[Crossfire-wiki] [Crossfire DokuWiki] page changed: client_side_scripting:client_scripting_interface-basic_howto

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Aug 18 11:48:41 CDT 2006


A page in your DokuWiki was added or changed. Here are the details:



Date        : 2006/08/18 11:48

User        : eracc

Edit Summary: 



@@ -89,10 +89,9 @@

  If you type the command __scripts__ in your client you will see our scri
pt is still running.\\ 

  \\ 

  Let's look more closely at the code. We define a character buffer and a 
length. We will use the buffer to read what the client sends to the script
. Then our script sends to the client the command __monitor__ (don't forge
t the \n). This command asks the client to give the script a copy of all c
ommands sent from the client to the server. Now each time a command is sen
t from client to server, the script will get a "monitor <command>" string.
\\ 

  \\ 

- A strange C command:

- 

+ == A strange C command ==

    fflush(stdout)

  

  The stdout has something called a buffer. When you write to output devic
e, it's not immediatly sent to it. For performance reasons, successive pri
nt to stdout are grouped. Most of the time, \n is enough to force sending 
of data, but we ensure all data are sent to client by flushing the stdout 
(force empty buffer). In the future, when you think client didn't get a co
mmand but the script did send it, ensure you flushed stdout.

  

@@ -151,10 +150,11 @@

  Here is a list of command the script can send to client.

  

    * //watch <command type>// - watch the given command from server-clien
t protocol. <command type> specifies the commands we want to watch. Set to
 empty to get all commands.

    * //unwatch <command type>// - unwatch the given command from server-c
lient protocol. <command type> specifies the commands we want to watch. Se
t to empty to get all commands.

-   * //request <data type>// - Request a piece of informations from clien
t memory. Following is the list of <data type> allowed:

+   * //request <data type>// - Request a piece of informations from clien
t memory. Following is a table of <data type> allowed:

  

+ <box round | Data Type Table>

  ^ Data Type ^ Comment ^

  | range	    | Return the type and name of the currently selected range
 attack |

  | stat <type>     | Return the specified stats |

  | stat stats | Return Str,Con,Dex,Int,Wis,Pow,Cha |

@@ -171,8 +171,9 @@

  | map pos | Return the players x,y within the current map |

  | map near | Return the 3x3 grid of the map centered on the player |

  | map all | Return all the known map information |

  | map <x> <y> | Return the information about square x,y in the current m
ap |

+ </box>

  

    * //issue <repeat> <must_send> <command>// - send <command> to server 
on behalf of client. <repeat> is the number of times to execute command <m
ust_send> tells whether or not the command must sent at all cost (1 or 0)

    * //issue mark <tag>// - special case of issue command. only gets the 
command 'mark' and a object tag

    * //issue lock <new state> <tag>// - special case of issue command. On
ly gets the command 'lock' with 2 parameters





IP-Address  : 72.4.41.2

Old Revision: http://wiki.metalforge.net/doku.php/client_side_scripting:cl
ient_scripting_interface-basic_howto?rev=1155907575

New Revision: http://wiki.metalforge.net/doku.php/client_side_scripting:cl
ient_scripting_interface-basic_howto



-- 

This mail was generated by DokuWiki at

http://wiki.metalforge.net/





More information about the crossfire-wiki mailing list