#ifndef CONNECTION_H__ #define CONNECTION_H__ #include #include #include "../SQCSim-common/player.h" #include "../SQCSim-common/vector3.h" #include "../SQCSim-common/netprotocol.h" #include "define.h" class Connection { public: Connection( in_addr addr, std::string name, uint64_t hash, uint64_t self_hash, uint64_t team_hash); ~Connection(); Player* player = nullptr; in_addr GetAddr() const; uint64_t GetHash(bool self = true) const; uint64_t GetTeamHash() const; std::string GetName() const; void AddInput(netprot::Input in); netprot::Output* getOutput(Timestamp time); netprot::Sync getSync(Timestamp time); void CleanInputManifest(Timestamp time); private: std::map m_input_manifest; std::map m_output_manifest; in_addr m_addr; uint64_t m_id, m_sid, m_tid; std::string m_name; }; #endif