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
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
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
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
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
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
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
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
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
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
3e8b43d222
More fixes and cleanup in wake of ic/ooc changes.
2011-11-06 23:55:24 +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
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
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
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
Griatch
16affc284b
Allow for changing the home location of new characters by changing a setting. The given location must exist and is given as a dbref. If one wants more advanced control over start locations, one needs to customize the unloggedin/create command to match the particular game. Resolves issue 178.
2011-08-06 19:39:06 +00:00
Griatch
ddfd8120bb
Made scripts and typeclassed objects remember db_typeclass_path at all times - a temporarily faulty typeclass will no longer mess up things forever after. Refined and optimized the way typeclasses are cached and loaded, minimizing db hits. The default result when trying to create an object or script with a typeclass that is faulty/not found is now to fail. The previous way, to create an entity anyway using defaults was hard to debug and caused confusion. Resolves issue 175.
2011-08-06 18:15:04 +00:00
Griatch
8770a263ac
Fixes, cleanups and bugfixes in various systems.
2011-06-26 22:03:09 +00:00
Griatch
95d672763b
Multiple fixes and cleanups - command parser excludes inaccessible commands already at parse level now. Fixed the functionality of a few of the lock functions to be more intuitive. Added functionality to the examine command to better show the commands available to an object.
2011-06-26 14:35:02 +00:00
Griatch
d2400a8a6b
Added the ability to give multiple typeclass search-paths to config file. This way you can add a path to your custom directory and don't have to write so much when creating typeclassed objects using e.g. @create.
2011-05-13 22:26:08 +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
9c5f662196
Added the "raw" switch to examine, to allow for viewing attributes and properties without parsing markup first.
2011-04-25 20:13: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
7f9f21f45e
Migration needed. Refactored the config.configValue model into server.ServerConfig (that's what the config model were used for anyway). The new model can handle arbitrary data structures through pickle. Run ./manage.py migrate to sync your database with the new setup.
...
Moved Connect screens (the text screen first seen when connecting) away from the database and into a module in gamesrc/world. This module allows for conveniently adding new connect screens on the fly. More than one screen in the given module will mean a random screen is used.
2011-04-12 21:43:57 +00:00
Griatch
6c53ec2bdb
OBS: Run migrate! Made exit's destination into a database field for performance. Fixed a too greedy @reload that caused ContentTypes to loose information. Resolves issue 157.
...
Migrate with: "python manage.py migrate"
2011-04-08 23:10:04 +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
126e2ea61f
OBS: You need to resync your database! Moved cmdsets into the database rather than being dependent on scripts. Moved the creation of the cmdset- and cmdset-handlers into ObjectDB.__init__ rather than bootstrapping it from the typeclass. Added some more script functionality for testing, includong the @script command for assigning a script to an object.
2011-03-20 19:45:56 +00:00
Griatch
08b3de9e5e
OBS: You'll need to resync/rebuild your database!
...
- This implements an updated, clearer and more robust access system. The policy is now to lock that which is not explicitly left open.
- Permission strings -> Lock strings. Separating permissions and locks makes more sense security-wise
- No more permissiongroup table; permissions instead use a simple tuple PERMISSIONS_HIERARCHY to define an access hierarchy
- Cleaner lock-definition syntax, all based on function calls.
- New objects/players/channels get a default security policy during creation (set through typeclass)
As part of rebuilding and testing the new lock/permission system I got into testing and debugging several other systems, fixing some
outstanding issues:
- @reload now fully updates the database asynchronously. No need to reboot server when changing cmdsets
- Dozens of new test suites added for about 30 commands so far
- Help for channels made more clever and informative.
2011-03-15 16:08:32 +00:00