Griatch
da51cb063f
ev-API cleanups. ev can now be imported also from a non-django initiated python interpreter (it initiates itself). Gave some more info text and made sure wrapped db_ methods correctly forward their doc strings for introspection.
2012-03-27 09:59:11 +02:00
Griatch
4398d42360
Added new templates to gamesrc/*/examples. The old base* modules still in place. Some cleanup of the API.
2012-03-25 16:35: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
6a78fdafcb
Removed a debug-print statement.
2012-03-13 01:39:30 +01:00
Griatch
ca280af659
Fixed cache issues with @type and @name commands that didn't properly update the cache when using them.
2012-03-13 01:37:28 +01:00
Griatch
42254fa3c4
Fixed an issue with creating new chars following the latest optimizations.
2012-02-26 19:04:57 +01:00
Griatch
018a98b92c
Optimized typeclass conversion in typeclass manager.
2012-02-26 16:04:19 +01:00
Griatch
91f2a5930c
Minor additions to typeclass loading.
2012-02-26 15:10:22 +01:00
Griatch
9660dd6656
Added caching to some more object properties.
2012-02-26 12:43:16 +01:00
Griatch
24c4791e9e
Fixed a bug with the updating of the caching.
2012-02-26 01:10:20 +01:00
Griatch
1fa5791e19
Added aggressive caching for common typeclassed variables.
2012-02-25 23:37:50 +01:00
Griatch
9733a43a16
Fixed the issues with assigning to nested attribute-lists/dicts "in-situ", e.g. obj.db.mylist[1][2] = val. This now works as it should. I'm still not sure this behaviour is worth the fact that returning mylist from the attribute will actually return a nested structure of PackedLists/Dicts, and these will continue to save to the database whenever they are updated, also if not used in conjuction with db. Since this behaviour is what is already in the database, I'm committing this fix for the nested assignment error until I decide what to do about the other issue = val. This now works as it should. I'm still not sure this behaviour is worth the fact that returning mylist from the attribute will actually return a nested structure of PackedLists/Dicts, and these will continue to save to the database whenever they are updated, also if not used in conjuction with db. Since this behaviour is what is already in the database, I'm committing this fix for the nested assignment error until I decide what to do about the other issue..
2012-02-24 23:22:38 +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
2c4af9076d
Made some commands sensible to the new form of obj.typeclass (it's not a typeclass instance, not a class). Changed the way TypedObject.swap_typeclass works, so as to properly manage failures.
2011-10-03 23:53:23 +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
2597df0512
Last commit had a typo leading to startup traceback.
2011-09-20 20:26:35 +02:00
Griatch
18669c8700
Fixing so assigning to a nested attribute value doesn't loose data. It is unfortunately not possible to support direct assignment of deeply nested attributes at this time. So if obj.db.mydict = {1:{2:3}}, then obj.db.mydict[1] = 1 will work just fine, but obj.db.mydict[1][2] = 4 will not. For more advanced manipulation such as the latter case, store the dict in a temporary variable and save it back after changes have been done.
2011-09-20 19:59:08 +02:00
Griatch
058f8a9519
Fixed a bug in creating fresh dict-attributes/lists in the new attribute-save system. Resolves issue 191.
2011-09-20 15:55:58 +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
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
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
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
6cb2b8b745
Working on cleaning some strange behavior when trying to submitting faulty typeclasses to script system. Also fixing bugs here and there.
2011-07-03 21:01:06 +00:00
Griatch
334c0b1d08
Fixed a bunch of small issues. The RedButton example hasn't been working for a while, should be ok again now - also cleaned it up a bit.
2011-06-24 20:12:59 +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
4bcd5239b5
Mixed batch of minor bug fixes and cleanups.
2011-04-30 21:09:19 +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
7f7016ad7d
Run Migrate. Implemented @search functionality with limits as per MUX (as part of the @find command). Added some more channel-related commands and changed locks for channels to have a "control" lock type rather than "admin". The migration converts this in existing channels..
2011-04-20 22:40:27 +00:00
Griatch
7d30b337d9
Cleanups and bug fixes. Fixed the @unlink command and also made it overally more stable. Resolves issue 161. Added more string conversion routines to handle non-ascii variables being stored in an Attribute. Resolves issue 160.
2011-04-16 22:26:22 +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
4519169e1c
Fixed a type. See previous commit.
2011-04-05 23:30:32 +00:00
Griatch
6eff51de20
OBS: Migration needed(objects, scripts, players). This resolves issue 136 by allowing database objects to be nested in lists and dictionaries as
...
attributes on objects. Behind the scenes, only the DBREF is stored since storing dbobjects cannot be pickled. One used to be able to store single objects this way, but objects hidden in nested iterable structures were not found. Note that ONLY lists and dictionaries are supported to store on attributes - custom iterables will be stored and retrieved as a generic list instead - this is a tradeoff to be able to store database objects.
To migrate, give the following commands from game/:
migrate.py migrate objects
migrate.py migrate scripts
migrate.py migrate players
2011-04-05 23:28:40 +00:00
Griatch
75956de7d1
Small bugfixes in the wake of the cmdset changes. Resolves issue 148.
2011-03-20 23:14:36 +00:00
Griatch
d73dd65500
Adjusted the way typeclasses are searched. Should correctly find overloaded methods now.
2011-03-20 20:44:48 +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
2f78bacd97
Added a check for multiple connected sessions to avoid moving disconnected object more than once. Resolves issue 145.
2011-03-19 22:17:00 +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
Griatch
38014eda3c
Resolves issue 138.
2011-02-28 23:43:14 +00:00
Griatch
e094a4d173
Fixed a test suite syntax error in command testing.
2011-02-28 00:34:03 +00:00
Griatch
45941e0c69
Implemented typeclass deleting; you can now do del obj.testval and expect the underlying attribute to be safely deleted from the database. Also fixed some reference errors when assigning to db/ndb properties on objects. Resolves issue 116. Fixed a bug in the command-testing system, so the few command tests that are defined should all work now.
2011-02-05 18:06:18 +00:00