Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CF: Documentation - client/server protocol
>From the V-Desk of Isak Styf:
> Chris Eleveld wrote:
> >
> > Is there any documentation on the network/client<->server protocol
> > and if not would it be worthwhile for me to start hashing out documentation
> > on it?
>
> At least in the client package there is a file called Protocol that
> outlines the C/S Protocol for Crossfire.
>
> However, it can be made better
I've just reviewed the new Protocol file and I really must agree
that it can and should be made more client friendly
Since the formats are a known quantity (more or less), eutl's strong
typing is overkill, so we've gained some protocol efficiencies but
we can do better. (As a small warning: I haven't yet read the actual
code and am basing most of my remarks on what's written in the
"Protocol" file.)
- Replace the text commands with a binary token
If you're worried enough to cut the packet length word down to 2
bytes from 4, doesn't it make sense to cut down the 7 byte command
string to 1 byte? Most languages I know of support some form of
a CASE/SWITCH or ON intvar GOSUB type flow control.
- PLEASE convert all numerical data passed as text BACK to binary
That short time parsing text strings adds up over the hundreds of
updates per quantum handled by the client
- Optional, but would be really nice: Prepend text with a length
I suppose we could ignore that in a few special cases:
- fixed length field, client knows length
- string last argument in packet
John "gah the Mage" soon "gah the Dustpile"
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]
Follow-Ups:
References: