-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement 2.1 support for level merger
- Loading branch information
Showing
5 changed files
with
148 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import saveUtil | ||
import hashlib | ||
import base64 | ||
from typing import Any, Dict | ||
import httpRequest | ||
import levelUtil | ||
|
||
|
||
def makeSeed(encoded: bytes) -> str: | ||
""" | ||
seed2 function for robtop games | ||
""" | ||
seed2: str = "" | ||
if len(encoded) < 49: | ||
seed2 = encoded.decode() | ||
else: | ||
seed2 = "" | ||
slot = len(encoded) // 50 | ||
for i in range(0, 50): | ||
seed2 += encoded.decode()[slot * i] | ||
return saveUtil.Xor( | ||
hashlib.sha1( | ||
seed2.encode() + | ||
b"xI25fpAapCQg").hexdigest(), | ||
41274) | ||
|
||
|
||
def getGJP(password: str) -> bytes: | ||
""" | ||
gets gjp from password | ||
""" | ||
return base64.urlsafe_b64encode(saveUtil.Xor(password, 37526).encode()) | ||
|
||
|
||
loginURL: str = "http://www.boomlings.com/database/accounts/loginGJAccount.php" | ||
|
||
|
||
def loginUser(username: str, password: str) -> int: | ||
""" | ||
logins a user | ||
returns account id | ||
""" | ||
data: Dict[str, Any] = { | ||
"userName": username, | ||
"password": password, | ||
"secret": "Wmfv3899gc9", | ||
"udid": "s12-03912-0391-2039" | ||
} | ||
loginRequest: bytes = httpRequest.postRequest(loginURL, data) | ||
if loginRequest == b"-1": | ||
raise ValueError() | ||
|
||
return int(loginRequest.split(b',')[0]) | ||
|
||
|
||
userInfoURL: str = "http://www.boomlings.com/database/getGJUserInfo20.php" | ||
|
||
|
||
def getUsername(accID: int) -> str: | ||
""" | ||
gets user from account id | ||
""" | ||
data: Dict[str, Any] = { | ||
"targetAccountID": accID, | ||
"secret": "Wmfd2893gb7", | ||
"gameVersion": 21 | ||
} | ||
userRequest: bytes = httpRequest.postRequest(userInfoURL, data) | ||
userInfo = levelUtil.parseKeyVarArray(userRequest.decode(), ":") | ||
|
||
return userInfo["1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters