[JDEV] Scripting Tool Component/ Multiplayer Jabber Gaming
//Chill
chill at collective3.com
Tue Apr 2 00:25:05 CST 2002
Hello all, long time listener, first time caller.
I'm using Jabber on a server and working on a client in Flash, for the purpose of multi-player game and chat environments. So far Jabber has everything we need, except a way to easily store data about rooms and determine game states. Say three people are playing a game show, all three players send their answers to the server, which then must decide who's the winner and send the relevant data back. Easy.
I was thinking the best and most unintrusive way to do this would be to create a custom namespace for gaming and metadata. This namespace would actually be used to pass the information off to PHP or Perl, which would then execute and write to a temp file or stdout, read back in to jabberd, then sent to the client. For security purposes tags would correspond to specific php scripts explicitly stated in a config file.
The reason behind using PHP or Perl is for ease of use for web developers. I would like to create a bridge from Jabber to these scripting tools to allow fast scripting of simple server-side decision making for multi-player flash games. This also will allow metadata on conference rooms etc. to be stored and retrieved from a database of the developer's choice.
I figured first I'd ask if something like this already exists. I've looked all over, but maybe it's out there, lurking under an acronym i don't know. I'm not looking for a big reply to my big jdev debut. It would be nice to have either a nod that it's a good idea and a couple links to point me in the right direction, or someone to say, 'duh, that's been done before, here's a tarball."
To be specific on what I want to make:
Client sends a SCRIPT tag:
<SCRIPT name="chess">
<PARAM name="move">checkmate</PARAM>
</SCRIPT>
jabberd receives tag, looks at its config file for a match which looks like:
<SCRIPTDEF name="chess">
<APPTYPE>php</APPTYPE>
<FILE>/home/user/chess.php</FILE>
</SCRIPTDEF>
So the script 'chess' is passed the parameter move and executed something like:
/usr/bin/php/php -q chess.php move=checkmate
PHP works its magic and then the data from the script is sent back to the client as:
<SCRIPT reply="chess">
...php output....
</SCRIPT>
Thanks for any help
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20020402/a6ff1842/attachment-0002.htm>
More information about the JDev
mailing list