Griatch
80da420ee7
Merge, with input and tweaks from discussion with lagos and Kelketek in irc.
2012-06-13 01:36:59 +02:00
Griatch
dfa0ced4e5
Some further cleanup of readmes.
2012-06-13 01:07:09 +02:00
Kelketek
9290cf2c0c
Fixed an issue where improper substitution would cause extra newline
...
characters for MCCP clients. This made them effectively press return twice
on each command.
2012-06-12 17:51:10 -05:00
Griatch
98a5f11159
Merge.
2012-06-12 21:04:50 +02:00
Griatch
5f8cc5e3a6
Small fix to batchprocess output.
2012-06-12 21:03:30 +02:00
lagos
1c4c3a4217
chargen.py uses managers instead of db_objects.
2012-06-12 08:09:15 +00:00
lagos
2729369027
Fixes two typos in sample code for evlang.
2012-06-12 07:35:50 +00:00
Griatch
58e20e2cf1
Added contrib "evlang", an experimental highly restricted Python code environment. It's intended to be used by untrusted users to add custom code e.g. to their crafted objects and similar. Please heed the warnings in the README file - this is experimental still and more people need to play with it and try to break it.
...
The system uses a hybrid blacklisting/whitelisting and AST-traversal approach to both remove dangerous builtins as well as disallow potentially exploitable python structures alltogether. Examples are while structures and attribute allocation. All advanced functionality is accessed through a set of "safe" methods on a holder object. You can extend this with your own safe methods in order to add more functionality befitting your game.
The system comes with a host of examples, a few scriptable objects and complete commands for adding code to objects. At this point it's not guaranteed that all systems are safe against meddling however - notably Attributes have no locks defined on them by default (although this system does properly check Attribute lock types should they exixt).
Please test and try to break - and report problems to the Issue tracker/forum as usual.
2012-06-10 22:16:46 +02:00
Griatch
3d24ee2242
Added a secure_attr() method to the base typeclass. This allows for system to access attributes with full access control (since it requires an accessing_obj as argument). This relies on (by default unused) lock types "readattr" (reading/listing the attr value), "editattr" (editing/deleting the attribute) and finally "createattr" for creating a new attribute. The first two checks are done directly on the Attribute class whereas the createattr check is done on the TypedObject on which the Attribute is to be stored.
2012-06-10 21:46:00 +02:00
Griatch
5f043d28d7
Minor cleanups of code.
2012-06-10 11:16:00 +02:00
Griatch
dc67b6b87c
Added a lock funcion self(), passing only if accessing_obj == accessed_obj. This is potentially useful for Objects who want to lock cmdsets and make them only available to themselves without having to know their id value in the lockstring.
2012-05-24 21:44:07 +02:00
Griatch
d3ee5a565b
Added a loader to the server that automatically detects changes in default cmdsets and typeclasses (like when you change them in settings.py),
...
loops over all objects in the database and updates the places were the old default was set. This will make it more intuitive to overload the default locations (which is the natural thing to do after all). After this update, just make sure to @reload your server once before editing your settings.py; this will store the old settings for you, so they change-detection can work subsequently.
2012-05-19 12:36:11 +02:00
Griatch
6fa5e42909
Fixed a typo in the example command template.
2012-05-19 11:01:48 +02:00
Griatch
4ce750d1ee
Made some changes to the tests. All tests doesn't clear at the moment, seems to be something weird in the test system itself though, rather than an actual problem in the core. For example the test system reports an error with the @desc command that I cannot reproduce when testing that command for real in the game ...
2012-05-18 18:13:58 +02:00
Griatch
8ad4f4a9fc
Changed player.search to only search for players explicitly.
...
Added a MuxCommandOOC class to handle the OOC commands in a more uniform way.
Fixed the @ic/@ooc and page commands. Resolves issue 233. Resolves issue 234.
2012-05-17 19:42:37 +02:00
Griatch
96e95ca525
Raised Python requirement to 2.6+. Some spurious work on the mdsp support.
2012-05-05 23:52:13 +02:00
Griatch
14ed95ebfe
Removed with statement, it's not well supported (without future import) in python 2.5.
2012-05-04 09:20:30 +00:00
Griatch
c49fbd7d99
Removed 'with' statement; it's available in Python2.5, but one needs to use the future import to do that, so easiest to remove it. Resolves issue 230.
2012-05-04 10:03:41 +02:00
Griatch
7058b9f210
Cleanup of API documentation.
2012-05-02 00:39:56 +02:00
Griatch
fce5c79561
A name change in a command stopped the ev API from loading.
2012-05-01 23:56:59 +02:00
Griatch
4acfe48d9c
Removed repetitive imports in the utils.create functions. I experimented with making these methods yield more, but it's hard to integrate this behaviour with actual production code.
2012-05-01 22:51:18 +02:00
Griatch
a8139feb1a
Updated ReST documentation.
2012-05-01 17:37:37 +02:00
Griatch
36b15b4ad8
Made some tweaks to some default commands, such as @version, which was renamed @about and displays some more info about the system.
2012-05-01 17:31:16 +02:00
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
e82ccc72ae
Removing the resync step for doing a server reset - this should act pretty much like a shutdown.
2012-05-01 14:27:59 +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
571c7a3cab
Some more cleanups.
2012-04-29 21:17:14 +02:00
Griatch
1feb3a80a5
Some minor cleanups here and there.
2012-04-29 12:35:21 +02:00
Griatch
ed6def0c88
Made XTERM256 properly range between 0-5 (it was erroneously capped at 1-5 which mean the darkest values
...
of the colour cube were unreachable).
Fixed some issues with the lock caching.
2012-04-29 01:26:10 +02:00
Griatch
73ff2afc78
Changed how the clean-cache script determines the size of the attribute cache.
2012-04-28 17:18:26 +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
9d970ea7c5
Added full caching to all attributes on a per-object level. This speeds up attribute loading considerably.
2012-04-26 21:39:16 +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
3fba0bdbe3
Changed suggestion system to give more suggestions also if the help entry catches the exact match.
2012-04-22 21:54:28 +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