AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [ANY] SteamWorks (https://forums.alliedmods.net/showthread.php?t=229556)

KyleS 06-13-2014 17:06

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Dr. Greg House (Post 2148592)
"SteamWorks_SetGameDescription" does not work on Linux and CSGO. No errors, just nothing. Extension loads fine as well.

When are you calling it? Before or after Steam loads? Do you have a test plugin?

Dr. Greg House 06-13-2014 19:14

Re: [ANY] SteamWorks
 
1 Attachment(s)
I'll prepare something for tomorrow.

EDIT:
Attached.

KyleS 06-13-2014 20:00

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Dr. Greg House (Post 2151301)
I'll prepare something for tomorrow.

EDIT:
Attached.

Okay, which version of the steamclient did you copy into your game directory?

Dr. Greg House 06-13-2014 21:12

Re: [ANY] SteamWorks
 
The one you attached in the first post, inside the bin directory.

KyleS 06-13-2014 21:28

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Dr. Greg House (Post 2151335)
The one you attached in the first post, inside the bin directory.

Which extension binary are you using?

Dr. Greg House 06-13-2014 21:56

Re: [ANY] SteamWorks
 
Code:

[07] SteamWorks Extension (1.1): Exposes SteamWorks functions to Developers
I think it is the attached one as well.

versatile_bfg 07-17-2014 20:29

Re: [ANY] SteamWorks
 
This might be a stupid question but steamtools has this native like this:
native bool:Steam_SendHTTPRequest(HTTPRequestHandle: HTTPRequest, HTTPRequestComplete:callbackFunction, any:contextData = 0);

But the steamworks one is like this:
native bool:SteamWorks_SendHTTPRequest(Handle:hReque st);

and what is the equivalent to native Steam_ReleaseHTTPRequest(HTTPRequestHandle:HT TPRequest);?

I'm just mucking around with updater and using steamworks instead of steamtools

PHP Code:

/* Extension Helper - SteamWorks */

Download_SteamWorks(const String:url[], const String:dest[])
{
    
decl String:sURL[MAX_URL_LENGTH];
    
PrefixURL(sURLsizeof(sURL), url);
    
    new 
Handle:hDLPack CreateDataPack();
    
WritePackString(hDLPackdest);

    new 
HTTPRequestHandle:hRequest SteamWorks_CreateHTTPRequest(HTTPMethod_GETsURL);
    
SteamWorks_SetHTTPRequestHeaderValue(hRequest"Pragma""no-cache");
    
SteamWorks_SetHTTPRequestHeaderValue(hRequest"Cache-Control""no-cache");
// need to change this to steamworks
    
Steam_SendHTTPRequest(hRequestOnSteamHTTPCompletehDLPack);
}

public 
OnSteamHTTPComplete(HTTPRequestHandle:HTTPRequestbool:requestSuccessfulHTTPStatusCode:statusCodeany:hDLPack)
{
    
decl String:sDest[PLATFORM_MAX_PATH];
    
ResetPack(hDLPack);
    
ReadPackString(hDLPacksDestsizeof(sDest));
    
CloseHandle(hDLPack);
    
    if (
requestSuccessful && statusCode == HTTPStatusCode_OK)
    {
        
SteamWorks_WriteHTTPResponseBodyToFile(HTTPRequestsDest);
        
DownloadEnded(true);
    }
    else
    {
        
decl String:sError[256];
        
FormatEx(sErrorsizeof(sError), "SteamTools error (status code %i). Request successful: %s"_:statusCoderequestSuccessful "True" "False");
        
DownloadEnded(falsesError);
    }
    
// need to change this to steamworks
    
Steam_ReleaseHTTPRequest(HTTPRequest);
}

// need to change this to steamworks if possible? 
/* Keep track of SteamTools load state.

new bool:g_bSteamLoaded;

public Steam_FullyLoaded()
{
    g_bSteamLoaded = true;
}

public Steam_Shutdown()
{
    g_bSteamLoaded = false;
} */ 


VoiDeD 07-18-2014 00:08

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by versatile_bfg (Post 2169596)
This might be a stupid question but steamtools has this native like this:
native bool:Steam_SendHTTPRequest(HTTPRequestHandle: HTTPRequest, HTTPRequestComplete:callbackFunction, any:contextData = 0);

But the steamworks one is like this:
native bool:SteamWorks_SendHTTPRequest(Handle:hReque st);

SteamWorks_SetHTTPCallbacks().

Quote:

Originally Posted by versatile_bfg (Post 2169596)
and what is the equivalent to native Steam_ReleaseHTTPRequest(HTTPRequestHandle:HT TPRequest);?

CloseHandle().

versatile_bfg 07-18-2014 00:36

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by VoiDeD (Post 2169657)
SteamWorks_SetHTTPCallbacks().

I know I'm being a little bit of a dick atm but how do I code it to work in this part?

PHP Code:

Download_SteamTools(const String:url[], const String:dest[])
{
    
decl String:sURL[MAX_URL_LENGTH];
    
PrefixURL(sURLsizeof(sURL), url);
    
    new 
Handle:hDLPack CreateDataPack();
    
WritePackString(hDLPackdest);

    new 
HTTPRequestHandle:hRequest SteamWorks_CreateHTTPRequest(HTTPMethod_GETsURL);
    
SteamWorks_SetHTTPRequestHeaderValue(hRequest"Pragma""no-cache");
    
SteamWorks_SetHTTPRequestHeaderValue(hRequest"Cache-Control""no-cache");
//    Steam_SendHTTPRequest(hRequest, OnSteamHTTPComplete, hDLPack); // part to be replaced
    
SteamWorks_SetHTTPCallbacks(Handle:hHandleSteamWorksHTTPRequestCompleted:fCompleted INVALID_FUNCTIONSteamWorksHTTPHeadersReceived:fHeaders INVALID_FUNCTIONSteamWorksHTTPDataReceived:fData INVALID_FUNCTIONHandle:hCalling INVALID_HANDLE);


I'm just lost on that one part.

VoiDeD 07-18-2014 15:18

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by versatile_bfg (Post 2169665)
I know I'm being a little bit of a dick atm but how do I code it to work in this part?

PHP Code:

Download_SteamTools(const String:url[], const String:dest[])
{
    
decl String:sURL[MAX_URL_LENGTH];
    
PrefixURL(sURLsizeof(sURL), url);
    
    new 
Handle:hDLPack CreateDataPack();
    
WritePackString(hDLPackdest);

    new 
HTTPRequestHandle:hRequest SteamWorks_CreateHTTPRequest(HTTPMethod_GETsURL);
    
SteamWorks_SetHTTPRequestHeaderValue(hRequest"Pragma""no-cache");
    
SteamWorks_SetHTTPRequestHeaderValue(hRequest"Cache-Control""no-cache");
//    Steam_SendHTTPRequest(hRequest, OnSteamHTTPComplete, hDLPack); // part to be replaced
    
SteamWorks_SetHTTPCallbacks(Handle:hHandleSteamWorksHTTPRequestCompleted:fCompleted INVALID_FUNCTIONSteamWorksHTTPHeadersReceived:fHeaders INVALID_FUNCTIONSteamWorksHTTPDataReceived:fData INVALID_FUNCTIONHandle:hCalling INVALID_HANDLE);


I'm just lost on that one part.

You set the callbacks you want, and then you send the request with SteamWorks_SendHTTPRequest.

PHP Code:

    new Handle:request SteamWorks_CreateHTTPRequestk_EHTTPMethodGETBACKPACK_TF_URL );

    
SteamWorks_SetHTTPRequestGetOrPostParameterrequest"key"key );
    
SteamWorks_SetHTTPRequestGetOrPostParameterrequest"format""vdf" );
    
SteamWorks_SetHTTPRequestGetOrPostParameterrequest"names""1" );

    
SteamWorks_SetHTTPCallbacksrequestOnBackpackTFComplete );

    
SteamWorks_SendHTTPRequestrequest );

...

public 
OnBackpackTFCompleteHandle:requestbool:bIOFailurebool:successfulEHTTPStatusCode:status )
{
    
// ...



Leonardo 07-19-2014 04:03

Re: [ANY] SteamWorks
 
The Ship support?
Code:

The procedure entry point SteamGameServer_GetHSteamPipe could not be located in the dynamic link library steam_api.dll.
EDIT:
if not, then how to deal with family sharing there?

psychonic 07-19-2014 05:32

Re: [ANY] SteamWorks
 
No. The Ship's steam_api is waaaaay too old. You'll have to just use the web api instead.

versatile_bfg 07-22-2014 06:48

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by VoiDeD (Post 2170064)
/snip

Thanks for this. I *think* understand how it works now. =)

Bubka3 07-24-2014 17:03

Re: [ANY] SteamWorks
 
What steps would be involved in compiling this for Windows?

Malak101 07-24-2014 18:01

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2173139)
What steps would be involved in compiling this for Windows?

Have you tried this? https://forums.alliedmods.net/showpo...&postcount=117

VoiDeD 07-24-2014 23:35

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2173139)
What steps would be involved in compiling this for Windows?

Load up Extension/msvc10/SteamWorks.sln in VS and press F5.

Dr. Greg House 07-25-2014 00:09

Re: [ANY] SteamWorks
 
I was wondering, is there a "friends"-interface? This might be particularly useful for team balance plugins that don't want to turn buddies into enemies. I mean the server should know at some point since there are friends-related events.

Bubka3 07-25-2014 00:40

Re: [ANY] SteamWorks
 
https://github.com/KyleSanderson/Ste...shooks.cpp#L79

Is this line supposed to take the token twice? I looked at the Steamworks SDK and it only has an argument for the token once?

asherkin 07-25-2014 04:33

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2173346)
https://github.com/KyleSanderson/Ste...shooks.cpp#L79

Is this line supposed to take the token twice? I looked at the Steamworks SDK and it only has an argument for the token once?

Yes, it's for an older version of the interface (that took a username and password rather than a token).

versatile_bfg 07-25-2014 09:04

Re: [ANY] SteamWorks
 
So if I wanted to compile this myself. What version of steamworks sdk should I be using? 1.30 not working for me because of the above difference.

Edit:

I am using the make file on ubuntu 14.4 - Testing with both SM1.5 + 1.6 & MM1.9 + 1.10 [steamworks 1.28]

Currently getting this error on mm1.9: [Prob the way I have set it up. Just unzipped the file actually]
Code:

/home/versatile/build/metamod-source-1.9-dev/core/ISmmPlugin.h:37:23: fatal error: interface.h: No such file or directory
 #include <interface.h>

But 1.10 moves past that and gets stuck on this:
Code:

CDetour/detours.cpp: In member function ‘bool CDetour::CreateDetour()’:
CDetour/detours.cpp:156:25: error: array subscript is above array bounds [-Werror=array-bounds]
  detour_restore.patch[i] = ((unsigned char *)detour_address)[i];
                        ^


Bubka3 07-25-2014 10:44

Re: [ANY] SteamWorks
 
Just make the same change I did. The SteamGameServer version of tf2, css, and nmrih matches the current steamworks sdk release.

versatile_bfg 07-25-2014 10:48

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2173564)
Just make the same change I did. The SteamGameServer version of tf2, css, and nmrih matches the current steamworks sdk release.

where can I get that? Also I want for csgo. =( All good fun though. Learning shit.

Bubka3 07-25-2014 10:50

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by versatile_bfg (Post 2173567)
where can I get that? Also I want for csgo. =( All good fun though. Learning shit.

If you want I can compile this for you on Windows. Otherwise you you should start at the SM Wiki. Theres a very cool article on compiling extensions.

versatile_bfg 07-27-2014 22:05

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2173569)
If you want I can compile this for you on Windows. Otherwise you you should start at the SM Wiki. Theres a very cool article on compiling extensions.

If you could that would be great. =)
I just need to get the latest one for Linux as well. Which is what I'm trying to build.

Is this the wiki link you are talking about? https://wiki.alliedmods.net/Writing_extensions

Bubka3 07-28-2014 05:20

Re: [ANY] SteamWorks
 
That's the correct link but I don't know how to compile for Linux. Fortunately, Linux is supported by the author so you should just use the attached build in the first post! :)

versatile_bfg 07-28-2014 05:43

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2174962)
That's the correct link but I don't know how to compile for Linux. Fortunately, Linux is supported by the author so you should just use the attached build in the first post! :)

Yeah the one on the first post is missing the latest commit on github. You able to upload the windows one for me? =)

Bubka3 07-28-2014 18:35

Re: [ANY] SteamWorks
 
1 Attachment(s)
Quote:

Originally Posted by versatile_bfg (Post 2174970)
Yeah the one on the first post is missing the latest commit on github. You able to upload the windows one for me? =)

Here you go.

Built from Github and Steamworks SDK 1.3.0.

versatile_bfg 07-28-2014 21:34

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2175395)
Here you go.

Built from Github and Steamworks SDK 1.3.0.

Thanks for this. =D

---
Edit:
Finally got it to compile on linux. But its only 78KB? Loads up fine on server though.

SephirothSG 08-04-2014 21:31

Re: [ANY] SteamWorks
 
Small question, why would this plugin
PHP Code:

#include <sourcemod>
#include <SteamWorks>

public SteamWorks_OnValidateClient(ownerauthidauthid)
{
    if (
ownerauthid && ownerauthid != authid)
    {
        
decl String:SteamID[32];
        
Format(SteamID32"STEAM_0:%d:%d", (authid 1), (authid >> 1));
        new 
client GetIndexBySteamID(SteamID);
        if (
client != -1)
        {
            
KickClient(client"Family Sharing users are not allowed to join this server");
        }
    }
}

GetIndexBySteamID(const String:SteamID[])
{
    
decl String:AuthStringToCompareWith[32];
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientConnected(i) && GetClientAuthString(iAuthStringToCompareWithsizeof(AuthStringToCompareWith)) && StrEqual(AuthStringToCompareWithSteamID))
        {
            return 
i;
        }
    }
    return -
1;


Not be blocking family sharing accounts on css?

code from this post

KyleS 08-04-2014 22:28

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by SephirothSG (Post 2179024)
Small question, why would this plugin
PHP Code:

#include <sourcemod>
#include <SteamWorks>

public SteamWorks_OnValidateClient(ownerauthidauthid)
{
    if (
ownerauthid && ownerauthid != authid)
    {
        
decl String:SteamID[32];
        
Format(SteamID32"STEAM_0:%d:%d", (authid 1), (authid >> 1));
        new 
client GetIndexBySteamID(SteamID);
        if (
client != -1)
        {
            
KickClient(client"Family Sharing users are not allowed to join this server");
        }
    }
}

GetIndexBySteamID(const String:SteamID[])
{
    
decl String:AuthStringToCompareWith[32];
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientConnected(i) && GetClientAuthString(iAuthStringToCompareWithsizeof(AuthStringToCompareWith)) && StrEqual(AuthStringToCompareWithSteamID))
        {
            return 
i;
        }
    }
    return -
1;


Not be blocking family sharing accounts on css?

code from this post

There's no guarantee there's a client connected with that authid, especially one that's verified.

Dr. McKay 08-04-2014 23:00

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by SephirothSG (Post 2179024)
-snip-

Turning in into an auth string for comparison is unnecessary and somewhat expensive, just use GetSteamAccountID and compare. Passing false as the second parameter to GetSteamAccountID should probably allow it to find unauthenticated users with that auth ID.

Bubka3 08-09-2014 08:26

Re: [ANY] SteamWorks
 
Can Steamworks expose some natives to get group status of clients?

psychonic 08-09-2014 09:10

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2181481)
Can Steamworks expose some natives to get group status of clients?

The Steamworks API for game servers that this extension uses only has access to a flawed check for that (the same one that SteamTools uses).

It doesn't actually check group membership, but rather if a user has a "relationship" with a group, which includes declining invitation to it.

Bubka3 08-09-2014 09:13

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by psychonic (Post 2181500)
The Steamworks API for game servers that this extension uses only has access to a flawed check for that (the same one that SteamTools uses).

It doesn't actually check group membership, but rather if a user has a "relationship" with a group, which includes declining invitation to it.

Well the check is the lesser of two evils. You could use HTTP + XML but that will get messy quick.

psychonic 08-09-2014 09:40

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2181503)
Well the check is the lesser of two evils. You could use HTTP + XML but that will get messy quick.

It's not an option if you want accurate results. Also, no XML is needed if you use the Steam Web API.

You can get a list of a user's group in keyvalues format pretty easily,
https://api.steampowered.com/ISteamUser/GetUserGroupList/v1?steamid=<steamid64>&key=<key>&format=vdf

Bubka3 08-09-2014 11:28

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by psychonic (Post 2181514)
It's not an option if you want accurate results. Also, no XML is needed if you use the Steam Web API.

You can get a list of a user's group in keyvalues format pretty easily,
https://api.steampowered.com/ISteamUser/GetUserGroupList/v1?steamid=<steamid64>&key=<key>&format=vdf

If the check is so bad then why did you (make a plugin that) use it? Especially on a plugin which grants admin permissions. I'm referring to this.

With that API, what type of rate limiting is going on?

psychonic 08-09-2014 12:06

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2181568)
If the check is so bad then why did you (make a plugin that) use it? Especially on a plugin which grants admin permissions. I'm referring to this.

I made that plugin long before the issues were known and haven't supported it in years anyway.

Quote:

Originally Posted by Bubka3 (Post 2181568)
With that API, what type of rate limiting is going on?

You would have to ask Valve.

rswallen 08-09-2014 12:23

Re: [ANY] SteamWorks
 
Quote:

Originally Posted by Bubka3 (Post 2181568)
With that API, what type of rate limiting is going on?

If you're referring to the Steam Web APIs, "one hundred thousand (100,000) calls to the Steam Web API per day"

sheo 08-09-2014 13:58

Re: [ANY] SteamWorks
 
Steam Web API does not work with private profiles, so this is not a solution

Bubka3 08-19-2014 00:39

Re: [ANY] SteamWorks
 
So it seems at this point I rather have the flawed check.


All times are GMT -4. The time now is 08:41.

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