+ SteamNetConnectionStatusChangedCallback_t *info = (void *)msg->m_pubParam;
+ vg_info( " Connection status changed for %lu\n", info->m_hConn );
+
+ vg_info( " %s -> %s\n",
+ string_ESteamNetworkingConnectionState(info->m_eOldState),
+ string_ESteamNetworkingConnectionState(info->m_info.m_eState) );
+
+ if( info->m_info.m_eState==k_ESteamNetworkingConnectionState_Connecting )
+ {
+ new_client_connecting( info->m_hConn );
+ }
+}
+
+static void on_inet_auth( SteamNetworkingMessage_t *msg )
+{
+ if( get_connection_authsteamid( msg ) != k_connection_unauthorized )
+ {
+ vg_warn( "Already authorized this user but app ticket was sent"
+ " again (%u)\n", msg->m_conn );
+ return;
+ }
+
+ vg_low( "Attempting to verify user\n" );
+
+ if( msg->m_cbSize < sizeof(netmsg_auth) )
+ {
+ vg_error( "Malformed auth ticket, too small (%u)\n", msg->m_conn );
+ return;
+ }
+
+ netmsg_auth *auth = msg->m_pData;
+
+ if( msg->m_cbSize < sizeof(netmsg_auth)+auth->ticket_length ||
+ auth->ticket_length > 1024 )
+ {
+ vg_error( "Malformed auth ticket, ticket_length incorrect (%u)\n",
+ auth->ticket_length );
+ return;
+ }
+
+ u8 decrypted[1024];
+ u32 ticket_len = 1024;
+
+ int success = SteamEncryptedAppTicket_BDecryptTicket(
+ auth->ticket, auth->ticket_length, decrypted,
+ &ticket_len, steam_symetric_key,
+ k_nSteamEncryptedAppTicketSymmetricKeyLen );
+
+ if( !success )