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();
|
2023-10-23 16:44:34 -04:00
|
|
|
|
|
|
|
SOCKET m_sock_udp = 0,
|
|
|
|
m_sock_tcp = 0;
|
2023-10-23 17:49:40 -04:00
|
|
|
sockaddr_in m_srvsockaddr;
|
2023-09-25 08:23:52 -04:00
|
|
|
private:
|
2023-09-25 17:17:17 -04:00
|
|
|
#ifdef _WIN32
|
|
|
|
WSADATA m_wsaData;
|
|
|
|
#endif
|
2023-09-27 17:34:25 -04:00
|
|
|
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;
|
|
|
|
|
2023-09-25 08:23:52 -04:00
|
|
|
};
|
|
|
|
#endif
|