[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: network game ?

Well, some more things to add:

The CRC16 should better go to the end of the packet, but isn't part of the size count (as size is only the game state data) and isn't used in calculating the CRC16, of course.

The header should also have a version number to be flexible in the future?

The game state includes gfx, correct? We could remove it adn then don't need to zip the state as it looks already packed.

This would lead to:

offset content description
0 start packet id // to mark the beginning of a crimson packet
4 packet type // game state or acknowledge
8 unique packet id // unique for each game state, used for acknowledge
12 version // version number at the moment 1
16 size of game state // size of following data withotu crc16 field
20 zipped .sav file // the game state itself
20 + size crc16 value // crc16 over the whole packet for error checking, crc16 field excluded

For TCP/IP you would put it into a TCP packet. For Bluetooth (VfComm it is), IRDA and other serial connections you would just send it straight.


  Henk Jonas
  Palm OS ® certified developer

  metaview@xxxxxx                                   www.metaviewsoft.de