Changed at_cmdset_get() hook to at_cmdset_get(**kwargs). This allows for the possibility to control dynamic generation of cmdsets, for example to force Exit cmdsets to be rebuilt. The aliasing command now uses this. Resolves #563.

This commit is contained in:
Griatch 2014-09-20 10:26:59 +02:00
parent ddc86f2a8b
commit 062a545a97
9 changed files with 45 additions and 27 deletions

View file

@ -26,10 +26,11 @@ class Exit(DefaultExit):
following methods:
basetype_setup() - sets default exit locks (to change, use at_object_creation instead)
at_cmdset_get() - this auto-creates and caches a command and a command set on itself
with the same name as the Exit object. This
allows users to use the exit by only giving its
name alone on the command line.
at_cmdset_get(**kwargs) - this is called when the cmdset is accessed and should
rebuild the Exit cmdset along with a command matching the name
of the Exit object. Conventionally, a kwarg 'force_init'
should force a rebuild of the cmdset, this is triggered
by the @alias command when aliases are changed.
at_failed_traverse() - gives a default error message ("You cannot
go there") if exit traversal fails and an
attribute err_traverse is not defined.

View file

@ -109,8 +109,10 @@ class Object(DefaultObject):
at_init() - called whenever typeclass is cached from memory,
at least once every server restart/reload
at_cmdset_get() - this is called just before the command handler
requests a cmdset from this object
at_cmdset_get(**kwargs) - this is called just before the command handler
requests a cmdset from this object. The kwargs are
not normally used unless the cmdset is created
dynamically (see e.g. Exits).
at_pre_puppet(player)- (player-controlled objects only) called just
before puppeting
at_post_puppet() - (player-controlled objects only) called just

View file

@ -78,7 +78,7 @@ class Player(DefaultPlayer):
usually handled on the character level:
at_init()
at_cmdset_get()
at_cmdset_get(**kwargs)
at_first_login()
at_post_login(sessid=None)
at_disconnect()