Commit graph

174 commits

Author SHA1 Message Date
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
Griatch
42d502bfc6 OBS - Database schema has changed! If you use south, you need to run manage.py migrate!
This adds db indexing on a set of important database fields, all in the interest of optimization.
2012-02-06 13:18:25 +01:00
Griatch
7b2a4e4467 Cleaned up typeclasses, removing a lot of extranenous and ineffective code from the setattr/getattr methods that are called most often. 2012-02-05 21:04:10 +01:00
Griatch
4c0d4a0294 Deactivating the creation of object attributes from admin for now, until one can figure out how to handle this. 2011-11-13 18:49:04 +01:00
Griatch
a60cd9bf1f Fixed User/Player creation in Admin, much more intuitive now. Remains issues with creating attributes since these need to be pickled to/from the database in order to be properly handled. 2011-11-13 18:46:14 +01:00
Griatch
3e8b43d222 More fixes and cleanup in wake of ic/ooc changes. 2011-11-06 23:55:24 +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
0ed692c19c Fixed a bug that prevented objects inside the room designated as "default home" from escaping when deleting that room. Objects will now be dumped to a null location (and warnings be given) instead of being deleted with the room.
Also noticed that large parts of the server is not covered by i18n.
2011-11-05 21:19:57 +01:00
Griatch
e7b46c89b4 Added the ability for the Command.func() method to return a value. This allows to potentially do e.g. value = caller.execute_cmd('cmdname'). Not used at all by default commands nor the engine itself, but potentially useful for admins wanting to implement some sort of 'nested' command structure, maybe using a custom input language. 2011-10-27 10:18:18 +02:00
Griatch
1291509d03 Added inlines and fixed admin interface to not allow editing User once a Player is created. 2011-10-04 21:14:41 +02:00
Griatch
bc0195bbaa Worked with admin interface, cleaning up and adding functionality. There are still some strange behaviour that makes e.g. the presence of inlines to auto-create empty database objects for some strange reason. Inlines are turned off at the moment (so there is no convenient way to add attributes from the admin interface at this time). Creating players now work, but one needs to create all three components (User, Player, Character) in one go and tie them together. The User-admin form was changed to also support multi-word usernames (django default didn't allow spaces). 2011-10-02 22:37:07 +02:00
Griatch
7f2e6dd4fa Tidying up the admin interface by adding more verbose and helpful names to database fields as well as adding more help texts. The ObjectAdmin still gives tracebacks. 2011-10-02 01:21:03 +02: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
0a1bcd36c2 Removed FULL_PERSISTENCE setting. It was a "feature" that was added at a time when caching was more inefficient than now. Also the new reload mechanism make FULL_PERSISTENCE=False unfeasable. Use ndb explicitly for non-persistence. 2011-10-01 15:10:21 +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
de9c2ec437 Cleaned admin interface, removing misleading fields. It's still broken in a few places however, objects give a traceback here, not sure why. 2011-09-15 00:28:26 +02:00
Griatch
399919a8a9 Database schema has changed. Run migrations if you use South. Started work on tidying up admin interface. 2011-09-14 22:34:10 +02:00
Greg Taylor
3aad32d7b4 Fixing issue 183, reported by sergi.reyner. Typo in src/objects/models.py, ocation/location. 2011-09-07 15:47:19 +00: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
Griatch
2b4e008d18 Scripts and Exits updated. Fixed some deep issues with Scripts that caused object-based scripts to not properly shut down in some situations, as well as spawn multiple instances of themselves. I think this should resolve all "at_repeat doubling" issues reported. Due to optimizations in the typeclass cache loader in a previous update, the Exit cmdsets were not properly loaded (they were loaded at cache time, which now doesn't happen as often). So Exits instead rely on the new "at_cmdset_get" hook called by the cmdhandler. It allows dynamic modification of cmdsets just before they are accessed. Resolves issue173 (I hope). Resolves issue180. Resolves issue 181. 2011-08-11 21:16:35 +00:00