[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Underware-devel] Current network packets structure
From: |
Loic Dachary |
Subject: |
[Underware-devel] Current network packets structure |
Date: |
Tue, 27 Jan 2004 22:59:07 +0100 |
Hi,
It appeared to me today (while working with Henry, welcome
Henry ;-) that the current code wrapping network packets leads to an
extremely complex set of modifications to do something as simple as
adding a new packet type.
Unless someone has serious objections by tomorrow morning I'll
trash the current system completly (not all the network code, just the
code used to access packets ;-). I will replace it by assuming that:
- All packets are stored in native Python structures (dict)
- C++ code accesses the data members of a packet using the
Python C++ API to dict objects.
- A minimal C++ class encapsulates the gory details and has an
API that looks like this:
void GetMember(string, &float)
void GetMember(string, &int)
...
and the same set of SetMember methods
The constructor allocates a first class Python object and
INCREF it, the destructor DECREF it.
Using Python objects instead of simple structs would be a
questionable if there was a performance issue but network code is not
really our concern in this matter. We do need, however, packets that
can be easily defined and used seamlessly in Python or C++.
The reason for doing this now (instead of implementing
gameplay code) is that the current complexity is a significant
drawback when prototyping a new gameplay code that needs new packets
to circulate between the client and the server.
Cheers,
--
Donate to FSF France online : http://rate.affero.net/fsffrance/
Loic Dachary, 12 bd Magenta, 75010 Paris. Tel: 33 1 42 45 07 97
http://www.fsffrance.org/ http://www.dachary.org/loic/gpg.txt
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Underware-devel] Current network packets structure,
Loic Dachary <=