From 0a664bd0dd675b599b8a6e4ee9a9597fe71bd067 Mon Sep 17 00:00:00 2001 From: dean11 Date: Wed, 19 Feb 2014 11:02:44 +0100 Subject: [PATCH] GameServer - Added dynamic player alias and model names --- Code/Game/GameServer/Implementation/GameClient.cpp | 4 ++-- .../GameServer/Implementation/GameSession_General.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Code/Game/GameServer/Implementation/GameClient.cpp b/Code/Game/GameServer/Implementation/GameClient.cpp index 81066450..9c04007f 100644 --- a/Code/Game/GameServer/Implementation/GameClient.cpp +++ b/Code/Game/GameServer/Implementation/GameClient.cpp @@ -17,7 +17,7 @@ GameClient::GameClient(Utility::DynamicMemory::SmartPointerclient = nwClient; this->player = 0; isReady = false; - this->character = L"Unknown"; + this->character = L"crate_colonists.dan"; this->alias = L"Unknown"; this->secondsSinceLastResponse = 0.0f; } @@ -25,7 +25,7 @@ GameClient::~GameClient() { this->player = 0; this->isReady = false; - this->character = L"Unknown"; + this->character = L"crate_colonists.dan"; this->alias = L"Unknown"; this->secondsSinceLastResponse = 0.0f; } diff --git a/Code/Game/GameServer/Implementation/GameSession_General.cpp b/Code/Game/GameServer/Implementation/GameSession_General.cpp index 933807a4..30eabed2 100644 --- a/Code/Game/GameServer/Implementation/GameSession_General.cpp +++ b/Code/Game/GameServer/Implementation/GameSession_General.cpp @@ -165,7 +165,8 @@ void GameSession::ThreadEntry( ) IPlayerData* pl = this->gClients[k]->GetPlayer(); Protocol_ObjectCreatePlayer p( pl->GetPosition(), pl->GetRotation(), pl->GetScale(), pl->GetID(), true, this->gClients[k]->GetPlayer()->GetTeamID(), - /*nwClient->GetAlias()*/"", /*playerData->GetMesh()*/"char_white.dan"); + Utility::String::WStringToString(this->gClients[k]->GetAlias(), std::string()), + Utility::String::WStringToString(this->gClients[k]->GetCharacter(), std::string())); readyList[i]->GetClient()->Send(p); } } @@ -204,7 +205,8 @@ bool GameSession::Join(gClient gameClient) { Protocol_ObjectCreatePlayer oc( playerData->GetPosition(), playerData->GetRotation(), playerData->GetScale(), playerData->GetID(), true, playerData->GetTeamID(), - /*nwClient->GetAlias()*/"Unknown", /*playerData->GetMesh()*/"char_white.dan"); + Utility::String::WStringToString(gameClient->GetAlias(), std::string()), + Utility::String::WStringToString(gameClient->GetCharacter(), std::string())); nwClient->Send(oc); } @@ -217,7 +219,8 @@ bool GameSession::Join(gClient gameClient) IPlayerData* temp = this->gClients[i]->GetPlayer(); Protocol_ObjectCreatePlayer oc( temp->GetPosition(), temp->GetRotation(), temp->GetScale(), temp->GetID(), false, temp->GetTeamID(), - /*nwClient->GetAlias()*/"Unknown", /*playerData->GetMesh()*/"char_white.dan"); + Utility::String::WStringToString(this->gClients[i]->GetAlias(), std::string()), + Utility::String::WStringToString(this->gClients[i]->GetCharacter(), std::string())); nwClient->Send(oc); } }