Zigonnage dans le srv.
This commit is contained in:
@@ -1,17 +1,30 @@
|
||||
#ifndef _CONNECTION_H__
|
||||
#define _CONNECTION_H__
|
||||
#ifndef CONNECTION_H__
|
||||
#define CONNECTION_H__
|
||||
#include <deque>
|
||||
#include <chrono>
|
||||
#include <map>
|
||||
#include "../SQCSim-common/player.h"
|
||||
#include "../SQCSim-common/vector3.h"
|
||||
#include "define.h"
|
||||
|
||||
struct Input {
|
||||
std::chrono::system_clock::time_point timestamp;
|
||||
Timestamp timestamp;
|
||||
UINT8 keys; // 0bFBLRJS__
|
||||
Vector3f direction;
|
||||
};
|
||||
|
||||
struct Output {
|
||||
Timestamp timestamp;
|
||||
UINT64 id = 0;
|
||||
Vector3f position, direction;
|
||||
bool is_shooting, is_jumping;
|
||||
};
|
||||
|
||||
struct Sync {
|
||||
Timestamp timestamp;
|
||||
UINT64 sid = 0;
|
||||
Vector3f position;
|
||||
};
|
||||
|
||||
class Connection {
|
||||
public:
|
||||
Connection(
|
||||
@@ -29,13 +42,18 @@ public:
|
||||
UINT64 GetTeamHash() const;
|
||||
std::string GetName() const;
|
||||
|
||||
void Clean(std::chrono::system_clock::time_point time);
|
||||
void AddInput(Input in);
|
||||
Output* getOutput(Timestamp time);
|
||||
Sync getSync(Timestamp time);
|
||||
|
||||
void CleanInputManifest(Timestamp time);
|
||||
private:
|
||||
std::deque<Input> m_input_manifest;
|
||||
std::map<Timestamp, Input> m_input_manifest;
|
||||
std::map<Timestamp, Output> m_output_manifest;
|
||||
in_addr m_addr;
|
||||
UINT64 m_hash,
|
||||
m_shash,
|
||||
m_thash;
|
||||
UINT64 m_id,
|
||||
m_sid,
|
||||
m_tid;
|
||||
std::string m_name;
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user