From 02169591261cc09047117ddff961595717c8903a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 10 Jul 2011 20:19:14 +0000 Subject: Add player guid to the connection string . --- src/core/netserver.cc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/core/netserver.cc') diff --git a/src/core/netserver.cc b/src/core/netserver.cc index 12210a5..81bd303 100644 --- a/src/core/netserver.cc +++ b/src/core/netserver.cc @@ -298,12 +298,6 @@ NetClient * NetServer::client_connect(std::string const host, int const port) void NetServer::client_initialize(NetClient *client) { - // send welcome message - std::string welcome("^B"); - welcome.append(Cvar::sv_name->str()); - client->player()->send(welcome); - client->transmit(); - // send info types send_infotypes(client); client->transmit(); @@ -327,6 +321,18 @@ void NetServer::client_initialize(NetClient *client) // set client state to pending client->client_state = NetClient::Pending; + + // send welcome message + std::string welcome("^B"); + welcome.append(Cvar::sv_name->str()); + send_message(client, Message::Info, welcome); + + welcome.assign("^B"); + welcome.append(Cvar::sv_description->str()); + send_message(client, Message::Info, welcome); + + client->transmit(); + } // send updates to one client @@ -747,7 +753,13 @@ void NetServer::parse_incoming_message(NetClient *client, const std::string & me send_disconnect(client); } - // TODO add player uid to connect message + // player guid + std:: string guid; + if (msgstream >> guid) { + client->player()->guid().assign(guid); + } + + con_print << client->host() << ":" << client->port() << " connected with UID " << client->player()->guid().str() << std::endl; return; -- cgit v1.2.3