changed player join/leave message

This commit is contained in:
2023-08-14 18:34:07 +02:00
parent 8f2a22762a
commit 7ab8c79fdf
3 changed files with 6 additions and 3 deletions

View File

@@ -22,6 +22,7 @@
#include "td/misc/Time.h"
#include "td/misc/Random.h"
#include "td/misc/Format.h"
#include <chrono>
@@ -96,6 +97,8 @@ void ServerConnexion::HandlePacket(const protocol::PlayerLoginPacket* packet) {
if (m_Player->GetName().empty() && !packet->GetPlayerName().empty()) {
m_Player->SetName(packet->GetPlayerName());
utils::LOG(utils::format("\t[%s] joined !", m_Player->GetName().c_str()));
protocol::PlayerJoinPacket joinPacket(m_ID, m_Player->GetName());
m_Server->BroadcastPacket(&joinPacket);