lagos
904884d4ed
Fixes multiple issues with searching.
...
* dbref now respect candidate lists. Previously a dbref match would ignore
candidates which permitted you to drop any object from anywhere by specifying
a dbref.
* If candidates is [], we now return right away. Without this, a candidate list
of [] would not filter out anything because short circuiting like:
cand_restriction = candidates and Q(pk__in=candidates_id) or Q()
will use Q() (what we really want is nothing to match). This would permit you
to drop any object you can refer by nick or name if your inventory was empty.
* Minor fix of 'ret_index' for typo'ed 'reg_index'.
2012-10-22 18:03:10 -07:00
Griatch
21408c56cf
Made the docstrings for objects' basetype_setup() more informative. Resolves Issue 302.
2012-10-20 09:33:40 +02:00
Griatch
7997cf62e8
Added a more comprehensive recursive location-loop checker that shouldn't be too expensive. Thanks to rcaskey for bouncing ideas in IRC!
2012-10-14 21:24:58 +02:00
Griatch
67dc11849f
Added a check for 1st level recursion of location. So self.location=self will no longer work. I did not add a full recursive check (it would need to go through all contents of the object and their contents etc) since this is expensive for something that should usually not be a common error. Further checks could be added higher up in the build commands if location-loops are considered a big problem. Resolves Issue 296.
2012-10-14 20:21:53 +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
c982cdbe3d
Fixed a traceback when searching with the *-syntax and not finding a match. Resolves Issue 297.
2012-10-14 17:27:57 +02:00
Griatch
46ffd06c78
Followed the suggestion of making nicks set on Player be globally available (I liked this better than the old default behaviour). Changed for execute_cmd nick replacement ("inputline","channels") as well as for caller.search nick replamement ("player", "object"). A Character's nick overrule a same-named nick on the Player level, which sounds like the most expected behaviour. Resolves Issue 292.
2012-10-14 17:24:30 +02:00
Griatch
446dfe9509
Properly set the auto_help flag to False on Exit commands, so they don't show up in the help listings.
2012-10-14 16:37:36 +02:00
Griatch
0141f94e9d
Fixed a bug in obj.copy() that tried to access contents without properly initializing the typeclass. Resolves Issue 288.
2012-10-14 16:31:22 +02:00
Griatch
4dff822764
Fixed bug in @batchcommand (Resolves Issue 287). Also updated @dig to again handle deleting ranges of dbrefs (with or without # in front).
2012-10-14 16:24:21 +02:00
Griatch
31daf5b013
Added an extra check to make sure the 'candidates' keyword to ev.search_object always contain proper dbobjs and not typeclasses. Resolves Issue 280.
2012-10-14 13:25:25 +02:00
Griatch
99c2dda8dc
Changed the way ExitCommands work by adding at_traverse() as a new hook to do the actual moving. This should allow for more flexibility in overloading new Exit typeclasses without having to re-implement the Exit Cmdset functionality more than necessary. By default the same error hooks are called wether the failure is due to a lock or some other error, this is (now) easy to modify as needed.
2012-10-14 13:11:13 +02:00
Griatch
532cbc5fb6
Changed initial look command (at login) to be called from at_post_login hook instead of from the default connect command, supposedly making it easier for those only wanting to change this one line rather than having to re-target connect. The player.at_post_login now also calls look in case no character is defined, for the cases when logging in without having a character selected. Resolves Issue 277.
2012-10-14 12:28:01 +02:00
Griatch
33c15e99d2
Added a check to allow obj.search to also search for 0.
2012-09-29 16:24:47 +02:00
Griatch
4944a589cc
Cleaned up and fixed problems in searching by attribute-value. Resolves Issue 267.
2012-09-29 00:09:55 +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
c819cdc2a6
Added a change to get_objs_with_attr_values that means simple python lookup values will be searched for directly in the database by pickling the input argument in the form used by Attributes. This should lead to a more efficient attrvalue lookup for larger databases (as long as value is a string, int or float and not a compound object, at which the lookup is continuously done in two steps filtering through the Attribute value mechanism.
2012-09-28 00:02:31 +02:00
Griatch
56c28f7e44
Fixed a strange typo in object-manager's get_attribute_with_value(). Also implemented a few further suggestions and fixes to object search.
2012-09-27 22:18:46 +02:00
Griatch
59ccd3eb38
Fixed a bug in exact search pattern matching.
2012-09-27 21:29:01 +02:00
Griatch
93d95377ce
Shifting ProcPool out of src and into a contrib, using the service plugin system.
2012-09-22 20:40:30 +02:00
Griatch
f677902811
Fixed a bug with setting a location to None.
2012-09-22 13:37:22 +02:00
Griatch
e874343387
Adjusted search() functionality to handle also a list of location(s) to search. Changed "get" command to not search inventory (which could lead to multimatch errors).
2012-09-21 08:36:59 +02:00
Griatch
c0b03c2ee3
Some further removal of recursive loops in the typeclass system.
2012-09-20 23:18:52 +02:00
Griatch
dc4340b34e
Bugfix for latest optimization.
2012-09-20 03:01:30 +02:00
Griatch
7a130cb442
Removing some of the last self-reference loops in object.models, based on profiling.
2012-09-20 02:52:21 +02:00
Griatch
4c83d3e7a1
Various speed optimizations in various places, following further profiling.
2012-09-20 00:47:28 +02:00
Griatch
ee450a4fed
Fixed a bug in the search method causing it to fail for commands ignoring the error handler (such as drop). Resolves issue 252.
2012-09-18 21:48:41 +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
160d4a2807
Minor typo cleanups.
2012-09-17 22:16:18 +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
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
3c96dc9cc9
Fixed a too-inclusive .hgignore file as well as some other fixes.
2012-09-07 19:31:51 +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
7995c91eee
Fixed a regression in the install process with south.
2012-08-28 11:18:08 +02:00
Griatch
5117bd2a0a
Minor fixes and reducing some sql calls in various managers.
2012-08-22 16:15:52 +02:00
Griatch
f5caab093e
Fixed a spurious error messages from the location setter when logging out (need to check None location)
2012-08-19 21:36:01 +02:00
Griatch
5e33690f40
Optimization: Added caching of object contents. This makes obj.contents not have to hit
...
the database at all. So far there are no regressions from this, but time will tell if
there are any problems.
2012-08-19 18:48:29 +02:00
Griatch
cc88d38ab6
Some optimizations towards speeding up getting the contents of a location.
2012-08-19 11:45:13 +02:00
Griatch
889708cf07
Make object search handle a dbref=0.
2012-08-18 23:17:14 +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
2d46d0306b
Some more i18n strings added; also updated swedish translation.
2012-06-14 08:56:57 +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
7058b9f210
Cleanup of API documentation.
2012-05-02 00:39:56 +02:00
Griatch
1feb3a80a5
Some minor cleanups here and there.
2012-04-29 12:35:21 +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