@@ -1291,9 +1291,6 @@ void CNetMsgScriptHelper::InitPostVM()
12911291{
12921292 ScriptVariant_t hHooks;
12931293 g_pScriptVM->CreateTable ( hHooks );
1294- #if _DEBUG
1295- g_pScriptVM->SetValue ( NULL , " __NetMsg_hooks" , hHooks );
1296- #endif
12971294 m_Hooks = (HSCRIPT)hHooks;
12981295}
12991296
@@ -1356,13 +1353,13 @@ void CNetMsgScriptHelper::ReceiveMessage( bf_read &msg )
13561353 if ( g_pScriptVM->ExecuteFunction ( hfn, NULL , 0 , NULL , NULL , true ) == SCRIPT_ERROR )
13571354#endif
13581355 {
1359- DevWarning ( 2 , DLL_LOC_STR " NetMsg: invalid callback [%d]\n " , hash );
1356+ DevWarning ( 1 , DLL_LOC_STR " NetMsg: invalid callback [%d]\n " , hash );
13601357 }
13611358 g_pScriptVM->ReleaseValue ( hfn );
13621359 }
13631360 else
13641361 {
1365- DevWarning ( 2 , DLL_LOC_STR " NetMsg hook not found [%d]\n " , hash );
1362+ DevWarning ( 1 , DLL_LOC_STR " NetMsg hook not found [%d]\n " , hash );
13661363 }
13671364}
13681365
@@ -1416,9 +1413,13 @@ void CNetMsgScriptHelper::Send()
14161413void CNetMsgScriptHelper::Receive ( const char *msg, HSCRIPT func )
14171414{
14181415 if ( func )
1416+ {
14191417 g_pScriptVM->SetValue ( m_Hooks, int ( HashStringCaseless (msg) ), func );
1418+ }
14201419 else
1420+ {
14211421 g_pScriptVM->ClearValue ( m_Hooks, int ( HashStringCaseless (msg) ) );
1422+ }
14221423}
14231424
14241425#ifdef GAME_DLL
@@ -3017,6 +3018,23 @@ END_SCRIPTDESC();
30173018class CScriptSteamAPI
30183019{
30193020public:
3021+ const char *GetSteam2ID ()
3022+ {
3023+ if ( !steamapicontext || !steamapicontext->SteamUser () )
3024+ return NULL ;
3025+
3026+ CSteamID id = steamapicontext->SteamUser ()->GetSteamID ();
3027+
3028+ uint32 accountID = id.GetAccountID ();
3029+ uint32 steamInstanceID = 0 ;
3030+ uint32 high32bits = accountID % 2 ;
3031+ uint32 low32bits = accountID / 2 ;
3032+
3033+ static char ret[48 ];
3034+ V_snprintf ( ret, sizeof (ret), " STEAM_%u:%u:%u" , steamInstanceID, high32bits, low32bits );
3035+ return ret;
3036+ }
3037+
30203038 int GetSecondsSinceComputerActive ()
30213039 {
30223040 if ( !steamapicontext || !steamapicontext->SteamUtils () )
@@ -3032,7 +3050,7 @@ class CScriptSteamAPI
30323050
30333051 return steamapicontext->SteamUtils ()->GetCurrentBatteryPower ();
30343052 }
3035-
3053+ # if 0
30363054 const char *GetIPCountry()
30373055 {
30383056 if ( !steamapicontext || !steamapicontext->SteamUtils() )
@@ -3047,7 +3065,7 @@ class CScriptSteamAPI
30473065
30483066 return ret;
30493067 }
3050-
3068+ # endif
30513069 const char *GetCurrentGameLanguage ()
30523070 {
30533071 if ( !steamapicontext || !steamapicontext->SteamApps () )
@@ -3066,6 +3084,7 @@ class CScriptSteamAPI
30663084} g_ScriptSteamAPI;
30673085
30683086BEGIN_SCRIPTDESC_ROOT_NAMED ( CScriptSteamAPI, " CSteamAPI" , SCRIPT_SINGLETON " " )
3087+ DEFINE_SCRIPTFUNC( GetSteam2ID, " " )
30693088 // DEFINE_SCRIPTFUNC( IsVACBanned, "" )
30703089 DEFINE_SCRIPTFUNC( GetSecondsSinceComputerActive, " Returns the number of seconds since the user last moved the mouse." )
30713090 DEFINE_SCRIPTFUNC( GetCurrentBatteryPower, " Return the amount of battery power left in the current system in % [0..100], 255 for being on AC power" )
0 commit comments