33 lines
530 B
C++
33 lines
530 B
C++
#ifndef CONNECTOR_H__
|
|
#define CONNECTOR_H__
|
|
|
|
#include "define.h"
|
|
#include "../SQCSim-common/netprotocol.h"
|
|
#include <stdlib.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
|
|
SOCKET m_sock_udp = 0,
|
|
m_sock_tcp = 0;
|
|
std::string m_name = "";
|
|
uint64_t m_sid = 0,
|
|
m_tid = 0;
|
|
unsigned int m_seed = 0;
|
|
|
|
};
|
|
#endif
|