Crossfire::Protocol::Base - client protocol module
use base 'Crossfire::Protocol::Base'; # you have to subclass
Base class to implement a crossfire client.
Called after the last setup packet has been received, just before an addme request is sent.
tag, weight, face, name
$spell = { tag => ..., level => ..., casting_time => ..., mana => ..., grace => ..., damage => ..., skill => ..., path => ..., face => ..., name => ..., message => ..., };
(the default implementation calls delete then add)
current <flags> <x> <y> <width> <height> <hashstring>
Called whenever the map is to be erased completely.
Called with a list of x|y coordinate pairs (as arrayrefs) for cells that have been updated and need refreshing.
Called whenever the map has been scrolled.
Called with the face number of face structure whenever a face image becomes known (either because face_find returned it, in which case $changed is false, or because we got an update, in which case $changed is true).
face_find
$changed
Find and return the png image for the given face, or the empty list if no face could be found, in which case it will be requested from the server.
Send a single packet/line to the server.
Uses either command or ncom to send a user-level command to the server. Encodes the command to UTF-8.
If the server supports a fixed version of the ncom command and this is detected by this module, the following is also supported:
If the callback $cb1 is given, calls it with the absolute time when this command has finished processing, as soon as this information is available.
$cb1
If the callback $cb2 is given it will be called when the command has finished processing, to the best knowledge of this module :)
$cb2
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/ Robin Redeker <elmex@ta-sa.org> http://www.ta-sa.org/
To install Crossfire, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crossfire
CPAN shell
perl -MCPAN -e shell install Crossfire
For more information on module installation, please visit the detailed CPAN module installation guide.