k_nSteamNetworkingSend_Reliable, NULL );
}
+static void network_disconnect(void){
+ SteamAPI_ISteamNetworkingSockets_CloseConnection(
+ hSteamNetworkingSockets, network_client.remote, 0, NULL, 0 );
+ network_client.remote = 0;
+
+ for( int i=0; i<vg_list_size(netplayers.list); i++ ){
+ netplayers.list[i].active = 0;
+ }
+}
+
static void on_server_connect_status( CallbackMsg_t *msg ){
SteamNetConnectionStatusChangedCallback_t *info = (void *)msg->m_pubParam;
vg_info( " Connection status changed for %lu\n", info->m_hConn );
k_ESteamNetConnectionEnd_Remote_Max ){
network_client.retries = 40;
}
-
- SteamAPI_ISteamNetworkingSockets_CloseConnection(
- hSteamNetworkingSockets, info->m_hConn, 0, NULL, 0 );
- network_client.remote = 0;
+ network_disconnect();
}
else if( info->m_info.m_eState ==
k_ESteamNetworkingConnectionState_ProblemDetectedLocally ){
- SteamAPI_ISteamNetworkingSockets_CloseConnection(
- hSteamNetworkingSockets, info->m_hConn, 0, NULL, 0 );
- network_client.remote = 0;
+ network_disconnect();
}
}
else{
const char *server_lon1 = "46.101.34.155:27402";
SteamAPI_SteamNetworkingIPAddr_ParseString( &remoteAddr, server_lon1 );
#endif
+ const char *server_lan = "192.168.1.32:27402";
+ SteamAPI_SteamNetworkingIPAddr_ParseString( &remoteAddr, server_lan );
char buf[256];
SteamAPI_SteamNetworkingIPAddr_ToString( &remoteAddr, buf, 256, 1 );