forked from mirror/openmw-tes3mp
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.
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
//
|
|
// Created by koncord on 12.01.16.
|
|
//
|
|
|
|
#ifndef OPENMW_NETWORKING_HPP
|
|
#define OPENMW_NETWORKING_HPP
|
|
|
|
#include <components/openmw-mp/PacketsController.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);
|
|
|
|
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
|