Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gafferongames committed Aug 16, 2017
1 parent b924ca1 commit 4f57a9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions netcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ int netcode_read_connect_token( uint8_t * buffer, int buffer_length, struct netc

if ( connect_token->num_server_addresses <= 0 || connect_token->num_server_addresses > NETCODE_MAX_SERVERS_PER_CONNECT )
{
netcode_printf( NETCODE_LOG_LEVEL_ERROR, "error: read connect data has bad num server addresses (%d)\n", connect_token->num_server_addresses );
netcode_printf( NETCODE_LOG_LEVEL_ERROR, "error: read connect data has bad number of server addresses (%d)\n", connect_token->num_server_addresses );
return NETCODE_ERROR;
}

Expand Down Expand Up @@ -2981,9 +2981,8 @@ void netcode_client_update( struct netcode_client_t * client, double time )

if ( client->state > NETCODE_CLIENT_STATE_DISCONNECTED && client->state < NETCODE_CLIENT_STATE_CONNECTED )
{
uint64_t connect_token_expire_seconds = ( client->connect_token.expire_timestamp - client->connect_token.create_timestamp );

if ( client->connect_start_time + connect_token_expire_seconds <= client->time )
uint64_t connect_token_expire_seconds = ( client->connect_token.expire_timestamp - client->connect_token.create_timestamp );
if ( client->time - client->connect_start_time >= connect_token_expire_seconds )
{
netcode_printf( NETCODE_LOG_LEVEL_INFO, "client connect failed. connect token expired\n" );
netcode_client_disconnect_internal( client, NETCODE_CLIENT_STATE_CONNECT_TOKEN_EXPIRED, 0 );
Expand Down

0 comments on commit 4f57a9e

Please sign in to comment.