1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 19:39:41 +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:
{
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);
player->CreatureStats()->mDead = true;
myPacket->Send(player, true);

View file

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

View file

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