[Client] Replace usage of Networking::isDedicatedPlayer()

0.6.1
David Cernat 8 years ago
parent 1f6d05dfe5
commit 014ff7a059

@ -14,7 +14,6 @@
Include additional headers for multiplayer purposes Include additional headers for multiplayer purposes
*/ */
#include "../mwmp/Main.hpp" #include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/LocalPlayer.hpp" #include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/DedicatedPlayer.hpp" #include "../mwmp/DedicatedPlayer.hpp"
/* /*
@ -564,9 +563,9 @@ namespace MWClass
/* /*
Start of tes3mp addition Start of tes3mp addition
Ignore hits from DedicatedPlayers Ignore hit calculations on this client from DedicatedPlayers
*/ */
if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) if (mwmp::PlayerList::isDedicatedPlayer(ptr))
return; return;
/* /*
End of tes3mp addition End of tes3mp addition
@ -949,7 +948,7 @@ namespace MWClass
Don't display a dialogue screen for two players interacting with each other Don't display a dialogue screen for two players interacting with each other
*/ */
if (actor == MWMechanics::getPlayer() && mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr)) if (actor == MWMechanics::getPlayer() && mwmp::PlayerList::isDedicatedPlayer(ptr))
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("Not implemented.")); return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("Not implemented."));
/* /*
End of tes3mp addition End of tes3mp addition

@ -4,10 +4,17 @@
#include <components/sceneutil/positionattitudetransform.hpp> #include <components/sceneutil/positionattitudetransform.hpp>
#include "../mwmp/Networking.hpp" /*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp" #include "../mwmp/Main.hpp"
#include "../mwmp/DedicatedPlayer.hpp" #include "../mwmp/DedicatedPlayer.hpp"
#include "../mwmp/LocalPlayer.hpp" #include "../mwmp/LocalPlayer.hpp"
/*
End of tes3mp addition
*/
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
@ -196,7 +203,7 @@ namespace MWMechanics
Ignore projectiles fired by DedicatedPlayers Ignore projectiles fired by DedicatedPlayers
*/ */
if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(attacker)) if (mwmp::PlayerList::isDedicatedPlayer(attacker))
return; return;
/* /*
End of tes3mp addition End of tes3mp addition

@ -8,9 +8,17 @@
#include <components/misc/rng.hpp> #include <components/misc/rng.hpp>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp" #include "../mwmp/Main.hpp"
#include "../mwmp/DedicatedPlayer.hpp" #include "../mwmp/DedicatedPlayer.hpp"
#include "../mwmp/LocalPlayer.hpp" #include "../mwmp/LocalPlayer.hpp"
/*
End of tes3mp addition
*/
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"

@ -235,10 +235,10 @@ DedicatedPlayer *PlayerList::getPlayer(const MWWorld::Ptr &ptr)
bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr) bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr)
{ {
if (getPlayer(ptr)) if (ptr.mRef == 0)
return true;
return false; return false;
return (getPlayer(ptr) != 0);
} }
void DedicatedPlayer::move(float dt) void DedicatedPlayer::move(float dt)

@ -299,15 +299,6 @@ WorldEvent *Networking::getWorldEvent()
return &worldEvent; return &worldEvent;
} }
bool Networking::isDedicatedPlayer(const MWWorld::Ptr &ptr)
{
if (ptr.mRef == 0)
return 0;
DedicatedPlayer *pl = PlayerList::getPlayer(ptr);
return pl != 0;
}
bool Networking::isConnected() bool Networking::isConnected()
{ {
return connected; return connected;

@ -35,8 +35,6 @@ namespace mwmp
ActorPacket *getActorPacket(RakNet::MessageID id); ActorPacket *getActorPacket(RakNet::MessageID id);
WorldPacket *getWorldPacket(RakNet::MessageID id); WorldPacket *getWorldPacket(RakNet::MessageID id);
bool isDedicatedPlayer(const MWWorld::Ptr &ptr);
RakNet::SystemAddress serverAddress() RakNet::SystemAddress serverAddress()
{ {
return serverAddr; return serverAddr;

Loading…
Cancel
Save