You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3coop/apps/openmw-mp/Networking.hpp

46 lines
955 B
C++

//
// Created by koncord on 12.01.16.
//
#ifndef OPENMW_NETWORKING_HPP
#define OPENMW_NETWORKING_HPP
#include <components/openmw-mp/PacketsController.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);
int MainLoop();
void StopServer(int code);
PacketsController *GetController() const;
static const Networking &Get();
static Networking *GetPtr();
private:
static Networking *sThis;
RakNet::RakPeerInterface *peer;
RakNet::BitStream bsOut;
TPlayers *players;
PacketsController *controller;
bool running;
int exitCode;
};
}
#endif //OPENMW_NETWORKING_HPP