fix long standing grind bug
[carveJwlIkooP6JGAAIwe30JlM.git] / network.h
index b47f518dd514b5003923f523cb12d8fa9fc1866b..3d45ab85e6dce64344fa8094ce464fa2fd936f85 100644 (file)
--- a/network.h
+++ b/network.h
@@ -11,6 +11,8 @@
 #include "network_msg.h"
 #include "highscores.h"
 
+VG_STATIC int network_scores_updated = 0;
+
 /* 
  * Interface
  */
@@ -23,7 +25,7 @@ VG_STATIC void network_init(void);
 VG_STATIC void network_update(void);
 
 /* Call it at shutdown */
-VG_STATIC void network_end(void*_);
+VG_STATIC void network_end(void);
 
 /* 
  * Can buffer up a bunch of these by calling many times, they will be
@@ -90,11 +92,12 @@ VG_STATIC void request_auth_ticket(void)
     */
 
    vg_info( "Requesting new authorization ticket\n" );
-   steam_async *call = steam_new_async();
-   call->data = NULL;
+
+   vg_steam_async_call *call = vg_alloc_async_steam_api_call();
+   call->userdata = NULL;
    call->p_handler = on_auth_ticket_recieved;
-   call->id =  SteamAPI_ISteamUser_RequestEncryptedAppTicket( hSteamUser, 
-                                                              NULL, 0 );
+   call->id = 
+      SteamAPI_ISteamUser_RequestEncryptedAppTicket( hSteamUser, NULL, 0 );
 }
 
 VG_STATIC void send_auth_ticket(void)
@@ -172,7 +175,8 @@ VG_STATIC void send_nickname(void)
    nick.inetmsg_id = k_inetmsg_set_nickname;
 
    memset( nick.nickname, 0, 16 );
-   vg_strncpy( steam_username_at_startup, nick.nickname, 16 );
+   vg_strncpy( steam_username_at_startup, nick.nickname, 16,
+               k_strncpy_allow_cutoff );
    
    SteamAPI_ISteamNetworkingSockets_SendMessageToConnection(
          hSteamNetworkingSockets, cremote, &nick, sizeof(netmsg_set_nickname),
@@ -349,7 +353,7 @@ VG_STATIC void network_init(void)
    }
 }
 
-VG_STATIC void network_end(void*_)
+VG_STATIC void network_end(void)
 {
    /* TODO: Fire off any buffered highscores that need to be setn */
    if( cremote_state == k_ESteamNetworkingConnectionState_Connected ||
@@ -364,7 +368,7 @@ VG_STATIC void network_end(void*_)
 
 VG_STATIC void network_init(void){}
 VG_STATIC void network_update(void){}
-VG_STATIC void network_end(void*_){}
+VG_STATIC void network_end(void){}
 
 #endif /* SR_NETWORKED */
 #endif /* NETWORK_H */