[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 08:26:16 CDT 2006


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



Date        : 2006/08/18 08:26

User        : eracc

Edit Summary: 



@@ -6,9 +6,9 @@

  === What is the Client Scripting Interface? ===

  Basically, the Client Scripting Interface is a way to have an external p
rogram (the script) interact client-side with your in-game behaviour. The 
script can have a copy of messages sent from the server to your client (th
ere is a wide variety of such messages), can have a copy of messages sent 
from your client to the server (there are also lots of them), may request 
information (on a item, a map square ...) and finally can issue commands t
o the server. Lets call those actions, respectively, server-client spying,
 client-server spying, examining and interacting.

  

  === Pipes, stdout, stdin ===

- 	If this section causes you to consider puking by the second line, jum
p to the next section.

+ (If this section causes you to consider puking by the second line, jump 
to the next section.)

  

  The script is a program which is external to the client. It can be writt
en in a wide range of languages. This can be C, Java, Perl, Python, Bash s
cript, php, anything you can think about. How can this be possible? Let's 
take a look at what happens when you type "echo hello world" on a shell pr
ompt. Sure it writes on your terminal "hello world". And if you are in a g
raphical shell prompt? It appears in the graphical console! Some process c
hanged your request of writing to screen to a complex process of //get som
e system font// and //render the line in the specified window at the speci
fied position//. All this because when you ask to "write hello world to sc
reen" you ask, really, to "write hello world to the standard output device
". This standard output device is called stdout. There is also the stdin, 
which most of the time is your keyboard and stderr, the standard error dev
ice being most of the time the same as stdout.\\  

  \\ 

  Ok, and now? Now what we use is exactly the same trick as the graphical 
console. when the client runs a script, it changes the script's stdin and 
replace the keyboard input with it's own orders (using a pipe). And it cha
nges the stdout so instead of writing to screen, the script sends data to 
the client (using another pipe). And this is how any language can be used.
 Because every language can write to the screen and read from the keyboard
!





IP-Address  : 72.4.41.2

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

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