Simple Game Server -- request for help

Mark Wieder mwieder at ahsoftware.net
Sun May 29 13:27:40 EDT 2011


Jim-

Sunday, May 29, 2011, 9:05:09 AM, you wrote:

> 2. Is there a way (using some kind of push method) that could
> eliminate polling for moves? It would be nice to extend the
> capability of the server to support faster games, such as between
> robot players.

Why would you consider client polling? Here's what I would do (caveat:
untested in this situation, but working in others)

1. User 1 contacts server to start playing game
2. User 2 does the same
3. User 1 makes a move
4. Server sends a notification of move to User 2
5. User 2 makes a move
6. Server sends a notification of move to User 1
7. Rinse and repeat

Since the server already has a list of who's connected to the game at
any time, it's easy to send a notification packet to each of them when
something of interest occurs. This significantly decreases the network
traffic vs client polling and puts more of the burden of game logic on
the server, allowing for thinner clients. In addition, this would
allow you to put move validation routines on the server instead of in
each client, providing easier maintenance over the long run.

-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list