Commit graph

6 commits

Author SHA1 Message Date
Griatch
c7cbc4854e Reworked object command tables.
Object commands used to require re-adding every call in the script parent's __init__ or factory functions, adding the commands to a new command table directly on the object. Since all other attributes can be set up in at_object_creation(), this was both inconsistent and a bit confusing to work with. There is now a method add_commands() directly defined on all objects. It takes the same arguments as the normal add_command()o but use a reserved attribute to create and update a command table on the object. This has the advantange of completely removing the __init__ call in the script parent, all definitions can now be kept in at_object_creation() and are, more importantly, persistent without having to be recreated every call.
- I updated the examine command to show all the commands defined on an object (if any).
- I updated gamesrc/parents/examples/red_button.py considerably using the new command methodology and also using the updated Events.
.
Griatch
2009-12-03 00:41:53 +00:00
Griatch
6bbdde763d Minor fix of an argument typo as well as making an example more compacent with the wiki. 2009-08-16 09:09:55 +00:00
Griatch
3eb4cddf42 - implemented @destroy as per the MUX help specifications. As part of this, fixed the object recycling routines to actually properly replace GARBAGE-flagged objects (it crashed before).
- Set up a global cleaner event to clean all @destroyed objects every 30 minutes (makes their dbrefs available).
- Added the @recover command for recovering @destroyed objects up until the point that the cleaner runs and actually destroys them. This can recover @destroyed objects, rooms and exits to the same state as before @destroy. It could easily be made to recover player objects too, but I'm thinking this would be a security issue.
- Added to @dig in order to allow for creating rooms with a particular parent. Also auto-creates exits in each room if desired. The only things that is not implemented is the aliases of the exits, I don't really know how to do that.
- Changed the @create command format to match the @dig (it uses : to mark the parent instead of = now, since MUX' @dig reserve = to the exit list.)
- Added extra security in the example event to guard against the bug that causes the whole scheduler to freak out if the event_function() gives a traceback.
- Changed many instances of type to point to the defines_global.OTYPE instead of giving the integer explicitly.
/Starkiel
2009-04-30 15:01:59 +00:00
Griatch
8799a0fd55 Added example of how to handle event errors gracefully without them taking down the server with with unhandled exceptions (this should be handled somewhere above exception too, but it's hard to tell when to do it since twisted is raising them). /Starkiel 2009-04-30 08:23:54 +00:00
Griatch
b63bcc6132 Removed an unneeded debug logger entry from the example event to avoid spamming the log. 2009-04-26 11:04:54 +00:00
Griatch
a9dbac8aae - Made many small bugfixes to the @parent and @create functions as well as their underlying methods.
- Made it so user #1 is also affected by the on_player_creation() function.
- Added an event folder for custom events, including a working example
- Expanded the example commands and parents to include the changes to how they should be initialized.
- Added an optional ansi scheme (not active by default)
2009-04-25 20:51:12 +00:00