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

55 lines
1.5 KiB
C++
Raw Normal View History

#ifndef OPENMW_SERVERCELL_HPP
#define OPENMW_SERVERCELL_HPP
2017-02-19 05:26:42 +00:00
#include <deque>
#include <string>
#include <components/esm/records.hpp>
#include <components/openmw-mp/Base/BaseActor.hpp>
#include <components/openmw-mp/Base/BaseObject.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
2017-02-19 05:26:42 +00:00
class Player;
class Cell;
class Cell
{
friend class CellController;
public:
Cell(ESM::Cell cell);
typedef std::deque<Player*> TPlayers;
2017-02-22 04:03:03 +00:00
typedef TPlayers::const_iterator Iterator;
Iterator begin() const;
Iterator end() const;
2017-02-19 05:26:42 +00:00
2017-02-19 08:07:44 +00:00
void addPlayer(Player *player);
2018-12-29 03:09:13 +00:00
void removePlayer(Player *player, bool cleanPlayer = true);
2017-02-19 05:26:42 +00:00
void readActorList(unsigned char packetID, const mwmp::BaseActorList *newActorList);
bool containsActor(int refNum, int mpNum);
mwmp::BaseActor *getActor(int refNum, int mpNum);
void removeActors(const mwmp::BaseActorList *newActorList);
RakNet::RakNetGUID *getAuthority();
void setAuthority(const RakNet::RakNetGUID& guid);
mwmp::BaseActorList *getActorList();
TPlayers getPlayers() const;
void sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *baseActorList) const;
void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseObjectList *baseObjectList) const;
std::string getDescription() const;
2017-02-19 05:26:42 +00:00
private:
TPlayers players;
ESM::Cell cell;
RakNet::RakNetGUID authorityGuid;
mwmp::BaseActorList cellActorList;
2017-02-19 05:26:42 +00:00
};
#endif //OPENMW_SERVERCELL_HPP