Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/netserver.cc')
-rw-r--r--src/core/netserver.cc26
1 files changed, 19 insertions, 7 deletions
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;