Updated the game/gamesrc/ examples with the new hook names.

This commit is contained in:
Griatch 2013-04-09 22:22:17 +02:00
parent 9a187b48ff
commit be2d0086a3
5 changed files with 123 additions and 39 deletions

View file

@ -29,12 +29,13 @@ class ExampleCharacter(Character):
and its commands only be called by itself, not anyone else.
(to change things, use at_object_creation() instead)
at_after_move - launches the "look" command
at_disconnect - stores the current location, so the "unconnected" character
at_post_puppet(player) - when Player disconnects from the Character, we
store the current location, so the "unconnected" character
object does not need to stay on grid but can be given a
None-location while offline.
at_post_login - retrieves the character's old location and puts it back
on the grid with a "charname has connected" message echoed
to the room
at_pre_puppet - just before Player re-connects, retrieves the character's old
location and puts it back on the grid with a "charname has
connected" message echoed to the room
"""
pass

View file

@ -47,7 +47,8 @@ class ExampleObject(Object):
date_created (string) - time stamp of object creation
permissions (list of strings) - list of permission strings
player (Player) - controlling player (will also return offline player)
player (Player) - controlling player (if any, only set together with sessid below)
sessid (int, read-only) - session id (if any, only set together with player above)
location (Object) - current location. Is None if this is a room
home (Object) - safety start-location
sessions (list of Sessions, read-only) - returns all sessions connected to this object
@ -91,10 +92,10 @@ class ExampleObject(Object):
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_first_login() - (player-controlled objects only) called once, the very first time user logs in.
at_pre_login() - (player-controlled objects only) called every time the user connects, after they have identified, before other setup
at_post_login() - (player-controlled objects only) called at the end of login, just before setting the player loose in the world.
at_disconnect() - (player-controlled objects only) called just before the user disconnects (or goes linkless)
at_pre_puppet(player)- (player-controlled objects only) called just before puppeting
at_post_puppet() - (player-controlled objects only) called just after completing connection player<->object
at_pre_unpuppet() - (player-controlled objects only) called just before un-puppeting
at_post_unpuppet(player) - (player-controlled objects only) called just after disconnecting player<->object link
at_server_reload() - called before server is reloaded
at_server_shutdown() - called just before server is fully shut down