Changeset 1907 for code/trunk/src/network/packet/Gamestate.h
- Timestamp:
- Oct 12, 2008, 7:40:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/packet/Gamestate.h
r1763 r1907 29 29 #include "Packet.h" 30 30 #include "network/Synchronisable.h" 31 #include <map> 31 32 #ifndef NDEBUG 32 33 #include "util/CRC32.h" 33 34 #endif 35 34 36 35 37 #ifndef NETWORK_PACKETGAMESTATE_H … … 42 44 struct GamestateHeader{ 43 45 ENUM::Type packetType; 44 int id; // id of the gamestate45 u nsigned int compsize;46 u nsigned int normsize;47 int base_id; // id of the base-gamestate diffed from48 bool diffed ; // wheter diffed or not49 bool complete ; // wheter it is a complete gamestate or only partial50 bool compressed ;46 int32_t id; // id of the gamestate 47 uint32_t compsize; 48 uint32_t datasize; 49 int32_t base_id; // id of the base-gamestate diffed from 50 bool diffed:1; // wheter diffed or not 51 bool complete:1; // wheter it is a complete gamestate or only partial 52 bool compressed:1; 51 53 #ifndef NDEBUG 52 54 uint32_t crc32; … … 55 57 56 58 /** 57 @author 59 @author Oliver Scheuss 58 60 */ 59 61 class Gamestate: public Packet{ 60 62 public: 61 63 Gamestate(); 62 Gamestate(unsigned char *data, int clientID); 64 Gamestate(uint8_t *data, unsigned int clientID); 65 Gamestate(uint8_t *data); 63 66 64 67 ~Gamestate(); … … 71 74 int getBaseID(); 72 75 Gamestate *diff(Gamestate *base); 76 Gamestate* intelligentDiff(Gamestate *base, unsigned int clientID); 73 77 Gamestate *undiff(Gamestate *base); 78 Gamestate* intelligentUnDiff(Gamestate *base); 79 Gamestate* doSelection(unsigned int clientID); 74 80 bool compressData(); 75 81 bool decompressData(); 76 82 77 83 // Packet functions 84 private: 78 85 virtual unsigned int getSize() const; 79 86 virtual bool process(); … … 83 90 unsigned int calcGamestateSize(unsigned int id, int mode=0x0); 84 91 void removeObject(orxonox::ObjectListIterator<Synchronisable> &it); 85 86 87 //Bytestream *bs_; 88 //GamestateHeader *header_; 92 std::map<unsigned int, Synchronisable*> dataMap_; 89 93 }; 90 94
Note: See TracChangeset
for help on using the changeset viewer.