Griatch
0e42eb74ed
Updated how cmdsethandler reports syntaxerrors in command modules - this used to lead to rather opaque error messages. Now a dummy cmdset is created instead, with the key _ERROR_CMDSET and holding the error message. This allows the user to see that an error was reported instead of just being left in the blank. Full tracebacks are reported to log as usual.
2012-05-01 16:15:49 +02:00
Griatch
94477b8340
Updated the reload and shutdown mecanism to avoid a loop when shutting down from inside the game. Made sure to have server sync correctly with portal at @reload (some session info were lost before). Some other cleanups.
2012-05-01 14:19:54 +02:00
Griatch
e82515f8cb
Updated to a supported idmapper version. Added a method for calculating the cache usage of the idmapper, and tied it to the @system command.
2012-04-30 00:51:36 +02:00
Griatch
e92c9ac93e
Edited lockhandler to pre-determine an object's superuser-status instead of re-acquiring it every lock check. This caused a surprisingly large overhead considering how often locks are checked for various reasons.
2012-04-28 15:26:52 +02:00
Griatch
2dba8ad547
Changed attribute-caching to use a string as key rather than the attribute-object itself. The latter caused the database to be invoked in order to create the hash over and over.
2012-04-28 14:47:11 +02:00
Griatch
3091587e33
Added a timeout to the attribute caching; the system will now clean cache at regular intervals once it pass a certain size defined in settings.
2012-04-28 00:37:36 +02:00
Griatch
e3ce0a7933
Some fixes to the caching, particularly in set_attribute.
2012-04-27 00:03:31 +02:00
Griatch
9f9dadd4eb
Minor tweak to how cmdsets are matched with the "in" operator.
2012-04-26 19:31:03 +02:00
Griatch
6e08c011a1
Further caching and optimization, making some operations noticeable faster in the end.
2012-04-26 17:47:25 +02:00
Griatch
1a6ef5d983
Added more caching to channelhandler as well as players in order to cut back on unnecessary database calls.
2012-04-26 13:38:34 +02:00
Griatch
a8373c685f
Some optimizations in one of the most expensive bits of the server, namely the command handler.
2012-04-25 18:47:03 +02:00
Griatch
21eed74c8d
Minor fixes to various default commands.
2012-04-22 23:31:22 +02:00
Griatch
c688865e10
Slightly changed text on not-found command.
2012-04-22 22:58:23 +02:00
Griatch
e4006bf386
Further cleanup in the error logic for commands - the system now gives resonable suggestions for all commands.
2012-04-22 20:04:24 +02:00
Griatch
181abb84a8
Cleanup of the help command, making it a lot easier to read. Also added cos-suggest algorithm to make better help entry suggestions.
2012-04-22 19:45:45 +02:00
Griatch
0c292b5ff2
Changed how command not found errors are handled by default: Implemented a cos-likeness algorithm (Coling 2008) for comparing strings, which allows for decent suggestions and speed.
2012-04-22 16:36:31 +02:00
Griatch
4678234e9a
Multiple fixes to ev and utils:
...
Made utils.variable_from_module more generic (it can now load pretty much any form of module it's given and also supports searching and returning multiple variables).
Removed the variable-load functionality from utils.load_module; this is now purely a loader - use variable_from_module instead.
I found out that one couldn't import from src.commands.default due to the __init__ file being restrictive for the sake of the ev API. Removed that and instead imported the default commands into ev.py with the help of utils.variable_from_module instead. Some more fixes in ev followed on this.
2012-04-22 12:23:42 +02:00
Griatch
3306e36d82
Fixed a bug in @set. Unittests all clear again.
2012-04-21 18:21:38 +02:00
Griatch
8c3b49e704
Changed how the Typeclass system returns errors. Instead of echoing typeclass erros to the MUD-info channel (which is not only not only very spammy for everyone but also very hard to make clean so as to avoid recursion at a stage of typeclass failing), the system instead stores a property on itself called 'typeclass_last_errmsg' that holds eventual errors. This means that the task of reporting errors does not fall on the typeclass system itself but on the calling methods, as it should be. So src.utils.create.create_* functions now takes a new optional keyword "report_to" that holds an object to receive errors. If this keyword is given, the function msg():es that object with the error and returns None as before. If report_to is not set however, the create_* methods now return an Exception containing the error text. All default commands have been changed to accomodate for this behaviour, which allows for much more control over errors.
...
Also, the default ADMIN_MEDIA static files changed location in Django 1.4. The initial_setup function now accounts for this.
2012-04-21 16:15:37 +02:00
Griatch
63329f5420
Added the ability to escape colour codes with \, So using \{g in a text will now result in '{g' being printed instead of the text switching to bright green. This can be useful for documentation.
2012-04-15 23:42:57 +02:00
Griatch
5a2228763f
Fixed a lingering bug with @set that made it not work when assigning normal strings without quotes. Changed so that proper Python constructs (lists, dicts etc) now requires you to entering proper Python syntax (since this is parsed).
2012-04-15 23:09:56 +02:00
Griatch
bcf214ee0d
Changed so object.move_to() traverses exits by default - i.e. you will no longer end up INSIDE the exit object if you move_to the exit, but instead you will go to the exits destination. This should be the most common use. The use_destination keyword to object.move_to can be used to change this behaviour. Also @teleport (which uses move_to()) has gotten a new flag to allow for teleporting into exits if so specifically desired. Resolves issue 224.
2012-04-15 22:04:15 +02:00
Griatch
464aa8ca9e
Added the ability to clear an object from the global cache. This is rarely
...
needed (and can be potentially dangerous if the object depends on certain
startup methods to run and/or holds temporary attributes on themselves -
these will all be lost due to a new instance being created. It is hoever
necessary when it comes to renaming Exits - since the Command on the exit
must then change name too, recaching the Exit will also update the command.
Resolves issue 223.
2012-04-15 21:46:43 +02:00
Griatch
91ec33b9a7
Fixed a spurious error happening with mud clients not properly implementing TTYPE negotiating (sending strings instead of numbers to identify their abilities).
2012-04-15 19:53:03 +02:00
Griatch
6501f30cbc
Fixed an elusive bug in utils.get_variable_from_module() that caused the connection screen to sometimes not load properly, due to the imported modules being erroneously extracted and used.
2012-04-15 19:05:50 +02:00
Griatch
5264dc85bb
@set now supports all forms of nested dicts and lists under Python 2.6. Python2.5 still depends on the old recursive solution that does not support nesting. Maybe time to up the python dependency number? Fixes Issue 225.
2012-04-14 10:55:56 +02:00
Griatch
551a91caef
Editing the ev.py API, removing db_* manager shortcuts in favour of a 'managers' container holding them all. It makes the API slightly less "flat", but makes for a cleaner interface.
2012-03-31 16:50:53 +02:00
Griatch
c728524c72
Made get_and_merge_cmdsets visible to default cmds.
2012-03-31 16:13:01 +02:00
Griatch
d44dd92b5f
Continuing to make more methods _private to simplify API.
2012-03-31 16:09:48 +02:00
Griatch
c0322c9eae
Cleaning some unnecessary whitespace, overall cleanup of various source codes.
2012-03-30 23:47:22 +02:00
Griatch
b9c6c4a6c2
Killing a bug that caused issues with migrations.
2012-03-25 22:30:51 +02:00
Griatch
7c4e0213ce
Fixed a bug since CmdCreate changed name to CmdUnloggedinCreate (to avoid name clashes in API)
2012-03-25 19:59:53 +02:00
Griatch
bdb5ab0123
Removed @ps command, it is superceded by @serverload and was just a placeholder anyway.
2012-03-25 18:47:31 +02:00
Griatch
07a17ac15e
Added ev API support to @py command.
2012-03-25 18:36:23 +02:00
Griatch
88c0087fbd
Updated game/ for the ev API. There will likely be some changes happening in the game/folder, in the way new objects are inherited. This should use the API rather than inherit from the basecommand/baseobject modules (these will probably into the example folders as vanilla templates instead).
2012-03-25 13:09:17 +02:00
Griatch
0d01462077
Adding a new API system to Evennia. This centralizes all access of the evennia driver through a single module "ev". Importing ev one should be able to access (and also importantly, easily explore) Evennia's API much easier. This API goes a long way to "flatten" the structure so that one doesn't need to remember how to find some method in a deeply nested subdirectory.
...
As part of this work, I have also written full listings of all available properties on Typeclassed objects (including those inherited in various ways). Should hopefully make things easier to find.
One can of course still import things directly from src/ as before. But this is a first step towards removing the "base" objects in game/gamesrc and instead making those accessible through the core API.
2012-03-24 23:02:45 +01:00
Griatch
8ada50fcb7
Adding more lenient checks of TTYPE to avoid a visible traceback. The error with TTYPE utf-8 tracebacks seems to be in an older version of tintin++, newer versions don't show this behaviour. Older versions of tintin++ will display one Huh? (with logged traceback) after which everything will work. This is reported in issue 219.
2012-03-21 19:56:04 +01:00
Griatch
6aac9e6c2b
Fixed permission on @batchcode command.
2012-03-21 11:46:15 +01:00
Griatch
1ca8df9e70
Fixed issues with batch-code processor not working correctly. Also added some better parsing. Resolves issue 221.
2012-03-20 22:29:37 +01:00
ploosh
f09bfdf1d6
Fixed pose command to echo in room only if a pose is actually struck
2012-03-17 03:22:52 -04:00
Griatch
f46a9a1280
Cropped @batchcommand output better. Resolves issue 217.
2012-03-14 21:03:28 +01:00
Griatch
5beee55149
Added ability of @set command to actually store real Python types, not just strings.
2012-03-13 23:56:19 +01:00
Griatch
aae67225a4
Added auto_help as a class property on Commands. This allows to turn on/off auto-help generation on a per-command basis (default is on).
2012-03-13 22:07:51 +01:00
Griatch
690bfadd9d
Added arg_regex, an optional Command class-method for customizing how commands are identified by using a regex to enforce a specific look/grammar to the command argument. Discussed and suggested in issue 213.
2012-02-27 20:56:01 +01:00
Griatch
fb0d77c794
Added caching for aliases.
2012-02-25 23:56:31 +01:00
Griatch
631020d8a2
Some small fixes to the help command.
2012-02-25 18:24:30 +01:00
Griatch
9e2380decd
Added ' as an alias for the "say" command, common in many muds.
2012-02-22 21:39:27 +01:00
Griatch
562a32107e
Added more yields to cmdhandler, removed unnecessary callback to return.
2012-02-22 16:00:41 +01:00
Griatch
641d829154
Added inlineCallback operator for cmdhandler, allowing the system to yield more often.
2012-02-20 21:40:28 +01:00
Griatch
6fdfbe657b
Changed the flag save_next to save_for_next, it makes more sense.
2012-02-17 19:02:57 +01:00