forked from mirror/openmw-tes3mp
[General] Change "enum ACTOR_ACTION" to "enum class Action"
This commit is contained in:
parent
ef0384b296
commit
35922e4898
5 changed files with 16 additions and 16 deletions
|
@ -239,7 +239,7 @@ void ActorController::sendList(std::shared_ptr<Player> player, std::vector<std::
|
||||||
{
|
{
|
||||||
actorList.cell = player->cell;
|
actorList.cell = player->cell;
|
||||||
actorList.guid = player->guid;
|
actorList.guid = player->guid;
|
||||||
actorList.action = mwmp::BaseActorList::SET;
|
actorList.action = mwmp::BaseActorList::Action::Set;
|
||||||
|
|
||||||
for (auto &actor : actors)
|
for (auto &actor : actors)
|
||||||
{
|
{
|
||||||
|
@ -257,7 +257,7 @@ void ActorController::requestList(std::shared_ptr<Player> player, const ESM::Cel
|
||||||
{
|
{
|
||||||
actorList.cell = player->cell;
|
actorList.cell = player->cell;
|
||||||
actorList.guid = player->guid;
|
actorList.guid = player->guid;
|
||||||
actorList.action = mwmp::BaseActorList::REQUEST;
|
actorList.action = mwmp::BaseActorList::Action::Request;
|
||||||
|
|
||||||
auto packet = mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_LIST);
|
auto packet = mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_LIST);
|
||||||
packet->setActorList(&actorList);
|
packet->setActorList(&actorList);
|
||||||
|
@ -270,9 +270,9 @@ std::vector<std::shared_ptr<Actor>> ActorController::getActors(std::shared_ptr<P
|
||||||
|
|
||||||
std::vector<std::shared_ptr<Actor>> actorList;
|
std::vector<std::shared_ptr<Actor>> actorList;
|
||||||
|
|
||||||
for (auto actor : serverCell->getActorList()->baseActors)
|
for (const auto &actor : serverCell->getActorList()->baseActors)
|
||||||
{
|
{
|
||||||
Actor *a = new Actor;
|
auto a = new Actor;
|
||||||
a->actor = actor;
|
a->actor = actor;
|
||||||
actorList.emplace_back(a);
|
actorList.emplace_back(a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore)
|
||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
cell = *cellStore->getCell();
|
cell = *cellStore->getCell();
|
||||||
action = BaseActorList::SET;
|
action = BaseActorList::Action::Set;
|
||||||
|
|
||||||
auto createActor = [](const MWWorld::Ptr &ptr){
|
auto createActor = [](const MWWorld::Ptr &ptr){
|
||||||
BaseActor *actor = new BaseActor;
|
BaseActor *actor = new BaseActor;
|
||||||
|
|
|
@ -23,10 +23,10 @@ namespace mwmp
|
||||||
if (!ptrCellStore) return;
|
if (!ptrCellStore) return;
|
||||||
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), actorList.cell.getDescription().c_str());
|
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), actorList.cell.getDescription().c_str());
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", actorList.action);
|
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", (int) actorList.action);
|
||||||
|
|
||||||
// If we've received a request for information, comply with it
|
// If we've received a request for information, comply with it
|
||||||
if (actorList.action == mwmp::BaseActorList::REQUEST)
|
if (actorList.action == mwmp::BaseActorList::Action::Request)
|
||||||
{
|
{
|
||||||
MechanicsHelper::spawnLeveledCreatures(ptrCellStore);
|
MechanicsHelper::spawnLeveledCreatures(ptrCellStore);
|
||||||
actorList.sendActorsInCell(ptrCellStore);
|
actorList.sendActorsInCell(ptrCellStore);
|
||||||
|
|
|
@ -46,12 +46,12 @@ namespace mwmp
|
||||||
cell.blank();
|
cell.blank();
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ACTOR_ACTION
|
enum class Action: uint8_t
|
||||||
{
|
{
|
||||||
SET = 0,
|
Set = 0,
|
||||||
ADD = 1,
|
Add,
|
||||||
REMOVE = 2,
|
Remsove,
|
||||||
REQUEST = 3
|
Request
|
||||||
};
|
};
|
||||||
|
|
||||||
RakNet::RakNetGUID guid;
|
RakNet::RakNetGUID guid;
|
||||||
|
@ -60,7 +60,7 @@ namespace mwmp
|
||||||
|
|
||||||
ESM::Cell cell;
|
ESM::Cell cell;
|
||||||
|
|
||||||
unsigned char action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item, 3 - Request items
|
Action action;
|
||||||
|
|
||||||
bool isValid;
|
bool isValid;
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace mwmp
|
||||||
{
|
{
|
||||||
struct Chat
|
struct Chat
|
||||||
{
|
{
|
||||||
enum class Action : uint8_t {
|
enum class Action: uint8_t {
|
||||||
print = 0,
|
print = 0,
|
||||||
clear,
|
clear,
|
||||||
addchannel,
|
addchannel,
|
||||||
|
@ -46,7 +46,7 @@ namespace mwmp
|
||||||
{
|
{
|
||||||
std::string quest;
|
std::string quest;
|
||||||
int index;
|
int index;
|
||||||
enum class Type
|
enum class Type: uint8_t
|
||||||
{
|
{
|
||||||
Entry = 0,
|
Entry = 0,
|
||||||
Index = 1
|
Index = 1
|
||||||
|
@ -85,7 +85,7 @@ namespace mwmp
|
||||||
{
|
{
|
||||||
std::string itemId;
|
std::string itemId;
|
||||||
|
|
||||||
enum class Type : uint8_t
|
enum class Type: uint8_t
|
||||||
{
|
{
|
||||||
Item = 0,
|
Item = 0,
|
||||||
Magic,
|
Magic,
|
||||||
|
|
Loading…
Reference in a new issue