SQCSimulator2023/SQCSim2021/connector.h

43 lines
819 B
C
Raw Permalink 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;
2023-10-27 14:37:53 -04:00
netprot::Sync getOrigin() const;
2023-09-25 08:23:52 -04:00
//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-10-03 12:43:54 -04:00
// void updateRemotePlayers(std::map<RemotePlayers> rplayers);
2023-10-27 14:37:53 -04:00
std::map<uint64_t, netprot::PlayerInfo> m_players;
2023-09-25 08:23:52 -04:00
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::TeamInfo> m_teams;
netprot::LoginInfo m_loginfo;
netprot::GameInfo m_gameinfo;
2023-10-27 14:37:53 -04:00
netprot::Sync m_origin;
2023-09-25 08:23:52 -04:00
};
#endif