Daniel Benoy
1e5b52f685
Object search routines now distinguish between candidates=None, and
...
candidates=[]
2013-07-17 03:30:48 -04:00
Griatch
878f83aba0
Merge. Added updates to some of the fixes, such as making channel connetion updates look for online Players instead of online Sessions (the latter would have created duplicates in a multi-session environment).
2013-06-30 13:57:21 +02:00
Kelketek
240dee1d5b
Fixed issue with attribute search not properly handling attribute prefixes.
2013-06-29 15:10:14 -05:00
Griatch
a9a70c91b1
Fixed a bug with the who command.
2013-05-23 21:38:01 +02:00
Griatch
efdb954491
Fixed a logical error in obj.manager causing it to fail to find arbitrary db_>fieldname>. Resolves Issue 373.
2013-05-21 14:29:50 +02:00
Kelketek
ad7d8fc9fd
Fixed typeclass searching for objects.
2013-05-18 18:47:04 -05:00
Griatch
51cf5461fa
Fixed a typo on the @ic command's search_object call.
2013-05-14 21:47:25 +02:00
Griatch
e15d6dfb6e
Fixed a search feature that was not included in the revision of the object search mechanism - the ability to search based on an object. Resolves Issue 363.
2013-05-14 21:17:29 +02:00
Griatch
bd9421d4b0
Implemented unittests for all default commands in a new and much faster way.
2013-05-12 19:53:19 +02:00
Griatch
78e7346962
Updated commands to use the new objectdb.search API.
2013-05-11 23:22:02 +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
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
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
87bfb97853
Rewrote the fuzzy-matching routine to correctly handle fuzzy, global searches on keys and aliases.
2012-10-23 20:29:03 +02:00
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
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
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
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
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
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
5117bd2a0a
Minor fixes and reducing some sql calls in various managers.
2012-08-22 16:15:52 +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
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
1feb3a80a5
Some minor cleanups here and there.
2012-04-29 12:35:21 +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
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
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
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
81e7a31072
Removed a mis-placed line in the object search that caused spurious errors in some commands.
2012-03-20 19:59:29 +01:00
Griatch
86f76d0d08
Contrib: Added chargen module, showing a simple example of creating a character from inside the game.
2011-11-06 22:28:24 +01:00
Griatch
703accdd60
Added an error_check_python_modules function to evennia.py. This basically imports a host of critical modules and quits with tracebacks if there are problems. This catches pure python-syntax errors (i.e. cases where the source-file itself is malformed), something which is hard to properly handle in the running server (where there's also an issue as to how to best report it). Best they fail out already at an early stage.
2011-11-06 21:32:00 +01:00
Griatch
8770a263ac
Fixes, cleanups and bugfixes in various systems.
2011-06-26 22:03:09 +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
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
695317e699
Resolves issue 155. Cleaned up the copy functionality and a few minor bugs at the same time. Copying an active character is somewhat confusing though (and deleting a character will currently make the player unable to log back in).
2011-04-07 22:10:51 +00:00
Griatch
9dcfea5971
Resolves issue 133. Added the location keyword to the ObjectDB.search() method for easier customizable object searches.
2011-02-27 22:55:42 +00:00
Ari Mudev
708aa66a04
Work around Issue 117. This is PROBABLY the right fix.
2010-11-10 23:03:38 +00:00
Griatch
8aa22fbec8
Fixed bugs in alias and search system, including properly searching inventory. Expanded @alias command with more functionality.
2010-11-09 14:46:39 +00:00
Griatch
19dd476115
Changed object and alias search methods to be more effective. Made aliases a separate model to avoid overhead with large searches. The change of aliases meand you need to resync your database.
2010-10-30 18:42:37 +00:00
Griatch
547eb53b32
Made search(*playername) commands correctly return a Player typeclass and not a character. Initial startup/character creation: Default permissions are now assigned on player level rather than character level (this gives more safety to @puppet operations). Made @puppet command work only on Character objects.
2010-10-21 18:58:47 +00:00
Griatch
9459178c43
Fixed character swap mechanisms. Created an example command @puppet for switching control between characters (note that it does not currently check permissions, nor make sure the target has the appropriate cmdsets).
2010-10-18 21:07:26 +00:00