Commit graph

69 commits

Author SHA1 Message Date
Griatch
24764743ff Made a new version of create_object function, and made Objects creatable using o=Object(). 2014-12-23 21:33:03 +01:00
Griatch
5b42b31240 API change. Removed managers for Attributes and Tags - these are instead incoorporated into the TypedObjectManager which all Typeclassed object handlers inherit from. This concludes the refactor started in #529. This means that access to Attributes/Permissions/Aliases and Tags/nicks are done directly through e.g. ObjectDB.objects.get_by_tag() (or ev.managers.objects.get_by_tag) rather than using Tag.get_obj_with_tag and specifying the model type manually. The create_tag() method was also moved into the TypedObjectManager as part of removing the Tagmanager. As part of this change, Tag and Attribute was also removed from the ev interface. 2014-10-25 22:40:38 +02:00
Griatch
1bcd9abc6b Changed order of Script save. This avoids a race condition where Scripts that die very quickly tries to delete themselves before having had time to save first. Resolves #597. 2014-10-13 08:41:22 +02:00
Griatch
3dc35d8b6d Changed create_object to have at_object_receive and at_after_move to correctly target the location and not the new object. Resolves #566. 2014-09-05 07:52:18 +02:00
Griatch
fdf5c723d2 Fixed silly error reporting when trying to create an object of a non-found typeclass. 2014-08-09 21:27:01 +02:00
Griatch
05d21ef4f7 Updated create.create_object to be faster. Made AttributeHandler.add() handle bulk-adding of Attributes and with a slightly more efficient way to create new Attributes. 2014-07-01 00:46:20 +02:00
Griatch
cda13989f6 Run Migrations! Made Tags unique based on the combination of their db_key, db_category AND their db_tagtype fields. 2014-06-30 20:14:58 +02:00
Griatch
57144b2c21 Made objects auto-unsubscribe from tickerhandler when deleted (resolves #515). Fixed a bug that made typeclass loading mechanism not report errors as verbosely as it could. 2014-06-14 19:31:19 +02:00
Griatch
91b23f58a4 Removed CHARACTER_DEFAULT_HOME, replaced with DEFAULT_HOME and added START_LOCATION for determining where default commands dump new characters. 2014-04-20 15:56:38 +02:00
Griatch
7d0ff9c71c Fixed a database referene bug that would remove ForeignKey referenced objects when reverse referenced through something like db_home (this defaults to CASCADE mode, is now SET_NULL). Also fixed some other minor things. 2014-04-20 15:03:53 +02:00
Griatch
7571e3606d Some cleanups of the unittests. 2014-03-15 07:37:02 +01:00
Griatch
8b52591c2f Run Migrations. Added player field to script model in order to allow Players to be scripted in the same way Objects can. 2014-03-08 11:41:23 +01:00
Griatch
1cabcae771 Fixed a mis-call in create_object. 2014-01-19 00:19:31 +01:00
Griatch
aef7ccec8d Added an explicit conversion when adding the default home value in create_object; also made the error more explicit. 2014-01-18 23:02:15 +01:00
Griatch
64fd3580a3 Added the possibility to use #dbrefs as arguments to ev.create_object (e.g. for home and location). If a non-existing #dbref is given, a DoesNotExist error will be raised. 2014-01-18 22:53:30 +01:00
Griatch
6e5de7847a Run migrations! Changed "Comm" typeclass to be called "Channel" to match the ChannelDB it is a typeclass for. The migration updates all old channel defaults to the new path. 2013-12-02 13:45:48 +01:00
Griatch
72bdc3b37f Created wrappers for creating Tags. 2013-12-02 13:00:14 +01:00
Griatch
1ae17bcbe4 PEP8 cleanup of the entire codebase. Unchanged are many cases of too-long lines, partly because of the rewrite they would require but also because splitting many lines up would make the code harder to read. Also the third-party libraries (idmapper, prettytable etc) were not cleaned. 2013-11-14 19:31:17 +01:00
Kelketek
48bcb9d0ba Useful default typeclass for channels added. Handles poses and provides interfaces for external messages and internal alike. 2013-09-29 13:11:10 -05:00
Kelketek
851e6d00cc Turned comms into typeclassed objects. 2013-09-28 22:23:30 -05:00
Griatch
b99833e8fc Fixed initial_setup to properly create new objects without a pre-set home. 2013-09-24 00:41:33 +02:00
Griatch
fd9acd6bf9 Fixed website. Fixing references to db_references, not sure how to add the m2m field access to the admin. Fixed wrapper for db_home. 2013-09-23 22:08:14 +02:00
Griatch
06e858b3f6 Moved permissions into a the tag system as a separate handler. Permissions still don't work quite right yet. 2013-08-24 23:57:44 +02:00
Griatch
37886adea1 Added signalhandler in test suite, still issues. 2013-07-13 15:39:16 +02:00
Griatch
c0b5c506a4 Removed a lot of old references to Aliases and Nicks. Still failing on @puppet. 2013-07-12 15:34:54 +02:00
Griatch
46d1c48a38 Working implementation of User->PlayerDB conversion. Superuser must be created separately. The player-create method was corrected, along with the most obvious places where the user-setup was used. One can log in and look around but it's not heavily debugged yet. 2013-07-11 18:03:07 +02:00
Griatch
efdb954491 Fixed a logical error in obj.manager causing it to fail to find arbitrary db_>fieldname>. Resolves Issue 373. 2013-05-21 14:29:50 +02:00
Kelketek
e752c2dd64 Made username creation/login case insensitive. 2013-05-13 12:30:00 -05:00
Griatch
71346dcc67 Merge. 2013-02-14 17:55:35 +01:00
Griatch
a1dc7451ef Some fixes to the way the admin initiates new player objects. 2013-02-12 19:54:11 +01:00
Griatch
b82a75d816 Fixed initial_setup and set up the _playable_characters attribute on all players, for handling multi-accounts. Still some issues with how the character's permissions is accessed. 2013-02-03 20:04:40 +01:00
Griatch
f1767251c6 Can now log in to a character selection screen. Lots more testing required before one-char-per-session works. 2013-02-03 00:25:06 +01:00
Griatch
9f6e3de637 Various cleanups and fixes found during refurbishing the unittest framework (not pushed yet) 2012-11-05 00:55:25 +01:00
Griatch
6c20987d9a Added header as keyword to the utils.create.create_message function 2012-11-04 17:39:06 +01:00
Griatch
dcc7f29a91 OBS: run migrations! This changes the Msg model to work with ManyToManyFields rather than with custom string representations for storing multiple receivers or channels. It also expands the Msg object with a "title" field and various filter options. This should make it easier to implement mail-like operations using the comms system. 2012-08-30 00:05:00 +02:00
Griatch
4acfe48d9c Removed repetitive imports in the utils.create functions. I experimented with making these methods yield more, but it's hard to integrate this behaviour with actual production code. 2012-05-01 22:51:18 +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
b43fb3156a Added create_* and search_* helper methods directly in the API. 2012-03-25 17:01:27 +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
3408f3ca3f Added alternative function names to create module, for consistency with the search module. This means you can do create.objects() now too. 2012-03-25 14:01:51 +02:00
Griatch
24c4791e9e Fixed a bug with the updating of the caching. 2012-02-26 01:10:20 +01:00
Griatch
ed00e42762 Made check for PlayerObject more rigorous in create.create_msg, in response to issue 209. 2012-02-20 21:56:11 +01:00
Griatch
a6f3e1f47f create_script(): Added new keywords for customizing a created script at creation time, overloading what is defined in the script's at_script_creation() hook. 2012-02-15 22:12:50 +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
2104fd391b Adding TTYPE support (allows server to query client for information such as name and capabilities, assuming the client supports ttype). 2011-11-19 19:34:00 +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
2b2d27ed39 Changed the way unloggedin commands work. Rather than the cmdhander having a special state for unlogged-in commands, the session itself simply stores the cmdset from settings.CMDSET_UNLOGGEDIN. Clean and efficient and also gives a lot more freedom for creating custom login mechanisms (notably it opens the door to using menu systems). 2011-11-06 17:38:29 +01:00
Griatch
aee147102b Gave better error messages when a player typeclass has bugs and thus won't load. Also made a better solution for hiding new characters from the start room when first being created (also makes sure that character.location never starts as being None, recovering back to home in that case). 2011-10-09 16:32: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