SQCSimulator2023/SQCSim-srv/connection.h
2023-09-25 08:23:52 -04:00

42 lines
863 B
C++

#ifndef CONNECTION_H__
#define CONNECTION_H__
#include <deque>
#include <map>
#include "../SQCSim-common/player.h"
#include "../SQCSim-common/vector3.h"
#include "../SQCSim-common/serialization.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(Input in);
Output* getOutput(Timestamp time);
Sync getSync(Timestamp time);
void CleanInputManifest(Timestamp time);
private:
std::map<Timestamp, Input> m_input_manifest;
std::map<Timestamp, Output> m_output_manifest;
in_addr m_addr;
uint64_t m_id,
m_sid,
m_tid;
std::string m_name;
};
#endif