diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index caf2aeef0..a619e2a98 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -98,22 +98,21 @@ source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR}) set(PROCESSORS_PLAYER processors/player/ProcessorChatMsg.hpp processors/player/ProcessorGUIMessageBox.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/ProcessorPlayerInput.hpp - processors/player/ProcessorPlayerInventory.hpp processors/player/ProcessorPlayerJournal.hpp - processors/player/ProcessorWorldKillCount.hpp processors/player/ProcessorPlayerLevel.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/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/ProcessorPlayerInput.hpp processors/player/ProcessorPlayerInventory.hpp + processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorWorldKillCount.hpp + processors/player/ProcessorPlayerLevel.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}) @@ -136,6 +135,7 @@ source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT}) set(PROCESSORS_WORLDSTATE processors/worldstate/ProcessorRecordDynamic.hpp processors/worldstate/ProcessorWorldMap.hpp + processors/worldstate/ProcessorWorldWeather.hpp ) source_group(tes3mp-server\\processors\\worldstate FILES ${PROCESSORS_WORLDSTATE}) diff --git a/apps/openmw-mp/processors/ProcessorInitializer.cpp b/apps/openmw-mp/processors/ProcessorInitializer.cpp index 775a08887..ffb9490a8 100644 --- a/apps/openmw-mp/processors/ProcessorInitializer.cpp +++ b/apps/openmw-mp/processors/ProcessorInitializer.cpp @@ -6,7 +6,6 @@ #include "PlayerProcessor.hpp" #include "player/ProcessorChatMsg.hpp" #include "player/ProcessorGUIMessageBox.hpp" -#include "player/ProcessorGameWeather.hpp" #include "player/ProcessorPlayerCharGen.hpp" #include "player/ProcessorPlayerAnimFlags.hpp" #include "player/ProcessorPlayerAnimPlay.hpp" @@ -77,6 +76,7 @@ #include "WorldstateProcessor.hpp" #include "worldstate/ProcessorRecordDynamic.hpp" #include "worldstate/ProcessorWorldMap.hpp" +#include "worldstate/ProcessorWorldWeather.hpp" using namespace mwmp; @@ -84,7 +84,6 @@ void ProcessorInitializer() { PlayerProcessor::AddProcessor(new ProcessorChatMsg()); PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); - PlayerProcessor::AddProcessor(new ProcessorGameWeather()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimPlay()); @@ -155,4 +154,5 @@ void ProcessorInitializer() WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic()); WorldstateProcessor::AddProcessor(new ProcessorWorldMap()); + WorldstateProcessor::AddProcessor(new ProcessorWorldWeather()); } diff --git a/apps/openmw-mp/processors/worldstate/ProcessorWorldWeather.hpp b/apps/openmw-mp/processors/worldstate/ProcessorWorldWeather.hpp new file mode 100644 index 000000000..f815a557e --- /dev/null +++ b/apps/openmw-mp/processors/worldstate/ProcessorWorldWeather.hpp @@ -0,0 +1,23 @@ +#ifndef OPENMW_PROCESSORWORLDWEATHER_HPP +#define OPENMW_PROCESSORWORLDWEATHER_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorWorldWeather : public WorldstateProcessor + { + public: + ProcessorWorldWeather() + { + BPP_INIT(ID_WORLD_WEATHER) + } + + void Do(WorldstatePacket &packet, Player &player, BaseWorldstate &worldstate) override + { + // Placeholder to be filled in later + } + }; +} + +#endif //OPENMW_PROCESSORWORLDWEATHER_HPP diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 01c84c908..291b75973 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -112,12 +112,12 @@ add_openmw_dir (mwmp/processors/actor ProcessorActorAI ProcessorActorAnimFlags P ) add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageBox ProcessorHandshake - ProcessorUserDisconnected ProcessorUserMyID ProcessorGameSettings ProcessorGameWeather ProcessorPlayerAnimFlags - ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerBehavior - ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass - ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerFaction - ProcessorPlayerInput ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorWorldKillCount - ProcessorPlayerLevel ProcessorPlayerMiscellaneous ProcessorPlayerMomentum ProcessorPlayerPosition ProcessorPlayerQuickKeys + ProcessorUserDisconnected ProcessorUserMyID ProcessorGameSettings ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay + ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerBehavior ProcessorPlayerBook + ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen + ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerFaction ProcessorPlayerInput + ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorWorldKillCount ProcessorPlayerLevel + ProcessorPlayerMiscellaneous ProcessorPlayerMomentum ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerShapeshift ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic ) @@ -135,7 +135,7 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ) add_openmw_dir (mwmp/processors/worldstate ProcessorCellCreate ProcessorCellReplace ProcessorRecordDynamic - ProcessorWorldCollisionOverride ProcessorWorldMap ProcessorWorldTime + ProcessorWorldCollisionOverride ProcessorWorldMap ProcessorWorldTime ProcessorWorldWeather ) # Main executable diff --git a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp index b71246b44..3d98ae917 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/ProcessorGameSettings.hpp" -#include "player/ProcessorGameWeather.hpp" #include "player/ProcessorPlayerAnimFlags.hpp" #include "player/ProcessorPlayerAnimPlay.hpp" #include "player/ProcessorPlayerAttack.hpp" @@ -95,6 +94,7 @@ #include "worldstate/ProcessorWorldCollisionOverride.hpp" #include "worldstate/ProcessorWorldMap.hpp" #include "worldstate/ProcessorWorldTime.hpp" +#include "worldstate/ProcessorWorldWeather.hpp" using namespace mwmp; @@ -105,7 +105,6 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); PlayerProcessor::AddProcessor(new ProcessorGameSettings()); - PlayerProcessor::AddProcessor(new ProcessorGameWeather()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimPlay()); PlayerProcessor::AddProcessor(new ProcessorPlayerAttack()); @@ -191,4 +190,5 @@ void ProcessorInitializer() WorldstateProcessor::AddProcessor(new ProcessorWorldCollisionOverride()); WorldstateProcessor::AddProcessor(new ProcessorWorldMap()); WorldstateProcessor::AddProcessor(new ProcessorWorldTime()); + WorldstateProcessor::AddProcessor(new ProcessorWorldWeather()); } diff --git a/apps/openmw/mwmp/processors/player/ProcessorGameWeather.hpp b/apps/openmw/mwmp/processors/player/ProcessorGameWeather.hpp deleted file mode 100644 index 64bced047..000000000 --- a/apps/openmw/mwmp/processors/player/ProcessorGameWeather.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef OPENMW_PROCESSORGAMEWEATHER_HPP -#define OPENMW_PROCESSORGAMEWEATHER_HPP - -#include "../PlayerProcessor.hpp" - -namespace mwmp -{ - class ProcessorGameWeather : public PlayerProcessor - { - public: - ProcessorGameWeather() - { - BPP_INIT(ID_GAME_WEATHER) - } - - virtual void Do(PlayerPacket &packet, BasePlayer *player) - { - // Placeholder to be filled in later - } - }; -} - -#endif //OPENMW_PROCESSORGAMEWEATHER_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorGameWeather.hpp b/apps/openmw/mwmp/processors/worldstate/ProcessorWorldWeather.hpp similarity index 58% rename from apps/openmw-mp/processors/player/ProcessorGameWeather.hpp rename to apps/openmw/mwmp/processors/worldstate/ProcessorWorldWeather.hpp index cb0a360f4..2cdf0e705 100644 --- a/apps/openmw-mp/processors/player/ProcessorGameWeather.hpp +++ b/apps/openmw/mwmp/processors/worldstate/ProcessorWorldWeather.hpp @@ -5,15 +5,15 @@ namespace mwmp { - class ProcessorGameWeather : public PlayerProcessor + class ProcessorWorldWeather : public WorldstateProcessor { public: - ProcessorGameWeather() + ProcessorWorldWeather() { - BPP_INIT(ID_GAME_WEATHER) + BPP_INIT(ID_WORLD_WEATHER) } - void Do(PlayerPacket &packet, Player &player) override + virtual void Do(WorldstatePacket &packet, Worldstate &worldstate) { // Placeholder to be filled in later } diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 32d2e1330..c117563f6 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -176,7 +176,7 @@ add_component_dir (openmw-mp/Packets/Actor add_component_dir (openmw-mp/Packets/Player PlayerPacket - PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameWeather + PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty @@ -203,7 +203,7 @@ add_component_dir (openmw-mp/Packets/Worldstate WorldstatePacket PacketCellCreate PacketCellReplace PacketRecordDynamic PacketWorldCollisionOverride PacketWorldMap - PacketWorldTime + PacketWorldTime PacketWorldWeather ) add_component_dir (fallback diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 2645769f3..005a39d57 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/PacketGameSettings.hpp" -#include "../Packets/Player/PacketGameWeather.hpp" #include "../Packets/Player/PacketPlayerActiveSkills.hpp" #include "../Packets/Player/PacketPlayerAnimFlags.hpp" #include "../Packets/Player/PacketPlayerAnimPlay.hpp" @@ -60,7 +59,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); diff --git a/components/openmw-mp/Controllers/WorldstatePacketController.cpp b/components/openmw-mp/Controllers/WorldstatePacketController.cpp index 31f2ca8a8..1320745a3 100644 --- a/components/openmw-mp/Controllers/WorldstatePacketController.cpp +++ b/components/openmw-mp/Controllers/WorldstatePacketController.cpp @@ -4,6 +4,7 @@ #include "../Packets/Worldstate/PacketWorldCollisionOverride.hpp" #include "../Packets/Worldstate/PacketWorldMap.hpp" #include "../Packets/Worldstate/PacketWorldTime.hpp" +#include "../Packets/Worldstate/PacketWorldWeather.hpp" #include "WorldstatePacketController.hpp" @@ -23,6 +24,7 @@ mwmp::WorldstatePacketController::WorldstatePacketController(RakNet::RakPeerInte AddPacket(&packets, 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 27aa5dd36..44e02274a 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -17,8 +17,6 @@ enum GameMessages ID_HANDSHAKE, ID_LOADED, ID_GUI_MESSAGEBOX, - - ID_GAME_WEATHER, ID_PLAYER_BASEINFO, ID_PLAYER_BEHAVIOR, @@ -111,6 +109,7 @@ enum GameMessages ID_WORLD_COLLISION_OVERRIDE, ID_WORLD_MAP, ID_WORLD_TIME, + ID_WORLD_WEATHER }; enum OrderingChannel diff --git a/components/openmw-mp/Packets/Player/PacketGameWeather.cpp b/components/openmw-mp/Packets/Player/PacketGameWeather.cpp deleted file mode 100644 index d02d51850..000000000 --- a/components/openmw-mp/Packets/Player/PacketGameWeather.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "PacketGameWeather.hpp" -#include - -using namespace mwmp; - -PacketGameWeather::PacketGameWeather(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) -{ - packetID = ID_GAME_WEATHER; - orderChannel = CHANNEL_SYSTEM; -} - -void PacketGameWeather::Packet(RakNet::BitStream *bs, bool send) -{ - PlayerPacket::Packet(bs, send); - - // Placeholder to be filled in later -} diff --git a/components/openmw-mp/Packets/Player/PacketGameWeather.hpp b/components/openmw-mp/Packets/Player/PacketGameWeather.hpp deleted file mode 100644 index 3d6806953..000000000 --- a/components/openmw-mp/Packets/Player/PacketGameWeather.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef OPENMW_PACKETGAMEWEATHER_HPP -#define OPENMW_PACKETGAMEWEATHER_HPP - -#include - -namespace mwmp -{ - class PacketGameWeather : public PlayerPacket - { - public: - PacketGameWeather(RakNet::RakPeerInterface *peer); - - virtual void Packet(RakNet::BitStream *bs, bool send); - }; -} - -#endif //OPENMW_PACKETGAMEWEATHER_HPP diff --git a/components/openmw-mp/Packets/Worldstate/PacketWorldWeather.cpp b/components/openmw-mp/Packets/Worldstate/PacketWorldWeather.cpp new file mode 100644 index 000000000..b99dda037 --- /dev/null +++ b/components/openmw-mp/Packets/Worldstate/PacketWorldWeather.cpp @@ -0,0 +1,17 @@ +#include "PacketWorldWeather.hpp" +#include + +using namespace mwmp; + +PacketWorldWeather::PacketWorldWeather(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer) +{ + packetID = ID_WORLD_WEATHER; + orderChannel = CHANNEL_WORLDSTATE; +} + +void PacketWorldWeather::Packet(RakNet::BitStream *bs, bool send) +{ + WorldstatePacket::Packet(bs, send); + + // Placeholder to be filled in later +} diff --git a/components/openmw-mp/Packets/Worldstate/PacketWorldWeather.hpp b/components/openmw-mp/Packets/Worldstate/PacketWorldWeather.hpp new file mode 100644 index 000000000..17a4a6e7e --- /dev/null +++ b/components/openmw-mp/Packets/Worldstate/PacketWorldWeather.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETWORLDWEATHER_HPP +#define OPENMW_PACKETWORLDWEATHER_HPP + +#include + +namespace mwmp +{ + class PacketWorldWeather : public WorldstatePacket + { + public: + PacketWorldWeather(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETWORLDWEATHER_HPP