- Timestamp:
- Mar 22, 2018, 4:12:23 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Masterserver_FS18/src/libraries/network/GamestateManager.h
r11071 r11829 62 62 * b: new Gamestate 63 63 * x: diffed and compressed gamestate 64 * x =(a^b)65 * b =(a^x)66 * diff(a, diff(a,x))=x (hope this is correct)64 * x = (a ^ b) 65 * b = (a ^ x) 66 * diff(a, diff(a, x)) = x (hope this is correct) 67 67 * @author Oliver Scheuss 68 68 */ … … 75 75 uint32_t lastAckedGamestateID; //!< id of the last gamestate on which we received an ack from the peer 76 76 bool isSynched; 77 std::map< uint32_t, packet::Gamestate*> gamestates;77 std::map<uint32_t, packet::Gamestate*> gamestates; 78 78 }; 79 79 … … 86 86 virtual bool ackGamestate(unsigned int gamestateID, unsigned int peerID) override; 87 87 virtual uint32_t getLastReceivedGamestateID( unsigned int peerID ) override; 88 virtual uint32_t getCurrentGamestateID() override { if( currentGamestate_) return currentGamestate_->getID(); else return GAMESTATEID_INITIAL; }88 virtual uint32_t getCurrentGamestateID() override { if(currentGamestate) return currentGamestate_->getID(); else return GAMESTATEID_INITIAL; } 89 89 90 90 bool processGamestates(); … … 98 98 void addPeer( uint32_t peerID ); 99 99 void setSynched( uint32_t peerID ) 100 { assert(peerMap_.find(peerID) !=peerMap_.end()); peerMap_[peerID].isSynched = true; }100 { assert(peerMap_.find(peerID) != peerMap_.end()); peerMap_[peerID].isSynched = true; } 101 101 void removePeer( uint32_t peerID ); 102 bool hasPeers(){ return this->peerMap_.size() !=0; }103 // void removeClient(ClientInformation *client); 102 bool hasPeers(){ return this->peerMap_.size() != 0; } 103 104 104 protected: 105 105 virtual bool sendPacket( packet::Packet* packet ) = 0; 106 106 107 private: 107 108 bool processGamestate(packet::Gamestate *gs); 108 109 109 // std::map<unsigned int, std::map<unsigned int, packet::Gamestate*>> gamestateMap_; 110 // TODO: What is the purpose of the gamestateQueue? 110 111 std::map<unsigned int, packet::Gamestate*> gamestateQueue; 111 // std::map<unsigned int, uint32_t> lastProcessedGamestateID_; 112 113 // Each peerID maps to a peerInfo struct 112 114 std::map<uint32_t, peerInfo> peerMap_; 115 116 // always contains the latest gamestate 113 117 packet::Gamestate* currentGamestate_; 114 // TrafficControl *trafficControl_;115 118 unsigned int id_; 116 // boost::mutex* threadMutex_; 117 ThreadPool* /*thread*/Pool_; 119 ThreadPool* Pool_; 118 120 }; 119 121
Note: See TracChangeset
for help on using the changeset viewer.