mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 21:49:56 +00:00
141eb8b7c2
Additionally, delete DedicatedPlayers who disconnect. Previously, all disconnected DedicatedPlayers were still kept in memory, but never used again. There was code that suggested they were meant to be reused upon reconnecting, but that reuse had never actually been implemented, and would probably not be that useful anyway.
48 lines
1 KiB
C++
48 lines
1 KiB
C++
#ifndef OPENMW_PLAYERLIST_HPP
|
|
#define OPENMW_PLAYERLIST_HPP
|
|
|
|
#include <components/esm/custommarkerstate.hpp>
|
|
#include <components/esm/loadnpc.hpp>
|
|
#include <components/openmw-mp/Base/BasePlayer.hpp>
|
|
|
|
#include "../mwmechanics/aisequence.hpp"
|
|
|
|
#include "../mwworld/manualref.hpp"
|
|
|
|
#include <map>
|
|
#include <RakNetTypes.h>
|
|
|
|
namespace MWMechanics
|
|
{
|
|
class Actor;
|
|
}
|
|
|
|
namespace mwmp
|
|
{
|
|
struct DedicatedPlayer;
|
|
|
|
class PlayerList
|
|
{
|
|
public:
|
|
|
|
static void update(float dt);
|
|
|
|
static DedicatedPlayer *newPlayer(RakNet::RakNetGUID guid);
|
|
|
|
static void deletePlayer(RakNet::RakNetGUID guid);
|
|
static void cleanUp();
|
|
|
|
static DedicatedPlayer *getPlayer(RakNet::RakNetGUID guid);
|
|
static DedicatedPlayer *getPlayer(const MWWorld::Ptr &ptr);
|
|
|
|
static bool isDedicatedPlayer(const MWWorld::Ptr &ptr);
|
|
|
|
static void clearHitAttemptActorId(int actorId);
|
|
|
|
private:
|
|
|
|
static std::map<RakNet::RakNetGUID, DedicatedPlayer *> players;
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PLAYERLIST_HPP
|