Prodigy-Hacking / ProdigyMathGameHacking

Prodigy Hacking: Hacking for the right reasons. | Questions? Ask on our Discord. https://discord.gg/XQDfbfq
https://prodigyhacking.com
Other
17 stars 10 forks source link

Better Saving #263

Closed MelnCat closed 4 years ago

MelnCat commented 4 years ago

Currently, hack.player.forceSaveCharacter() only saves some times. We need to figure out what method saves everything.

BoredFishRE commented 4 years ago

Try seeing what the game runs when saving then try that. Gonna look into that though.

BoredFishRE commented 4 years ago

Apparently a prototype part of game. Also noticed that every time it saves, puts saveEnabled = 1 which affects other parts of game.

BoredFishRE commented 4 years ago

Force save has multiple properties forceSaveCharacter, and forceSaveTown(has to do with math town). Found updateUserData, maybe could be used like first, forceSaveCharacter, then updateUserData

ooo788 commented 4 years ago

Annotation 2020-08-02 222417

ooo788 commented 4 years ago

HOW?!

ArcerionDev commented 4 years ago

@TNThacker2015 it seems like entering a battle saves the character, we could make it so it enters a battle, and then uses

hack.instance.game.state.states.Battle.startVictory()

to win instantly, thus saving the character. It's kinda inconvenient, so this definitely shouldn't be our solution, but it's a placeholder for now.

PatheticMustan commented 4 years ago

image

These hacks are only temporary. Normal users will not be able to see levels past 100. This is from the hacker's perspective.

image

and this is from a normal user's perspective the only way you would be able to see a hacked level is if you yourself have hacks.

You can do this by manually setting hack.player.data.level.

hack.player.data.level = 1e5
ArcerionDev commented 4 years ago

Seems like some things save instantly, and some don't...

What saves

What doesn't save

To be honest, the biggest issue is the inventory.

ArcerionDev commented 4 years ago

Update: We've found that this data saves:

"userID"
"target.x"
"target.y"
"appearance.name"
"appearance.name.first"
"appearance.name.middle"
"appearance.name.last"
"appearance.name.nick"
"appearance.gender"
"appearance.hair.style"
"appearance.hair.color"
"appearance.skinColor"
"appearance.eyeColor"
"appearance.face"
"isMember"
"equipment.boots"
"equipment.follow"
"equipment.hat"
"equipment.outfit"
"equipment.weapon"
"data.level"
"data.win"
"data.loss"
"data.gold"
"data.tower"
"data.stars"
"data.hp"
"data.team"
"data.allowsHouseVisitors"
"data.versionID"
"data.playerTransformation.transformType"
"data.playerTransformation.transformID"
"equipment.mount"
"coOpTeam.hostID"
"coOpTeam.teamMembers"
MelnCat commented 4 years ago

How did you find that?

PatheticMustan commented 4 years ago

I found it

ArcerionDev commented 4 years ago

emitMessagereferences MESSAGE_SCHEMAS, which are those.

PatheticMustan commented 4 years ago

Lines 17209 - 17211 in 3-8-3.js

t.MESSAGE_SCHEMAS = {
    info: ["userID", "target.x", "target.y", "appearance.name", "appearance.name.first", "appearance.name.middle", "appearance.name.last", "appearance.name.nick", "appearance.gender", "appearance.hair.style", "appearance.hair.color", "appearance.skinColor", "appearance.eyeColor", "appearance.face", "isMember", "equipment.boots", "equipment.follow", "equipment.hat", "equipment.outfit", "equipment.weapon", "data.level", "data.win", "data.loss", "data.gold", "data.tower", "data.stars", "data.hp", "data.team", "data.allowsHouseVisitors", "data.versionID", "data.playerTransformation.transformType", "data.playerTransformation.transformID", "equipment.mount", "coOpTeam.hostID", "coOpTeam.teamMembers"],
    catapult: []
}
PatheticMustan commented 4 years ago

sniped 😋

ArcerionDev commented 4 years ago

sniped 😋

pog

ArcerionDev commented 4 years ago

It looks like to save, Prodigy makes a post request to https://api.prodigygame.com/game-cortex-server/v3/characters/`userID`. If we do this as well, we probably could save more then we do now.

ArcerionDev commented 4 years ago

Alright, so here's what we know. _.player.forceSaveCharacter() posts a JSON file something like this:

{"inventory":{"weapon":[{"ID":25}],"item":[],"outfit":[],"relic":[],"boots":[],"hat":[],"currency":[{"N":20,"ID":13}],"fossil":[],"follow":[],"mount":[{"ID":1}],"key":[{"ID":13,"lvl":0}],"spellRelic":[]},"data":{"settings":{"bgmVolume":0.3,"voiceVolume":1,"sfxVolume":0.9},"battleCounter":1,"level":1,"storedMemberStars":0,"hp":530,"memberStarsExpirationDate":1598241599000,"stars":-1e+22,"team":0,"allowsHouseVisitors":false,"membershipVideoTimeStamp":1597690457536,"gold":100,"versionID":36,"school":"none","zone":"forest-B8","daily":{"lastStarted":0,"isComplete":false},"startDate":1597690336702,"nm":2,"energy":1},"isMember":1,"tutorial":{"zones":{},"menus":{}},"pets":[],"encounters":{"pets":[{"firstSeenDate":1597690414009,"ID":81,"timesBattled":1,"timesRescued":0}]},"quests":{},"appearance":{"name":{"last":882,"first":44,"middle":754},"hair":{"color":1,"style":19},"face":4,"gender":"male","eyeColor":1,"skinColor":1},"equipment":{"boots":19,"weapon":19,"hat":19,"outfit":19,"follow":19},"house":{"currentHouseTag":"suburbs","active":[{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":480,"y":160,"z":1,"ID":17},{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":400,"y":160,"z":1,"ID":3},{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":440,"y":100,"z":1,"ID":18},{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":840,"y":100,"z":1,"ID":18},{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":880,"y":240,"z":1,"ID":14},{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":880,"y":140,"z":1,"ID":1},{"anchorY":0,"r":0,"stack":[],"dx":0,"dy":0,"x":640,"y":80,"z":1,"ID":13}],"bg":{"active":1,"own":[1]},"items":{"1":{"A":[],"N":1},"3":{"A":[],"N":1},"13":{"A":[],"N":1},"14":{"A":[],"N":1},"17":{"A":[],"N":1},"18":{"A":[],"N":2}}},"achievements":{"kills":1,"progress":{},"gE":100},"state":{"tutorial":{"0":4},"world":{"bounties":[13445393.622196501,86931385.37942387,611311514.0192045]},"zone":{"forest":{"8":{"date":"08172020","flags":[1,1,1,1,1],"rewards":0},"quest":{"ID":1,"state":{"2":1},"seq":0,"req":{"ID":81,"type":"pet","U":true,"N":1}}},"lamplight":{"2":"08172020"},"house":{"quest":{"ID":2}},"academy":{"quest":{"ID":2}}},"breadcrumbs":{"FEATURE_BATTLE_TUTORIAL":3,"BREADCRUMB_UNLOCK_ACADEMY":1,"FEATURE_SOCIAL_FEED":1,"FEATURE_BADGES":1},"towers":{"earthtower":{"achievementPagesCount":0,"wardenSaved":false,"floors":0,"boss":false,"achievementMonstersCount":0}}}}

So it contains:

Inventory (Boots, hats, etc.)
Pets
settings
battleCounter
level
storedMemberStars
hp
memberStarsExpirationDate
stars
team
allowsHouseVisitors
membershipVideoTimeStamp
gold
versionID
school
zone
daily
startDate
nm
energy
encounters
quests
appearance
equipment
house
achievements
state

These always save at least locally. However, Prodigy caches a lot of their files, and uses what's in the gamedata locally. So a definite fix is to clear your cache and cookies. Hope this helps!

PatheticMustan commented 4 years ago

no longer relevant