[Client] Rename mwmp::Players into mwmp::PlayerList for clarity

pull/199/head
David Cernat 8 years ago
parent c05c456b11
commit 0aaf68c994

@ -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;

@ -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);
/*

@ -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;

@ -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)

@ -39,7 +39,7 @@
using namespace mwmp;
using namespace std;
std::map<RakNet::RakNetGUID, DedicatedPlayer *> Players::players;
std::map<RakNet::RakNetGUID, DedicatedPlayer *> 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 <RakNet::RakNetGUID, DedicatedPlayer *>::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 <RakNet::RakNetGUID, DedicatedPlayer *>::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 <RakNet::RakNetGUID, DedicatedPlayer *>::iterator it = players.begin();

@ -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:

@ -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)
{

@ -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);

@ -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)

@ -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;

Loading…
Cancel
Save