Commit graph

105 commits

Author SHA1 Message Date
Griatch
b26c3ab872 Fixed bugs and allowed for logging in using one character. Added a simple command for creating a new character. 2013-02-03 17:00:46 +01:00
Griatch
c0d634fe8c Added "typeclass" as a shortcut variable name of __getattribute__. This allows for obj.typeclass to always cleanly return typeclass regardless of if obj is already a typeclass or is a database object. I.e. the same functionality of using obj.dbobj to always get the database object. 2013-02-03 00:23:58 +01:00
Griatch
5ef92b6bf8 Some cleanups, properly marking the OOB stuff as WIP still. OOB is progressing but not yet functional or in its final form. 2013-01-07 15:47:41 +01:00
Griatch
0ac2a58428 Removed Deprecated "Fast Assignment" attribute operators. 2013-01-04 11:19:58 +01:00
Griatch
b0b0fa7983 First, untested version of the OOBhandler mechanism. 2013-01-03 09:18:49 +01:00
Griatch
1643427fa3 Added at_set hook for Attributes. This is a first step towards OOB definition. 2012-12-08 20:26:44 +01:00
Griatch
c615693a2a Added a give command to the default command set. As part of this also fixed some bugs in how object typeclasses were compared. 2012-12-08 17:11:22 +01:00
Griatch
8f4f123230 Fixed a lingering call to the old caching scheme by swap_typeclass method. Resolves Issue 332. 2012-11-13 21:34:42 +01:00
Griatch
d55bee8905 Fixed a type - get_attribute_cache() should be get_attr_cache() 2012-11-09 23:17:10 +01:00
Griatch
8654d8cc48 Further migrated script caches to the central cache location, removing old cruft. 2012-11-08 19:29:57 +01:00
Griatch
98d0eb7869 Added __delitem__ support to PackedDict/List, allowing for things like in-place "del obj.db.dict[key]". 2012-11-08 19:16:21 +01:00
Griatch
e4382e3e8a Fixed a regression in has_attribute caused by changing the location of caches. Resolves Issue 328. 2012-11-07 20:22:46 +01:00
Griatch
82e57d4ada Fixed an API inconsistency in Attribute's PackedList/PackedDict. Resolves Issue 326. 2012-11-07 18:44:12 +01:00
Griatch
9f6e3de637 Various cleanups and fixes found during refurbishing the unittest framework (not pushed yet) 2012-11-05 00:55:25 +01:00
Griatch
d2d9953f94 Cache changes: Moved all caches (except idmapper) to central caching module. This makes it easier to overview cache memory usage (and clean it) as well as plug-in external cache mechanisms. 2012-11-01 11:20:07 +01:00
Griatch
32b069c5fc Added the ability to store Sets in Attributes (using a PackedSet object type). 2012-10-20 12:10:03 +02:00
Griatch
4830560ac5 Added better error checking for when trying to set an attribute on an object stored in an attribute but which after retrieved and cached was deleted. The fix doesn't fully fix the problem of stale caching but does give more information. Related to Issue 295.
Also fixed a curiously phrased import.
2012-10-14 19:29:56 +02:00
Griatch
86a44ab84d Made sure the cmd-classes for 'home' and '@home' were differently named, which messed up their appearance in ev. Resolves Issue 285. 2012-10-14 16:03:02 +02:00
Griatch
5b5328e6ca Changed default dbref search mechanic to require #N format and thus allow searching for objects named as integers (so "@create/drop 2" followed by 'look 2' will now work as expected instead of looking at the object with dbref=2). Doing "look #2" will now look at the object with dbref 2 (Limbo). Resolves Issue 284. 2012-10-14 15:45:21 +02:00
Griatch
a347252407 Added the ability to clean the attribute_cache on a per-object bases using obj.flush_attr_cache(). 2012-09-29 16:02:43 +02:00
Griatch
9a3562148a Reverting indexing of objattribute.db_value; it is a highly db-incompatible change, and also lacking the possibility to create unique indices with unclear results. 2012-09-28 09:08:43 +02:00
Griatch
b0ac916b9a Obs-run migrations! Added an index to the ObjAttribute's values. 2012-09-28 00:14:29 +02:00
Griatch
0dae03156c Some optimizations, cleanup and a few bugfixes. Just changing a spurious property retrieval in the typeclass removed an extra, pointless database query. 2012-09-18 01:03:35 +02:00
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
ffcf4b3c2f Added cache-resyncing to ProcPool. This makes sure to update all affected object caches
whenever the subprocess returns (this is potentially not good enough for long-running scripts,
will have to ponder that one). Made ProcPool work with MySQL (where it works much better). Tested and fixed many
small bugs.
2012-09-03 01:11:14 +02:00
Griatch
f68523cc22 Minor optimizations and some fixes to the dummyrunner. 2012-08-22 22:34:43 +02:00
Griatch
5117bd2a0a Minor fixes and reducing some sql calls in various managers. 2012-08-22 16:15:52 +02:00
Griatch
4edde61be4 Minor cleanups and a fix to manage.py that lead to a traceback if running without arguments. 2012-08-22 13:28:38 +02:00
Griatch
cc88d38ab6 Some optimizations towards speeding up getting the contents of a location. 2012-08-19 11:45:13 +02:00
Griatch
1dee271fc7 Removed a bug in property cache that disabled the cache if the property was null (e.g for player lookups) 2012-08-19 11:15:22 +02:00
Griatch
8a44daef7e Further changes to allow dbrefs to be 0. 2012-08-18 23:35:11 +02:00
Griatch
7dcfdc4d4b Fixed a minor typo in docstring for ObjectDB.__db_get: To view all Attributes one uses obj.db.all, not obj.db.all(). 2012-06-20 23:22:26 +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
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
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
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
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
c8df141e89 Further cleanup of source; making class methods _private for clarity in the API. 2012-03-31 15:09:22 +02:00
Griatch
fc156b5a54 Continuing work on API, making local-use class properties _private to make things easier to explore. 2012-03-31 13:06:29 +02:00
Griatch
c0322c9eae Cleaning some unnecessary whitespace, overall cleanup of various source codes. 2012-03-30 23:47:22 +02:00
Griatch
d4c97d7df8 Fixed a caching issue with TypedAttributes. 2012-03-29 20:30:35 +02:00
Griatch
82a10903d1 Added more comments to help exploration through the ev interface. 2012-03-29 19:42:08 +02:00
Griatch
da51cb063f ev-API cleanups. ev can now be imported also from a non-django initiated python interpreter (it initiates itself). Gave some more info text and made sure wrapped db_ methods correctly forward their doc strings for introspection. 2012-03-27 09:59:11 +02:00
Griatch
4398d42360 Added new templates to gamesrc/*/examples. The old base* modules still in place. Some cleanup of the API. 2012-03-25 16:35: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