Griatch
c53a9b5770
Changed how Objects are searched, using proper Django Q objects instead of hack-y evals to build queries. This has lead to a number of changes to the ObjectDB manager search. Notably there is now no way to supply a "location" to either of the manager search methods anymore. Instead you can now supply the keyword "candidates", a list of objects which should be used to limit the search. This is much more generic than giving location. The higher-level search (like caller.search, reached from commands) have not changed its API, so commands should work the same unless you are using the manager backbone directly. This search function is now using location to create the "candidates" list. Some other things, like matching for "me" and "here" have also been moved up to a level were it can be easily overloaded. "me" and "here" etc were also moved under i18n.
...
As part of this overhaul I implemented the partial_matching algorithm originally asked for by user "Adam_ASE" over IRC. This will allow for (local-only) partial matching of objects. So "big black sword" will now be matched by "bi", "sword", "bi bla" and so on. The partial matcher sits in src.utils.utils.py if one wants to use it for something else.
2012-09-17 15:31:50 +02:00
Griatch
cc6fa079b6
Added some more functionality to the copy method of objects, as well as some minor fixes.
2012-09-11 23:47:29 +02:00
Griatch
327cfc5098
Changed default permission of objects so as to not have 'control' permission of themselves. As user Kelketek pointed out, this could be a possible exploit. At any rate there is no need for objects to have control of themselves.
2012-08-18 20:20:42 +02:00
Griatch
0d1f9d5bdc
Fixed a bug in object's __eq__ that returned erroneous fails.
2012-08-12 09:55:19 +02:00
Griatch
724027d134
Optimizations: Removed unnecessary lookups when comparing objects with the = operator (used a lot in moving and messaging)
2012-08-02 17:03:26 +02:00
Griatch
44bf35cd81
Make sure to forward no_channels, no_objs and no_exits flags across cmdset merges. Also changes how system commands are saved across merges. Resolves Issue 243.
2012-06-20 21:16:34 +02:00
Griatch
7058b9f210
Cleanup of API documentation.
2012-05-02 00:39:56 +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
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
c8df141e89
Further cleanup of source; making class methods _private for clarity in the API.
2012-03-31 15:09:22 +02:00
Griatch
c0322c9eae
Cleaning some unnecessary whitespace, overall cleanup of various source codes.
2012-03-30 23:47:22 +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
7a2cdd3842
Moved all command definitions of Typeclassed entities up one level, to Object, Player and Script respectively. The actual code is still on the models (ObjectDB, PlayerDB and ScriptDB), but one should not be able to use the methods without having to dig into the code as far. Also added extensive, up-to-date headers to the inheriting base objects in game/gamesrc.
2012-03-24 18:25:32 +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
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
3e8b43d222
More fixes and cleanup in wake of ic/ooc changes.
2011-11-06 23:55:24 +01:00
Griatch
6ae1123421
Fixed hook method descriptions.
2011-10-01 22:36:55 +02:00
Griatch
23cd9e31b1
Restructured the way typeclasses are loaded. This makes it possible to run at_init() hooks at initiation also for objects without any custom cases for character/players. at_init() hooks are called only when an object is initiated. This means that a room's at_init() hook is only called when someone looks or enters it or a script operates on it, for example, rest of the time these objects are dormant, most efficiently.
2011-10-01 22:00:22 +02:00
Griatch
ecf11b38cd
Fixed an issue with the locks not getting properly set on rooms.
2011-09-20 13:44:26 +02:00
Griatch
475361ad28
Added functionality to Attributes to store and update dicts and lists dynamically. One side effect of this is that dicts and tuples need to be stored as custom object types which means that e.g. isintance(obj.db.mylist) == type(list) will return False. In order to do checks like this, use src.utils.utils.inherits_from() instead. The Attribute system now also supports tuples. All other iterables except dicts, lists and tuples are stored and retrieved as lists, same as before.
...
This fixes issue 189.
2011-09-20 12:37:45 +02:00
Griatch
1995f61d46
Put up a warning about not using BaseObject.at_init() at this time (it's not called, as per issue 188). Also removed the deprecated at_cache() hook (it doesn't work anymore now that the caching system is much more efficient and only caches once).
2011-09-15 10:46:41 +02:00
Griatch
f1d743f14c
Checked at_init() due to reported issues of it not getting called. Couldn't find any problems, rather it was called too many times, so removed an unecessary call.
2011-09-15 01:18:53 +02:00
Griatch
f13e8cdf7c
Trunk: Merged griatch-branch. This implements a new reload mechanism - splitting Evennia into two processes: Server and Portal with different tasks. Also cleans and fixes several bugs in script systems as well as introduces i18n (courtesy of raydeejay).
2011-09-03 10:22:19 +00:00
Griatch
2b4e008d18
Scripts and Exits updated. Fixed some deep issues with Scripts that caused object-based scripts to not properly shut down in some situations, as well as spawn multiple instances of themselves. I think this should resolve all "at_repeat doubling" issues reported. Due to optimizations in the typeclass cache loader in a previous update, the Exit cmdsets were not properly loaded (they were loaded at cache time, which now doesn't happen as often). So Exits instead rely on the new "at_cmdset_get" hook called by the cmdhandler. It allows dynamic modification of cmdsets just before they are accessed. Resolves issue173 (I hope). Resolves issue180. Resolves issue 181.
2011-08-11 21:16:35 +00:00
Griatch
8770a263ac
Fixes, cleanups and bugfixes in various systems.
2011-06-26 22:03:09 +00:00
Griatch
95d672763b
Multiple fixes and cleanups - command parser excludes inaccessible commands already at parse level now. Fixed the functionality of a few of the lock functions to be more intuitive. Added functionality to the examine command to better show the commands available to an object.
2011-06-26 14:35:02 +00:00
Griatch
b8a13a2389
Migrate. Made Exits work differently, by use of commands directly instead of an exithandler assigning commands on-the-fly. This solution is a lot cleaner and also solves an issue where @reload would kill typeclasses in situations where an exit was painting to an object whose typeclass was reloaded (same issue occured if the exit typeclass itself was reloaded). As part of these fixes I cleaned up the merging of cmdsets to now merge in strict priority order, as one would expect them to do. Many small bug-fixes and cleanups all over. Resolves issue 164. Resolves issue 163.
2011-05-01 18:04:15 +00:00
Griatch
4bcd5239b5
Mixed batch of minor bug fixes and cleanups.
2011-04-30 21:09:19 +00:00
Griatch
27809694d7
Migrate. Added the "view" access restriction (to make objects invisible). Also changed the input of ObjectDB.objects.object_search() to not require a caller as an argument (this makes it consistent with other search methods). All default systems should have updated to the new call, but if you have custom calls, you need to change them to fit the new syntax (this is only important if explicitly use ObjectDB.objects.object_search; if you just use caller.search you should be fine)
2011-04-24 11:26:51 +00:00
Griatch
28fe2ad3f4
Run Migrate. Implemented a full separation between Player and Character - Players (OOC entities) can now also hold cmdsets and execute commands. This means that "disconnecting" from a Character becomes possible, putting the Player in an "OOC" state outside the game. This overall makes the game much more stable since there used to be issues if the character was destroyed. Having an OOC set also avoids the previous problem of @puppeting into an object that didn't have any cmdset of its own - you couldn't get back out! A new default OOC-Cmdset handles commands available to a player while OOC. Commands in this set are applied with a low priority, allowing "IC" mode to give precedence if desired.
...
This change meant several changes to the lock and permission functionality, since it becomes important if permissions are assigned on the Player or on their Character (lock functions pperm() and pid() etc check on Player rather than Character). This has the boon of allowing Admins to switch and play/test the game as a "Low access" character as they like.
Plenty of bug fixes and adjustments. Migrations should make sure to move over all data properly.
2011-04-23 11:54:08 +00:00
Griatch
6f0d21802b
Debugged and added @cpattr and @mvattr. Added unittest cases for all default commands for which they are suitable. Many small bug fixes as part of that.
2011-04-21 16:45:18 +00:00
Griatch
6c53ec2bdb
OBS: Run migrate! Made exit's destination into a database field for performance. Fixed a too greedy @reload that caused ContentTypes to loose information. Resolves issue 157.
...
Migrate with: "python manage.py migrate"
2011-04-08 23:10:04 +00:00
Griatch
126e2ea61f
OBS: You need to resync your database! Moved cmdsets into the database rather than being dependent on scripts. Moved the creation of the cmdset- and cmdset-handlers into ObjectDB.__init__ rather than bootstrapping it from the typeclass. Added some more script functionality for testing, includong the @script command for assigning a script to an object.
2011-03-20 19:45:56 +00:00
Griatch
e965830735
Made the reload mechanism fully asynchronous. Work on improving cache operations.
2011-03-20 13:24:07 +00:00
Griatch
2f78bacd97
Added a check for multiple connected sessions to avoid moving disconnected object more than once. Resolves issue 145.
2011-03-19 22:17:00 +00:00
Griatch
de28b2d575
Fixes @locks to block self-escalation. Fixed a few bugs in @reload that caused it to reload also unsafe modules.
2011-03-17 22:28:30 +00:00
Griatch
bccd84e480
Fixed some bugs in the access system. Changed the "owner" default permission to "control" instead to more general. Added a new hook for setting locks for objects (the suspicion was that this would give lots of grief to newbies otherwise, now we have a lockdown policy in the absence of lock definitions).
2011-03-17 21:43:18 +00:00
Griatch
08b3de9e5e
OBS: You'll need to resync/rebuild your database!
...
- This implements an updated, clearer and more robust access system. The policy is now to lock that which is not explicitly left open.
- Permission strings -> Lock strings. Separating permissions and locks makes more sense security-wise
- No more permissiongroup table; permissions instead use a simple tuple PERMISSIONS_HIERARCHY to define an access hierarchy
- Cleaner lock-definition syntax, all based on function calls.
- New objects/players/channels get a default security policy during creation (set through typeclass)
As part of rebuilding and testing the new lock/permission system I got into testing and debugging several other systems, fixing some
outstanding issues:
- @reload now fully updates the database asynchronously. No need to reboot server when changing cmdsets
- Dozens of new test suites added for about 30 commands so far
- Help for channels made more clever and informative.
2011-03-15 16:08:32 +00:00
Griatch
2bdaf034c8
OBS: You need to resync your database! The Nickname system is now a separate database model with the result that also channel nicks are more robust. Also nickname replacement has been adjusted to fix some exceptional circumstances. Fixed a host of issues in the channel and nick handlers and adjoining commands that caused the channel-syscommands to fail in some situations. Resolves issue131. Resolves issue 132. Resolves issue 134.
2011-02-27 22:27:56 +00:00
Griatch
6a13d07c55
Fixed some hooks to match wiki docs.
2011-02-14 18:31:16 +00:00
Griatch
72bb8ac667
Fixes towards resolving issue99.
2010-09-04 09:47:38 +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
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
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