- Timestamp:
- Jan 6, 2009, 9:39:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/network/packet/Gamestate.h
r2382 r2575 46 46 namespace packet { 47 47 48 #define GAMESTATE_START(data) (data + sizeof(GamestateHeader)) 49 #define GAMESTATE_HEADER(data) ((GamestateHeader *)data) 50 #define HEADER GAMESTATE_HEADER(data_) 51 48 52 struct _NetworkExport GamestateHeader{ 49 53 ENUM::Type packetType; … … 55 59 bool complete:1; // wheter it is a complete gamestate or only partial 56 60 bool compressed:1; 57 #ifndef NDEBUG58 uint32_t crc32;59 #endif60 61 }; 61 62 … … 73 74 bool collectData(int id, uint8_t mode=0x0); 74 75 bool spreadData( uint8_t mode=0x0); 75 in t getID();76 bool isDiffed();77 bool isCompressed();78 in t getBaseID();76 inline int32_t getID() const { return HEADER->id; } 77 inline bool isDiffed() const { return HEADER->diffed; } 78 inline bool isCompressed() const { return HEADER->compressed; } 79 inline int32_t getBaseID() const { return HEADER->base_id; } 79 80 Gamestate *diff(Gamestate *base); 80 Gamestate* intelligentDiff(Gamestate *base, unsigned int clientID);81 81 Gamestate *undiff(Gamestate *base); 82 Gamestate* intelligentUnDiff(Gamestate *base);83 82 Gamestate* doSelection(unsigned int clientID, unsigned int targetSize); 84 83 bool compressData(); … … 88 87 private: 89 88 virtual uint32_t getSize() const; 90 virtual bool process();89 virtual inline bool process(); 91 90 92 91 bool operator ==(packet::Gamestate gs); 93 92 private: 94 93 uint32_t calcGamestateSize(int32_t id, uint8_t mode=0x0); 95 void removeObject(ObjectListIterator<Synchronisable> &it);96 94 std::list<obj> dataMap_; 97 // static TrafficControl *trafficControl_;98 95 }; 99 96
Note: See TracChangeset
for help on using the changeset viewer.