Commit graph

122 commits

Author SHA1 Message Date
Griatch
2386b308f5 Added flushing to attribute caches when an typed object is deleted. This fixes isse 295, but keeping that open for a little longer to see if some other solution can be devised. 2013-05-14 08:44:40 +02:00
Griatch
c843f15d42 Merged the dev branch (many-chars-per-player) and made some more error checking in the migrations. 2013-05-12 22:13:05 +02:00
Griatch
218e4a149c Implemented a modified and cleaned objectdb.search and accompanying object.manager.search_object that also searches globally. The default commands have not yet been converted to use the new call. 2013-05-11 20:01:19 +02:00
Griatch
be22a31ec4 Made it possible to "take" over puppeting from one's own stale sessions. Fixed a nasty bug in swap_typeclass. 2013-05-11 16:09:26 +02:00
Griatch
80a6745a1e Made Attribute value queries also work with database objects by overloading the Attribute manager methods in question. Added procpool support for the new serializer functions and cleaned up some things. 2013-04-14 16:36:44 +02:00
Griatch
8d48aa5a06 Added the last migrations needed to fully convert the Attribute system. Cleaned up the @ooclook command a bit as well as tidied up the who command a bit. 2013-04-14 13:35:25 +02:00
Griatch
230d73cfa0 Migrations work under sqlite3, both from latest dev, from new install and from trunk. There might be some consistency issues though (it seems the character list is not properly migrated), so more testing is required. 2013-04-13 23:50:33 +02:00
Griatch
512d7748d1 Finished with a working implementation of the new Attribute mechanism using PickledObjectField. First step of migration is finished, but not converting any old attribute data yet. 2013-04-13 18:13:15 +02:00
Griatch
75341ade6f A first test using PickledObjectField and a rewritten dbserialize module to store Attributes. No migrations set up yet. 2013-04-13 15:15:02 +02:00
Griatch
8969017aaa Added prettytable (http://code.google.com/p/prettytable/) as a replacement for utils.format_table and updated almost all places where the old formatter was used. The code becomes much simpler and shorter with prettytable, there are some situations, such as the contrib/menusystem where the old format_table works well for dynamically creating any number of columns and rows on the fly. 2013-04-12 22:06:41 +02:00
Griatch
b58a464409 Cleaned up all commands of the player type to correctly relay their msg-data only to their assigned session. 2013-04-12 13:59:15 +02:00
Griatch
1aff5f1fd1 Renamed cmdset_ooc -> cmdset_player and settings.CMDSET_OOC -> settings.CMDSET_PLAYER. Also split most of the player-specific commands to a new module player. 2013-04-11 01:02:05 +02:00
Griatch
5874505902 Changed object.player to return a typeclass. Resolves Issue 325. Also made sure that .typeclass always returns a typeclass, also if called on something which is already a typeclass. 2013-04-10 22:33:32 +02:00
Griatch
4669b8ed89 Fixed the migrations from a pre-populated database to the many-char-per-player branch. 2013-04-10 21:45:56 +02:00
Griatch
70b8f074f1 Merge. 2013-02-03 17:28:26 +01:00
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
Kelketek
adb3965888 Follow-up on that last one-- missed one of the Abstract models. 2013-02-03 09:54:36 -06:00
Kelketek
2e08517ec5 Changed lock storage from character-limit field to unlimited TextField. 2013-02-03 08:54:57 -06: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