From 5b23da8e1c3172595c172acfaa3c5912db2f0f8c Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 10 Jun 2017 12:01:37 +0300 Subject: [PATCH] [General] Rename unused PlayerRegionChange packet into PlayerKillCount --- apps/openmw-mp/CMakeLists.txt | 6 ++--- apps/openmw-mp/ProcessorInitializer.cpp | 4 +-- apps/openmw-mp/Script/ScriptFunctions.hpp | 2 +- .../player/ProcessorPlayerKillCount.hpp | 25 +++++++++++++++++++ .../player/ProcessorPlayerRegionChange.hpp | 25 ------------------- .../Controllers/PlayerPacketController.cpp | 4 +-- components/openmw-mp/NetworkMessages.hpp | 2 +- .../Packets/Player/PacketPlayerKillCount.cpp | 14 +++++++++++ ...onChange.hpp => PacketPlayerKillCount.hpp} | 4 +-- .../Player/PacketPlayerRegionChange.cpp | 16 ------------ 10 files changed, 50 insertions(+), 52 deletions(-) create mode 100644 apps/openmw-mp/processors/player/ProcessorPlayerKillCount.hpp delete mode 100644 apps/openmw-mp/processors/player/ProcessorPlayerRegionChange.hpp create mode 100644 components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp rename components/openmw-mp/Packets/Player/{PacketPlayerRegionChange.hpp => PacketPlayerKillCount.hpp} (71%) delete mode 100644 components/openmw-mp/Packets/Player/PacketPlayerRegionChange.cpp diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index 3cdae7b2e..c3da17823 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -121,9 +121,9 @@ set(PROCESSORS_PLAYER processors/player/ProcessorPlayerCharGen.hpp processors/player/ProcessorPlayerDeath.hpp processors/player/ProcessorPlayerDisposition.hpp processors/player/ProcessorPlayerEquipment.hpp processors/player/ProcessorPlayerFaction.hpp processors/player/ProcessorPlayerInventory.hpp - processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerLevel.hpp - processors/player/ProcessorPlayerMap.hpp processors/player/ProcessorPlayerPosition.hpp - processors/player/ProcessorPlayerRegionChange.hpp processors/player/ProcessorPlayerRest.hpp + processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerKillCount.hpp + processors/player/ProcessorPlayerLevel.hpp processors/player/ProcessorPlayerMap.hpp + processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerRest.hpp processors/player/ProcessorPlayerResurrect.hpp processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpeech.hpp processors/player/ProcessorPlayerSpellbook.hpp processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerTopic.hpp diff --git a/apps/openmw-mp/ProcessorInitializer.cpp b/apps/openmw-mp/ProcessorInitializer.cpp index 90569a6a8..b8dafa770 100644 --- a/apps/openmw-mp/ProcessorInitializer.cpp +++ b/apps/openmw-mp/ProcessorInitializer.cpp @@ -27,10 +27,10 @@ #include "processors/player/ProcessorPlayerFaction.hpp" #include "processors/player/ProcessorPlayerInventory.hpp" #include "processors/player/ProcessorPlayerJournal.hpp" +#include "processors/player/ProcessorPlayerKillCount.hpp" #include "processors/player/ProcessorPlayerLevel.hpp" #include "processors/player/ProcessorPlayerMap.hpp" #include "processors/player/ProcessorPlayerPosition.hpp" -#include "processors/player/ProcessorPlayerRegionChange.hpp" #include "processors/player/ProcessorPlayerRest.hpp" #include "processors/player/ProcessorPlayerResurrect.hpp" #include "processors/player/ProcessorPlayerSkill.hpp" @@ -94,10 +94,10 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorPlayerFaction()); PlayerProcessor::AddProcessor(new ProcessorPlayerInventory()); PlayerProcessor::AddProcessor(new ProcessorPlayerJournal()); + PlayerProcessor::AddProcessor(new ProcessorPlayerKillCount()); PlayerProcessor::AddProcessor(new ProcessorPlayerLevel()); PlayerProcessor::AddProcessor(new ProcessorPlayerMap()); PlayerProcessor::AddProcessor(new ProcessorPlayerPosition()); - PlayerProcessor::AddProcessor(new ProcessorPlayerRegionChange()); PlayerProcessor::AddProcessor(new ProcessorPlayerRest()); PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect()); PlayerProcessor::AddProcessor(new ProcessorPlayerSkill()); diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 7177a7e51..cc7246549 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -126,7 +126,7 @@ public: {"OnPlayerDeath", Function()}, {"OnPlayerResurrect", Function()}, {"OnPlayerCellChange", Function()}, - {"OnPlayerRegionChange", Function()}, + {"OnPlayerKillCount", Function()}, {"OnPlayerAttribute", Function()}, {"OnPlayerSkill", Function()}, {"OnPlayerLevel", Function()}, diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerKillCount.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerKillCount.hpp new file mode 100644 index 000000000..89843bf01 --- /dev/null +++ b/apps/openmw-mp/processors/player/ProcessorPlayerKillCount.hpp @@ -0,0 +1,25 @@ +#ifndef OPENMW_PROCESSORPLAYERKILLCOUNT_HPP +#define OPENMW_PROCESSORPLAYERKILLCOUNT_HPP + +#include "apps/openmw-mp/PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerKillCount : public PlayerProcessor + { + public: + ProcessorPlayerKillCount() + { + BPP_INIT(ID_PLAYER_KILL_COUNT) + } + + void Do(PlayerPacket &packet, Player &player) override + { + DEBUG_PRINTF(strPacketID.c_str()); + + Script::Call(player.getId()); + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERKILLCOUNT_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerRegionChange.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerRegionChange.hpp deleted file mode 100644 index b1b12cbd3..000000000 --- a/apps/openmw-mp/processors/player/ProcessorPlayerRegionChange.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef OPENMW_PROCESSORPLAYERREGIONCHANGE_HPP -#define OPENMW_PROCESSORPLAYERREGIONCHANGE_HPP - -#include "apps/openmw-mp/PlayerProcessor.hpp" - -namespace mwmp -{ - class ProcessorPlayerRegionChange : public PlayerProcessor - { - public: - ProcessorPlayerRegionChange() - { - BPP_INIT(ID_PLAYER_REGION_CHANGE) - } - - void Do(PlayerPacket &packet, Player &player) override - { - DEBUG_PRINTF(strPacketID.c_str()); - - Script::Call(player.getId()); - } - }; -} - -#endif //OPENMW_PROCESSORPLAYERREGIONCHANGE_HPP diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 256ea6b92..2417a4864 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -27,11 +27,11 @@ #include "../Packets/Player/PacketPlayerFaction.hpp" #include "../Packets/Player/PacketPlayerInventory.hpp" #include "../Packets/Player/PacketPlayerJournal.hpp" +#include "../Packets/Player/PacketPlayerKillCount.hpp" #include "../Packets/Player/PacketPlayerLevel.hpp" #include "../Packets/Player/PacketPlayerMap.hpp" #include "../Packets/Player/PacketPlayerPosition.hpp" #include "../Packets/Player/PacketPlayerRegionAuthority.hpp" -#include "../Packets/Player/PacketPlayerRegionChange.hpp" #include "../Packets/Player/PacketPlayerRest.hpp" #include "../Packets/Player/PacketPlayerResurrect.hpp" #include "../Packets/Player/PacketPlayerSkill.hpp" @@ -78,11 +78,11 @@ 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); AddPacket(&packets, peer); - 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 3a4ba33e3..9bcd284fe 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -39,11 +39,11 @@ enum GameMessages ID_PLAYER_FACTION, ID_PLAYER_INVENTORY, ID_PLAYER_JOURNAL, + ID_PLAYER_KILL_COUNT, ID_PLAYER_LEVEL, ID_PLAYER_MAP, ID_PLAYER_POSITION, ID_PLAYER_REGION_AUTHORITY, - ID_PLAYER_REGION_CHANGE, ID_PLAYER_RESURRECT, ID_PLAYER_REST, ID_PLAYER_SKILL, diff --git a/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp new file mode 100644 index 000000000..010bf8921 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp @@ -0,0 +1,14 @@ +#include +#include "PacketPlayerKillCount.hpp" + +mwmp::PacketPlayerKillCount::PacketPlayerKillCount(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_PLAYER_KILL_COUNT; +} + +void mwmp::PacketPlayerKillCount::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder to be filled in later +} diff --git a/components/openmw-mp/Packets/Player/PacketPlayerRegionChange.hpp b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp similarity index 71% rename from components/openmw-mp/Packets/Player/PacketPlayerRegionChange.hpp rename to components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp index 571fb8f6b..6883d3507 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerRegionChange.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.hpp @@ -5,10 +5,10 @@ namespace mwmp { - class PacketPlayerRegionChange : public PlayerPacket + class PacketPlayerKillCount : public PlayerPacket { public: - PacketPlayerRegionChange(RakNet::RakPeerInterface *peer); + PacketPlayerKillCount(RakNet::RakPeerInterface *peer); virtual void Packet(RakNet::BitStream *bs, bool send); }; diff --git a/components/openmw-mp/Packets/Player/PacketPlayerRegionChange.cpp b/components/openmw-mp/Packets/Player/PacketPlayerRegionChange.cpp deleted file mode 100644 index 3a6aa356b..000000000 --- a/components/openmw-mp/Packets/Player/PacketPlayerRegionChange.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include "PacketPlayerRegionChange.hpp" - -mwmp::PacketPlayerRegionChange::PacketPlayerRegionChange(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) -{ - packetID = ID_PLAYER_REGION_CHANGE; - priority = IMMEDIATE_PRIORITY; - reliability = RELIABLE_ORDERED; -} - -void mwmp::PacketPlayerRegionChange::Packet(RakNet::BitStream *bs, bool send) -{ - PlayerPacket::Packet(bs, send); - - // Placeholder to be filled in later -}