KISS-multiplayer icon indicating copy to clipboard operation
KISS-multiplayer copied to clipboard

Added `client:getSteamID` method for the Lua API

Open vulcan-dev opened this issue 1 year ago • 6 comments

I added this functionality because secret isn't persistent so storing users in a DB (On CPR & Verb servers) doesn't work very well. It's also a good way to identify users.

Usage:

connections[client_id]:getSteamID()

vulcan-dev avatar Jul 18 '22 16:07 vulcan-dev

Be aware that the client reporting the SteamID can not be trusted since the client could provide a falsified SteamID. They could, for example, redefine the global Steam with one that provides a fake SteamID. It's still useful, but the server-side would have to scrutinize it for anything important like permissions.

WhiteHusky avatar Jul 18 '22 22:07 WhiteHusky

That's true but it's very unlikely they'll do that. And either way, they could do the same with secret by modifying the mod.

vulcan-dev avatar Jul 18 '22 23:07 vulcan-dev

@vulcan-dev

True. Probably needs to be stressed in the documentation to rely on another source of truth when using either values.

WhiteHusky avatar Jul 19 '22 00:07 WhiteHusky

Looks good for 0.6, but changes the netcode so can't be added into 0.5

TheHellBox avatar Jul 19 '22 07:07 TheHellBox

That's true but it's very unlikely they'll do that. And either way, they could do the same with secret by modifying the mod.

But to be fair kissmp secrets are not public, hence the name, while steamids for anyone could easily be looked up. If SteamIDs cannot be trusted, then what is the point of having them?

AsciiJakob avatar Jul 19 '22 09:07 AsciiJakob

That's true but it's very unlikely they'll do that. And either way, they could do the same with secret by modifying the mod.

But to be fair kissmp secrets are not public, hence the name, while steamids for anyone could easily be looked up. If SteamIDs cannot be trusted, then what is the point of having them?

Yeah, I had another think about it before and I think it's best to implement it into the bridge. For now, it's fine since I doubt anyone is going to be changing them since most people don't have the knowledge on how.

vulcan-dev avatar Jul 19 '22 09:07 vulcan-dev