Raised This Month: $51 Target: $400
 12% 

Old thread


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 10-14-2011 , 14:18   Re: SteamTools - SteamWorks for SourceMod
#181

@asherkin: When I look into the file from the first post it still says 7.2
Quote:
Asher Baker (asherkin) Sep 22 2011 SteamWorks for SourceMod. 0.7.2
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-14-2011 , 14:40   Re: SteamTools - SteamWorks for SourceMod
#182

Quote:
Originally Posted by Sillium View Post
@asherkin: When I look into the file from the first post it still says 7.2
Turn's out the Linux file didn't get updated, all sorted now.
__________________
asherkin is offline
jungjunghoo
Senior Member
Join Date: Sep 2009
Old 10-17-2011 , 06:07   Re: SteamTools - SteamWorks for SourceMod
#183

Quote:
Originally Posted by asherkin View Post
Turn's out the Linux file didn't get updated, all sorted now.
No update yet for linux?
jungjunghoo is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 10-17-2011 , 08:47   Re: SteamTools - SteamWorks for SourceMod
#184

That's what the "all sorted now" means. After this post the linux build was updated
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-20-2011 , 20:32   Re: SteamTools - SteamWorks for SourceMod
#185

0.8.0 has been released.

Changelog:
  • Added Steam_SetGameDescription native to replace the broken (and now-removed) SDKHooks functionality.
  • Added HTTP interface.

The HTTP interface is currently undocumented, but here is an example of the common functionality:
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <steamtools>

new HTTPRequestHandle:g_HTTPRequest INVALID_HTTP_HANDLE;

public 
Steam_FullyLoaded()
{
    
g_HTTPRequest Steam_CreateHTTPRequest(HTTPMethod_GET"http://dl.dropbox.com/u/6938670/avatar.png");
    
Steam_SendHTTPRequest(g_HTTPRequestOnDownloadComplete);
}

public 
OnGameFrame()
{
    static 
Float:lastPctDone 0.0;
    
    if (
g_HTTPRequest == INVALID_HTTP_HANDLE)
    {
        
lastPctDone 0.0;
        return;
    }
    
    new 
Float:pctDone Steam_GetHTTPDownloadProgressPercent(g_HTTPRequest);
    
    if (
pctDone <= lastPctDone)
        return;
    
    
PrintToServer("[SM] Download progress: %.2f%%"pctDone);
    
    
lastPctDone pctDone;
}

public 
OnDownloadComplete(HTTPRequestHandle:HTTPRequestbool:requestSuccessfulHTTPStatusCode:statusCode)
{
    if (
HTTPRequest != g_HTTPRequest || !requestSuccessful || statusCode != HTTPStatusCode_OK)
        return;
    
    
Steam_WriteHTTPResponseBody(g_HTTPRequest"avatar.png");
    
    
Steam_ReleaseHTTPRequest(g_HTTPRequest);
    
g_HTTPRequest INVALID_HTTP_HANDLE;

__________________
asherkin is offline
DaftMink
Member
Join Date: Apr 2009
Old 10-21-2011 , 02:16   Re: SteamTools - SteamWorks for SourceMod
#186

Installed the extension, inc and test plugin but sm_setgamedescription only prints back the usage.

Tested on my HL2DM standalone server.

Edit: also using the "map mapname" command crashed the server.

Last edited by DaftMink; 10-21-2011 at 02:29.
DaftMink is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 10-21-2011 , 02:42   Re: SteamTools - SteamWorks for SourceMod
#187

I can confirm this. If I deactivate steamtools I get no crash when changing the map using "map mapname". But I don't really change maps that way

Linux dmp attached.
Attached Files
File Type: 7z crash_20111021083859_1.7z (22.0 KB, 175 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de

Last edited by Sillium; 10-21-2011 at 02:43.
Sillium is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-21-2011 , 03:33   Re: SteamTools - SteamWorks for SourceMod
#188

Quote:
Originally Posted by asherkin View Post
Added HTTP interface.
Gave it a try already. Nice work.

I'll start off by saying that it works, and is probably the easiest way to download from HTTP using pawn. Here comes some nitpicking...

1. I would like to pass data from Steam_SendHTTPRequest to the callback. Something like this:
Code:
functag public HTTPRequestComplete(HTTPRequestHandle:HTTPRequest, bool:requestSuccessful, HTTPStatusCode:statusCode, any:data); native bool:Steam_SendHTTPRequest(HTTPRequestHandle:HTTPRequest, HTTPRequestComplete:callbackFunction, any:data);

2. Would your example leak if a request was successful but the status-code wasn't OK? (Steam_ReleaseHTTPRequest wouldn't be called)

3. Is there a reason you used HTTPRequestHandle and Steam_ReleaseHTTPRequest instead of SourceMod's Handle and CloseHandle?

4. Not sure if this matters much since it allows longer names on SM 1.4, but I'll mention it anyway:
Code:
// steamtools.inc(220) :
 warning 200: symbol "HTTPStatusCode_SwitchingProtoco" is truncated to 31 characters
// steamtools.inc(238) :
 warning 200: symbol "HTTPStatusCode_TemporaryRedirec" is truncated to 31 characters
// steamtools.inc(248) :
 warning 200: symbol "HTTPStatusCode_ProxyAuthRequire" is truncated to 31 characters
// steamtools.inc(253) :
 warning 200: symbol "HTTPStatusCode_PreconditionFail" is truncated to 31 characters
// steamtools.inc(254) :
 warning 200: symbol "HTTPStatusCode_RequestEntityToo" is truncated to 31 characters
// steamtools.inc(255) :
 warning 200: symbol "HTTPStatusCode_RequestURITooLon" is truncated to 31 characters
// steamtools.inc(256) :
 warning 200: symbol "HTTPStatusCode_UnsupportedMedia" is truncated to 31 characters
// steamtools.inc(257) :
 warning 200: symbol "HTTPStatusCode_RequestedRangeNo" is truncated to 31 characters
// steamtools.inc(258) :
 warning 200: symbol "HTTPStatusCode_ExpectationFaile" is truncated to 31 characters
// steamtools.inc(261) :
 warning 200: symbol "HTTPStatusCode_InternalServerEr" is truncated to 31 characters
// steamtools.inc(264) :
 warning 200: symbol "HTTPStatusCode_ServiceUnavailab" is truncated to 31 characters
// steamtools.inc(266) :
 warning 200: symbol "HTTPStatusCode_HTTPVersionNotSu" is truncated to 31 characters
// steamtools.inc(272) :
 warning 200: symbol "Steam_SetHTTPRequestNetworkActi" is truncated to 31 characters
// steamtools.inc(274) :
 warning 200: symbol "Steam_SetHTTPRequestGetOrPostPa" is truncated to 31 characters
// steamtools.inc(279) :
 warning 200: symbol "Steam_GetHTTPResponseHeaderValu" is truncated to 31 characters
// steamtools.inc(284) :
 warning 200: symbol "Steam_GetHTTPDownloadProgressPe" is truncated to 31 characters
If I compile using the 1.4 compiler, will it still be compatible with 1.3?

5. Are these requests proxied through Steam servers?
__________________

Last edited by GoD-Tony; 10-21-2011 at 03:40.
GoD-Tony is offline
duydangle
Senior Member
Join Date: May 2010
Old 10-21-2011 , 04:49   Re: SteamTools - SteamWorks for SourceMod
#189

Quote:
Originally Posted by GoD-Tony View Post
If I compile using the 1.4 compiler, will it still be compatible with 1.3?
VS Saxton Hale cannot be compiled under 1.3, and it works with 1.3.8 stable...
duydangle is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-21-2011 , 06:53   Re: SteamTools - SteamWorks for SourceMod
#190

Quote:
Originally Posted by GoD-Tony View Post
1. I would like to pass data from Steam_SendHTTPRequest to the callback. Something like this:
Code:
functag public HTTPRequestComplete(HTTPRequestHandle:HTTPRequest, bool:requestSuccessful, HTTPStatusCode:statusCode, any:data); native bool:Steam_SendHTTPRequest(HTTPRequestHandle:HTTPRequest, HTTPRequestComplete:callbackFunction, any:data);
I'm afraid ISteamHTTP only gives me a uint64 to do this with, and I'm already using all 64-bits to store required information in (the plugin and callback function).

Quote:
Originally Posted by GoD-Tony View Post
2. Would your example leak if a request was successful but the status-code wasn't OK? (Steam_ReleaseHTTPRequest wouldn't be called)
Yes.

Quote:
Originally Posted by GoD-Tony View Post
3. Is there a reason you used HTTPRequestHandle and Steam_ReleaseHTTPRequest instead of SourceMod's Handle and CloseHandle?
The "handle" is provided by the ISteamHTTP API, it's not a SourceMod handle.

Quote:
Originally Posted by GoD-Tony View Post
4. Not sure if this matters much since it allows longer names on SM 1.4, but I'll mention it anyway:
Code:
// steamtools.inc(220) :
 warning 200: symbol "HTTPStatusCode_SwitchingProtoco" is truncated to 31 characters
// steamtools.inc(238) :
 warning 200: symbol "HTTPStatusCode_TemporaryRedirec" is truncated to 31 characters
// steamtools.inc(248) :
 warning 200: symbol "HTTPStatusCode_ProxyAuthRequire" is truncated to 31 characters
// steamtools.inc(253) :
 warning 200: symbol "HTTPStatusCode_PreconditionFail" is truncated to 31 characters
// steamtools.inc(254) :
 warning 200: symbol "HTTPStatusCode_RequestEntityToo" is truncated to 31 characters
// steamtools.inc(255) :
 warning 200: symbol "HTTPStatusCode_RequestURITooLon" is truncated to 31 characters
// steamtools.inc(256) :
 warning 200: symbol "HTTPStatusCode_UnsupportedMedia" is truncated to 31 characters
// steamtools.inc(257) :
 warning 200: symbol "HTTPStatusCode_RequestedRangeNo" is truncated to 31 characters
// steamtools.inc(258) :
 warning 200: symbol "HTTPStatusCode_ExpectationFaile" is truncated to 31 characters
// steamtools.inc(261) :
 warning 200: symbol "HTTPStatusCode_InternalServerEr" is truncated to 31 characters
// steamtools.inc(264) :
 warning 200: symbol "HTTPStatusCode_ServiceUnavailab" is truncated to 31 characters
// steamtools.inc(266) :
 warning 200: symbol "HTTPStatusCode_HTTPVersionNotSu" is truncated to 31 characters
// steamtools.inc(272) :
 warning 200: symbol "Steam_SetHTTPRequestNetworkActi" is truncated to 31 characters
// steamtools.inc(274) :
 warning 200: symbol "Steam_SetHTTPRequestGetOrPostPa" is truncated to 31 characters
// steamtools.inc(279) :
 warning 200: symbol "Steam_GetHTTPResponseHeaderValu" is truncated to 31 characters
// steamtools.inc(284) :
 warning 200: symbol "Steam_GetHTTPDownloadProgressPe" is truncated to 31 characters
If I compile using the 1.4 compiler, will it still be compatible with 1.3?
Yes, but the 1.3 compiler has the same symbol length change in the newer snapshots as well.

Quote:
Originally Posted by GoD-Tony View Post
5. Are these requests proxied through Steam servers?
No.
__________________
asherkin is offline
Closed Thread



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 11:16.


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