ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/pod/extensions.pod
(Generate patch)

Comparing deliantra/server/pod/extensions.pod (file contents):
Revision 1.1 by elmex, Fri Sep 8 15:34:56 2006 UTC vs.
Revision 1.2 by elmex, Sat Sep 9 23:22:06 2006 UTC

10 10
11=head2 Extension to <thing> attachments 11=head2 Extension to <thing> attachments
12 12
13You can "attach" extensions to global events, to type/subtypes, 13You can "attach" extensions to global events, to type/subtypes,
14to specifix objects, to players and to maps. 14to specifix objects, to players and to maps.
15 On top of that a extension can implement new user commands. 15On top of that an extension can implement new user commands.
16 16
17If a extension for example wants to attach itself to all jeweler 17If an extension for example wants to attach itself to all jeweler
18skills it has to attach itself like this: 18skills it has to attach itself like this:
19 19
20 cf::attach_to_type cf::SKILL, cf::SK_JEWELER, 20 cf::attach_to_type cf::SKILL, cf::SK_JEWELER,
21 on_use_skill => sub { 21 on_use_skill => sub {
22 ... handling code here ... 22 ... handling code here ...
37in the game, this is mainly for debugging purposes, as it will produce a 37in the game, this is mainly for debugging purposes, as it will produce a
38high load. 38high load.
39 39
40The map attachments work like this: 40The map attachments work like this:
41 41
42If a extension wants to attach itself to the 'trigger' event (this is 42If an extension wants to attach itself to the 'trigger' event (this is
43the event that is generated when a connection is activated (pushed or 43the event that is generated when a connection is activated (pushed or
44released)), it has to do this: 44released)), it has to do this:
45 45
46 cf::attach_to_maps 46 cf::attach_to_maps
47 on_trigger => sub { 47 on_trigger => sub {
114This way multiple different attachments have a seperate field for storing 114This way multiple different attachments have a seperate field for storing
115their arguments. 115their arguments.
116 116
117=head2 Defining new user commands 117=head2 Defining new user commands
118 118
119If a extension wants to redefine a user command it does it like this: 119If an extension wants to redefine a user command it does it like this:
120 120
121 cf::register_command invite => 10, sub { 121 cf::register_command invite => 10, sub {
122 my ($who, $args) = @_; 122 my ($who, $args) = @_;
123 ... 123 ...
124 } 124 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines