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

[ANY] SteamWorks


Post New Thread Reply   
 
Thread Tools Display Modes
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 02-02-2020 , 15:05   Re: [ANY] SteamWorks
Reply With Quote #731

I have a similar problem but i installed the linux version on a linux server, was working the other day and it just stopped.

Last edited by JLmelenchon; 02-02-2020 at 15:05.
JLmelenchon is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 02-04-2020 , 01:05   Re: [ANY] SteamWorks
Reply With Quote #732

Ok i had to do "sm exts load SteamWorks", why it does not load automatically when server launch ??? I have installed all files.

edit: solved with SteamWorks.autoload file

Last edited by JLmelenchon; 02-04-2020 at 01:52.
JLmelenchon is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-04-2020 , 03:25   Re: [ANY] SteamWorks
Reply With Quote #733

Extensions are loaded automatically when a plugin needs them, it won’t be loaded unless you have a plugin that wants to use it.
__________________
asherkin is offline
vn_lind
Member
Join Date: Jul 2017
Old 02-11-2020 , 08:23   Re: [ANY] SteamWorks
Reply With Quote #734

i tried the latest version on my css server but it crashes the server ,, any ideas what i have missed ?
vn_lind is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 02-11-2020 , 15:49   Re: [ANY] SteamWorks
Reply With Quote #735

Native SteamWorks_SetGameDescription doesn't work in L4D2, GameDescription doesn't changed
Vit_amin is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 02-16-2020 , 09:09   Re: [ANY] SteamWorks
Reply With Quote #736

So, I'm not being able to send a HTTP PUT Request.

Here's my code:

Code:
public Action Event_Round_End_Post(Handle event, const char[]name, bool dontBroadcast)
{
	char link[256];
	Format(link, sizeof(link), "%s/%s", portal_url, match_id);

	char body[512];
	Format(body, sizeof(body), "{\"results\": [{\"team\": \"2\", \"score\": %d}, {\"team\": \"3\", \"score\": %d}]}", GetTeamScore(CS_TEAM_T), GetTeamScore(CS_TEAM_CT));

	Handle req = SteamWorks_CreateHTTPRequest(k_EHTTPMethodPUT, link);
	SteamWorks_SetHTTPRequestHeaderValue(req, "Content-Type", "application/json");
	SteamWorks_SetHTTPRequestRawPostBody(req, "application/json", body, strlen(body)sizeof(body)); // found the mistake, should be strlen() instead of sizeof()
	SteamWorks_SetHTTPCallbacks(req, OnRequestComplete_RoundEnd);
	SteamWorks_SendHTTPRequest(req);
}

public int OnRequestComplete_RoundEnd(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode)
{
	Log("RoundEnd request complete.");

	int length;
	SteamWorks_GetHTTPResponseBodySize(hRequest, length);
	char[] body = new char[length];
	SteamWorks_GetHTTPResponseBodyData(hRequest, body, length);

	Log("Response:");
	Log(body);
}
Here's the response logged:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>
I have already tried to log the body and copy it to test using Postman, there it works fine. I have checked and the right header is just "Content-Type", "application/json", and my body is JSON format.

Any help is appreciated.

Last edited by joao7yt; 02-17-2020 at 16:10.
joao7yt is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 02-17-2020 , 16:07   Re: [ANY] SteamWorks
Reply With Quote #737

Quote:
Originally Posted by joao7yt View Post
So, I'm not being able to send a HTTP PUT Request.

Here's my code:

Code:
public Action Event_Round_End_Post(Handle event, const char[]name, bool dontBroadcast)
{
	char link[256];
	Format(link, sizeof(link), "%s/%s", portal_url, match_id);

	char body[512];
	Format(body, sizeof(body), "{\"results\": [{\"team\": \"2\", \"score\": %d}, {\"team\": \"3\", \"score\": %d}]}", GetTeamScore(CS_TEAM_T), GetTeamScore(CS_TEAM_CT));

	Handle req = SteamWorks_CreateHTTPRequest(k_EHTTPMethodPUT, link);
	SteamWorks_SetHTTPRequestHeaderValue(req, "Content-Type", "application/json");
	SteamWorks_SetHTTPRequestRawPostBody(req, "application/json", body, sizeof(body));
	SteamWorks_SetHTTPCallbacks(req, OnRequestComplete_RoundEnd);
	SteamWorks_SendHTTPRequest(req);
}

public int OnRequestComplete_RoundEnd(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode)
{
	Log("RoundEnd request complete.");

	int length;
	SteamWorks_GetHTTPResponseBodySize(hRequest, length);
	char[] body = new char[length];
	SteamWorks_GetHTTPResponseBodyData(hRequest, body, length);

	Log("Response:");
	Log(body);
}
Here's the response logged:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>
I have already tried to log the body and copy it to test using Postman, there it works fine. I have checked and the right header is just "Content-Type", "application/json", and my body is JSON format.

Any help is appreciated.
Found my mistake, I was using 'sizeof(body)' instead of 'strlen(body)'...
joao7yt is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 03-14-2020 , 01:38   Re: [ANY] SteamWorks
Reply With Quote #738

http://users.alliedmods.net/~kyles/builds/SteamWorks/ not working.
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-14-2020 , 11:33   Re: [ANY] SteamWorks
Reply With Quote #739

Quote:
Originally Posted by Mr.Freeman View Post
One of AM's servers is down which is what is causing that outage - it currently looks like it'll be at least the entire weekend.
__________________
asherkin is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 03-14-2020 , 15:19   Re: [ANY] SteamWorks
Reply With Quote #740

"There is no spoon"
Attached Files
File Type: so SteamWorks.ext.so (1.06 MB, 202 views)
File Type: dll SteamWorks.ext.dll (297.0 KB, 140 views)
__________________

Last edited by Kailo; 03-17-2020 at 20:34.
Kailo is offline
Reply


Thread Tools
Display Modes

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 08:21.


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