[General] Rename ID_GAME_DIE and ID_GAME_RESURRECT

This commit is contained in:
David Cernat 2017-02-28 01:38:25 +02:00
parent 4aaa9ed694
commit 5c269a5f8d
9 changed files with 29 additions and 27 deletions

View file

@ -356,9 +356,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break; 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()); Player *killer = Players::getPlayer(player->getLastAttackerId());
@ -384,9 +384,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break; break;
} }
case ID_GAME_RESURRECT: case ID_PLAYER_RESURRECT:
{ {
DEBUG_PRINTF("ID_GAME_RESURRECT\n"); DEBUG_PRINTF("ID_PLAYER_RESURRECT\n");
//packetResurrect.Read(player); //packetResurrect.Read(player);
player->creatureStats.mDead = false; player->creatureStats.mDead = false;
myPacket->Send(player, true); myPacket->Send(player, true);

View file

@ -458,7 +458,7 @@ void StatsFunctions::Resurrect(unsigned short pid)
{ {
Player *player; Player *player;
GET_PLAYER(pid, 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 void StatsFunctions::SendBaseInfo(unsigned short pid) noexcept

View file

@ -556,7 +556,7 @@ void LocalPlayer::updateDeadState(bool forceUpdate)
{ {
creatureStats.mDead = true; creatureStats.mDead = true;
RakNet::BitStream bs; 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); getNetworking()->sendData(&bs);
isDead = true; isDead = true;
} }

View file

@ -454,9 +454,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
} }
break; 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) if (guid == myGuid)
{ {
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
@ -477,7 +477,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
} }
break; break;
} }
case ID_GAME_RESURRECT: case ID_PLAYER_RESURRECT:
{ {
if (guid == myGuid) if (guid == myGuid)
{ {

View file

@ -161,6 +161,8 @@ add_component_dir (openmw-mp
Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills
Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState
Packets/Player/PacketPlayerResurrect
Packets/Player/PacketGUIBoxes Packets/Player/PacketTime Packets/Player/PacketGUIBoxes Packets/Player/PacketTime
Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectScale Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectScale

View file

@ -10,8 +10,8 @@
#include "../Packets/Player/PacketPlayerEquipment.hpp" #include "../Packets/Player/PacketPlayerEquipment.hpp"
#include "../Packets/Player/PacketPlayerAttack.hpp" #include "../Packets/Player/PacketPlayerAttack.hpp"
#include "../Packets/Player/PacketPlayerDynamicStats.hpp" #include "../Packets/Player/PacketPlayerDynamicStats.hpp"
#include "../Packets/Player/PacketResurrect.hpp" #include "../Packets/Player/PacketPlayerResurrect.hpp"
#include "../Packets/Player/PacketDie.hpp" #include "../Packets/Player/PacketPlayerDeath.hpp"
#include "../Packets/Player/PacketSendMyID.hpp" #include "../Packets/Player/PacketSendMyID.hpp"
#include "../Packets/Player/PacketDisconnect.hpp" #include "../Packets/Player/PacketDisconnect.hpp"
#include "../Packets/Player/PacketPlayerDrawState.hpp" #include "../Packets/Player/PacketPlayerDrawState.hpp"
@ -51,9 +51,9 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p
AddPacket<PacketPlayerAttack>(&packets, peer); AddPacket<PacketPlayerAttack>(&packets, peer);
AddPacket<PacketPlayerDynamicStats>(&packets, peer); AddPacket<PacketPlayerDynamicStats>(&packets, peer);
AddPacket<PacketResurrect>(&packets, peer); AddPacket<PacketPlayerResurrect>(&packets, peer);
AddPacket<PacketDie>(&packets, peer); AddPacket<PacketPlayerDeath>(&packets, peer);
AddPacket<PacketPlayerDrawState>(&packets, peer); AddPacket<PacketPlayerDrawState>(&packets, peer);
AddPacket<PacketSendMyID>(&packets, peer); AddPacket<PacketSendMyID>(&packets, peer);
AddPacket<PacketDisconnect>(&packets, peer); AddPacket<PacketDisconnect>(&packets, peer);

View file

@ -18,8 +18,8 @@ enum GameMessages
ID_USER_MYID, ID_USER_MYID,
ID_PLAYER_EQUIPMENT, ID_PLAYER_EQUIPMENT,
ID_USER_DISCONNECTED, ID_USER_DISCONNECTED,
ID_GAME_DIE, ID_PLAYER_DEATH,
ID_GAME_RESURRECT, ID_PLAYER_RESURRECT,
ID_CHAT_MESSAGE, ID_CHAT_MESSAGE,
ID_PLAYER_DRAWSTATE, ID_PLAYER_DRAWSTATE,

View file

@ -2,8 +2,8 @@
// Created by koncord on 13.01.16. // Created by koncord on 13.01.16.
// //
#ifndef OPENMW_PACKETDIE_HPP #ifndef OPENMW_PACKETPLAYERDEATH_HPP
#define OPENMW_PACKETDIE_HPP #define OPENMW_PACKETPLAYERDEATH_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp> #include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
@ -11,12 +11,12 @@
namespace mwmp namespace mwmp
{ {
class PacketDie: public PlayerPacket class PacketPlayerDeath: public PlayerPacket
{ {
public: 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) void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{ {
@ -26,4 +26,4 @@ namespace mwmp
}; };
} }
#endif //OPENMW_PACKETDIE_HPP #endif //OPENMW_PACKETPLAYERDEATH_HPP

View file

@ -2,8 +2,8 @@
// Created by koncord on 13.01.16. // Created by koncord on 13.01.16.
// //
#ifndef OPENMW_PACKETRESURRECT_HPP #ifndef OPENMW_PACKETPLAYERRESURRECT_HPP
#define OPENMW_PACKETRESURRECT_HPP #define OPENMW_PACKETPLAYERRESURRECT_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp> #include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
@ -11,12 +11,12 @@
namespace mwmp namespace mwmp
{ {
class PacketResurrect: public PlayerPacket class PacketPlayerResurrect: public PlayerPacket
{ {
public: 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) void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{ {
@ -27,4 +27,4 @@ namespace mwmp
} }
#endif //OPENMW_PACKETRESURRECT_HPP #endif //OPENMW_PACKETPLAYERRESURRECT_HPP