From a69f294ef0f745336aec89abea66828452bb81ea Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 20 Jan 2017 10:30:50 +0200 Subject: [PATCH] Rename ID_GAME_CELL into ID_PLAYER_CELL_CHANGE --- apps/openmw-mp/Networking.cpp | 10 ++++---- .../Script/Functions/Translocations.cpp | 2 +- apps/openmw/mwmp/LocalPlayer.cpp | 4 ++-- apps/openmw/mwmp/Networking.cpp | 2 +- components/CMakeLists.txt | 12 +++++----- .../Controllers/PlayerPacketController.cpp | 4 ++-- components/openmw-mp/NetworkMessages.hpp | 3 ++- .../openmw-mp/Packets/Player/PacketCell.hpp | 24 ------------------- ...ketCell.cpp => PacketPlayerCellChange.cpp} | 8 +++---- .../Packets/Player/PacketPlayerCellChange.hpp | 24 +++++++++++++++++++ 10 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 components/openmw-mp/Packets/Player/PacketCell.hpp rename components/openmw-mp/Packets/Player/{PacketCell.cpp => PacketPlayerCellChange.cpp} (58%) create mode 100644 components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index e91a87ba6..6b8d2b2ff 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -148,9 +148,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) break; } - case ID_GAME_CELL: + case ID_PLAYER_CELL_CHANGE: { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_CELL from %s", + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_CELL_CHANGE from %s", player->Npc()->mName.c_str()); if (!player->CreatureStats()->mDead) @@ -318,7 +318,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) player->CreatureStats()->mDead = false; myPacket->Send(player, true); playerController->GetPacket(ID_GAME_POS)->RequestData(player->guid); - playerController->GetPacket(ID_GAME_CELL)->RequestData(player->guid); + playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->RequestData(player->guid); Script::Call(player->getId()); @@ -729,7 +729,7 @@ void Networking::newPlayer(RakNet::RakNetGUID guid) playerController->GetPacket(ID_GAME_BASE_INFO)->RequestData(guid); playerController->GetPacket(ID_GAME_DYNAMICSTATS)->RequestData(guid); playerController->GetPacket(ID_GAME_POS)->RequestData(guid); - playerController->GetPacket(ID_GAME_CELL)->RequestData(guid); + playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->RequestData(guid); playerController->GetPacket(ID_GAME_EQUIPMENT)->RequestData(guid); LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Sending info about other players to %lu", @@ -754,7 +754,7 @@ void Networking::newPlayer(RakNet::RakNetGUID guid) playerController->GetPacket(ID_GAME_ATTRIBUTE)->Send(pl->second, guid); playerController->GetPacket(ID_GAME_SKILL)->Send(pl->second, guid); playerController->GetPacket(ID_GAME_POS)->Send(pl->second, guid); - playerController->GetPacket(ID_GAME_CELL)->Send(pl->second, guid); + playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->Send(pl->second, guid); playerController->GetPacket(ID_GAME_EQUIPMENT)->Send(pl->second, guid); } } diff --git a/apps/openmw-mp/Script/Functions/Translocations.cpp b/apps/openmw-mp/Script/Functions/Translocations.cpp index f32c7be74..4e075890f 100644 --- a/apps/openmw-mp/Script/Functions/Translocations.cpp +++ b/apps/openmw-mp/Script/Functions/Translocations.cpp @@ -191,6 +191,6 @@ void TranslocationFunctions::SendCell(unsigned short pid) noexcept Player *player; GET_PLAYER(pid, player, ); - mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_CELL)->Send(player, false); + mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_CELL_CHANGE)->Send(player, false); } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 2dc379417..4876613a4 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -334,7 +334,7 @@ void LocalPlayer::updateCell(bool forceUpdate) if (cellChanged) { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_GAME_CELL to server"); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_PLAYER_CELL_CHANGE to server"); LOG_APPEND(Log::LOG_INFO, "- Moved from %s to %s", getCell()->getDescription().c_str(), @@ -347,7 +347,7 @@ void LocalPlayer::updateCell(bool forceUpdate) updatePosition(true); RakNet::BitStream bs; - getNetworking()->getPlayerPacket((RakNet::MessageID) ID_GAME_CELL)->Packet(&bs, this, true); + getNetworking()->getPlayerPacket((RakNet::MessageID) ID_PLAYER_CELL_CHANGE)->Packet(&bs, this, true); getNetworking()->sendData(&bs); // Also force an update to skills (to send all progress to skill increases) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 4f2bb1085..7459196a0 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -497,7 +497,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) } break; } - case ID_GAME_CELL: + case ID_PLAYER_CELL_CHANGE: { if (guid == myGuid) { diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 330125426..4eaef77c2 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -153,12 +153,12 @@ add_component_dir (openmw-mp Packets/BasePacket Packets/Player/PlayerPacket Packets/World/WorldPacket Packets/Player/PacketBaseInfo Packets/Player/PacketPosition Packets/Player/PacketEquipment - Packets/Player/PacketAttack Packets/Player/PacketDynamicStats Packets/Player/PacketCell - Packets/Player/PacketDrawState Packets/Player/PacketChatMessage Packets/Player/PacketCharGen - Packets/Player/PacketAttribute Packets/Player/PacketSkill Packets/Player/PacketLevel - Packets/Player/PacketHandshake Packets/Player/PacketGUIBoxes Packets/Player/PacketClass - Packets/Player/PacketTime Packets/Player/PacketInventory Packets/Player/PacketSpellbook - Packets/Player/PacketActiveSkills + Packets/Player/PacketAttack Packets/Player/PacketDynamicStats Packets/Player/PacketDrawState + Packets/Player/PacketChatMessage Packets/Player/PacketCharGen Packets/Player/PacketAttribute + Packets/Player/PacketSkill Packets/Player/PacketLevel Packets/Player/PacketHandshake + Packets/Player/PacketGUIBoxes Packets/Player/PacketClass Packets/Player/PacketTime + Packets/Player/PacketInventory Packets/Player/PacketSpellbook Packets/Player/PacketActiveSkills + Packets/Player/PacketPlayerCellChange Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectLock Packets/World/PacketObjectUnlock Packets/World/PacketObjectScale Packets/World/PacketObjectMove diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 5b877ad12..07aa24766 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -10,7 +10,6 @@ #include "../Packets/Player/PacketDynamicStats.hpp" #include "../Packets/Player/PacketResurrect.hpp" #include "../Packets/Player/PacketDie.hpp" -#include "../Packets/Player/PacketCell.hpp" #include "../Packets/Player/PacketSendMyID.hpp" #include "../Packets/Player/PacketDisconnect.hpp" #include "../Packets/Player/PacketDrawState.hpp" @@ -27,6 +26,7 @@ #include "../Packets/Player/PacketSpellbook.hpp" #include "../Packets/Player/PacketConsole.hpp" #include "../Packets/Player/PacketActiveSkills.hpp" +#include "../Packets/Player/PacketPlayerCellChange.hpp" #include "PlayerPacketController.hpp" @@ -41,7 +41,7 @@ inline void AddPacket(mwmp::PlayerPacketController::packets_t *packets, RakNet:: mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *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 6f3943def..6538c4c15 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -21,7 +21,6 @@ enum GameMessages ID_GAME_DIE, ID_GAME_RESURRECT, ID_CHAT_MESSAGE, - ID_GAME_CELL, ID_GAME_DRAWSTATE, ID_GAME_ATTRIBUTE, @@ -36,6 +35,8 @@ enum GameMessages ID_GAME_SPELLBOOK, ID_GAME_ACTIVESKILLS, + ID_PLAYER_CELL_CHANGE, + ID_OBJECT_PLACE, ID_OBJECT_DELETE, ID_OBJECT_LOCK, diff --git a/components/openmw-mp/Packets/Player/PacketCell.hpp b/components/openmw-mp/Packets/Player/PacketCell.hpp deleted file mode 100644 index b130202b4..000000000 --- a/components/openmw-mp/Packets/Player/PacketCell.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Created by koncord on 15.01.16. -// - -#ifndef OPENMW_PACKETCELL_HPP -#define OPENMW_PACKETCELL_HPP - - -#include - -namespace mwmp -{ - class PacketCell : public PlayerPacket - { - public: - PacketCell(RakNet::RakPeerInterface *peer); - - virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send); - }; -} - - - -#endif //OPENMW_PACKETCELL_HPP diff --git a/components/openmw-mp/Packets/Player/PacketCell.cpp b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp similarity index 58% rename from components/openmw-mp/Packets/Player/PacketCell.cpp rename to components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp index da8cebab1..0b9a3482c 100644 --- a/components/openmw-mp/Packets/Player/PacketCell.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp @@ -3,17 +3,17 @@ // #include -#include "PacketCell.hpp" +#include "PacketPlayerCellChange.hpp" -mwmp::PacketCell::PacketCell(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +mwmp::PacketPlayerCellChange::PacketPlayerCellChange(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) { - packetID = ID_GAME_CELL; + packetID = ID_PLAYER_CELL_CHANGE; priority = IMMEDIATE_PRIORITY; reliability = RELIABLE_ORDERED; } -void mwmp::PacketCell::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send) +void mwmp::PacketPlayerCellChange::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send) { PlayerPacket::Packet(bs, player, send); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp new file mode 100644 index 000000000..d0c6bda3b --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.hpp @@ -0,0 +1,24 @@ +// +// Created by koncord on 15.01.16. +// + +#ifndef OPENMW_PACKETPLAYERCELLCHANGE_HPP +#define OPENMW_PACKETPLAYERCELLCHANGE_HPP + + +#include + +namespace mwmp +{ + class PacketPlayerCellChange : public PlayerPacket + { + public: + PacketPlayerCellChange(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send); + }; +} + + + +#endif //OPENMW_PACKETPLAYERCELLCHANGE_HPP