Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SteamID autoconvert #678

Open
wants to merge 1 commit into
base: v1.x
Choose a base branch
from

Conversation

TheByKotik
Copy link
Contributor

Description

Add ConvertSteamID function.
Add GetAccountIDBySteamID64 function with support elder browsers.
Add but not used ResolveVanityURL function.
Use onblur event for <input id="steamid">, <input id="steam"> and <input name="SteamID"> to autoconvert SteamID.

How Has This Been Tested?

Windows:

  1. Last stable Google Chrome.
  2. Last stable Mozilla Firefox.
  3. Microsoft Edge 44.18362.449.0

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.

Add `ConvertSteamID` function.
Add `GetAccountIDBySteamID64` function with support elder browsers.
Add but not used `ResolveVanityURL` function.
Use `onblur` event for <input id="steamid">, <input id="steam"> and <input name="SteamID"> to autoconvert SteamID.
:
(SteamID) =>
{
const BigBit = /* Bits (1 << 63...32) as decimal integers as numeric array. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what the hell

Copy link
Contributor Author

@TheByKotik TheByKotik Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all browsers support BigInt.
It's something like var & 0xFFFFFFFF.
This code subtracts bits 1 << 63...32 from number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can implement auto-converting feature on backend side, what should also resolve CSRF problems when user inserts URL with custom address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can implement auto-converting feature on backend side, what should also resolve CSRF problems when user inserts URL with custom address.

I think this is unwanted load for server and absolutely not needed for simple converting [U:1:116845363] -> STEAM_0:1:58422681.
If someone wants it can to implement call ResolveVanityURL through SteamAPI on server-side.

And... I already did it for client-side (except ResolveVanityURL; This blocked by CORS).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simple math, you can't make a high load for server with simple calculating SteamID v2 from v3/community id.
I would agree with your position only if "Add ban/comm/admin" page would be haunted, but no. This is another case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree with your position only if "Add ban/comm/admin" page would be haunted, but no. This is another case.

This function also must been used for search on main pages.

This is simple math, you can't make a high load for server with simple calculating SteamID v2 from v3/community id.

And no matter how simple the functions are, we must not forget that thousands and tens of thousands of clients call them.
And the functions themselves in web server are at least several hundred.
Such a simple converting is quite possible to entrust the client.

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.

None yet

3 participants