[General] Include ScriptLocalFloat as part of ClientScriptLocal

pull/558/head
David Cernat 5 years ago
parent b97fa7553c
commit abd18745df

@ -122,8 +122,8 @@ set(PROCESSORS_OBJECT
processors/object/ProcessorObjectRotate.hpp processors/object/ProcessorObjectScale.hpp processors/object/ProcessorObjectRotate.hpp processors/object/ProcessorObjectScale.hpp
processors/object/ProcessorObjectSpawn.hpp processors/object/ProcessorObjectState.hpp processors/object/ProcessorObjectSpawn.hpp processors/object/ProcessorObjectState.hpp
processors/object/ProcessorObjectTrap.hpp processors/object/ProcessorClientScriptLocal.hpp processors/object/ProcessorObjectTrap.hpp processors/object/ProcessorClientScriptLocal.hpp
processors/object/ProcessorScriptLocalFloat.hpp processors/object/ProcessorScriptMemberShort.hpp processors/object/ProcessorScriptMemberShort.hpp processors/object/ProcessorScriptMemberFloat.hpp
processors/object/ProcessorScriptMemberFloat.hpp processors/object/ProcessorVideoPlay.hpp processors/object/ProcessorVideoPlay.hpp
) )
source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT}) source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT})

@ -326,12 +326,12 @@ const char *ObjectFunctions::GetVideoFilename(unsigned int index) noexcept
const char *ObjectFunctions::GetScriptVariableName(unsigned int index) noexcept const char *ObjectFunctions::GetScriptVariableName(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(index).varName.c_str(); return readObjectList->baseObjects.at(index).clientVariable.id.c_str();
} }
int ObjectFunctions::GetScriptVariableShortValue(unsigned int index) noexcept int ObjectFunctions::GetScriptVariableShortValue(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(index).shortVal; return readObjectList->baseObjects.at(index).clientVariable.intValue;
} }
unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
@ -549,12 +549,12 @@ void ObjectFunctions::SetObjectDoorDestinationRotation(double x, double z) noexc
void ObjectFunctions::SetScriptVariableName(const char* varName) noexcept void ObjectFunctions::SetScriptVariableName(const char* varName) noexcept
{ {
tempObject.varName = varName; tempObject.clientVariable.id = varName;
} }
void ObjectFunctions::SetScriptVariableShortValue(int shortVal) noexcept void ObjectFunctions::SetScriptVariableShortValue(int shortVal) noexcept
{ {
tempObject.shortVal = shortVal; tempObject.clientVariable.intValue = shortVal;
} }
void ObjectFunctions::SetPlayerAsObject(unsigned short pid) noexcept void ObjectFunctions::SetPlayerAsObject(unsigned short pid) noexcept

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

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

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

@ -862,31 +862,26 @@ void ObjectList::runConsoleCommands(MWWorld::CellStore* cellStore)
} }
} }
void ObjectList::setLocalShorts(MWWorld::CellStore* cellStore) void ObjectList::setClientLocals(MWWorld::CellStore* cellStore)
{ {
for (const auto &baseObject : baseObjects) for (const auto &baseObject : baseObjects)
{ {
LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s %i-%i, index: %i, shortVal: %i", baseObject.refId.c_str(), std::string valueAsString;
baseObject.refNum, baseObject.mpNum, baseObject.index, baseObject.shortVal); std::string variableType;
MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::INTEGER)
if (ptrFound)
{ {
LOG_APPEND(TimedLog::LOG_VERBOSE, "-- Found %s %i-%i", ptrFound.getCellRef().getRefId().c_str(), valueAsString = std::to_string(baseObject.clientVariable.intValue);
ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum()); variableType = "integer";
}
ptrFound.getRefData().getLocals().mShorts.at(baseObject.index) = baseObject.shortVal; else if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::FLOAT)
{
valueAsString = std::to_string(baseObject.clientVariable.floatValue);
variableType = "float";
} }
}
}
void ObjectList::setLocalFloats(MWWorld::CellStore* cellStore) LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s %i-%i, index: %i, type %s, value: %s", baseObject.refId.c_str(),
{ baseObject.refNum, baseObject.mpNum, baseObject.index, variableType.c_str(), valueAsString.c_str());
for (const auto &baseObject : baseObjects)
{
LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s %i-%i, index: %i, floatVal: %f", baseObject.refId.c_str(),
baseObject.refNum, baseObject.mpNum, baseObject.index, baseObject.floatVal);
MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum);
@ -895,7 +890,10 @@ void ObjectList::setLocalFloats(MWWorld::CellStore* cellStore)
LOG_APPEND(TimedLog::LOG_VERBOSE, "-- Found %s %i-%i", ptrFound.getCellRef().getRefId().c_str(), LOG_APPEND(TimedLog::LOG_VERBOSE, "-- Found %s %i-%i", ptrFound.getCellRef().getRefId().c_str(),
ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum()); ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum());
ptrFound.getRefData().getLocals().mFloats.at(baseObject.index) = baseObject.floatVal; if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::INTEGER)
ptrFound.getRefData().getLocals().mShorts.at(baseObject.index) = baseObject.clientVariable.intValue;
else if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::FLOAT)
ptrFound.getRefData().getLocals().mFloats.at(baseObject.index) = baseObject.clientVariable.floatValue;
} }
} }
} }
@ -1222,7 +1220,7 @@ void ObjectList::addConsoleCommandObject(const MWWorld::Ptr& ptr)
addBaseObject(baseObject); addBaseObject(baseObject);
} }
void ObjectList::addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int shortVal) void ObjectList::addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int value)
{ {
cell = *ptr.getCell()->getCell(); cell = *ptr.getCell()->getCell();
@ -1230,12 +1228,13 @@ void ObjectList::addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int sh
baseObject.refId = ptr.getCellRef().getRefId(); baseObject.refId = ptr.getCellRef().getRefId();
baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.refNum = ptr.getCellRef().getRefNum().mIndex;
baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.mpNum = ptr.getCellRef().getMpNum();
baseObject.index = index; baseObject.clientVariable.index = index;
baseObject.shortVal = shortVal; baseObject.clientVariable.variableType = mwmp::VARIABLE_TYPE::INTEGER;
baseObject.clientVariable.intValue = value;
addBaseObject(baseObject); addBaseObject(baseObject);
} }
void ObjectList::addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float floatVal) void ObjectList::addClientScriptLocal(const MWWorld::Ptr& ptr, int index, float value)
{ {
cell = *ptr.getCell()->getCell(); cell = *ptr.getCell()->getCell();
@ -1243,8 +1242,9 @@ void ObjectList::addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float f
baseObject.refId = ptr.getCellRef().getRefId(); baseObject.refId = ptr.getCellRef().getRefId();
baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.refNum = ptr.getCellRef().getRefNum().mIndex;
baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.mpNum = ptr.getCellRef().getMpNum();
baseObject.index = index; baseObject.clientVariable.index = index;
baseObject.floatVal = floatVal; baseObject.clientVariable.variableType = mwmp::VARIABLE_TYPE::FLOAT;
baseObject.clientVariable.floatValue = value;
addBaseObject(baseObject); addBaseObject(baseObject);
} }
@ -1368,23 +1368,27 @@ void ObjectList::sendClientScriptLocal()
LOG_MESSAGE_SIMPLE(TimedLog::LOG_VERBOSE, "Sending ID_CLIENT_SCRIPT_LOCAL 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) 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); std::string valueAsString;
std::string variableType;
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CLIENT_SCRIPT_LOCAL)->setObjectList(this);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CLIENT_SCRIPT_LOCAL)->Send();
}
void ObjectList::sendScriptLocalFloat() if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::INTEGER)
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_FLOAT about %s", cell.getDescription().c_str()); valueAsString = std::to_string(baseObject.clientVariable.intValue);
variableType = "integer";
}
else if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::FLOAT)
{
valueAsString = std::to_string(baseObject.clientVariable.floatValue);
variableType = "float";
}
for (const auto &baseObject : baseObjects) LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s %i-%i, index: %i, type %s, value: %s", baseObject.refId.c_str(),
LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, floatVal: %f", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum, baseObject.clientVariable.index, variableType.c_str(), valueAsString.c_str());
baseObject.refNum, baseObject.index, baseObject.floatVal); }
mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CLIENT_SCRIPT_LOCAL)->setObjectList(this);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CLIENT_SCRIPT_LOCAL)->Send();
} }
void ObjectList::sendScriptMemberShort() void ObjectList::sendScriptMemberShort()

@ -41,8 +41,7 @@ namespace mwmp
void setDoorDestinations(MWWorld::CellStore* cellStore); void setDoorDestinations(MWWorld::CellStore* cellStore);
void runConsoleCommands(MWWorld::CellStore* cellStore); void runConsoleCommands(MWWorld::CellStore* cellStore);
void setLocalShorts(MWWorld::CellStore* cellStore); void setClientLocals(MWWorld::CellStore* cellStore);
void setLocalFloats(MWWorld::CellStore* cellStore);
void setMemberShorts(); void setMemberShorts();
void playMusic(); void playMusic();
@ -68,8 +67,8 @@ namespace mwmp
void addMusicPlay(std::string filename); void addMusicPlay(std::string filename);
void addVideoPlay(std::string filename, bool allowSkipping); void addVideoPlay(std::string filename, bool allowSkipping);
void addConsoleCommandObject(const MWWorld::Ptr& ptr); void addConsoleCommandObject(const MWWorld::Ptr& ptr);
void addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int shortVal); void addClientScriptLocal(const MWWorld::Ptr& ptr, int index, int value);
void addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float floatVal); void addClientScriptLocal(const MWWorld::Ptr& ptr, int index, float value);
void addScriptMemberShort(std::string refId, int index, int shortVal); void addScriptMemberShort(std::string refId, int index, int shortVal);
void sendObjectActivate(); void sendObjectActivate();
@ -87,7 +86,6 @@ namespace mwmp
void sendMusicPlay(); void sendMusicPlay();
void sendVideoPlay(); void sendVideoPlay();
void sendClientScriptLocal(); void sendClientScriptLocal();
void sendScriptLocalFloat();
void sendScriptMemberShort(); void sendScriptMemberShort();
void sendContainer(); void sendContainer();
void sendConsoleCommand(); void sendConsoleCommand();

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

@ -17,7 +17,7 @@ namespace mwmp
{ {
BaseObjectProcessor::Do(packet, objectList); BaseObjectProcessor::Do(packet, objectList);
objectList.setLocalShorts(ptrCellStore); objectList.setClientLocals(ptrCellStore);
} }
}; };
} }

@ -1,25 +0,0 @@
#ifndef OPENMW_PROCESSORSCRIPTLOCALFLOAT_HPP
#define OPENMW_PROCESSORSCRIPTLOCALFLOAT_HPP
#include "BaseObjectProcessor.hpp"
namespace mwmp
{
class ProcessorScriptLocalFloat final: public BaseObjectProcessor
{
public:
ProcessorScriptLocalFloat()
{
BPP_INIT(ID_SCRIPT_LOCAL_FLOAT)
}
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, objectList);
objectList.setLocalFloats(ptrCellStore);
}
};
}
#endif //OPENMW_PROCESSORSCRIPTLOCALFLOAT_HPP

@ -267,8 +267,8 @@ namespace MWScript
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset(); objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType()); objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(getContextType());
objectList->addScriptLocalFloat(mReference, index, value); objectList->addClientScriptLocal(mReference, index, value);
objectList->sendScriptLocalFloat(); objectList->sendClientScriptLocal();
} }
/* /*
End of tes3mp addition End of tes3mp addition

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

@ -54,10 +54,11 @@ namespace mwmp
std::string animGroup; std::string animGroup;
int animMode; int animMode;
ClientVariable clientVariable;
int index; int index;
int shortVal; int shortVal;
float floatVal; float floatVal;
std::string varName;
bool isDisarmed; bool isDisarmed;
bool droppedByPlayer; bool droppedByPlayer;

@ -29,6 +29,7 @@ namespace mwmp
struct ClientVariable struct ClientVariable
{ {
std::string id; std::string id;
int index;
char variableType; char variableType;

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

@ -12,6 +12,11 @@ PacketClientScriptLocal::PacketClientScriptLocal(RakNet::RakPeerInterface *peer)
void PacketClientScriptLocal::Object(BaseObject &baseObject, bool send) void PacketClientScriptLocal::Object(BaseObject &baseObject, bool send)
{ {
ObjectPacket::Object(baseObject, send); ObjectPacket::Object(baseObject, send);
RW(baseObject.index, send); RW(baseObject.clientVariable.index, send);
RW(baseObject.shortVal, send); RW(baseObject.clientVariable.variableType, send);
if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::INTEGER)
RW(baseObject.clientVariable.intValue, send);
else if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::FLOAT)
RW(baseObject.clientVariable.floatValue, send);
} }

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

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