diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index 0c8974878..b887d1088 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -123,23 +123,22 @@ source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR}) set(PROCESSORS_PLAYER processors/player/ProcessorChatMsg.hpp processors/player/ProcessorGUIMessageBox.hpp - processors/player/ProcessorRecordDynamic.hpp processors/player/ProcessorGameWeather.hpp - processors/player/ProcessorPlayerAnimFlags.hpp processors/player/ProcessorPlayerAnimPlay.hpp - processors/player/ProcessorPlayerAttack.hpp processors/player/ProcessorPlayerAttribute.hpp - processors/player/ProcessorPlayerBook.hpp processors/player/ProcessorPlayerBounty.hpp - processors/player/ProcessorPlayerCellChange.hpp processors/player/ProcessorPlayerCellState.hpp - processors/player/ProcessorPlayerCharClass.hpp processors/player/ProcessorPlayerCharGen.hpp - processors/player/ProcessorPlayerDeath.hpp processors/player/ProcessorPlayerDisposition.hpp - processors/player/ProcessorPlayerEquipment.hpp processors/player/ProcessorPlayerFaction.hpp - processors/player/ProcessorPlayerInteraction.hpp processors/player/ProcessorPlayerInventory.hpp - processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerKillCount.hpp - processors/player/ProcessorPlayerLevel.hpp processors/player/ProcessorPlayerMap.hpp - processors/player/ProcessorPlayerMiscellaneous.hpp processors/player/ProcessorPlayerPosition.hpp - processors/player/ProcessorPlayerQuickKeys.hpp processors/player/ProcessorPlayerRest.hpp - processors/player/ProcessorPlayerResurrect.hpp processors/player/ProcessorPlayerShapeshift.hpp - processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpeech.hpp - processors/player/ProcessorPlayerSpellbook.hpp processors/player/ProcessorPlayerStatsDynamic.hpp - processors/player/ProcessorPlayerTopic.hpp + processors/player/ProcessorGameWeather.hpp processors/player/ProcessorPlayerAnimFlags.hpp + processors/player/ProcessorPlayerAnimPlay.hpp processors/player/ProcessorPlayerAttack.hpp + processors/player/ProcessorPlayerAttribute.hpp processors/player/ProcessorPlayerBook.hpp + processors/player/ProcessorPlayerBounty.hpp processors/player/ProcessorPlayerCellChange.hpp + processors/player/ProcessorPlayerCellState.hpp processors/player/ProcessorPlayerCharClass.hpp + processors/player/ProcessorPlayerCharGen.hpp processors/player/ProcessorPlayerDeath.hpp + processors/player/ProcessorPlayerDisposition.hpp processors/player/ProcessorPlayerEquipment.hpp + processors/player/ProcessorPlayerFaction.hpp processors/player/ProcessorPlayerInteraction.hpp + processors/player/ProcessorPlayerInventory.hpp processors/player/ProcessorPlayerJournal.hpp + processors/player/ProcessorPlayerKillCount.hpp processors/player/ProcessorPlayerLevel.hpp + processors/player/ProcessorPlayerMap.hpp processors/player/ProcessorPlayerMiscellaneous.hpp + processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerQuickKeys.hpp + processors/player/ProcessorPlayerRest.hpp processors/player/ProcessorPlayerResurrect.hpp + processors/player/ProcessorPlayerShapeshift.hpp processors/player/ProcessorPlayerSkill.hpp + processors/player/ProcessorPlayerSpeech.hpp processors/player/ProcessorPlayerSpellbook.hpp + processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerTopic.hpp ) source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER}) @@ -159,6 +158,12 @@ set(PROCESSORS_OBJECT source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT}) +set(PROCESSORS_WORLDSTATE + processors/worldstate/ProcessorRecordDynamic.hpp + ) + +source_group(tes3mp-server\\processors\\worldstate FILES ${PROCESSORS_WORLDSTATE}) + set(PROCESSORS processors/ProcessorInitializer.cpp processors/PlayerProcessor.cpp diff --git a/apps/openmw-mp/processors/ProcessorInitializer.cpp b/apps/openmw-mp/processors/ProcessorInitializer.cpp index a7fe44a8c..c5d365dec 100644 --- a/apps/openmw-mp/processors/ProcessorInitializer.cpp +++ b/apps/openmw-mp/processors/ProcessorInitializer.cpp @@ -1,7 +1,3 @@ -// -// Created by koncord on 31.03.17. -// - #include "ProcessorInitializer.hpp" #include "Networking.hpp" @@ -11,7 +7,6 @@ #include "player/ProcessorChatMsg.hpp" #include "player/ProcessorGUIMessageBox.hpp" #include "player/ProcessorGameWeather.hpp" -#include "player/ProcessorRecordDynamic.hpp" #include "player/ProcessorPlayerCharGen.hpp" #include "player/ProcessorPlayerAnimFlags.hpp" #include "player/ProcessorPlayerAnimPlay.hpp" @@ -79,7 +74,8 @@ #include "object/ProcessorScriptGlobalShort.hpp" #include "object/ProcessorScriptGlobalFloat.hpp" #include "object/ProcessorVideoPlay.hpp" - +#include "WorldstateProcessor.hpp" +#include "worldstate/ProcessorRecordDynamic.hpp" using namespace mwmp; @@ -88,7 +84,6 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorChatMsg()); PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); PlayerProcessor::AddProcessor(new ProcessorGameWeather()); - PlayerProcessor::AddProcessor(new ProcessorRecordDynamic()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimPlay()); @@ -156,4 +151,6 @@ void ProcessorInitializer() ObjectProcessor::AddProcessor(new ProcessorScriptGlobalShort()); ObjectProcessor::AddProcessor(new ProcessorScriptGlobalFloat()); ObjectProcessor::AddProcessor(new ProcessorVideoPlay()); + + WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic()); } diff --git a/apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp b/apps/openmw-mp/processors/worldstate/ProcessorRecordDynamic.hpp similarity index 68% rename from apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp rename to apps/openmw-mp/processors/worldstate/ProcessorRecordDynamic.hpp index 4acb7b0a8..8187a2cb6 100644 --- a/apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp +++ b/apps/openmw-mp/processors/worldstate/ProcessorRecordDynamic.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP #define OPENMW_PROCESSORRECORDDYNAMIC_HPP -#include "../PlayerProcessor.hpp" +#include "../WorldstateProcessor.hpp" namespace mwmp { - class ProcessorRecordDynamic : public PlayerProcessor + class ProcessorRecordDynamic : public WorldstateProcessor { public: ProcessorRecordDynamic() @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_RECORD_DYNAMIC) } - void Do(PlayerPacket &packet, Player &player) override + void Do(WorldstatePacket &packet, Player &player, BaseWorldstate &worldstate) override { DEBUG_PRINTF(strPacketID.c_str()); diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 3d9b13cdf..8258b9c06 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -114,15 +114,14 @@ add_openmw_dir (mwmp/processors/actor ProcessorActorAI ProcessorActorAnimFlags P ) add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageBox ProcessorHandshake - ProcessorUserDisconnected ProcessorUserMyID ProcessorCellCreate ProcessorRecordDynamic ProcessorGameSettings - ProcessorGameWeather ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute - ProcessorPlayerBaseInfo ProcessorPlayerBehavior ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange - ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition - ProcessorPlayerEquipment ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail - ProcessorPlayerJournal ProcessorPlayerKillCount ProcessorPlayerLevel ProcessorPlayerMap ProcessorPlayerMiscellaneous - ProcessorPlayerMomentum ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect - ProcessorPlayerShapeshift ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic - ProcessorPlayerTopic + ProcessorUserDisconnected ProcessorUserMyID ProcessorCellCreate ProcessorGameSettings ProcessorGameWeather + ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo + ProcessorPlayerBehavior ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState + ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment + ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal + ProcessorPlayerKillCount ProcessorPlayerLevel ProcessorPlayerMap ProcessorPlayerMiscellaneous ProcessorPlayerMomentum + ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerShapeshift + ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic ) add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer ProcessorDoorDestination @@ -133,7 +132,7 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleComma ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ) -add_openmw_dir (mwmp/processors/worldstate ProcessorWorldTime +add_openmw_dir (mwmp/processors/worldstate ProcessorRecordDynamic ProcessorWorldTime ) # Main executable diff --git a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp index 5e4e8f5d6..7f12e4629 100644 --- a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp @@ -6,7 +6,6 @@ #include "player/ProcessorHandshake.hpp" #include "player/ProcessorUserDisconnected.hpp" #include "player/ProcessorCellCreate.hpp" -#include "player/ProcessorRecordDynamic.hpp" #include "player/ProcessorGameSettings.hpp" #include "player/ProcessorGameWeather.hpp" #include "player/ProcessorPlayerAnimFlags.hpp" @@ -91,6 +90,7 @@ #include "actor/ProcessorActorTest.hpp" #include "WorldstateProcessor.hpp" +#include "worldstate/ProcessorRecordDynamic.hpp" #include "worldstate/ProcessorWorldTime.hpp" using namespace mwmp; @@ -102,7 +102,6 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); PlayerProcessor::AddProcessor(new ProcessorCellCreate()); - PlayerProcessor::AddProcessor(new ProcessorRecordDynamic()); PlayerProcessor::AddProcessor(new ProcessorGameSettings()); PlayerProcessor::AddProcessor(new ProcessorGameWeather()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); @@ -184,5 +183,6 @@ void ProcessorInitializer() ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic()); ActorProcessor::AddProcessor(new ProcessorActorTest()); + WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic()); WorldstateProcessor::AddProcessor(new ProcessorWorldTime()); } diff --git a/apps/openmw/mwmp/processors/player/ProcessorRecordDynamic.hpp b/apps/openmw/mwmp/processors/worldstate/ProcessorRecordDynamic.hpp similarity index 63% rename from apps/openmw/mwmp/processors/player/ProcessorRecordDynamic.hpp rename to apps/openmw/mwmp/processors/worldstate/ProcessorRecordDynamic.hpp index dfcfc9d64..ef7a1df11 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorRecordDynamic.hpp +++ b/apps/openmw/mwmp/processors/worldstate/ProcessorRecordDynamic.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP #define OPENMW_PROCESSORRECORDDYNAMIC_HPP -#include "../PlayerProcessor.hpp" +#include "../WorldstateProcessor.hpp" namespace mwmp { - class ProcessorRecordDynamic : public PlayerProcessor + class ProcessorRecordDynamic : public WorldstateProcessor { public: ProcessorRecordDynamic() @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_RECORD_DYNAMIC) } - virtual void Do(PlayerPacket &packet, BasePlayer *player) + virtual void Do(WorldstatePacket &packet, BaseWorldstate &worldstate) { // Placeholder } diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 7bf2535fc..9fcec629f 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -167,6 +167,7 @@ add_component_dir (openmw-mp/Packets add_component_dir (openmw-mp/Packets/Actor ActorPacket + PacketActorList PacketActorAuthority PacketActorTest PacketActorAI PacketActorAnimFlags PacketActorAnimPlay PacketActorAttack PacketActorCellChange PacketActorDeath PacketActorEquipment PacketActorInteraction PacketActorPosition PacketActorSpeech PacketActorStatsDynamic @@ -174,9 +175,10 @@ add_component_dir (openmw-mp/Packets/Actor add_component_dir (openmw-mp/Packets/Player PlayerPacket + PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameWeather - PacketCellCreate PacketRecordDynamic + PacketCellCreate PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty @@ -189,6 +191,7 @@ add_component_dir (openmw-mp/Packets/Player add_component_dir (openmw-mp/Packets/Object ObjectPacket + PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap @@ -198,7 +201,8 @@ add_component_dir (openmw-mp/Packets/Object add_component_dir (openmw-mp/Packets/Worldstate WorldstatePacket - PacketWorldTime + + PacketRecordDynamic PacketWorldTime ) add_component_dir (fallback diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 55c256adb..71962b298 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -5,7 +5,6 @@ #include "../Packets/Player/PacketGUIBoxes.hpp" #include "../Packets/Player/PacketLoaded.hpp" #include "../Packets/Player/PacketCellCreate.hpp" -#include "../Packets/Player/PacketRecordDynamic.hpp" #include "../Packets/Player/PacketGameSettings.hpp" #include "../Packets/Player/PacketGameWeather.hpp" #include "../Packets/Player/PacketPlayerActiveSkills.hpp" @@ -63,7 +62,6 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); - AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); diff --git a/components/openmw-mp/Controllers/WorldstatePacketController.cpp b/components/openmw-mp/Controllers/WorldstatePacketController.cpp index d9d575119..802c45cef 100644 --- a/components/openmw-mp/Controllers/WorldstatePacketController.cpp +++ b/components/openmw-mp/Controllers/WorldstatePacketController.cpp @@ -1,3 +1,4 @@ +#include "../Packets/Worldstate/PacketRecordDynamic.hpp" #include "../Packets/Worldstate/PacketWorldTime.hpp" #include "WorldstatePacketController.hpp" @@ -12,6 +13,7 @@ inline void AddPacket(mwmp::WorldstatePacketController::packets_t *packets, RakN mwmp::WorldstatePacketController::WorldstatePacketController(RakNet::RakPeerInterface *peer) { + AddPacket(&packets, peer); AddPacket(&packets, peer); } diff --git a/components/openmw-mp/Packets/Player/PacketRecordDynamic.cpp b/components/openmw-mp/Packets/Worldstate/PacketRecordDynamic.cpp similarity index 72% rename from components/openmw-mp/Packets/Player/PacketRecordDynamic.cpp rename to components/openmw-mp/Packets/Worldstate/PacketRecordDynamic.cpp index 4ed8364eb..ef13d8cc2 100644 --- a/components/openmw-mp/Packets/Player/PacketRecordDynamic.cpp +++ b/components/openmw-mp/Packets/Worldstate/PacketRecordDynamic.cpp @@ -3,15 +3,15 @@ using namespace mwmp; -PacketRecordDynamic::PacketRecordDynamic(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +PacketRecordDynamic::PacketRecordDynamic(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer) { packetID = ID_RECORD_DYNAMIC; - orderChannel = CHANNEL_SYSTEM; + orderChannel = CHANNEL_WORLDSTATE; } void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send) { - PlayerPacket::Packet(bs, send); + WorldstatePacket::Packet(bs, send); // Placeholder } diff --git a/components/openmw-mp/Packets/Player/PacketRecordDynamic.hpp b/components/openmw-mp/Packets/Worldstate/PacketRecordDynamic.hpp similarity index 72% rename from components/openmw-mp/Packets/Player/PacketRecordDynamic.hpp rename to components/openmw-mp/Packets/Worldstate/PacketRecordDynamic.hpp index d58f936c3..3c9658673 100644 --- a/components/openmw-mp/Packets/Player/PacketRecordDynamic.hpp +++ b/components/openmw-mp/Packets/Worldstate/PacketRecordDynamic.hpp @@ -1,12 +1,12 @@ #ifndef OPENMW_PACKETRECORDDYNAMIC_HPP #define OPENMW_PACKETRECORDDYNAMIC_HPP -#include +#include #include namespace mwmp { - class PacketRecordDynamic: public PlayerPacket + class PacketRecordDynamic: public WorldstatePacket { public: PacketRecordDynamic(RakNet::RakPeerInterface *peer);