Open w1lla opened 3 years ago
For pyplanet it can be done in manager.py as seen in the pull request no: #1039
Only did the conversion not vice-versa. But its basicly the other way around.
Hi @w1lla can you make functions to do the opposite as well. We have to prepare for potential usage in the future of this specific ID!
player_login = 'q2-lckjXSxai11x2CgX5ew';
webserviceID = 'ab6fa572-48d7-4b16-a2d7-5c760a05f97b';
player_addweb = player_login.ljust(24, "=")
player_replaceweb1 = player_addweb.replace("-", "+")
player_replaceweb2 = player_replaceweb1.replace("_", "/")
decodedbase64 = base64.b64decode(bytes(player_replaceweb2, 'ascii'))
player_webserviceId = uuid.UUID(bytes=decodedbase64)
print(player_webserviceId)
webservicereplace = webserviceID.replace('-','')
b64 = base64.b64encode(bytes.fromhex(webservicereplace)).decode()
replace1sttry = b64.replace('/','_')
replace2ndtry = replace1sttry.replace('+','-')
trim3rdtry = replace2ndtry.strip('=')
webserviceoutputlogin = trim3rdtry
print(webserviceoutputlogin)
outputs:
ab6fa572-48d7-4b16-a2d7-5c760a05f97b q2-lckjXSxai11x2CgX5ew
Hi,
as spoken here: https://forum.nadeo.com/viewtopic.php?f=94&t=2303 you can do a conversion of webserviceId to Login and back.
I did a basic php example which can be seen here:
Even though they might add in future updates the requested WebserviceId this is a temporary fix for in the meantime.
It comes in handy for example Knockout mode where the callback Trackmania.Knockout.Elimination only gives back the webserviceId.
Or in this case:
https://github.com/PyPlanet/PyPlanet/blob/c491a9265c53a47c3bd2867537003bf59c9a0357/pyplanet/apps/core/trackmania/callbacks.py#L72
It gives the account_id which is the webserviceId. so in a case you could on player_connect let it decode the player_login so in future cases it can be needed.