Raised This Month: $ Target: $400
 0% 

steamtools.inc missing __ext_SteamTools_SetNTVOptional()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-11-2012 , 14:49   steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #1

Basically, SteamTools doesn't mark any of its natives as optional. This is a problem for code that has SteamTools as an optional dependency... iirc it throws runtime errors.

Basically, we need this added to steamtools.inc:

PHP Code:
public __ext_SteamTools_SetNTVOptional()
{
    
MarkNativeAsOptional("Steam_IsVACEnabled");
    
MarkNativeAsOptional("Steam_GetPublicIP");
    
MarkNativeAsOptional("Steam_RequestGroupStatus");
    
MarkNativeAsOptional("Steam_RequestGameplayStats");
    
MarkNativeAsOptional("Steam_RequestServerReputation");
    
MarkNativeAsOptional("Steam_IsConnected");
    
MarkNativeAsOptional("Steam_SetRule");
    
MarkNativeAsOptional("Steam_ClearRules");
    
MarkNativeAsOptional("Steam_ForceHeartbeat");
    
MarkNativeAsOptional("Steam_SetGameDescription");
    
MarkNativeAsOptional("Steam_RequestStats");
    
MarkNativeAsOptional("Steam_GetStat");
    
MarkNativeAsOptional("Steam_GetStatFloat");
    
MarkNativeAsOptional("Steam_IsAchieved");
    
MarkNativeAsOptional("Steam_GetNumClientSubscriptions");
    
MarkNativeAsOptional("Steam_GetClientSubscription");
    
MarkNativeAsOptional("Steam_GetNumClientDLCs");
    
MarkNativeAsOptional("Steam_GetClientDLC");
    
MarkNativeAsOptional("Steam_GetCSteamIDForClient");
    
MarkNativeAsOptional("Steam_SetCustomSteamID");
    
MarkNativeAsOptional("Steam_GetCustomSteamID");
    
MarkNativeAsOptional("Steam_RenderedIDToCSteamID");
    
MarkNativeAsOptional("Steam_CSteamIDToRenderedID");
    
MarkNativeAsOptional("Steam_GroupIDToCSteamID");
    
MarkNativeAsOptional("Steam_CSteamIDToGroupID");

    
// HTTP functions
    
MarkNativeAsOptional("Steam_CreateHTTPRequest");
    
MarkNativeAsOptional("Steam_SetHTTPRequestNetworkActivityTimeout");
    
MarkNativeAsOptional("Steam_SetHTTPRequestHeaderValue");
    
MarkNativeAsOptional("Steam_SetHTTPRequestGetOrPostParameter");
    
MarkNativeAsOptional("Steam_SendHTTPRequest");
    
MarkNativeAsOptional("Steam_DeferHTTPRequest");
    
MarkNativeAsOptional("Steam_PrioritizeHTTPRequest");
    
MarkNativeAsOptional("Steam_GetHTTPResponseHeaderSize");
    
MarkNativeAsOptional("Steam_GetHTTPResponseHeaderValue");
    
MarkNativeAsOptional("Steam_GetHTTPResponseBodySize");
    
MarkNativeAsOptional("Steam_GetHTTPResponseBodyData");
    
MarkNativeAsOptional("Steam_WriteHTTPResponseBody");
    
MarkNativeAsOptional("Steam_ReleaseHTTPRequest");
    
MarkNativeAsOptional("Steam_GetHTTPDownloadProgressPercent");

    
// deprecated functions
    
MarkNativeAsOptional("Steam_AddMasterServer");
    
MarkNativeAsOptional("Steam_RemoveMasterServer");
    
MarkNativeAsOptional("Steam_GetNumMasterServers");
    
MarkNativeAsOptional("Steam_GetMasterServerAddress");

I've attached a copy of steamtools.inc with this included, but I haven't tested it.
Attached Files
File Type: inc steamtools.inc (11.8 KB, 496 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-11-2012 at 14:50.
Powerlord is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-11-2012 , 15:05   Re: steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #2

Plugins should be marking the natives they use themselves as optional.
__________________
asherkin is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-11-2012 , 15:17   Re: steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
Plugins should be marking the natives they use themselves as optional.
If it's an optional dependency, then you get fun things like this:

Code:
L 10/11/2012 - 09:44:56: [SM] Plugin encountered error 21: Native is not bound
L 10/11/2012 - 09:44:56: [SM] Native "Steam_SetGameDescription" reported: 
L 10/11/2012 - 09:44:56: [SM] Displaying call stack trace for plugin "saxtonhale.smx":
L 10/11/2012 - 09:44:56: [SM]   [0]  Line 553, C:\sourcemod\saxtonhale.sp::OnConfigsExecuted  ()
(it's marked as optional on line 332)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-11-2012 at 15:19.
Powerlord is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-11-2012 , 15:25   Re: steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #4

Marking it as optional inside the include isn't going to change that - the plugin shouldn't be calling it if the library isn't loaded.
__________________
asherkin is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 10-11-2012 , 15:46   Re: steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #5

So am I correct in thinking that a plugin that does NOT call a certain native does NOT need to mark it as optional?
In addition, a plugin will not error when marking a native as optional if the ext/plugin that owns the native isn't loaded, correct? Only when a plugin attempts to call the (not-loaded) native will an error be thrown.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 10-11-2012 at 15:47.
FlaminSarge is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-11-2012 , 16:21   Re: steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #6

Correct on both counts.
__________________
asherkin is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 10-11-2012 , 18:30   Re: steamtools.inc missing __ext_SteamTools_SetNTVOptional()
Reply With Quote #7

Nothing's wrong with the saxtonhale code, then, Powerlord. It should be properly tracking the steamtools library in the boolean named "steamtools".

Not really even a bug report. Mark as INVALID...?
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 10-11-2012 at 18:34.
FlaminSarge is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode