1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:19:54 +00:00
openmw-tes3mp/apps/openmw-mp/Networking.hpp

48 lines
1.1 KiB
C++

//
// Created by koncord on 12.01.16.
//
#ifndef OPENMW_NETWORKING_HPP
#define OPENMW_NETWORKING_HPP
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
#include "Player.hpp"
namespace mwmp
{
class Networking
{
public:
Networking(RakNet::RakPeerInterface *peer);
~Networking();
void NewPlayer(RakNet::RakNetGUID guid);
void DisconnectPlayer(RakNet::RakNetGUID guid);
void KickPlayer(RakNet::RakNetGUID guid);
void Update(RakNet::Packet *packet);
unsigned short NumberOfConnections() const;
unsigned int MaxConnections() const;
int MainLoop();
void StopServer(int code);
PlayerPacketController *GetPlayerController() const;
static const Networking &Get();
static Networking *GetPtr();
private:
static Networking *sThis;
RakNet::RakPeerInterface *peer;
RakNet::BitStream bsOut;
TPlayers *players;
PlayerPacketController *playerController;
bool running;
int exitCode;
};
}
#endif //OPENMW_NETWORKING_HPP