Commit graph

198 commits

Author SHA1 Message Date
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
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
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
bcf214ee0d Changed so object.move_to() traverses exits by default - i.e. you will no longer end up INSIDE the exit object if you move_to the exit, but instead you will go to the exits destination. This should be the most common use. The use_destination keyword to object.move_to can be used to change this behaviour. Also @teleport (which uses move_to()) has gotten a new flag to allow for teleporting into exits if so specifically desired. Resolves issue 224. 2012-04-15 22:04:15 +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
a713ad16d3 Migrate! Fixes some more objects to the new API. 2012-03-25 21:53:24 +02:00
Griatch
81980605b4 OBS! Run Migrations! Converts old API cmdsets and typeclass paths to new system for already existing objects. 2012-03-25 20:30:05 +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
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
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
9660dd6656 Added caching to some more object properties. 2012-02-26 12:43:16 +01:00
Griatch
bdf86b203d Reverting caching-changes to cmdset_storage, causes spurious errors. 2012-02-26 12:07:25 +01:00
Griatch
71c7d5f8e0 aching cmdset_paths. 2012-02-26 01:26:38 +01:00
Griatch
24c4791e9e Fixed a bug with the updating of the caching. 2012-02-26 01:10:20 +01:00
Griatch
fb0d77c794 Added caching for aliases. 2012-02-25 23:56:31 +01:00
Griatch
440d403327 Added some more error catching to the attr migrations. 2012-02-22 11:40:52 +01:00
Griatch
e170505878 Adding full convertion to the migrations, should hopefully cover all cases now. 2012-02-15 18:28:44 +01:00
Griatch
3b88767865 Made fixes to the migrations. 2012-02-15 14:27:26 +01:00
Griatch
a32aebaa0e OBS- need to run migrations! Refactored attributes to use a slightly different internal storage format for faster access. Also set up caching of all attribute data, so subsequent reads of an attribute will not hit the database anymore, and writes will re-cache. 2012-02-14 23:40:16 +01:00