Commit graph

2866 commits

Author SHA1 Message Date
Griatch
8bedd4d793 Fixed and debugged object_search to more generically search for any attribute name except 'key' (issue110). Also included alias-search as a last-resort if normal searches fail. This is now also working for global searches (issue106). 2010-09-12 15:07:12 +00:00
Griatch
7e736d19e2 Cleaned up the ansi.py module and made it better match the the style rest of the code. 2010-09-05 20:59:32 +00:00
Griatch
e125763ea5 Made so the default add_default_cmdset script also removes the added cmdset when stopped. Fixed the function of @delplayer command. 2010-09-05 18:20:39 +00:00
Griatch
212061abb6 Made so the @scripts command properly display when scripts will fire next. 2010-09-05 16:35:39 +00:00
Griatch
c4128e4656 Fixed the strange login error reported in issue103. 2010-09-05 15:05:40 +00:00
Griatch
a2291953f2 Changed erroneous DateField to DateTimeField in ObjectDB, so you might have to resync your database. Fixed lots of formatting issues in the info and list commands. Resolved issue105. 2010-09-05 14:42:09 +00:00
Ari Mudev
76624cd6f3 Modify Django version requirements to suit our usage of csrf middleware,
which was modified heavily between Django v1.1 and Django v1.2.

While it is possible to modify our code to use Django v1.1's csrf, the
best experience "out-of-the-box" will be while using Django v1.2.
2010-09-05 12:36:53 +00:00
Griatch
1ed013dc11 Fixed a bug in @open (issue104). Some other refinements. 2010-09-04 21:52:35 +00:00
Ari Mudev
cbdeae5334 Add 'page-pose' functionality. 2010-09-04 18:58:13 +00:00
Ari Mudev
d9e854404d Add common alias to "say" command (single double-quote). 2010-09-04 18:55:52 +00:00
Ari Mudev
56a03367f7 Allow speaking and posing while blind. 2010-09-04 18:53:52 +00:00
Griatch
cfbb249d96 Added more functionality to page command (resolving and going beyond issue102). Cleaned up the output of sevreral commands as well as added a few more useful functions in src/utils/utils.py. 2010-09-04 17:21:26 +00:00
Ari Mudev
60851ade11 Fix trivial typo in CmdSethandler documentation. 2010-09-04 16:57:01 +00:00
Ari Mudev
6413f2251e Fix trivial typo in @service help. 2010-09-04 16:21:01 +00:00
Ari Mudev
98c898ffeb Add "exam" alias to examine command; it is an extremely common alias in other codebases. 2010-09-04 16:04:16 +00:00
Ari Mudev
25dec92db5 Fix trivial typo. 2010-09-04 16:00:31 +00:00
Ari Mudev
e4a71ef420 Fix red button nudge lid aliases. 2010-09-04 15:39:43 +00:00
Ari Mudev
09cc31dafc Fix nudge lid randomness, fix order of emits. 2010-09-04 15:35:38 +00:00
Griatch
7d8edf0235 Better (and correct) output from the 'groups' command. 2010-09-04 14:19:07 +00:00
Ari Mudev
39e66dbc34 Remove debugging print statements introduced in r1044. 2010-09-04 14:05:04 +00:00
Griatch
142cb00566 Removed spam-possibilities with page command (issue100). Also did several other refinements to the comm system. 2010-09-04 13:52:01 +00:00
Griatch
d90c2909a2 Fixed a lacking implementation in the Msg API. You need to re-sync the database since Msg now relies on three fields that where commented out before. 2010-09-04 12:18:00 +00:00
Griatch
72bb8ac667 Fixes towards resolving issue99. 2010-09-04 09:47:38 +00:00
Griatch
933e29afee Gave a more informative error message when reading non-UTF-8 batchfiles containing international symbols (issue97) as well as refactored the processors a bit further. Fixed some minor typographic details in some other commands. 2010-09-04 07:55:25 +00:00
Ari Mudev
76edd254b0 Fix minor typo. 2010-09-03 22:24:58 +00:00
Griatch
ec5295b973 Included 'Alias' field for examine (issue98). Fixed a rare traceback with @reload in situations when it tried to move on before modules has time to finish reloading. Also clarified how @perm and examine display information. 2010-09-03 21:17:51 +00:00
Griatch
e2f92f0bfe Resolved issue99, which concerned commands on adjacent players being erroneously included among a player's available commands (giving multiple-command errors). 2010-09-03 19:33:17 +00:00
Ari Mudev
35bb9444a1 Update pylint instructions for pylint v0.19.0 (included with Ubuntu 10.04 LTS). 2010-09-03 15:14:42 +00:00
Griatch
9be2b5a64b Fixed some strange behaviour in the help system due to recent changes in how cmdsets are merged by cmdhandler. 2010-09-02 18:14:45 +00:00
Ari Mudev
e767b3458a Give correct code repository URL to Subversion checkout command. 2010-09-02 14:51:59 +00:00
Griatch
4528e26e03 Fixed a minor batchcommand reload bug. 2010-09-02 11:50:45 +00:00
Griatch
4d8fc05157 Cleaned up the batch processors (both cmd- and code processor) and homogenized their interfaces and APIs. Also test-ran the example codes and fixed some bugs. 2010-09-02 11:39:01 +00:00
Griatch
e114c33d8a Fixed a bug with red_button introduced in a previous revision. Resolves issue95. 2010-09-02 07:48:39 +00:00
Griatch
900f6da80f Fixed several special cases of handling multiple same-named commands gracefully. Should resolve issue94. 2010-09-01 21:59:13 +00:00
Griatch
03cc4970d0 Fixed the behaviour of some build commands to match that in wiki build tutorial. 2010-08-31 17:31:48 +00:00
Griatch
96be66828c Added some functionality to command 'get' to match wiki tutorial. 2010-08-31 11:24:08 +00:00
Griatch
2cee32a75b Fixed bug in @stats (issue93). 2010-08-29 23:39:33 +00:00
Griatch
9148705c89 Fixed a trivial bug in @perm (r92) as well as expanded its functionality a bit. 2010-08-29 23:35:25 +00:00
Griatch
0a95e17758 Updated the trunk version file from 'SVN-griatch-branch' to 'SVN-Alpha'. 2010-08-29 19:02:07 +00:00
Griatch
f83c2bddf8 Trunk: Merged the Devel-branch (branches/griatch) into /trunk. This constitutes a major refactoring of Evennia. Development will now continue in trunk. See the wiki and the past posts to the mailing list for info. /Griatch 2010-08-29 18:46:58 +00:00
Griatch
df29defbcd Added gamesrc/utils.py as a convenient shorthand for often-used methods from the engine
Added a @deluser command and gave it and @boot an option to give a reason for booting/deleting a player
Fixed a bug in @dig that confused exit directions in text
Small bug fixes
/Griatch
2009-12-20 20:51:26 +00:00
Griatch
81bec61d7d Added the apropos command for broader help searching (uses icontains).
The suggestions: footer used in help gave too narrow results, now using apropos-style search instead.
Bug fix of state-help command to make it accept switches.
Added several new example commands and cleaned up old ones to be more user-friendly.
Added protection in @delevent to make it harder to delete system events.
Some small bug fixes and other cleanup.
2009-12-20 12:39:08 +00:00
Griatch
c7cbc4854e Reworked object command tables.
Object commands used to require re-adding every call in the script parent's __init__ or factory functions, adding the commands to a new command table directly on the object. Since all other attributes can be set up in at_object_creation(), this was both inconsistent and a bit confusing to work with. There is now a method add_commands() directly defined on all objects. It takes the same arguments as the normal add_command()o but use a reserved attribute to create and update a command table on the object. This has the advantange of completely removing the __init__ call in the script parent, all definitions can now be kept in at_object_creation() and are, more importantly, persistent without having to be recreated every call.
- I updated the examine command to show all the commands defined on an object (if any).
- I updated gamesrc/parents/examples/red_button.py considerably using the new command methodology and also using the updated Events.
.
Griatch
2009-12-03 00:41:53 +00:00
Griatch
5f6454ea1e Updated the batch processor to use the new global cache system instead of the custom dict-based cache it used before. Much cleaner now.
.
Griatch
2009-11-25 23:23:24 +00:00
Griatch
c2d603c3db Fixes in batchprocessor. The batchprocessor now completely ignores states (so running a batch file where e.g. a player is forced into a state by entering a room will no longer also trap the builder using the batchprocessor to build that trapping room.) This is by automatically setting the flag ADMIN_NOSTATE on the user running batchprocessor.
.
Griatch
2009-11-25 23:02:28 +00:00
Griatch
1e2fba9680 Small bugfix to cmdhandler to avoid a unicode-related traceback.
.
Griatch
2009-11-25 22:02:22 +00:00
Griatch
4d9081d710 Various cleanups in the recent modifications, and improvements to how time is handled and displayed.
.
Griatch
2009-11-25 19:27:32 +00:00
Griatch
1ea7e69821 Implemented persistent cache, events and gametime counter.
OBS - there is a new data table (for the persistent cache) so you need to sync or restart with your database.

* Persistent cache (pcache)- this works the same as the volatile cache, except it is regularly saved to disk and recovered upon restart. How often the pcache is backed up is set in preferences. This was heck of a tricky thing to get right due to the intricacies of pickle; for example it turns out there is a bug in cPickle, so only normal pickle works to store the cache objects.
* Persistent events - this makes use of the pcache to re-load the scheduled events every reload. Only events with the property "persistent" will be saved this way (if not set, events will get lost upon reboot, just like now). All the main system events have been implemented as persistent events, including a new event to regularly save the pcache to disk.
* In order to track persistent event timers across reboots, there is also a global "game time" defined now. This is saved in cache and counts seconds only when the server is running. Event timers are adjusted with an offset when restarting (otherwise they will be confused by the real time jumping forward after a downtime). There are also a small set of helpful routines in src/gametime.py to help convert from real time to game time (for easy creation of new events).
* Various info commands have been updated to incoorporate the time stamp and the cache sync information.
* There are a few test commands commented out in commands/general.py that I used for testing; I left them in if you want to test things quickly. It works here, but as always more people testing is needed.
/Griatch
2009-11-22 21:18:55 +00:00
Griatch
5e866c6b73 Added more stable events.
- added PIDs to all events, so they can be deleted safely.
- scheduler.del_event(pid) cleanly deletes events from the scheduler
- added @delevent for deleting events based on PID (@ps shows this now)
- Events has a self.repeat property allowing them to only be repeated a certain time (default is infinitely many times). After the set number of repeats, the event deletes itself from the scheduler.

Events are currently not persistently stored; this is left for future commits.
.
Griatch
2009-11-18 20:10:35 +00:00
Griatch
642932a403 * Implemented a non-persistent cache in src/cache.py. The cache is lost when restarting the server but it has the advantage of not hitting the database, and so is useful for implementing things that should be remembered over time but does not need to be persistently saved in the database at every point, like fast-updating combat systems, timers etc. Using the cache can substantially cut down on database access at the cost of memory comsumption. It is easiest accessed through the object model using normal dot notation. So to store a variable in volatile memory e.g. from your script parent, you can do things like self.scripted_obj.cache.myvariable = variable and be sure that later (unless there was a reboot) doing self.scripted_obj.cache.myvariable will return the value you stored there.
* OBS - doing e.g. self.scripted_obj.myvariable = variable was always iffy and since a few revisions back this will NOT work - this is because the objects are now consistently synced with the database (in the past this was not done consistently which caused strange behaviour).
* Fixed some bugs in the multi-word command handler. It can handle multi-word exits as well now.
2009-11-01 15:12:38 +00:00