Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2008, 5:58:37 PM (16 years ago)
Author:
scheusso
Message:

added crc checksum testing for submitted gamestates (can also be used for other packet types)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/merge/src/network/PacketManager.h

    r1264 r1336  
    3333
    3434#include <string>
     35#include <inttypes.h>
    3536#include <enet/enet.h>
    3637
     
    3839
    3940#define CLIENTID_CLIENT -1
     41#define NETWORK_CRC32POLY 0x04C11DB7 /* CRC-32 Polynom */
    4042
    4143//enum netowk generally used to set the type ID of a packet
     
    4850  *
    4951  */
     52  //void calcCRC(uint32_t &crc32, int bit);
     53  uint32_t calcCRC(unsigned char *data, unsigned int dataLength);
     54 
    5055  class PacketGenerator
    5156  {
     
    6368    ENetPacket* generateConnectRequest( int reliable = ENET_PACKET_FLAG_RELIABLE );
    6469  private:
     70    bool addCRC( ENetPacket *packet);
    6571  };
    6672
     
    8490
    8591  private:
    86 
     92    bool testAndRemoveCRC(ENetPacket *packet);
    8793
    8894
Note: See TracChangeset for help on using the changeset viewer.