SQCSimulator2023/SQCSim2021/connector.h

37 lines
696 B
C
Raw Normal View History

2023-09-25 08:23:52 -04:00
#ifndef CONNECTOR_H__
#define CONNECTOR_H__
2023-09-27 11:24:41 -04:00
#include <stdlib.h>
2023-09-29 12:04:08 -04:00
#include "../SQCSim-common/netprotocol.h"
#include "define.h"
2023-09-25 08:23:52 -04:00
class Connector {
public:
Connector();
~Connector();
2023-09-25 17:17:17 -04:00
int Init();
2023-10-23 15:41:07 -04:00
int Connect(const char* srv_addr, std::string name);
2023-09-27 11:24:41 -04:00
uint64_t getId() const;
2023-09-25 08:23:52 -04:00
unsigned int getSeed() const;
//void SendInput();
//int Sync();
private:
2023-09-25 17:17:17 -04:00
#ifdef _WIN32
WSADATA m_wsaData;
#endif
std::map<Timestamp, netprot::Input> m_inputmanifest;
std::map<uint64_t, netprot::PlayerInfo> m_players;
std::map<uint64_t, netprot::TeamInfo> m_teams;
netprot::LoginInfo m_loginfo;
netprot::GameInfo m_gameinfo;
sockaddr_in m_srvsockaddr;
2023-09-25 17:17:17 -04:00
SOCKET m_sock_udp = 0,
m_sock_tcp = 0;
2023-09-25 08:23:52 -04:00
};
#endif