[CF-Devel] Protocol Questions (Server to Client)

Mark Wedel mwedel at sonic.net
Sat Aug 31 00:12:26 CDT 2002


Bjoern Becker wrote:
>
     
      Hi.
     
     >
     
     
     >
     
      I'm currently working on the S2C Protocol of the Win-Client I'm coding.
     
     >
     
      While browsing through the Docs that came with the Server Source some
     
     >
     
      questions arose :
     
     
  Unless there is good reason not to do so (eg, you want to keep your client 
closed source), I would strongly suggest you look at the common directory in the 
'unix' client.  That directory, which generates a library that handles most all 
the packet communication, but makes calls to the graphical/more machine specific 
areas.  The common area should hopefully be pretty cross platform.

  If there are specific commands that you need info on, let me know and I'll 
look and find out how many they are in fact using.

>
     
     
     >
     
      1. How large in bytes is the Face-ID ?
     
     >
     
          I found some passages that speak of 4 Bytes and some say 2 Bytes
     
     
  Taking a quick look, it seems to vary based on the command.  I can't remember 
why it should ever need to be 4 bytes, yet it is used in places.  The max face 
right now is something like 3000-4000 range, so there shouldn't be any real need 
for it being 32 bit.  My only guess was the idea to use the extra bits for 
something or another.


>
     
     
     >
     
      2. NCOM/COMC
     
     >
     
          Where to find out which Value to use for <packet> ?
     
     
  Start at 0, and re-wrap to 0 when you get to 255.  What this is used for is so 
that the client can know if the server has executed a specific command. 
Basically, if the player is moving really slow, you don't want to send 200 
commands to the server, because that gets way too far ahead for the players 
action.  So the client can look at the last comc value and see how many 
unexecuted commands it has sent to the server and decide not to send this one.

>
     
     
     >
     
      3. Pixmap / Bitmap support
     
     >
     
          As I'm trying to stay compatible to old servers i wanted to know
     
     >
     
          at which S->C Protocol Version the support for Pix/Bitmap was
     
     >
     
          stopped.
     
     
  Don't worry about those - they have been gone for a while.  In addition, there 
was quite some time where those along with PNG support existed - so even if the 
server is soo old it still supports those, you can still use the PNG images.

>
     
     
     >
     
      4. MAP1 / MAP1A
     
     >
     
          Is 1a only used for large faces ?
     
     
  The client can use the setmode command to request which one to use. 
currently, there are no 'big faces' on the server, yet I have the unix clients 
using the map1a command.

  I note that the docs on that is incorrect - currently, the map1 and map1a 
command are exactly the same in terms of format, only the map1a command sends 
maps off the edge of the viewable map (the doc says that the two MSB bits in the 
face are used for other stuff - that isn't true).


>
     
     
     >
     
      5. Face Checksum
     
     >
     
          Which Algorithm is used ? CRC32 ? (yes , i know that the Client
     
     >
     
          doesn't need to generate it)
     
     
  Its a 32 bit CRC.

>
     
     
     >
     
      6. Sounds
     
     >
     
          Are the sound available as .tar.bz2 or .zip ? Only found the
     
     >
     
          RPM's. They are somewhat unhandy on Windoze , you know ;)
     
     
  Can get them from CVS - they are in the top level of the repository as 
'sounds'.  There should be tar.gz ones available - this may not be the newest 
version, but they haven't changed for a while.  I think new rpms are done for 
them to keep in sync with the client and dependency issues.



    
    


More information about the crossfire mailing list