in reply to Making an Interactive Game on a website (Texas Hold'em)
Now to get to your question. I originally wanted to do it via CGI, but you run into one big problem...CGI is a stateless protocol, so you will have to store all the sessions in a database of some sort, send out alot of hidden fields to maintain state of the users, and deal with the fact that you will need to force an update to all the users, that may require javascript ? Otherwise, the players won't know when the other players have played, unless they click an "update" button. So that is your big problem with using CGI.
Now I just decided that using TCP sockets was an easier way to go. You make a perl server listening on some port, and have your clients connect to it. I'm using Tk for the clients. The benefits of using TCP are: it maintains state, the server can send out data to the clients for updates, automatically; and it also allows for a little real-time chat between players.
So consider TCP for realtime games, it actually is easier than CGI, (once you learn a bit about sockets, and some Tk for the clients)
|
|---|