--- deliantra/server/pod/events.pod 2006/12/19 04:58:05 1.8 +++ deliantra/server/pod/events.pod 2007/04/02 18:04:46 1.17 @@ -20,16 +20,16 @@ will be ignored (presumably your plug-in took care of it). -=head2 OBJECT EVENTS +=head2 ATTACHABLE EVENTS -Object events always relate to a specific object, which is always the -first argument. Not all events get generated for every object, some are -specific to an object type. +No time to document this, screw me. =head3 instantiate (object init-args...) -An archetype was instantiated into an object. This event occurs when -a map is loaded for the first time, or when the object was created +An object was instantiated. + +For objects, this event occurs when a map is loaded for the first time +when it was instantiated from an archetype, or when the object was created dynamically. The arguments are as specified in the C attribute of the object or archetype. @@ -44,11 +44,25 @@ =head3 clone (object destination) -An object with _attached extension_ is cloned, that is, a copy was -made. The copy automatically has all attachments the original object -had. The perl variables get copied in a shallow way (references are shared -between instances). If this is not the behaviour you need, you have to -adjust the B object as you see fit. +An object with _attached plugin_ is cloned, that is, a copy was made. The +copy automatically has all attachments the original object had. The perl +variables get copied in a shallow way (references are shared between +instances). If this is not the behaviour you need, you have to adjust the +B object as you see fit. + +=head3 destroy (object -- ) + +Invoked when the crossfire object gets destroyed, and only when the object +has a handler for this event. This event can occur many times, as its +called when the in-memory object is destroyed, not when the object itself +dies. + + +=head2 OBJECT EVENTS + +Object events always relate to a specific object, which is always the +first argument. Not all events get generated for every object, some are +specific to an object type. =head3 add_bonus (item creator difficulty max_magic flags) @@ -64,14 +78,15 @@ In general, if flags != 0 or creator != 0 you should just return and leave item generation to the standard code. -=head3 destroy (object) +=head3 remove (object -- ) -Invoked when the crossfire object gets destroyed, and only when the object -has a handler for this event. This event can occur many times, as its -called when the in-memory object is destroyed, not when the object itself -dies. +Invoked before the object is removed from its environment. + +=head3 insert (object -- ) + +Called after the object was inserted into a container or map. -=head3 tick (object) +=head3 tick (object -- ) Invoked whenever the object "ticks", i.e. has positive B. Only during ticks should an objetc process any movement or other events. @@ -190,9 +205,17 @@ moving onto it. This includes not just traps, but also buttons, holes, signs and similar stuff. +=head3 open (container who -- ) + +Invoked whenever a container gets opened. When overriden, the container will not +get opened, but you must tell op about the reason. + =head3 close (container who -- ) -Invoked whenever a container gets closed (this event is not yet reliable!). +Invoked whenever a container gets closed. When overriden, the container +will not get closed, but you must tell op about the reason. This event +is not crash-safe, i.e. containers might be closed due to a server crash +without this event being invoked. =head2 GLOBAL EVENTS @@ -212,12 +235,6 @@ Player events always have a player object as first argument. -=head3 reattach (player) - -Invoked whenever attachments/plug-ins need to get reattached to the player -object. This usually happens when the player gets loaded from disk, or -when the server is reloaded. - =head3 birth (player) Invoked as very first thing after creating a player. @@ -228,16 +245,29 @@ =head3 kick (player params -- ) -Invoked when the given plaer is being kicked, before the kick is executed. +Invoked when the given player is being kicked, before the kick is +executed. -=head3 load (player) +=head3 load (player -- ) Invoked whenever a player has been loaded from disk, but before actual login. -=head3 save (player) +=head3 save (player -- ) + +Invoked just before a player gets serialised. + +=head3 save_done (player -- ) + +Invoked just after a player was serialised. + +=head3 connect (player -- ) + +Invoked just after the player object was connected to a client. -Invoked just before a player gets saved. +=head3 disconnect (player -- ) + +Invoked just before the player gets disconnected from the client. =head3 login (player) @@ -276,6 +306,11 @@ Invoked whenever the player uses the B or B command, before it gets processed. +=head3 told (player player message -- ) + +Invoked right before a message is being told to a player using B or +B. + =head3 say (player message --) =head3 chat (player message --) @@ -296,19 +331,6 @@ Original B has been loaded (e.g. on first use, or after a map reset). -=head3 reattach (map) - -Invoked whenever attachments/plug-ins need to get reattached to the -B. This usually happens when the map was loaded from disk, or when the -server was reloaded. - -=head3 destroy (map) - -Invoked when the map object gets destroyed, and only when the map object -has a handler for this event. This event can occur many times, as its -called when the in-memory object is destroyed, not when the object itself -dies. - =head3 swapin (map) Invoked when a previously swapped-out temporary B has been loaded again. @@ -336,7 +358,7 @@ Invoked whenever a player tries to leave the B. Overriding means the player won't be able to leave. -=head3 trigger (map connection state) +=head3 trigger (map connection state -- ) Invoked whenever something activates a B on the B. If B is true the connection was 'state' and if false it is 'released'. @@ -348,7 +370,27 @@ handled asynchronously as soon as the command reaches the server, even when the player hasn't logged in yet (meaning there is no player yet). -=head3 exticmd (client string) +=head3 connect (client -- ) + +Called as soon as a new connection to the server is established. Should +not be overriden. + +=head3 setup (client string -- ) + +Client sent the setup command to negotiate parameters. Handling is +mandatory and done by F. + +=head3 addme (client -- ) + +The client sent an addme, thus ending the initial handshaking. Handling is mandatory +and done by F. + +=head3 reply (client replystring -- ) + +Called when the client submits a reply in the ST_CUSTOM state. Usually +handled internally by language plugins. + +=head3 exticmd (client string -- ) Like C, but can be called before a player has logged in.