Skip to content
Permalink
Browse files

Merge pull request #81 from stellarLuminant/add-address-check

Add netcode_server_client_address function
  • Loading branch information...
gafferongames committed Feb 23, 2019
2 parents 9368da2 + e5f3fb2 commit 0f46ae2d74b16bf478e96702205eec68887be995
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 NULL;

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

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 0f46ae2

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