Skip to content

Commit

Permalink
Added fix by @obstriegel. when kicking clients the full IP is exposed…
Browse files Browse the repository at this point in the history
…. Strip this information..
  • Loading branch information
Fohlen committed May 21, 2016
1 parent a98a7d1 commit ff8c286
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/engine/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,14 @@ void disconnect_client(int n, int reason)
if(!clients.inrange(n) || clients[n]->type!=ST_TCPIP) return;
enet_peer_disconnect(clients[n]->peer, reason);
server::clientdisconnect(n);
delclient(clients[n]);
const char *msg = disconnectreason(reason);
string s;
if(msg) formatstring(s, "client (%s) disconnected because: %s", clients[n]->hostname, msg);
else formatstring(s, "client (%s) disconnected", clients[n]->hostname);
if(msg) formatstring(s, "client (%s) disconnected because: %s", ((server::clientinfo *)(clients[n]->info))->name, msg);
else formatstring(s, "client (%s) disconnected", ((server::clientinfo *)(clients[n]->info))->name);
logoutf("%s", s);

delclient(clients[n]);

// remod
if(!(!ipbanmsg && reason == DISC_IPBAN)) server::sendservmsg(s);
}
Expand Down

0 comments on commit ff8c286

Please sign in to comment.