From 5c269a5f8dbd0361012b5076cbc2b619dcc05536 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 28 Feb 2017 01:38:25 +0200 Subject: [PATCH] [General] Rename ID_GAME_DIE and ID_GAME_RESURRECT --- apps/openmw-mp/Networking.cpp | 8 ++++---- apps/openmw-mp/Script/Functions/Stats.cpp | 2 +- apps/openmw/mwmp/LocalPlayer.cpp | 2 +- apps/openmw/mwmp/Networking.cpp | 6 +++--- components/CMakeLists.txt | 2 ++ .../openmw-mp/Controllers/PlayerPacketController.cpp | 8 ++++---- components/openmw-mp/NetworkMessages.hpp | 4 ++-- .../Player/{PacketDie.hpp => PacketPlayerDeath.hpp} | 12 ++++++------ ...PacketResurrect.hpp => PacketPlayerResurrect.hpp} | 12 ++++++------ 9 files changed, 29 insertions(+), 27 deletions(-) rename components/openmw-mp/Packets/Player/{PacketDie.hpp => PacketPlayerDeath.hpp} (60%) rename components/openmw-mp/Packets/Player/{PacketResurrect.hpp => PacketPlayerResurrect.hpp} (58%) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 30695d403..3f9fff4ea 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -356,9 +356,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) break; } - case ID_GAME_DIE: + case ID_PLAYER_DEATH: { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_DIE from %s", player->npc.mName.c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_DEATH from %s", player->npc.mName.c_str()); Player *killer = Players::getPlayer(player->getLastAttackerId()); @@ -384,9 +384,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) break; } - case ID_GAME_RESURRECT: + case ID_PLAYER_RESURRECT: { - DEBUG_PRINTF("ID_GAME_RESURRECT\n"); + DEBUG_PRINTF("ID_PLAYER_RESURRECT\n"); //packetResurrect.Read(player); player->creatureStats.mDead = false; myPacket->Send(player, true); diff --git a/apps/openmw-mp/Script/Functions/Stats.cpp b/apps/openmw-mp/Script/Functions/Stats.cpp index 60af4c630..aae95b35c 100644 --- a/apps/openmw-mp/Script/Functions/Stats.cpp +++ b/apps/openmw-mp/Script/Functions/Stats.cpp @@ -458,7 +458,7 @@ void StatsFunctions::Resurrect(unsigned short pid) { Player *player; GET_PLAYER(pid, player,); - mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid); + mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_RESURRECT)->RequestData(player->guid); } void StatsFunctions::SendBaseInfo(unsigned short pid) noexcept diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 9846ffd51..9b5b29608 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -556,7 +556,7 @@ void LocalPlayer::updateDeadState(bool forceUpdate) { creatureStats.mDead = true; RakNet::BitStream bs; - getNetworking()->getPlayerPacket((RakNet::MessageID)ID_GAME_DIE)->Packet(&bs, this, true); + getNetworking()->getPlayerPacket((RakNet::MessageID)ID_PLAYER_DEATH)->Packet(&bs, this, true); getNetworking()->sendData(&bs); isDead = true; } diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index fce91e000..aaa0a0dc5 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -454,9 +454,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) } break; } - case ID_GAME_DIE: + case ID_PLAYER_DEATH: { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_DIE from server"); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_DEATH from server"); if (guid == myGuid) { MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); @@ -477,7 +477,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) } break; } - case ID_GAME_RESURRECT: + case ID_PLAYER_RESURRECT: { if (guid == myGuid) { diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 120902594..af3776d04 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -161,6 +161,8 @@ add_component_dir (openmw-mp Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState + Packets/Player/PacketPlayerResurrect + Packets/Player/PacketGUIBoxes Packets/Player/PacketTime Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectScale diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 6ad7a907a..4fc80207b 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -10,8 +10,8 @@ #include "../Packets/Player/PacketPlayerEquipment.hpp" #include "../Packets/Player/PacketPlayerAttack.hpp" #include "../Packets/Player/PacketPlayerDynamicStats.hpp" -#include "../Packets/Player/PacketResurrect.hpp" -#include "../Packets/Player/PacketDie.hpp" +#include "../Packets/Player/PacketPlayerResurrect.hpp" +#include "../Packets/Player/PacketPlayerDeath.hpp" #include "../Packets/Player/PacketSendMyID.hpp" #include "../Packets/Player/PacketDisconnect.hpp" #include "../Packets/Player/PacketPlayerDrawState.hpp" @@ -51,9 +51,9 @@ 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); diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index 0da02b08f..ccf69376f 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -18,8 +18,8 @@ enum GameMessages ID_USER_MYID, ID_PLAYER_EQUIPMENT, ID_USER_DISCONNECTED, - ID_GAME_DIE, - ID_GAME_RESURRECT, + ID_PLAYER_DEATH, + ID_PLAYER_RESURRECT, ID_CHAT_MESSAGE, ID_PLAYER_DRAWSTATE, diff --git a/components/openmw-mp/Packets/Player/PacketDie.hpp b/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp similarity index 60% rename from components/openmw-mp/Packets/Player/PacketDie.hpp rename to components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp index 85c89e877..e6c481568 100644 --- a/components/openmw-mp/Packets/Player/PacketDie.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp @@ -2,8 +2,8 @@ // Created by koncord on 13.01.16. // -#ifndef OPENMW_PACKETDIE_HPP -#define OPENMW_PACKETDIE_HPP +#ifndef OPENMW_PACKETPLAYERDEATH_HPP +#define OPENMW_PACKETPLAYERDEATH_HPP #include @@ -11,12 +11,12 @@ namespace mwmp { - class PacketDie: public PlayerPacket + class PacketPlayerDeath: public PlayerPacket { public: - PacketDie(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) + PacketPlayerDeath(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) { - packetID = ID_GAME_DIE; + packetID = ID_PLAYER_DEATH; } void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send) { @@ -26,4 +26,4 @@ namespace mwmp }; } -#endif //OPENMW_PACKETDIE_HPP +#endif //OPENMW_PACKETPLAYERDEATH_HPP diff --git a/components/openmw-mp/Packets/Player/PacketResurrect.hpp b/components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp similarity index 58% rename from components/openmw-mp/Packets/Player/PacketResurrect.hpp rename to components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp index fa7810e44..c4f70123a 100644 --- a/components/openmw-mp/Packets/Player/PacketResurrect.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerResurrect.hpp @@ -2,8 +2,8 @@ // Created by koncord on 13.01.16. // -#ifndef OPENMW_PACKETRESURRECT_HPP -#define OPENMW_PACKETRESURRECT_HPP +#ifndef OPENMW_PACKETPLAYERRESURRECT_HPP +#define OPENMW_PACKETPLAYERRESURRECT_HPP #include @@ -11,12 +11,12 @@ namespace mwmp { - class PacketResurrect: public PlayerPacket + class PacketPlayerResurrect: public PlayerPacket { public: - PacketResurrect(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) + PacketPlayerResurrect(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) { - packetID = ID_GAME_RESURRECT; + packetID = ID_PLAYER_RESURRECT; } void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send) { @@ -27,4 +27,4 @@ namespace mwmp } -#endif //OPENMW_PACKETRESURRECT_HPP +#endif //OPENMW_PACKETPLAYERRESURRECT_HPP