diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 934ad0646..78923e751 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -627,7 +627,7 @@ namespace MWClass if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) { mwmp::Main::get().getLocalPlayer()->attack.success = true; - mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::Players::getPlayer(victim); + mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::PlayerList::getPlayer(victim); if (dedicatedPlayer != nullptr) mwmp::Main::get().getLocalPlayer()->attack.target.guid = dedicatedPlayer->guid; } @@ -804,7 +804,7 @@ namespace MWClass If the attacker is a DedicatedPlayer with a successful knockdown, apply the knockdown; otherwise, use default probability roll */ - mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::Players::getPlayer(attacker); + mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::PlayerList::getPlayer(attacker); bool isDedicated = dedicatedPlayer != nullptr; bool isDedicatedKnockdown = false; if (isDedicated) @@ -925,7 +925,7 @@ namespace MWClass If the victim was the LocalPlayer, check whether packets should be sent about their new dynamic stats and position */ - mwmp::DedicatedPlayer *victimPlayer = mwmp::Players::getPlayer(ptr); + mwmp::DedicatedPlayer *victimPlayer = mwmp::PlayerList::getPlayer(ptr); if (attacker == MWMechanics::getPlayer() && victimPlayer != nullptr) { mwmp::Attack *attack = &mwmp::Main::get().getLocalPlayer()->attack; diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index d0d774415..eaf84848c 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1132,7 +1132,7 @@ namespace MWMechanics If this actor is a DedicatedPlayer, update their mAttackingOrSpell */ - mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::Players::getPlayer(iter->first); + mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::PlayerList::getPlayer(iter->first); if (dedicatedPlayer != NULL) dedicatedPlayer->updateActor(iter->second); /* diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 2c8c7bf99..f217627c6 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -123,7 +123,7 @@ namespace MWMechanics Only calculate block chance for blockers who are not DedicatedPlayers and update block state for LocalPlayer */ - mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::Players::getPlayer(blocker); + mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::PlayerList::getPlayer(blocker); bool isDedicated = dedicatedPlayer != NULL; if (attacker == MWMechanics::getPlayer()) mwmp::Main::get().getLocalPlayer()->attack.block = false; diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index b9433feee..fd6dc4df7 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -848,7 +848,7 @@ namespace MWMechanics TODO: See if LocalPlayer being the target and having godmode on can be accounted for like it is in OpenMW's corresponding code */ - mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::Players::getPlayer(mCaster); + mwmp::DedicatedPlayer *dedicatedPlayer = mwmp::PlayerList::getPlayer(mCaster); bool isDedicated = dedicatedPlayer != NULL; if (isDedicated) diff --git a/apps/openmw/mwmp/DedicatedPlayer.cpp b/apps/openmw/mwmp/DedicatedPlayer.cpp index 6d6082277..1b1360661 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.cpp +++ b/apps/openmw/mwmp/DedicatedPlayer.cpp @@ -39,7 +39,7 @@ using namespace mwmp; using namespace std; -std::map Players::players; +std::map PlayerList::players; DedicatedPlayer::DedicatedPlayer(RakNet::RakNetGUID guid) : BasePlayer(guid) { @@ -57,7 +57,7 @@ MWWorld::Ptr DedicatedPlayer::getPtr() return ptr; } -void Players::createPlayer(RakNet::RakNetGUID guid) +void PlayerList::createPlayer(RakNet::RakNetGUID guid) { LOG_APPEND(Log::LOG_INFO, "- Setting up character info"); @@ -137,13 +137,13 @@ void Players::createPlayer(RakNet::RakNetGUID guid) } -void Players::cleanUp() +void PlayerList::cleanUp() { for (std::map ::iterator it = players.begin(); it != players.end(); it++) delete it->second; } -void Players::disconnectPlayer(RakNet::RakNetGUID guid) +void PlayerList::disconnectPlayer(RakNet::RakNetGUID guid) { if (players[guid]->state > 1) { @@ -166,7 +166,7 @@ void Players::disconnectPlayer(RakNet::RakNetGUID guid) } } -DedicatedPlayer *Players::getPlayer(RakNet::RakNetGUID guid) +DedicatedPlayer *PlayerList::getPlayer(RakNet::RakNetGUID guid) { return players[guid]; } @@ -206,7 +206,7 @@ void DedicatedPlayer::move(float dt) world->rotateObject(ptr, position.rot[0], position.rot[1], position.rot[2]); } -void Players::update(float dt) +void PlayerList::update(float dt) { for (std::map ::iterator it = players.begin(); it != players.end(); it++) { @@ -262,7 +262,7 @@ void DedicatedPlayer::updatePtr(MWWorld::Ptr newPtr) } -DedicatedPlayer *Players::newPlayer(RakNet::RakNetGUID guid) +DedicatedPlayer *PlayerList::newPlayer(RakNet::RakNetGUID guid) { LOG_APPEND(Log::LOG_INFO, "- Creating new DedicatedPlayer with guid %lu", guid.g); @@ -311,7 +311,7 @@ void DedicatedPlayer::updateEquipment() } } -DedicatedPlayer *Players::getPlayer(const MWWorld::Ptr &ptr) +DedicatedPlayer *PlayerList::getPlayer(const MWWorld::Ptr &ptr) { std::map ::iterator it = players.begin(); diff --git a/apps/openmw/mwmp/DedicatedPlayer.hpp b/apps/openmw/mwmp/DedicatedPlayer.hpp index f793b033e..bcb4bec42 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.hpp +++ b/apps/openmw/mwmp/DedicatedPlayer.hpp @@ -25,7 +25,7 @@ namespace mwmp { struct DedicatedPlayer; - class Players + class PlayerList { public: @@ -44,7 +44,7 @@ namespace mwmp class DedicatedPlayer : public BasePlayer { - friend class Players; + friend class PlayerList; public: diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index eb7066cd7..81d545a85 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -264,7 +264,7 @@ private: ESM::CustomMarker mwmp::GUIController::CreateMarker(const RakNet::RakNetGUID &guid) { - DedicatedPlayer *player = Players::getPlayer(guid); + DedicatedPlayer *player = PlayerList::getPlayer(guid); ESM::CustomMarker mEditingMarker; if (!player) { diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index abb94d57b..837d55b92 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -83,7 +83,7 @@ Main::~Main() LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "tes3mp stopped"); delete mNetworking; delete mLocalPlayer; - Players::cleanUp(); + PlayerList::cleanUp(); } void Main::optionsDesc(boost::program_options::options_description *desc) @@ -183,7 +183,7 @@ void Main::frame(float dt) get().getNetworking()->update(); - Players::update(dt); + PlayerList::update(dt); get().getCellController()->updateDedicated(dt); get().updateWorld(dt); diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index 1a3328731..03f998505 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -50,8 +50,8 @@ void MechanicsHelper::processAttack(const MWWorld::Ptr& attacker, Attack attack) if (attack.target.guid == mwmp::Main::get().getLocalPlayer()->guid) victim = MWBase::Environment::get().getWorld()->getPlayerPtr(); - else if (Players::getPlayer(attack.target.guid) != 0) - victim = Players::getPlayer(attack.target.guid)->getPtr(); + else if (PlayerList::getPlayer(attack.target.guid) != 0) + victim = PlayerList::getPlayer(attack.target.guid)->getPtr(); // Get the weapon used (if hand-to-hand, weapon = inv.end()) if (attackerStats.getDrawState() == MWMechanics::DrawState_Weapon) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 54c5fb583..4af89067c 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -252,7 +252,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) DedicatedPlayer *pl = 0; static RakNet::RakNetGUID myGuid = getLocalPlayer()->guid; if (guid != myGuid) - pl = Players::getPlayer(guid); + pl = PlayerList::getPlayer(guid); PlayerPacket *myPacket = playerPacketController.GetPacket(packet->data[0]); @@ -294,12 +294,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) if (pl == 0) { LOG_APPEND(Log::LOG_INFO, "- Exchanging data with new player"); - pl = Players::newPlayer(guid); + pl = PlayerList::newPlayer(guid); } myPacket->setPlayer(pl); myPacket->Packet(&bsIn, false); - Players::createPlayer(guid); + PlayerList::createPlayer(guid); } break; } @@ -338,7 +338,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) if (guid == myGuid) MWBase::Environment::get().getStateManager()->requestQuit(); else if (pl != 0) - Players::disconnectPlayer(guid); + PlayerList::disconnectPlayer(guid); } case ID_PLAYER_EQUIPMENT: @@ -787,7 +787,7 @@ void Networking::processActorPacket(RakNet::Packet *packet) DedicatedPlayer *pl = 0; static RakNet::RakNetGUID myGuid = getLocalPlayer()->guid; if (guid != myGuid) - pl = Players::getPlayer(guid); + pl = PlayerList::getPlayer(guid); ActorPacket *myPacket = actorPacketController.GetPacket(packet->data[0]); @@ -876,7 +876,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) DedicatedPlayer *pl = 0; static RakNet::RakNetGUID myGuid = getLocalPlayer()->guid; if (guid != myGuid) - pl = Players::getPlayer(guid); + pl = PlayerList::getPlayer(guid); WorldPacket *myPacket = worldPacketController.GetPacket(packet->data[0]); @@ -1110,14 +1110,14 @@ bool Networking::isDedicatedPlayer(const MWWorld::Ptr &ptr) { if (ptr.mRef == 0) return 0; - DedicatedPlayer *pl = Players::getPlayer(ptr); + DedicatedPlayer *pl = PlayerList::getPlayer(ptr); return pl != 0; } bool Networking::attack(const MWWorld::Ptr &ptr) { - DedicatedPlayer *pl = Players::getPlayer(ptr); + DedicatedPlayer *pl = PlayerList::getPlayer(ptr); if (pl == 0) return false;