[General] Rename ScriptLocalShort into ClientScriptLocal

pull/558/head
David Cernat 5 years ago
parent dae76b91ee
commit 4841c1ad4c

@ -121,7 +121,7 @@ set(PROCESSORS_OBJECT
processors/object/ProcessorObjectPlace.hpp processors/object/ProcessorObjectRestock.hpp
processors/object/ProcessorObjectRotate.hpp processors/object/ProcessorObjectScale.hpp
processors/object/ProcessorObjectSpawn.hpp processors/object/ProcessorObjectState.hpp
processors/object/ProcessorObjectTrap.hpp processors/object/ProcessorScriptLocalShort.hpp
processors/object/ProcessorObjectTrap.hpp processors/object/ProcessorClientScriptLocal.hpp
processors/object/ProcessorScriptLocalFloat.hpp processors/object/ProcessorScriptMemberShort.hpp
processors/object/ProcessorScriptMemberFloat.hpp processors/object/ProcessorVideoPlay.hpp
)

@ -71,7 +71,7 @@
#include "object/ProcessorObjectSpawn.hpp"
#include "object/ProcessorObjectState.hpp"
#include "object/ProcessorObjectTrap.hpp"
#include "object/ProcessorScriptLocalShort.hpp"
#include "object/ProcessorClientScriptLocal.hpp"
#include "object/ProcessorScriptLocalFloat.hpp"
#include "object/ProcessorScriptMemberShort.hpp"
#include "object/ProcessorScriptMemberFloat.hpp"
@ -154,7 +154,7 @@ void ProcessorInitializer()
ObjectProcessor::AddProcessor(new ProcessorObjectSpawn());
ObjectProcessor::AddProcessor(new ProcessorObjectState());
ObjectProcessor::AddProcessor(new ProcessorObjectTrap());
ObjectProcessor::AddProcessor(new ProcessorScriptLocalShort());
ObjectProcessor::AddProcessor(new ProcessorClientScriptLocal());
ObjectProcessor::AddProcessor(new ProcessorScriptLocalFloat());
ObjectProcessor::AddProcessor(new ProcessorScriptMemberShort());
ObjectProcessor::AddProcessor(new ProcessorScriptMemberFloat());

@ -0,0 +1,18 @@
#ifndef OPENMW_PROCESSORCLIENTSCRIPTLOCAL_HPP
#define OPENMW_PROCESSORCLIENTSCRIPTLOCAL_HPP
#include "../ObjectProcessor.hpp"
namespace mwmp
{
class ProcessorClientScriptLocal : public ObjectProcessor
{
public:
ProcessorClientScriptLocal()
{
BPP_INIT(ID_CLIENT_SCRIPT_LOCAL)
}
};
}
#endif //OPENMW_PROCESSORCLIENTSCRIPTLOCAL_HPP

@ -1,18 +0,0 @@
#ifndef OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
#define OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
#include "../ObjectProcessor.hpp"
namespace mwmp
{
class ProcessorScriptLocalShort : public ObjectProcessor
{
public:
ProcessorScriptLocalShort()
{
BPP_INIT(ID_SCRIPT_LOCAL_SHORT)
}
};
}
#endif //OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP

@ -133,7 +133,7 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor
ProcessorObjectActivate ProcessorObjectAnimPlay ProcessorObjectAttach ProcessorObjectDelete ProcessorObjectHit
ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace ProcessorObjectRestock ProcessorObjectRotate
ProcessorObjectScale ProcessorObjectSound ProcessorObjectSpawn ProcessorObjectState ProcessorObjectTrap
ProcessorScriptLocalShort ProcessorScriptLocalFloat ProcessorScriptMemberShort ProcessorScriptMemberFloat
ProcessorClientScriptLocal ProcessorScriptLocalFloat ProcessorScriptMemberShort ProcessorScriptMemberFloat
)
add_openmw_dir (mwmp/processors/worldstate ProcessorCellReset ProcessorClientScriptGlobal ProcessorClientScriptSettings

@ -1223,7 +1223,7 @@ void ObjectList::addConsoleCommandObject(const MWWorld::Ptr& ptr)
addBaseObject(baseObject);
}
void ObjectList::addScriptLocalShort(const MWWorld::Ptr& ptr, int index, int shortVal)
void ObjectList::addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int shortVal)
{
cell = *ptr.getCell()->getCell();
@ -1364,16 +1364,16 @@ void ObjectList::sendVideoPlay()
mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->Send();
}
void ObjectList::sendScriptLocalShort()
void ObjectList::sendClientScriptLocal()
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_SHORT about %s", cell.getDescription().c_str());
LOG_MESSAGE_SIMPLE(TimedLog::LOG_VERBOSE, "Sending ID_CLIENT_SCRIPT_LOCAL about %s", cell.getDescription().c_str());
for (const auto &baseObject : baseObjects)
LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, shortVal: %i", baseObject.refId.c_str(),
baseObject.refNum, baseObject.index, baseObject.shortVal);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->setObjectList(this);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->Send();
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CLIENT_SCRIPT_LOCAL)->setObjectList(this);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CLIENT_SCRIPT_LOCAL)->Send();
}
void ObjectList::sendScriptLocalFloat()

@ -68,7 +68,7 @@ namespace mwmp
void addMusicPlay(std::string filename);
void addVideoPlay(std::string filename, bool allowSkipping);
void addConsoleCommandObject(const MWWorld::Ptr& ptr);
void addScriptLocalShort(const MWWorld::Ptr& ptr, int index, int shortVal);
void addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int shortVal);
void addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float floatVal);
void addScriptMemberShort(std::string refId, int index, int shortVal);
@ -86,7 +86,7 @@ namespace mwmp
void sendDoorState();
void sendMusicPlay();
void sendVideoPlay();
void sendScriptLocalShort();
void sendClientScriptLocal();
void sendScriptLocalFloat();
void sendScriptMemberShort();
void sendContainer();

@ -67,7 +67,7 @@
#include "object/ProcessorObjectSpawn.hpp"
#include "object/ProcessorObjectState.hpp"
#include "object/ProcessorObjectTrap.hpp"
#include "object/ProcessorScriptLocalShort.hpp"
#include "object/ProcessorClientScriptLocal.hpp"
#include "object/ProcessorScriptLocalFloat.hpp"
#include "object/ProcessorScriptMemberShort.hpp"
#include "object/ProcessorScriptMemberFloat.hpp"
@ -170,7 +170,7 @@ void ProcessorInitializer()
ObjectProcessor::AddProcessor(new ProcessorObjectSpawn());
ObjectProcessor::AddProcessor(new ProcessorObjectState());
ObjectProcessor::AddProcessor(new ProcessorObjectTrap());
ObjectProcessor::AddProcessor(new ProcessorScriptLocalShort());
ObjectProcessor::AddProcessor(new ProcessorClientScriptLocal());
ObjectProcessor::AddProcessor(new ProcessorScriptLocalFloat());
ObjectProcessor::AddProcessor(new ProcessorScriptMemberShort());
ObjectProcessor::AddProcessor(new ProcessorScriptMemberFloat());

@ -1,16 +1,16 @@
#ifndef OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
#define OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
#ifndef OPENMW_PROCESSORCLIENTSCRIPTLOCAL_HPP
#define OPENMW_PROCESSORCLIENTSCRIPTLOCAL_HPP
#include "BaseObjectProcessor.hpp"
namespace mwmp
{
class ProcessorScriptLocalShort final: public BaseObjectProcessor
class ProcessorClientScriptLocal final: public BaseObjectProcessor
{
public:
ProcessorScriptLocalShort()
ProcessorClientScriptLocal()
{
BPP_INIT(ID_SCRIPT_LOCAL_SHORT)
BPP_INIT(ID_CLIENT_SCRIPT_LOCAL)
}
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
@ -22,4 +22,4 @@ namespace mwmp
};
}
#endif //OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
#endif //OPENMW_PROCESSORCLIENTSCRIPTLOCAL_HPP

@ -224,7 +224,7 @@ namespace MWScript
/*
Start of tes3mp addition
Send an ID_SCRIPT_LOCAL_SHORT packet every time a local short changes its value
Send an ID_CLIENT_SCRIPT_LOCAL packet every time a local short changes its value
in a script approved for packet sending
*/
if (sendPackets)
@ -232,8 +232,8 @@ namespace MWScript
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addScriptLocalShort(mReference, index, value);
objectList->sendScriptLocalShort();
objectList->addClientScriptLocal(mReference, index, value);
objectList->sendClientScriptLocal();
}
/*
End of tes3mp addition

@ -207,7 +207,7 @@ add_component_dir (openmw-mp/Packets/Object
PacketConsoleCommand PacketContainer PacketObjectActivate PacketObjectAnimPlay PacketObjectAttach
PacketObjectDelete PacketObjectHit PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectRestock
PacketObjectRotate PacketObjectScale PacketObjectSound PacketObjectSpawn PacketObjectState PacketObjectTrap
PacketMusicPlay PacketVideoPlay PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort
PacketMusicPlay PacketVideoPlay PacketClientScriptLocal PacketScriptLocalFloat PacketScriptMemberShort
PacketScriptMemberFloat
)

@ -21,7 +21,7 @@
#include "../Packets/Object/PacketVideoPlay.hpp"
#include "../Packets/Object/PacketConsoleCommand.hpp"
#include "../Packets/Object/PacketScriptLocalShort.hpp"
#include "../Packets/Object/PacketClientScriptLocal.hpp"
#include "../Packets/Object/PacketScriptLocalFloat.hpp"
#include "../Packets/Object/PacketScriptMemberShort.hpp"
#include "../Packets/Object/PacketScriptMemberFloat.hpp"
@ -61,7 +61,7 @@ mwmp::ObjectPacketController::ObjectPacketController(RakNet::RakPeerInterface *p
AddPacket<PacketVideoPlay>(&packets, peer);
AddPacket<PacketConsoleCommand>(&packets, peer);
AddPacket<PacketScriptLocalShort>(&packets, peer);
AddPacket<PacketClientScriptLocal>(&packets, peer);
AddPacket<PacketScriptLocalFloat>(&packets, peer);
AddPacket<PacketScriptMemberShort>(&packets, peer);
AddPacket<PacketScriptMemberFloat>(&packets, peer);

@ -89,7 +89,7 @@ enum GameMessages
ID_MUSIC_PLAY,
ID_VIDEO_PLAY,
ID_SCRIPT_LOCAL_SHORT,
ID_CLIENT_SCRIPT_LOCAL,
ID_SCRIPT_LOCAL_FLOAT,
ID_SCRIPT_MEMBER_SHORT,
ID_SCRIPT_MEMBER_FLOAT,

@ -0,0 +1,17 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketClientScriptLocal.hpp"
using namespace mwmp;
PacketClientScriptLocal::PacketClientScriptLocal(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{
packetID = ID_CLIENT_SCRIPT_LOCAL;
hasCellData = true;
}
void PacketClientScriptLocal::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(baseObject, send);
RW(baseObject.index, send);
RW(baseObject.shortVal, send);
}

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETCLIENTSCRIPTLOCAL_HPP
#define OPENMW_PACKETCLIENTSCRIPTLOCAL_HPP
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp
{
class PacketClientScriptLocal : public ObjectPacket
{
public:
PacketClientScriptLocal(RakNet::RakPeerInterface *peer);
virtual void Object(BaseObject &obj, bool send);
};
}
#endif //OPENMW_PACKETCLIENTSCRIPTLOCAL_HPP

@ -1,17 +0,0 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketScriptLocalShort.hpp"
using namespace mwmp;
PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{
packetID = ID_SCRIPT_LOCAL_SHORT;
hasCellData = true;
}
void PacketScriptLocalShort::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(baseObject, send);
RW(baseObject.index, send);
RW(baseObject.shortVal, send);
}

@ -1,17 +0,0 @@
#ifndef OPENMW_PACKETSCRIPTLOCALSHORT_HPP
#define OPENMW_PACKETSCRIPTLOCALSHORT_HPP
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp
{
class PacketScriptLocalShort : public ObjectPacket
{
public:
PacketScriptLocalShort(RakNet::RakPeerInterface *peer);
virtual void Object(BaseObject &obj, bool send);
};
}
#endif //OPENMW_PACKETSCRIPTLOCALSHORT_HPP
Loading…
Cancel
Save