- Timestamp:
- Oct 10, 2018, 3:06:55 PM (6 years ago)
- Location:
- code/branches/mergeFS18
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/mergeFS18
- Property svn:mergeinfo changed
/code/branches/Masterserver_FS18 (added) merged: 11816,11829,11842,11856,11858,11880,11889,11905,11907,11910,11929-11930,11937,11962-11963,11973,11983,11990
- Property svn:mergeinfo changed
-
code/branches/mergeFS18/src/libraries/network/GamestateManager.h
r11071 r12027 58 58 * - writing gamestates to universe 59 59 * - diffing gamestates 60 * 61 * Inherited by Host 62 * 60 63 * EN/DECODATION: 61 64 * a: last Gamestate a client has received 62 65 * b: new Gamestate 63 66 * x: diffed and compressed gamestate 64 * x =(a^b)65 * b =(a^x)66 * diff(a, diff(a,x))=x (hope this is correct)67 * x = (a ^ b) 68 * b = (a ^ x) 69 * diff(a, diff(a, x)) = x (hope this is correct) 67 70 * @author Oliver Scheuss 68 71 */ … … 75 78 uint32_t lastAckedGamestateID; //!< id of the last gamestate on which we received an ack from the peer 76 79 bool isSynched; 77 std::map< uint32_t, packet::Gamestate*> gamestates;80 std::map<uint32_t, packet::Gamestate*> gamestates; 78 81 }; 79 82 … … 86 89 virtual bool ackGamestate(unsigned int gamestateID, unsigned int peerID) override; 87 90 virtual uint32_t getLastReceivedGamestateID( unsigned int peerID ) override; 88 virtual uint32_t getCurrentGamestateID() override { if(currentGamestate_) return currentGamestate_->getID(); else return GAMESTATEID_INITIAL; }91 virtual uint32_t getCurrentGamestateID() override { if(currentGamestate_) return currentGamestate_->getID(); else return GAMESTATEID_INITIAL; } 89 92 90 93 bool processGamestates(); … … 98 101 void addPeer( uint32_t peerID ); 99 102 void setSynched( uint32_t peerID ) 100 { assert(peerMap_.find(peerID) !=peerMap_.end()); peerMap_[peerID].isSynched = true; }103 { assert(peerMap_.find(peerID) != peerMap_.end()); peerMap_[peerID].isSynched = true; } 101 104 void removePeer( uint32_t peerID ); 102 bool hasPeers(){ return this->peerMap_.size() !=0; }103 // void removeClient(ClientInformation *client); 105 bool hasPeers(){ return this->peerMap_.size() != 0; } 106 104 107 protected: 105 108 virtual bool sendPacket( packet::Packet* packet ) = 0; 109 106 110 private: 107 111 bool processGamestate(packet::Gamestate *gs); 108 112 109 // std::map<unsigned int, std::map<unsigned int, packet::Gamestate*>> gamestateMap_;110 113 std::map<unsigned int, packet::Gamestate*> gamestateQueue; 111 // std::map<unsigned int, uint32_t> lastProcessedGamestateID_; 114 115 // Each peerID maps to a peerInfo struct 112 116 std::map<uint32_t, peerInfo> peerMap_; 117 118 // always contains the latest gamestate 113 119 packet::Gamestate* currentGamestate_; 114 // TrafficControl *trafficControl_;115 120 unsigned int id_; 116 // boost::mutex* threadMutex_; 117 ThreadPool* /*thread*/Pool_; 121 ThreadPool* Pool_; 118 122 }; 119 123
Note: See TracChangeset
for help on using the changeset viewer.