I have a bank system for my map that saves a couple of integers/booleans for players. The problem is that it sometimes is unverified on battle.net. A player will play a game, join another, and sometimes their bank resets or is unverified. Any idea what is wrong with my code? Do I have too many variables?
I have 3 triggers, one that preloads the bank, one that loads and sets the variables from them, and one that saves the banks.
BanksVarsEventsTimer-Elapsedtimeis0.0GameTimesecondsLocalVariablesloopint=1<Integer>int=1<Integer>ConditionsActionsGeneral-Foreachintegerloopintfrom1to12withincrement1,do(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Bankbanks[loopint]isverified)==TrueThenVariable-SetPlayerExperience[1][loopint]=(Load"experience"ofsection"enlisted"frombankbanks[loopint]asintegervalue)Variable-SetPlayerExperience[2][loopint]=(Load"experience"ofsection"warrant officer"frombankbanks[loopint]asintegervalue)Variable-SetPlayerExperience[3][loopint]=(Load"experience"ofsection"officer"frombankbanks[loopint]asintegervalue)Variable-SetPlayerGamesPlayed[loopint]=(Load"games played"ofsection"general"frombankbanks[loopint]asintegervalue)Variable-SetPlayerGamesPlayed[loopint]=(PlayerGamesPlayed[loopint]+1)Variable-Setplayercamounlocked[1][loopint]=TrueGeneral-Foreachintegerintfrom2to10withincrement1,do(Actions)ActionsVariable-Setplayercamounlocked[int][loopint]=(Loadplayercamostring[int]ofsection"camo"frombankbanks[loopint]asboolean)General-Foreachintegerintfrom1to6withincrement1,do(Actions)ActionsVariable-Setplayerdecalunlocked[int][loopint]=(Loadplayerdecalstring[int]ofsection"decals"frombankbanks[loopint]asboolean)Variable-SetPlayerAvgGameTime[loopint]=(Load"avg game time"ofsection"general"frombankbanks[loopint]asintegervalue)UI-Display(Combine("Biometric ID recognized. XP:"))for(Playergroup(loopint))toDebugareaUI-Display(Combine("Enlisted:",(Text(PlayerExperience[1][loopint]))))for(Playergroup(loopint))toDebugareaUI-Display(Combine("WO:",(Text(PlayerExperience[2][loopint]))))for(Playergroup(loopint))toDebugareaUI-Display(Combine("Officer:",(Text(PlayerExperience[3][loopint]))))for(Playergroup(loopint))toDebugareaGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerExperience[1][loopint]>=RankXPMin[1][3]ThenTechTree-SetPFCupgradelevelto1forplayerloopintElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerExperience[1][loopint]>=RankXPMin[1][6]ThenTechTree-SetSGTupgradelevelto1forplayerloopintElseElseVariable-Setplayercamounlocked[1][loopint]=TrueUI-Display(Combine("Biometric ID not recognized. XP: ",(Text(PlayerExperience[1][loopint]))))for(Playergroup(loopint))toDebugareaVariable-Setloopint=(loopint+1)
SaveBankEventsGame-PlayerAnyPlayertypesachatmessagecontaining"-save",matchingExactlyLocalVariablesloopint=1<Integer>ConditionsActionsGeneral-Foreachintegerloopintfrom2to10withincrement1,do(Actions)ActionsBank-Storebooleanplayercamounlocked[loopint][(Triggeringplayer)]asplayercamostring[loopint]ofsection"camo"inbankbanks[(Triggeringplayer)]General-Foreachintegerloopintfrom1to6withincrement1,do(Actions)ActionsBank-Storebooleanplayerdecalunlocked[loopint][(Triggeringplayer)]asplayerdecalstring[loopint]ofsection"decals"inbankbanks[(Triggeringplayer)]Bank-StoreintegerPlayerExperience[1][(Triggeringplayer)]as"experience"ofsection"enlisted"inbankbanks[(Triggeringplayer)]Bank-StoreintegerPlayerExperience[2][(Triggeringplayer)]as"experience"ofsection"warrant officer"inbankbanks[(Triggeringplayer)]Bank-StoreintegerPlayerExperience[3][(Triggeringplayer)]as"experience"ofsection"officer"inbankbanks[(Triggeringplayer)]Bank-StoreintegerPlayerGamesPlayed[(Triggeringplayer)]as"games played"ofsection"general"inbankbanks[(Triggeringplayer)]Bank-StoreintegerPlayerAvgGameTime[(Triggeringplayer)]as"avg game time"ofsection"general"inbankbanks[(Triggeringplayer)]Bank-Savebankbanks[(Triggeringplayer)]UI-Display(Combine("Biometric ID saved. Enlisted XP: ",(Text((Load"experience"ofsection"enlisted"frombankbanks[(Triggeringplayer)]asintegervalue)))))for(Playergroup((Triggeringplayer)))toDebugareaUI-Display(Combine("Biometric ID saved. WO XP: ",(Text((Load"experience"ofsection"warrant officer"frombankbanks[(Triggeringplayer)]asintegervalue)))))for(Playergroup((Triggeringplayer)))toDebugareaUI-Display(Combine("Biometric ID saved. CO XP: ",(Text((Load"experience"ofsection"officer"frombankbanks[(Triggeringplayer)]asintegervalue)))))for(Playergroup((Triggeringplayer)))toDebugarea
Wouldn't messing with the signature make the verification check fail? So it could be that someone tried to mess with their stats.
Also, @Hookah, I just wanted to point out that contrary to what the thread says, signature'd maps can be hacked. There's a program floating around d3scene which allows you to easily resign a map after you modify it.
I feel like we're screwed, bank-wise. Even if we lock our maps and obfuscate our code, they can get the source and figure out all the smart things we've done with it. If we encrypt the banks with a key, they can find the key in the source.
I wish we were able to store banks on Blizzard's servers. You could store the key there and retrieve it when you needed to encrypt something. The hacker wouldn't be able to see the key in the source and they wouldn't be able to get it since only your published maps can retrieve your banks on blizzard's servers.
Actually, I don't think it is the signature. I think the bank itself is simply not loading period (as in, they are NOT getting the message). Could it be a compatibility issue with the 1.5 beta patch?
Or do I have too many variables getting saved? I can easily turn those decal and camo unlocks into 2 strings rather than like 20 booleans.
On-topic, I'll restate my original question: Wouldn't messing with the signature make the verification check fail? So it could be that someone tried to mess with their stats.
In other words, did you or someone you trust notice this bug or was it someone else?
If a bank is not verified, the cause is either:
- new player with an empty bank (no entries within bank)
- edited/broken bank (bank contains entries)
- bugged sharing of banks. The bank sharing in multiplayer seems to fail after 8kb of banks total in multiplayer games.
If everyone joins a singleplayer game and the banks are loaded properly, it was the failed sharing. Else someone tinkered with his bank or broke it somehow (crash while writing on hard disk?).
From my experience, every problem I encountered was the bank sharing/loading bug. It caused random resets, etc, which other mappers experienced and backup banks didn't solve the problem entirely.
Golden rule: Don't save any banks ingame, if there was an unverified bank which had entries.
I have a bank system for my map that saves a couple of integers/booleans for players. The problem is that it sometimes is unverified on battle.net. A player will play a game, join another, and sometimes their bank resets or is unverified. Any idea what is wrong with my code? Do I have too many variables?
I have 3 triggers, one that preloads the bank, one that loads and sets the variables from them, and one that saves the banks.
You get message that "Biometric ID not recognized"? Are you sure its the bank signature? btw I suggest using double bank for safety save...: http://www.sc2mapster.com/forums/resources/tutorials/28875-trigger-bank-facts/#p1
Wouldn't messing with the signature make the verification check fail? So it could be that someone tried to mess with their stats.
Also, @Hookah, I just wanted to point out that contrary to what the thread says, signature'd maps can be hacked. There's a program floating around d3scene which allows you to easily resign a map after you modify it.
@Siretu: Go shit, you are right...
I feel like we're screwed, bank-wise. Even if we lock our maps and obfuscate our code, they can get the source and figure out all the smart things we've done with it. If we encrypt the banks with a key, they can find the key in the source.
I wish we were able to store banks on Blizzard's servers. You could store the key there and retrieve it when you needed to encrypt something. The hacker wouldn't be able to see the key in the source and they wouldn't be able to get it since only your published maps can retrieve your banks on blizzard's servers.
Dream on....
http://us.battle.net/sc2/en/forum/topic/3530213500?page=3#44
Not to say Blizzard haven't let us down before, but at least it's been considered.
Let's stay on topic, please!
Actually, I don't think it is the signature. I think the bank itself is simply not loading period (as in, they are NOT getting the message). Could it be a compatibility issue with the 1.5 beta patch?
Or do I have too many variables getting saved? I can easily turn those decal and camo unlocks into 2 strings rather than like 20 booleans.
I'm sorry.
On-topic, I'll restate my original question: Wouldn't messing with the signature make the verification check fail? So it could be that someone tried to mess with their stats.
In other words, did you or someone you trust notice this bug or was it someone else?
@Siretu: Go
If a bank is not verified, the cause is either:
- new player with an empty bank (no entries within bank)
- edited/broken bank (bank contains entries)
- bugged sharing of banks. The bank sharing in multiplayer seems to fail after 8kb of banks total in multiplayer games.
If everyone joins a singleplayer game and the banks are loaded properly, it was the failed sharing. Else someone tinkered with his bank or broke it somehow (crash while writing on hard disk?).
From my experience, every problem I encountered was the bank sharing/loading bug. It caused random resets, etc, which other mappers experienced and backup banks didn't solve the problem entirely.
Golden rule: Don't save any banks ingame, if there was an unverified bank which had entries.
Thank you ahli. I'll try to reduce my bank sizes.