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

Leaderboards' entries need to have the same format output as GMS #2370

Closed
k0T0z opened this issue Nov 27, 2023 · 11 comments · Fixed by #2383
Closed

Leaderboards' entries need to have the same format output as GMS #2370

k0T0z opened this issue Nov 27, 2023 · 11 comments · Fixed by #2383

Comments

@k0T0z
Copy link
Contributor

k0T0z commented Nov 27, 2023

GMS's output looks like this:

Steam ASYNC: {"entries":"{\n    \"entries\": [\n                { \"name\"  : \"TomasJPereyra\", \"score\" : 1, \"rank\"  : 1, \"userID\": \"@i64@110000108ae8556$i64$\" },\n                { \"name\"  : \"Scott-ish\", \"score\" : 10, \"rank\"  : 2, \"userID\": \"@i64@11000010241f4ea$i64$\" },\n                { \"name\"  : \"Loyal RaveN\", \"score\" : 63, \"rank\"  : 3, \"userID\": \"@i64@11000015c558396$i64$\" },\n                { \"name\"  : \"luca.muehlbauer\", \"score\" : 100, \"rank\"  : 4, \"userID\": \"@i64@11000015d44ce04$i64$\", \"data\"  : \"UWx1Y2EubXVlaGxiYXVlciB3YXMgaGVyZSA6KQAAAAA=\" },\n                { \"name\"  : \"Peardox\", \"score\" : 113, \"rank\"  : 5, \"userID\": \"@i64@1100001040447b6$i64$\" },\n                { \"name\"  : \"meFroggy蛙\", \"score\" : 138, \"rank\"  : 6, \"userID\": \"@i64@110000117c9d62b$i64$\", \"data\"  : \"HG1lRnJvZ2d5IHdhcyBoZXJlIDopAAAA\" },\n                { \"name\"  : \"wadams73\", \"score\" : 155, \"rank\"  : 7, \"userID\": \"@i64@1100001012f2bf7$i64$\", \
"data\"  : \"S3dhZGFtczczIHdhcyBoZXJlIDopAAAA\" },\n                { \"name\"  : \"Boom-da-da-mmm-dum-na-ee-ma\", \"score\" : 155, \"rank\"  : 8, \"userID\": \"@i64@11000010be342ce$i64$\", \"data\"  : \"FEZlZWxpbmcgU2lja25lenogd2FzIGhlcmUgOikAAAA=\" },\n                { \"name\"  : \"hermitpal\", \"score\" : 196, \"rank\"  : 9, \"userID\": \"@i64@110000106401474$i64$\", \"data\"  : \"R2hlcm1pdCB3YXMgaGVyZSA6KQA=\" },\n                { \"name\"  : \"Joeyman98\", \"score\" : 239, \"rank\"  : 10, \"userID\": \"@i64@11000010624f1e3$i64$\", \"data\"  : \"I0pvZXltYW45OCB3YXMgaGVyZSA6KQAA\" }\n        \n    ]\n}\n","lb_name":"YYLeaderboard_10\/29\/21--","event_type":"leaderboard_download","id":3.0,"num_entries":10.0,"status":1.0}

See the userID entry for each player. For example TomasJPereyra, his userID is @i64@110000108ae8556$i64$.

Currently, ENIGMA's Steamworks extension output contains the real ID, which is coming from leaderboard_entries[i].m_steamIDUser.ConvertToUint64().

ENIGMA's Output:

Steam ASYNC: {"entries":"{"entries":[{"name":"McGregor","score":696969696,"rank":1,"userID":"00000000000000000"},{"name":"AlEw","score":196198,"rank":2,"userID":"00000000000000000"},{"name":"wiederholungszeichen","score":133434,"rank":3,"userID":"00000000000000000"},{"name":"Fange","score":58158,"rank":4,"userID":"00000000000000000"},{"name":"saif","score":798,"rank":5,"userID":"00000000000000000"},{"name":"Bucciarati (Couter55)","score":336,"rank":6,"userID":"00000000000000000"},{"name":"Haiyatin","score":236,"rank":7,"userID":"00000000000000000"},{"name":"Ichix","score":235,"rank":8,"userID":"00000000000000000"},{"name":"Sigcito","score":185,"rank":9,"userID":"00000000000000000"},{"name":"Kaito","score":137,"rank":10,"userID":"00000000000000000"}]}","event_type":"leaderboard_download","id":1,"lb_name":"","num_entries":10,"status":1}

Note that I replaced all IDs with Zeros for privacy purposes.

I think the IDs shouldn't be the 64-bit number.

@sidling1
Copy link
Contributor

sidling1 commented Mar 6, 2024

If the IDs should not be present, can't we simply remove that part of the code that includes the IDs in the output?

@k0T0z
Copy link
Contributor Author

k0T0z commented Mar 6, 2024

No, we can't, that's a debugging output and it is important. I suggest you get GMS with Steamworks extension set up to better understand why we do this.

@sidling1
Copy link
Contributor

sidling1 commented Mar 7, 2024

So the issue is that GMS is doing some encryption kind of thing before outputting the ID's but the Enigma's Steamwork is just outputting the Real ID's ?

@k0T0z
Copy link
Contributor Author

k0T0z commented Mar 7, 2024

exactly

@sidling1
Copy link
Contributor

sidling1 commented Mar 8, 2024

so should i just write some function that encrypts the id's ? or there is some specific format that is preffered ?

@k0T0z
Copy link
Contributor Author

k0T0z commented Mar 8, 2024

I have no idea, I suggest you check the GMS output. For example, how can we output this id: @i64@1100001012f2bf7$i64$ from a 64-bit id such as 76005040030002001

@sidling1
Copy link
Contributor

sidling1 commented Mar 9, 2024

"\"@i64@" << std::hex << leaderboardEntry.m_steamIDUser.ConvertToUint64() << std::dec << "$i64$\""

this is the line that i got from GM Steamworks Extension repo

Turns out they are just converting the value to a hex value before outputing

@k0T0z
Copy link
Contributor Author

k0T0z commented Mar 9, 2024

Interesting!!! Let me check and confirm then. Thank you @sidling1

@k0T0z
Copy link
Contributor Author

k0T0z commented Mar 11, 2024

@sidling1 Can you create a PR asap?

@sidling1
Copy link
Contributor

Just fixing the hex thing ? And to which branch should i do the changes

@k0T0z
Copy link
Contributor Author

k0T0z commented Mar 11, 2024

@sidling1 Just the master branch

@k0T0z k0T0z changed the title Leaderboards' entries contains real players' IDs which is a sensitive information Leaderboards' entries need to have the same format output as GMS Mar 14, 2024
JoshDreamland pushed a commit that referenced this issue Mar 17, 2024
Fixes #2370.

Previously the userId of the steam users was shown as it is in integer
form.

Since this is not desirable, this PR converts the integer into a
**hexadecimal number** , prepends it with `@i64@` and appends it with
`$i64$` before getting output on the leaderboard.

changed lines 53/54 in the
[file](https://github.com/enigma-dev/enigma-dev/blob/3918af3dc40734465b355a7d52cb9f9f93f5a8d6/ENIGMAsystem/SHELL/Universal_System/Extensions/Steamworks/gameclient/utils/gc_leaderboards_score_downloaded_cookies.cpp#L53)
to handle hex conversion.
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 a pull request may close this issue.

2 participants