[Client] Set packetOrigin for all ObjectList packets sent

fix/skillcap
David Cernat 7 years ago
parent 692ee01340
commit 36ac2d9de4

@ -209,6 +209,7 @@ namespace MWClass
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true);
objectList->sendObjectTrap();
/*
@ -225,6 +226,7 @@ namespace MWClass
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectLock(ptr, 0);
objectList->sendObjectLock();
}

@ -208,6 +208,7 @@ namespace MWClass
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true);
objectList->sendObjectTrap();
/*
@ -224,6 +225,7 @@ namespace MWClass
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectLock(ptr, 0);
objectList->sendObjectLock();
}

@ -114,6 +114,7 @@ namespace MWGui
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->cell = *mPtr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::REMOVE;
objectList->containerSubAction = mwmp::BaseObjectList::DRAG;
@ -158,6 +159,7 @@ namespace MWGui
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->cell = *mPtr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::ADD;
objectList->containerSubAction = mwmp::BaseObjectList::DROP;
@ -296,6 +298,7 @@ namespace MWGui
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->cell = *mPtr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::REMOVE;
objectList->containerSubAction = mwmp::BaseObjectList::TAKE_ALL;
@ -379,6 +382,7 @@ namespace MWGui
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectDelete(mPtr);
objectList->sendObjectDelete();
}

@ -74,6 +74,7 @@ namespace MWGui
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectPlace(dropped, true);
objectList->sendObjectPlace();
/*

@ -709,6 +709,7 @@ namespace MWGui
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectDelete(object);
objectList->sendObjectDelete();
mwmp::Main::get().getLocalPlayer()->sendInventory();

@ -1816,6 +1816,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectDelete(ptr);
objectList->sendObjectDelete();
/*

@ -94,6 +94,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectActivate(target, actor);
objectList->sendObjectActivate();
/*

@ -86,6 +86,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectLock(lock, 0);
objectList->sendObjectLock();
/*
@ -154,6 +155,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectTrap(trap, trap.getRefData().getPosition(), true);
objectList->sendObjectTrap();
/*

@ -712,6 +712,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectLock(target, static_cast<int>(magnitude));
objectList->sendObjectLock();
/*
@ -758,6 +759,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectLock(target, 0);
objectList->sendObjectLock();
/*
@ -939,7 +941,7 @@ namespace MWMechanics
/*
Start of tes3mp addition
If this mPtr belongs to a LocalPlayer or LocalActor, get their Attack and prepare
If this mCaster belongs to a LocalPlayer or LocalActor, get their Attack and prepare
it for sending
*/
mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(mCaster);

@ -108,6 +108,7 @@ namespace MWMechanics
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
MWMechanics::CreatureStats *actorCreatureStats = &mActor.getClass().getCreatureStats(mActor);
@ -168,6 +169,7 @@ namespace MWMechanics
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectDelete(ptr);
objectList->sendObjectDelete();
/*

@ -37,6 +37,7 @@ void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore)
MWWorld::CellRefList<ESM::CreatureLevList> *creatureLevList = cellStore->getCreatureLists();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
int spawnCount = 0;

@ -11,6 +11,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/ScriptController.hpp"
/*
End of tes3mp addition
*/
@ -84,6 +85,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addObjectAnimPlay(ptr, group, mode);
objectList->sendObjectAnimPlay();
}

@ -16,6 +16,7 @@
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/PlayerList.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/ScriptController.hpp"
/*
End of tes3mp addition
*/
@ -127,6 +128,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->cell = *ptr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::ADD;
objectList->containerSubAction = mwmp::BaseObjectList::NONE;
@ -253,6 +255,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->cell = *ptr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::REMOVE;
objectList->containerSubAction = mwmp::BaseObjectList::NONE;

@ -20,6 +20,7 @@
#include "../mwmp/Networking.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/ScriptController.hpp"
/*
End of tes3mp addition
*/
@ -231,6 +232,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addScriptLocalShort(mReference, index, value);
objectList->sendScriptLocalShort();
}
@ -265,6 +267,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addScriptLocalFloat(mReference, index, value);
objectList->sendScriptLocalFloat();
}
@ -328,6 +331,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addScriptGlobalShort(name, value);
objectList->sendScriptGlobalShort();
}
@ -618,6 +622,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addObjectState(ref, true);
objectList->sendObjectState();
}
@ -655,6 +660,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addObjectState(ref, false);
objectList->sendObjectState();
}
@ -734,6 +740,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addScriptMemberShort(id, index, value);
objectList->sendScriptMemberShort();
}

@ -10,6 +10,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/ScriptController.hpp"
/*
End of tes3mp addition
*/
@ -106,6 +107,7 @@ namespace MWScript
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addVideoPlay(name, allowSkipping);
objectList->sendVideoPlay();
/*
@ -216,6 +218,7 @@ namespace MWScript
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addObjectLock(ptr, lockLevel);
objectList->sendObjectLock();
/*
@ -265,6 +268,7 @@ namespace MWScript
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addObjectLock(ptr, 0);
objectList->sendObjectLock();
/*
@ -768,6 +772,7 @@ namespace MWScript
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addObjectDelete(ptr);
objectList->sendObjectDelete();
/*

@ -8,6 +8,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/ScriptController.hpp"
/*
End of tes3mp addition
*/
@ -89,6 +90,7 @@ namespace MWScript
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addMusicPlay(sound);
objectList->sendMusicPlay();
/*

@ -12,6 +12,7 @@
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/PlayerList.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/ScriptController.hpp"
/*
End of tes3mp addition
*/
@ -82,6 +83,7 @@ namespace MWScript
{
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addObjectScale(ptr, scale);
objectList->sendObjectScale();
}
@ -599,6 +601,7 @@ namespace MWScript
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
if (ptr.getClass().isActor())
{

@ -42,6 +42,7 @@ namespace MWWorld
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectDelete(getTarget());
objectList->sendObjectDelete();
mwmp::Main::get().getLocalPlayer()->sendInventory();

@ -60,6 +60,7 @@ namespace MWWorld
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
ESM::Position pos;

@ -261,6 +261,7 @@ namespace MWWorld
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectActivate(toActivate, player);
objectList->sendObjectActivate();
/*

@ -2579,6 +2579,7 @@ namespace MWWorld
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addDoorState(door, state);
objectList->sendDoorState();
/*
@ -2598,6 +2599,7 @@ namespace MWWorld
*/
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addDoorState(door, state);
objectList->sendDoorState();
/*
@ -3676,6 +3678,7 @@ namespace MWWorld
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectSpawn(ptr);
objectList->sendObjectSpawn();

Loading…
Cancel
Save