Skip to content
Permalink
Browse files

Add netcode_server_client_address function

This allows the server to check the IP address of a specified client.
  • Loading branch information...
stellarLuminant committed Feb 13, 2019
1 parent 9368da2 commit 892b0fa1b332bdc10aab9f06202e89cabcc0c440
Showing with 15 additions and 0 deletions.
  1. +13 −0 netcode.c
  2. +2 −0 netcode.h
@@ -4775,6 +4775,19 @@ uint64_t netcode_server_client_id( struct netcode_server_t * server, int client_
return server->client_id[client_index];
}

struct netcode_address_t * netcode_server_client_address( struct netcode_server_t * server, int client_index )
{
netcode_assert( server );

if (!server->running)
return 0;

if (client_index < 0 || client_index >= server->max_clients)
return 0;

return &server->client_address[client_index];
}

uint64_t netcode_server_next_packet_sequence( struct netcode_server_t * server, int client_index )
{
netcode_assert( client_index >= 0 );
@@ -214,6 +214,8 @@ int netcode_server_client_connected( struct netcode_server_t * server, int clien

uint64_t netcode_server_client_id( struct netcode_server_t * server, int client_index );

struct netcode_address_t * netcode_server_client_address( struct netcode_server_t * server, int client_index );

void netcode_server_disconnect_client( struct netcode_server_t * server, int client_index );

void netcode_server_disconnect_all_clients( struct netcode_server_t * server );

0 comments on commit 892b0fa

Please sign in to comment.
You can’t perform that action at this time.