-
Notifications
You must be signed in to change notification settings - Fork 173
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
base: v1.x
Are you sure you want to change the base?
Conversation
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. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what the hell
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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:
Types of changes
Checklist: