Skip to content

SteamID lib added#470

Merged
Groruk merged 11 commits intosbpp:v1.xfrom
Groruk:SteamID_lib
May 19, 2018
Merged

SteamID lib added#470
Groruk merged 11 commits intosbpp:v1.xfrom
Groruk:SteamID_lib

Conversation

@Groruk
Copy link
Member

@Groruk Groruk commented May 18, 2018

Description

Added my 'new' SteamID conversion library to replace the existing SQL conversion functions.

Motivation and Context

The new lib supports GMP, bcmath and as fallback SQL for Steamid conversion
and with that could have a massive performance increase when using GMP or bcmath.
It also supports a better way to resolve steam's custom urls.

Features needed until merging

  • Add special support for xPaw's SourceQuery lib (SourceQuery.php L307-319)
    Turns out bcmath doesn't support logical operation (e.g AND, OR, XOR) and SQL would be a mess... so since we don't use the server steamid it will return 0 now if it cant find a suitable calculation method.
  • Force admin Steam2 ids to begin with STEAM_0

Testing needed until merging

  • Steam Openid login (steamopenid.php)
  • Edit comm bans (admin.edit.comms.php)
  • Edit bans (admin.edit.ban.php)
  • Edit admin details (admin.edit.admindetails.php)
  • banned_user.cfg import (admin.bans.php)
  • checkMultiplePlayers() (system-functions.php)
  • GetCommunityName() (system-functions.php)
  • BlockPlayer() (admin.blockit.php)
  • KickPlayer() (admin.kickit.php)
  • xajax_AddAdmin() (sb-callback.php)
  • xajax_KickPlayer() (sb-callback.php)
  • xajax_PasteBan() (sb-callback.php)
  • xajax_AddBan() (sb-callback.php)
  • xajax_BanMemberOfGroup() (sb-callback.php)
  • xajax_BanFriends() (sb-callback.php)
  • xajax_ViewCommunityProfile() (sb-callback.php)
  • xajax_AddBlock() (sb-callback.php)
  • xajax_PasteBlock() (sb-callback.php)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

@Bara
Copy link

Bara commented May 18, 2018

How about https://github.com/xPaw/SteamID.php ?

@Groruk
Copy link
Member Author

Groruk commented May 18, 2018

The new lib supports GMP, bcmath and as fallback SQL for Steamid conversion.

xPaw's library only supports GMP...

@Bara
Copy link

Bara commented May 18, 2018

I hope it works with CommunityIDs like 76561193872069853. Example output: https://steamid.io/lookup/76561193872069853

@rumblefrog
Copy link
Member

Would a new updater data be made to properly convert the admin steamids? ie. correcting the universe

@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@sbpp sbpp deleted a comment May 18, 2018
@Groruk
Copy link
Member Author

Groruk commented May 18, 2018

@rumblefrog yeah I will push some changes that forces admin Steam2 ids to begin with STEAM_0 until we switch to Steam64 IDs

@Groruk Groruk merged commit d027ac2 into sbpp:v1.x May 19, 2018
@Groruk Groruk deleted the SteamID_lib branch May 19, 2018 02:24
@CrazyHackGUT
Copy link
Contributor

we switch to Steam64 IDs

Bad-bad-bad. Maybe you should use Steam Account ID? In SourceMod API we have function for obtaining him, and Account ID is guaranteed integer and takes 4 bytes from memory.

@rumblefrog
Copy link
Member

rumblefrog commented May 19, 2018

Bad-bad-bad. Maybe you should use Steam Account ID? In SourceMod API we have function for obtaining him, and Account ID is guaranteed integer and takes 4 bytes from memory.

Perhaps, we should take all forms of Steam IDs, but handles it one way internally

@Groruk
Copy link
Member Author

Groruk commented May 19, 2018

Bad-bad-bad. Maybe you should use Steam Account ID? In SourceMod API we have function for obtaining him, and Account ID is guaranteed integer and takes 4 bytes from memory.

I still think Steam's 64bit IDs are the way to go. They would be a uint64 (8 bytes of data), can also be retrieved with the function GetClientAuthId(), but would contain all information stored in a SteamID.

Also Steam64 is the only format accepted from most of Steam's WebAPI endpoints and since SourceBans++ is more and more relying on the Steam WebAPI for complex features it would be good to store the complete ID in the database (would mean less internal conversions / calculations).
And there could be a high chance of Steam64 being the ID format for Source2 (effectively future proofing SourceBans++ a bit)

@CrazyHackGUT
Copy link
Contributor

CrazyHackGUT commented May 20, 2018

can also be retrieved with the function GetClientAuthId()

In TF2 sometimes SteamID64 not returned by this function.
Also noticed the same bug in CS:S.

I don't know how it works, but to deny the existence of these bugs is meaningless. So i continue think about Steam Account ID.

@good-live
Copy link

The namespace for the SQL Class seems to be wrong.

In https://github.com/sbpp/sourcebans-pp/blob/v1.x/web/includes/SteamID/SteamID.php#L17 it try's to load SteamID\SQL
but it's declared as SteamID\calc\SQL https://github.com/sbpp/sourcebans-pp/blob/v1.x/web/includes/SteamID/calc/SQL.php#L3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants