Giter Club home page Giter Club logo

steamcore's Introduction

SteamCore

If you see a bug, want to add a new feature or have a question, you should create an issue here.

Sourcemod natives that extends the functionality of Pawn to interact with common Steam functions.

This is not an actual plugin, it's a library for other plugins to work and it doesn't interact directly with players in servers.

Table of Contents

Server Owners

Prerequisites

SteamCore makes use of an account to send requests to Steam server as a normal user would do. To get more of this plugin, it is better to use a full steam account, read this to check the limitations of a limited account.

The Steam account must have Steam Guard configured to send e-mail codes, so if you don't have it enabled, enable it by choosing "Get Steam Guard codes by email" in this page.

I recommend you not using your personal account for this

Install

Requirements

To install SteamCore unpack the latest release in the Sourcemod directory.

To add the plugins and extensions restart the server.

Setting Account

After you have installed SteamCore you need to configure the Steam account's credentials, to do so open sourcemod/configs/steamcore_login.cfg and input the accounts credentials in the file, an example would be this:

"steamcore_login"
{
	"username"	"testaccountname789"
	"password"	"arandompassword123"
}

Use alphanumeric user/pass, max length: 32 characters

Now to login to Steam servers you need join the server as a player and from console or chat (i recommend console) input the next command:

sm_steamcore_send_code or from chat /steamcore_send_code

This will send a Steam Guard code to the configured e-mail of the account. Copy the code and input the next command with the code:

sm_steamcore_input_code YOURCODE

If everything went right, you should have now completed the setup process, if not use the command sm_steamcore_last_error to check the last error in the errors table.

Cvars

  • sc_debug Toggles debug mode (Default = 0).

Turning debug mode on will write a lot of data in /sourcemod/logs/steamcore_debug_DATE.cfg only enable it if you are having problems othewise it will only put extra load, huge files and console spam on your server. If you need to enable it check the errors and then disable it. Never let it on all the time.

Download

Compiled versions: steamcore.zip.

Scripts Writers

Read the include file. You only need the SteamCore include file to compile your plugin.

Error Codes Table

0x00(00): General: No error, request successful.
0x01(01): General: Logged out, plugin will attempt to login.
0x02(02): General: Connection timed out.
0x03(03): General: Steam servers down.

0x04(04): Login Error: Failed http RSA Key request.
0x05(05): Login Error: RSA Key response failed, unknown reason, probably server side.
0x06(06): Login Error: Failed htpps login request.
0x07(07): Login Error: Incorrect login information.
0x08(08): Login Error: Failed http token request.
0x09(09): Login Error: Invalid session token. Incorrect cookie?.
0x0A(10): Login Error: Requires e-mail confirmation.
0x0B(11): Login Error: Steam Guard disabled, only accounts with mail confirmation allowed.
0x0C(12): Login Error: Requires captcha, wait a few minutes then try again.

0x10(16): Announcement Error: Failed http group announcement request.
0x11(17): Announcement Error: (LEGACY, no longer used)
0x12(18): Announcement Error: Form error on request or too many consecutive requests.

// Invitee: Who receives the invite.
0x20(32): Invite Error: Failed http group invite request.
0x21(33): Invite Error: Incorrect invitee or another error.
0x22(34): Invite Error: Incorrect Group ID or missing data.
0x23(35): Invite Error: (LEGACY, no longer used)
0x24(36): Invite Error: SteamCore account is not a member of the group or does not have permissions to invite.
0x25(37): Invite Error: Limited account. Only full Steam accounts can send Steam group invites
0x26(38): Invite Error: Unkown error. Check https://github.com/polvora/SteamCore/issues/6
0x27(39): Invite Error: Invitee has already received an invite or is already on the group.
0x28(40): Invite Error: Invitee must be friends with the SteamCore account to receive an invite.

0x30(48): Friend Add Error: Failed http friend request.
0x31(49): Friend Add Error: Invited account ignored the friend request.
0x32(50): Friend Add Error: Invited account has blocked the SteamCore account.
0x33(51): Friend Add Error: SteamCore account is limited. Only full Steam accounts can send friend requests.
0x34(52): Friend Remove Error: Failed http request.

0x40(64): Chat Connect Error: Failed http chat connect request.
0x41(65): Chat Connect Error: Incorrect chat connect response.
0x42(66): Chat Connect Error: Chat not allowed for limited accounts. Only full Steam accounts can use chat.
0x43(67): Chat Disconnect Error: Failed http poll request.
0x44(68): Chat Disconnect Error: Message poller timed out, plugin will automatically reconnect.
0x45(69): Chat Send Message Error: Failed http send message request.
0x46(70): Chat Send Message Error: Diconnected from chat, plugin will automatically reconnect.

Changelog

[04/02/2015] v1.0

  • Initial Release.

[29/03/2015] v1.1

  • Announcement Module: Fixed critical bug that made announcements stopped working after a few calls.
  • Added a timeout error code.
  • Added the native isSteamCoreBusy to check if there is a request being executed.
  • Eliminated the retry function in all requests.
  • Announcement Module: Changed steamGroupAnnoucement function name to SteamGroupAnnouncement for convention purposes.

[13/04/2015] v1.2

  • Added the native SteamGroupInvite, sending group invites is only available to non-limited accounts (accounts that have purshased something on the Steam store).

[03/05/2015] v1.3

  • Added compatibility with most source games, instead of only TF2.
  • SteamTools extension is no longer needed. Instead, SteamWorks is now required.

[08/05/2015] v1.4

  • Invite Module: Permissions errors and Limited account error are now differentiated.
  • Invite Module: Fixed the unknown errors being called as success and added an errorCode for them (0x26).

[18/05/2015] v1.5

  • Fixed critical bug that prevented logging in on Steam.

[12/06/2015] v1.5.1

  • Increased timeout time for requests to 10 seconds (previously 5 seconds).

[17/08/2015] v1.6

  • Fixed critical bug that prevented logging in on Steam.

[02/02/2017] v1.7

  • Announcement Module: Fixed critical bug caused by outdated method to post announcements.
  • Fixed critical bug that crashed the plugin when making a request while plugin is busy.

[15/03/2017] v1.7.1

  • Added minor debug text.

[03/08/2017] v1.8

  • Changed the way developers have to handle busy requests.
  • Solved a bug when a request was made while logging on map change.

[03/08/2017] v1.9

  • Adds natives to Add/Remove friends.

[21/08/2017] v2.0

  • Complete restructuring of the code.
  • Debug now logs to file.
  • Now plugin can handle multiple requests at the same time. No more busy requests.
  • Steam account credentials storage is now safer.
  • Steam Guard login is possible and mandatory.
  • Now plugin only needs to login when server restarts. No more random logouts.
  • Added a Steam chat module with 4 new natives to connect/disconnect from chat and send/receive messages.

[24/08/2017] v2.1

  • Added cvar sm_steamcore_last_error.
  • Added some helper stocks for scripts writers.
  • Added OnChatRelationshipChange() forward.

steamcore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

steamcore's Issues

Exception Reported: Invalid function id (FFFFFFFF)

L 07/10/2017 - 14:52:21: [SM] Blaming: steamcore.smx
L 07/10/2017 - 14:52:21: [SM] Call stack trace:
L 07/10/2017 - 14:52:21: [SM]   [0] RemoveFromForward
L 07/10/2017 - 14:52:21: [SM]   [1] Line 298, steamcore.sp::tmrBusyCallback
L 07/10/2017 - 14:52:21: [SM] Exception reported: Invalid function id (FFFFFFFF)
L 07/10/2017 - 14:52:21: [SM] Blaming: steamcore.smx
L 07/10/2017 - 14:52:21: [SM] Call stack trace:
L 07/10/2017 - 14:52:21: [SM]   [0] RemoveFromForward
L 07/10/2017 - 14:52:21: [SM]   [1] Line 298, steamcore.sp::tmrBusyCallback

What can be the problem here?

SteamCore max acc i can use

how many acc can i use on to login with
"steamcore_login"
{
"username" "testaccountname789"
"password" "arandompassword123"
}

Log not work

Hello !

I installed the new version of the plugin.

But debug mode does not work ,logs are not written.

Can you fix it?

Thanks

account logged out since valve forced https

hi,

since valve forced all requests to https the steamcore-account keeps logged out...
I've changed all urls to use https (rsa-key and friendsajax) and recompiled it, but still logged out.

any fix would be nice (-:

SteamTools Version

I read a reply saying that a mix of SteamTools and Steamworks can result in the other extension eating up the callback and someone of the users are using a mix of both. So, is it possible for you to create another branch that utilizes SteamTools instead? It won't be a big deal if you can't.

error

Group invite request failed (1). Status Code: 500
L 10/08/2017 - 13:12:25: [steam/steamcore.smx]
Preparing request to:
http://steamcommunity.com/actions/GroupInvite...
L 10/08/2017 - 13:12:25: [steam/steamcore.smx]
Invitee community ID:
STEAM_ID_STOP_IGNORING_RETVALS
L 10/08/2017 - 13:12:25: [steam/steamcore.smx]
Group community ID:
103582791435260626
L 10/08/2017 - 13:12:25: [steam/steamcore.smx]
Verifying login...
L 10/08/2017 - 13:12:25: [steam/steamcore.smx]
Logged in, executing task....
L 10/08/2017 - 13:12:25: [steam/steamcore.smx]
Group invite request failed (1). Status Code: 500

Steam Core is busy

Hi !

I use this Plugin but I have a recurring error.
So I try with this version of the Plugin

And it gives me logs like that:

============================================================================

Logging in to keep login alive...

============================================================================

Obtaining RSA Key from steamcommunity.com/login/getrsakey...

And I have no more

Thanks !

IsSteamFriend() Check

I couldn't find it in SteamWorks so is it possible to add an IsSteamFriend() check?

Help with invites

The group invite has been sent.

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?><response><results><![CDATA[OK]]></results><groupId><![CDATA[103582791439566221]]></groupId></response>co�

But the invite never shows up. Any help would be great!

Steam Will Update Group Invites.

Since the next steam update will add the following, I was wondering if it is possible to add an add as friend feature in SteamCore.

"To address this, you can now only be invited into a group by your friends. This still maintains the common uses of forming a closed group to hang out with your friends, or creating a restricted group for people of similar interests or achievements."

Many errors 0x23

When using native "SteamGroupInvite" I've got many 0x23 errors - about 80% of those errors and 20% success. Is there any fix possible?

Exception reported: Invalid match index passed.

SteamCore is failing to login to our Steam account and we are receiving this error:

Logging in to steamcommunity.com/login/dologin/...
L 10/08/2018 - 22:10:31: [SM] Exception reported: Invalid match index passed.

L 10/08/2018 - 22:10:31: [SM] Blaming: steamcore.smx
L 10/08/2018 - 22:10:31: [SM] Call stack trace:
L 10/08/2018 - 22:10:31: [SM]   [0] GetRegexSubString
L 10/08/2018 - 22:10:31: [SM]   [1] Line 351, steamcore/login.sp::cbkLoginRequest
L 10/08/2018 - 22:11:21: [steamcore.smx] 

After re-attempting the login with the sm_steamcore_send_code command, it doesn't get past this:
Found machine cookie: ""

Does this plugin/extension still work?

0x07

0x07

Aborted logging, incorrect response body (192):

{"success":false,"requires_twofactor":false,"message":"The account name or password that you have entered is incorrect.","clear_password_field":true,"captcha_needed":false,"captcha_gid":-1}cac?

Any idea?

Error 0x09

sc debug claims session cookie wasnt recieved.

Debug log below

L 07/29/2018 - 18:34:49: [steamcore.smx]
Logging successful, obtaining session token from steamcommunity.com/chat...
L 07/29/2018 - 18:34:50: [steamcore.smx]
Storing machine auth in addons/sourcemod/configs/steamcore_login.cfg...
L 07/29/2018 - 18:34:50: [steamcore.smx]
Success.
L 07/29/2018 - 18:34:50: [steamcore.smx]
Could not get session token. Got: "false". Incorrect Cookie?

Error 0x12 (Form error on request or too many consecutive requests)

Hello,

I've been using this plugin for a while for posting announcements to steam groups. A couple of days ago, it stopped working, with the error code:

There was an error 0x12 while posting your announcement.

From the main page:

0x12(18): Announcement Error: Form error on request or too many consecutive requests.

The account can post just fine to the page if i log into chrome. I've tried resending the code a few times with no luck:

] sm_steamcore_send_code
Attempting to send an auth code to mail...
Login auth code sent, check the mail and then use sm_steamcore_input_code "YOURCODE".

] sm_steamcore_input_code XXXXX
Attempting to login with code: XXXXX
Successfully connected to Steam.

There was an error 0x12 while posting your announce

No luck. Someone else has told me they are having the same problem.

My code is as follows:

void SomeFunction()
{
	SteamCommunityGroupAnnounce(sTitle, sBody, g_sSteamGroupID, iClient);
}

public int OnCommunityGroupAnnounceResult(const char[] sTitle, const char[] sBody, const char[] sGroup, int iErrorCode, any vData)
{
	int client = vData;
	
	char sReply[100];
	if(!iErrorCode)
	{
		Format(sReply, sizeof(sReply), "Announcement posted.");
	}
	else
	{
		if(iErrorCode == 0x01)
		{
			Format(sReply, sizeof(sReply), "Server is busy with another task at this time, try again in a few seconds.");
		}
		else if(iErrorCode == 0x02)
		{
			Format(sReply, sizeof(sReply), "There was a timeout in your request, try again.");
		}
		else if(iErrorCode == 0x07)
		{
			Format(sReply, sizeof(sReply), "The server is configured with the wrong login information for posting announcements.");
		}
		else if(iErrorCode == 0x11)
		{
			Format(sReply, sizeof(sReply), "Session expired, retry to reconnect.");
		}
		else
		{
			Format(sReply, sizeof(sReply), "There was an error \x010x%02x while posting your announcement.", iErrorCode);
		}
	}
	
	if(!IsValidClient(client))
	{
		LogToGame(sReply);
	}
	else
	{
		PrintToChat(client, sReply);
	}
}

Any help is appreciated.

Error 0x26

If you see this error in a request please set cvar sc_debug 1, call the function (run the command) again and copy the result you get in the console, it will be a lot of lines, copy them all and paste them here.

A report says response 0x26 can be returned when trying to send an invite with a limited account (polvora/Inviter#4), if that's your case (you used a limited account and got this error) it would be fantastic for me if you can confirm it here in the comments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.