1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 23:49:55 +00:00
openmw-tes3mp/apps/openmw-mp/Player.hpp
2016-08-19 01:32:39 +03:00

57 lines
1.1 KiB
C++

//
// Created by koncord on 05.01.16.
//
#ifndef OPENMW_PLAYER_HPP
#define OPENMW_PLAYER_HPP
#include <map>
#include <string>
#include <RakNetTypes.h>
#include <components/esm/npcstats.hpp>
#include <components/esm/cellid.hpp>
#include <components/esm/loadnpc.hpp>
#include <components/esm/loadcell.hpp>
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/Base/BasePlayer.hpp>
struct Player;
typedef std::map<RakNet::RakNetGUID, Player*> TPlayers;
typedef std::map<unsigned short, Player*> TSlots;
class Players
{
public:
static void NewPlayer(RakNet::RakNetGUID id);
static void DeletePlayer(RakNet::RakNetGUID id);
static Player *GetPlayer(RakNet::RakNetGUID id);
static Player *GetPlayer(unsigned short id);
static TPlayers *GetPlayers();
private:
static TPlayers players;
static TSlots slots;
};
class Player : public mwmp::BasePlayer
{
unsigned short id;
public:
Player(RakNet::RakNetGUID id);
unsigned short GetID();
void SetID(unsigned short id);
bool isHandshaked();
void Handshake();
virtual ~Player();
private:
bool handshake;
};
#endif //OPENMW_PLAYER_HPP