1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 18:09:39 +00:00

Log player initialization on server

This commit is contained in:
David Cernat 2016-08-19 01:32:39 +03:00
parent 2337a0becb
commit cba01af683
3 changed files with 16 additions and 1 deletions

View file

@ -229,7 +229,9 @@ void Networking::Update(RakNet::Packet *packet)
case ID_GAME_DIE: case ID_GAME_DIE:
{ {
DEBUG_PRINTF("ID_GAME_DIE\n"); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_DIE from %s\n",
player->Npc()->mName.c_str());
//packetMainStats.Read(player); //packetMainStats.Read(player);
player->CreatureStats()->mDead = true; player->CreatureStats()->mDead = true;
myPacket->Send(player, true); myPacket->Send(player, true);

View file

@ -9,8 +9,14 @@ TSlots Players::slots;
void Players::DeletePlayer(RakNet::RakNetGUID id) void Players::DeletePlayer(RakNet::RakNetGUID id)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Deleting player with guid %s\n",
id.ToString());
if (players[id] != 0) if (players[id] != 0)
{ {
LOG_APPEND(Log::LOG_INFO, "- Emptying slot %i\n",
players[id]->GetID());
slots[players[id]->GetID()] = 0; slots[players[id]->GetID()] = 0;
delete players[id]; delete players[id];
players.erase(id); players.erase(id);
@ -20,12 +26,18 @@ void Players::DeletePlayer(RakNet::RakNetGUID id)
void Players::NewPlayer(RakNet::RakNetGUID id) void Players::NewPlayer(RakNet::RakNetGUID id)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Creating new player with guid %s\n",
id.ToString());
players[id] = new Player(id); players[id] = new Player(id);
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
if (slots[i] == 0) if (slots[i] == 0)
{ {
LOG_APPEND(Log::LOG_INFO, "- Storing in slot %i\n",
i);
slots[i] = players[id]; slots[i] = players[id];
slots[i]->SetID(i); slots[i]->SetID(i);
break; break;

View file

@ -14,6 +14,7 @@
#include <components/esm/loadnpc.hpp> #include <components/esm/loadnpc.hpp>
#include <components/esm/loadcell.hpp> #include <components/esm/loadcell.hpp>
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/Base/BasePlayer.hpp> #include <components/openmw-mp/Base/BasePlayer.hpp>
struct Player; struct Player;