Commit graph

72 commits

Author SHA1 Message Date
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
ad8a9fbe69 Added warning message for puppeting to an object without neither location nor home set. 2013-04-20 16:14:12 +02:00
Griatch
416d6e14bc Fixing a bug in @ic if trying to puppet while already puppeting. Added sessid keyword to at_post_login hook in order to correctly relay login text only to the correct session. Removed the src.utils.debug module as well as the CmdDebug command which has not been supported for a good while. 2013-04-18 09:13:31 +02:00
Griatch
a6544f2848 changed cmdset_default -> cmdset_character and changed the class names to match. Added migrations to properly update default-set cmdset_stores to the new positions (objects created from custom types are not migrated, these should see errors and need to re-point their imports to the new defaults) 2013-04-12 13:01:20 +02:00
Griatch
be2d0086a3 Updated the game/gamesrc/ examples with the new hook names. 2013-04-09 22:22:17 +02:00
Griatch
1e07b8ca34 After the rework of the many-char mode, mode 0 now works stably and auto-logins correctly it seems. 2013-04-09 17:11:34 +02:00
Griatch
20a57d4167 Further fixes to the system, still some issues remaining. 2013-04-06 21:36:52 +02:00
Griatch
9eb1903f02 Lots of cleanup and bug fixes. Still some issues with reconnecting to the right location in multisession_mode 0. 2013-04-03 18:31:53 +02:00
Griatch
458e3e7599 Added @sessions command for viewing active sessions connected to a given account. 2013-02-17 20:21:23 +01:00
Griatch
261363bae7 Moved connect/disconnect messages to be triggered by Player, not by Character. 2013-02-17 14:24:31 +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
Griatch
ea545d7ff3 Added the ability to deactivate local caching, by use of the settings.GAME_CACHE_TYPE variable. A temporary solution for working with multiple processes. Will also be useful for debugging and profiling. 2013-01-09 19:43:46 +01:00
Griatch
15feb915e6 Fixing a missing report. 2013-01-08 09:45:59 +01:00
Griatch
45bf38679f Moving a check for the connect channel, probably resolving a weird django error appearing in postgreSQL. Related to Issue 341. 2013-01-08 09:44:13 +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
949da47917 Removed some old and now confusing, unsused variables and added some documenting strings. 2012-12-08 15:39:09 +01:00
Griatch
c0302f7cff Added global_dbref argument to caller.search, for allowing e.g. the examine command to view globally by dbref yet local-only if supplying a name. Resolves Issue 327. 2012-12-08 14:09:42 +01:00
Griatch
28c625c12c Re-activated connect-channel again, called from hooks. Fixed some bugs and minor things to give more control over how messages sent to channels are handled. 2012-11-13 21:24:05 +01:00
Griatch
52af816977 Added hooks at_access_success and at_access_failure to allow for custom messaging for certain lock errors. Resolves Issue 311. 2012-10-28 14:07:18 +01:00
Griatch
ce036e07f3 Added the ability of obj.move_to to accept a None location with a keyword to_none. Also changed the @tel command to accept a /tonone switch for putting things' location to None. Resolves Issue 307. 2012-10-23 22:31:51 +02:00
Griatch
21408c56cf Made the docstrings for objects' basetype_setup() more informative. Resolves Issue 302. 2012-10-20 09:33:40 +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
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
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
4c83d3e7a1 Various speed optimizations in various places, following further profiling. 2012-09-20 00:47:28 +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
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