2017-02-19 05:26:42 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 18.02.17.
|
|
|
|
//
|
|
|
|
|
2017-04-29 20:05:12 +00:00
|
|
|
#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>
|
2017-04-30 21:42:34 +00:00
|
|
|
#include <components/openmw-mp/Base/BaseActor.hpp>
|
2018-05-12 21:42:24 +00:00
|
|
|
#include <components/openmw-mp/Base/BaseObject.hpp>
|
2017-04-09 05:51:28 +00:00
|
|
|
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
|
2018-05-12 16:40:00 +00:00
|
|
|
#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);
|
|
|
|
void removePlayer(Player *player);
|
2017-02-19 05:26:42 +00:00
|
|
|
|
2017-04-30 21:42:34 +00:00
|
|
|
void readActorList(unsigned char packetID, const mwmp::BaseActorList *newActorList);
|
2018-07-13 01:12:03 +00:00
|
|
|
bool containsActor(int refNum, int mpNum);
|
|
|
|
mwmp::BaseActor *getActor(int refNum, int mpNum);
|
2017-05-01 22:39:08 +00:00
|
|
|
void removeActors(const mwmp::BaseActorList *newActorList);
|
2017-05-05 03:13:34 +00:00
|
|
|
|
|
|
|
RakNet::RakNetGUID *getAuthority();
|
|
|
|
void setAuthority(const RakNet::RakNetGUID& guid);
|
2017-04-30 21:42:34 +00:00
|
|
|
mwmp::BaseActorList *getActorList();
|
|
|
|
|
2017-02-24 04:33:59 +00:00
|
|
|
TPlayers getPlayers() const;
|
2017-04-09 13:32:44 +00:00
|
|
|
void sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *baseActorList) const;
|
2018-05-12 21:42:24 +00:00
|
|
|
void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseObjectList *baseObjectList) const;
|
2017-02-19 15:27:38 +00:00
|
|
|
|
|
|
|
std::string getDescription() const;
|
2017-02-19 17:39:53 +00:00
|
|
|
|
2017-02-19 17:42:16 +00:00
|
|
|
|
2017-02-19 05:26:42 +00:00
|
|
|
private:
|
|
|
|
TPlayers players;
|
|
|
|
ESM::Cell cell;
|
2017-04-30 21:42:34 +00:00
|
|
|
|
2017-05-05 03:13:34 +00:00
|
|
|
RakNet::RakNetGUID authorityGuid;
|
2017-04-30 21:42:34 +00:00
|
|
|
mwmp::BaseActorList cellActorList;
|
2017-02-19 05:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-04-29 20:05:12 +00:00
|
|
|
#endif //OPENMW_SERVERCELL_HPP
|