mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
* Initial commit.
:)
This commit is contained in:
42
source/Network/RakNetInstance.hpp
Normal file
42
source/Network/RakNetInstance.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "PingedCompatibleServer.hpp"
|
||||
#include "BitStream.h"
|
||||
#include "RakPeerInterface.h"
|
||||
#include "Packet.hpp"
|
||||
|
||||
class Packet;
|
||||
|
||||
class RakNetInstance
|
||||
{
|
||||
public:
|
||||
RakNetInstance();
|
||||
~RakNetInstance();
|
||||
void announceServer(const std::string& name);
|
||||
void clearServerList();
|
||||
bool connect(const char* host, int port);
|
||||
void disconnect();
|
||||
RakNet::RakPeerInterface* getPeer();
|
||||
std::vector<PingedCompatibleServer>* getServerList();
|
||||
bool host(const std::string& name, int port, int maxConnections);
|
||||
bool isMyLocalGuid(const RakNet::RakNetGUID& guid);
|
||||
void pingForHosts(int port);
|
||||
void runEvents(NetEventCallback*);
|
||||
void send(Packet* packet);
|
||||
void send(const RakNet::RakNetGUID& guid, Packet* packet);
|
||||
void stopPingForHosts();
|
||||
|
||||
public:
|
||||
RakNet::RakPeerInterface* m_pRakPeerInterface = nullptr;
|
||||
bool m_bIsHost = false;
|
||||
int field_C;
|
||||
RakNet::RakNetGUID m_guid;
|
||||
int field_1C;
|
||||
std::vector<PingedCompatibleServer> m_servers;
|
||||
bool m_bPingingForHosts;
|
||||
int m_hostPingPort;
|
||||
int m_startedPingingAt;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user