mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
added ip to (dis)connect debug messages
This commit is contained in:
parent
d0b55de9b2
commit
70d7cb773c
|
@ -92,7 +92,14 @@ int netserver_close(NETSERVER *s)
|
|||
int netserver_drop(NETSERVER *s, int client_id, const char *reason)
|
||||
{
|
||||
/* TODO: insert lots of checks here */
|
||||
dbg_msg("net_server", "client dropped. cid=%d reason=\"%s\"", client_id, reason);
|
||||
NETADDR addr;
|
||||
netserver_client_addr(s, client_id, &addr);
|
||||
|
||||
dbg_msg("net_server", "client dropped. cid=%d ip=%d.%d.%d.%d reason=\"%s\"",
|
||||
client_id,
|
||||
addr.ip[0], addr.ip[1], addr.ip[2], addr.ip[3],
|
||||
reason
|
||||
);
|
||||
conn_disconnect(&s->slots[client_id].conn, reason);
|
||||
|
||||
if(s->del_client)
|
||||
|
|
|
@ -623,6 +623,8 @@ static void server_send_rcon_line_authed(const char *line, void *user_data)
|
|||
static void server_process_client_packet(NETCHUNK *packet)
|
||||
{
|
||||
int cid = packet->client_id;
|
||||
NETADDR addr;
|
||||
|
||||
int sys;
|
||||
int msg = msg_unpack_start(packet->data, packet->data_size, &sys);
|
||||
|
||||
|
@ -686,7 +688,12 @@ static void server_process_client_packet(NETCHUNK *packet)
|
|||
{
|
||||
if(clients[cid].state == SRVCLIENT_STATE_CONNECTING)
|
||||
{
|
||||
dbg_msg("server", "player is ready. cid=%x", cid);
|
||||
netserver_client_addr(net, cid, &addr);
|
||||
|
||||
dbg_msg("server", "player is ready. cid=%x ip=%d.%d.%d.%d",
|
||||
cid,
|
||||
addr.ip[0], addr.ip[1], addr.ip[2], addr.ip[3]
|
||||
);
|
||||
clients[cid].state = SRVCLIENT_STATE_READY;
|
||||
mods_connected(cid);
|
||||
}
|
||||
|
@ -695,7 +702,12 @@ static void server_process_client_packet(NETCHUNK *packet)
|
|||
{
|
||||
if(clients[cid].state == SRVCLIENT_STATE_READY)
|
||||
{
|
||||
dbg_msg("server", "player as entered the game. cid=%x", cid);
|
||||
netserver_client_addr(net, cid, &addr);
|
||||
|
||||
dbg_msg("server", "player has entered the game. cid=%x ip=%d.%d.%d.%d",
|
||||
cid,
|
||||
addr.ip[0], addr.ip[1], addr.ip[2], addr.ip[3]
|
||||
);
|
||||
clients[cid].state = SRVCLIENT_STATE_INGAME;
|
||||
mods_client_enter(cid);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue