[plt-scheme] Poker server in scheme

From: Joel Reymont (joelr at well.com)
Date: Sat Dec 4 08:58:55 EST 2004


I'm considering writing my poker server in Scheme and C++ by using the
RakNet library (http://www.rakkarsoft.com/) for the network layer and
Scheme for the server logic, etc. I can't get over a few of issues,
though, and I googled for a solution to no avail.

My poker protocol will be a series of binary packets. I understand that I
can (should?) use PLT Scheme structs then do struct->vector and write
that to a binary port. I also understand that I should use match when
restoring the packet as described here: http://list.cs.brown.edu/

My questions are:

1. How do I introduce field types? I would like a balance field to be a
float for example. 

2. When passing the vector to the external C++ code to be sent over the
net are there any endian-ness issues? How do I avoid them, i.e. store
everything big-endian?

3. Is there an elegant recipe to "register" my structs so that when I get
a vector from the network C++ code into scheme I could avoid a long
series of match statements.

4. Is there a way to serialize things in some sort of a well-defined
binary format? I would like to have clients that not only use Scheme but
are pure C++ or Java for example. I would like to be able to publish the
protocol and  describe the packet structure by saying here goes the float
balance and then an integer id follows, etc.

    Thanks in advance, Joel

OpenPoker: The Linux of poker software

Posted on the users mailing list.