SQCSimulator2023/SQCSim2021/connector.h
2023-09-29 12:04:08 -04:00

37 lines
690 B
C++

#ifndef CONNECTOR_H__
#define CONNECTOR_H__
#include <stdlib.h>
#include "../SQCSim-common/netprotocol.h"
#include "define.h"
class Connector {
public:
Connector();
~Connector();
int Init();
int Connect(char* srv_addr, std::string name);
uint64_t getId() const;
unsigned int getSeed() const;
//void SendInput();
//int Sync();
private:
#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;
SOCKET m_sock_udp = 0,
m_sock_tcp = 0;
};
#endif