Début sockets.

This commit is contained in:
MarcEricMartel
2023-09-24 08:45:40 -04:00
parent b7ca0253ca
commit 51b0795c62
11 changed files with 455 additions and 45 deletions

31
SQCSim-srv/connection.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include "connection.h"
Connection::Connection(in_addr addr,
std::string name,
UINT64 hash,
UINT64 self_hash,
UINT64 team_hash):
m_addr(addr),
m_hash(hash),
m_shash(self_hash),
m_thash(team_hash),
m_name(name) {
}
Connection::~Connection() {
}
in_addr Connection::GetAddr() const { return m_addr; }
UINT64 Connection::GetHash(bool self) const { return self? m_shash: m_hash; }
UINT64 Connection::GetTeamHash() const { return m_thash; }
std::string Connection::GetName() const { return m_name; }
void Connection::Clean(std::chrono::system_clock::time_point time) {
while (m_input_manifest.front().timestamp < time || !m_input_manifest.empty())
m_input_manifest.pop_front();
}