diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 8258b9c06..1a93b0a96 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -124,15 +124,15 @@ add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageB ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic ) -add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer ProcessorDoorDestination - ProcessorDoorState ProcessorMusicPlay ProcessorVideoPlay ProcessorObjectAnimPlay ProcessorObjectAttach - ProcessorObjectCollision ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace - ProcessorObjectReset ProcessorObjectRotate ProcessorObjectScale ProcessorObjectSpawn ProcessorObjectState - ProcessorObjectTrap ProcessorScriptLocalShort ProcessorScriptLocalFloat ProcessorScriptMemberShort - ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat +add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer + ProcessorDoorDestination ProcessorDoorState ProcessorMusicPlay ProcessorVideoPlay ProcessorObjectAnimPlay + ProcessorObjectAttach ProcessorObjectCollision ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove + ProcessorObjectPlace ProcessorObjectReset ProcessorObjectRotate ProcessorObjectScale ProcessorObjectSpawn + ProcessorObjectState ProcessorObjectTrap ProcessorScriptLocalShort ProcessorScriptLocalFloat + ProcessorScriptMemberShort ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ) -add_openmw_dir (mwmp/processors/worldstate ProcessorRecordDynamic ProcessorWorldTime +add_openmw_dir (mwmp/processors/worldstate ProcessorRecordDynamic ProcessorWorldCollisionOverride ProcessorWorldTime ) # Main executable diff --git a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp index 7f12e4629..c437b4381 100644 --- a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp @@ -91,6 +91,7 @@ #include "WorldstateProcessor.hpp" #include "worldstate/ProcessorRecordDynamic.hpp" +#include "worldstate/ProcessorWorldCollisionOverride.hpp" #include "worldstate/ProcessorWorldTime.hpp" using namespace mwmp; @@ -184,5 +185,6 @@ void ProcessorInitializer() ActorProcessor::AddProcessor(new ProcessorActorTest()); WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic()); + WorldstateProcessor::AddProcessor(new ProcessorWorldCollisionOverride()); WorldstateProcessor::AddProcessor(new ProcessorWorldTime()); } diff --git a/apps/openmw/mwmp/processors/worldstate/ProcessorWorldCollisionOverride.hpp b/apps/openmw/mwmp/processors/worldstate/ProcessorWorldCollisionOverride.hpp new file mode 100644 index 000000000..e918e7d09 --- /dev/null +++ b/apps/openmw/mwmp/processors/worldstate/ProcessorWorldCollisionOverride.hpp @@ -0,0 +1,28 @@ +#ifndef OPENMW_PROCESSORWORLDCOLLISIONOVERRIDE_HPP +#define OPENMW_PROCESSORWORLDCOLLISIONOVERRIDE_HPP + + +#include +#include +#include "../WorldstateProcessor.hpp" + +namespace mwmp +{ + class ProcessorWorldCollisionOverride : public WorldstateProcessor + { + public: + ProcessorWorldCollisionOverride() + { + BPP_INIT(ID_WORLD_COLLISION_OVERRIDE) + } + + virtual void Do(WorldstatePacket &packet, BaseWorldstate &worldstate) + { + // Placeholder + } + }; +} + + + +#endif //OPENMW_PROCESSORWORLDCOLLISIONOVERRIDE_HPP diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 9fcec629f..72b79adf8 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -202,7 +202,7 @@ add_component_dir (openmw-mp/Packets/Object add_component_dir (openmw-mp/Packets/Worldstate WorldstatePacket - PacketRecordDynamic PacketWorldTime + PacketRecordDynamic PacketWorldCollisionOverride PacketWorldTime ) add_component_dir (fallback diff --git a/components/openmw-mp/Controllers/WorldstatePacketController.cpp b/components/openmw-mp/Controllers/WorldstatePacketController.cpp index 802c45cef..991029439 100644 --- a/components/openmw-mp/Controllers/WorldstatePacketController.cpp +++ b/components/openmw-mp/Controllers/WorldstatePacketController.cpp @@ -1,4 +1,5 @@ #include "../Packets/Worldstate/PacketRecordDynamic.hpp" +#include "../Packets/Worldstate/PacketWorldCollisionOverride.hpp" #include "../Packets/Worldstate/PacketWorldTime.hpp" #include "WorldstatePacketController.hpp" @@ -14,6 +15,7 @@ inline void AddPacket(mwmp::WorldstatePacketController::packets_t *packets, RakN mwmp::WorldstatePacketController::WorldstatePacketController(RakNet::RakPeerInterface *peer) { AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); } diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index 143553a7f..b66786f71 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -18,7 +18,6 @@ enum GameMessages ID_LOADED, ID_GUI_MESSAGEBOX, - ID_WORLD_TIME, ID_GAME_WEATHER, ID_PLAYER_BASEINFO, @@ -90,7 +89,6 @@ enum GameMessages ID_OBJECT_TRAP, ID_CELL_CREATE, - ID_RECORD_DYNAMIC, ID_CONSOLE_COMMAND, ID_CONTAINER, @@ -107,7 +105,11 @@ enum GameMessages ID_SCRIPT_GLOBAL_FLOAT, ID_GAME_SETTINGS, - ID_GAME_PREINIT + ID_GAME_PREINIT, + + ID_RECORD_DYNAMIC, + ID_WORLD_COLLISION_OVERRIDE, + ID_WORLD_TIME, }; enum OrderingChannel diff --git a/components/openmw-mp/Packets/Worldstate/PacketWorldCollisionOverride.cpp b/components/openmw-mp/Packets/Worldstate/PacketWorldCollisionOverride.cpp new file mode 100644 index 000000000..b2b482b92 --- /dev/null +++ b/components/openmw-mp/Packets/Worldstate/PacketWorldCollisionOverride.cpp @@ -0,0 +1,17 @@ +#include "PacketWorldCollisionOverride.hpp" +#include + +using namespace mwmp; + +PacketWorldCollisionOverride::PacketWorldCollisionOverride(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer) +{ + packetID = ID_WORLD_COLLISION_OVERRIDE; + orderChannel = CHANNEL_WORLDSTATE; +} + +void PacketWorldCollisionOverride::Packet(RakNet::BitStream *bs, bool send) +{ + WorldstatePacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Worldstate/PacketWorldCollisionOverride.hpp b/components/openmw-mp/Packets/Worldstate/PacketWorldCollisionOverride.hpp new file mode 100644 index 000000000..2698ae0f7 --- /dev/null +++ b/components/openmw-mp/Packets/Worldstate/PacketWorldCollisionOverride.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETWORLDCOLLISIONOVERRIDE_HPP +#define OPENMW_PACKETWORLDCOLLISIONOVERRIDE_HPP + +#include + +namespace mwmp +{ + class PacketWorldCollisionOverride : public WorldstatePacket + { + public: + PacketWorldCollisionOverride(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETWORLDCOLLISIONOVERRIDE_HPP