mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
migrate ALMOST everything from source tree into client
This commit is contained in:
50
source/client/network/RakNetInstance.hpp
Normal file
50
source/client/network/RakNetInstance.hpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/********************************************************************
|
||||
Minecraft: Pocket Edition - Decompilation Project
|
||||
Copyright (C) 2023 iProgramInCpp
|
||||
|
||||
The following code is licensed under the BSD 1 clause license.
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
|
||||
#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