def createAccount(self): Players.CreateNewBrawlersList() db = TinyDB('Database/Player/data.db') data = { "token": str(self.player.token), "info": { "name": self.player.name, "lowID": self.player.low_id, "clubID": 0, "clubRole": 0, "isFBLinked": 0, "facebookID": self.player.FacebookID, "tutorial": self.player.tutorial, "leagueReward": self.player.trophy_road, "playerExp": self.player.player_experience, "cappedExp": self.player.collected_experience, "soloWins": self.player.solo_wins, "duoWins": self.player.duo_wins, "3vs3Wins": self.player.ThreeVSThree_wins, "gems": self.player.gems, "gold": self.player.gold, "starpoints": self.player.star_points, "tokensdoubler": self.player.tokensdoubler, "availableTokens": self.player.battle_tokens, "tickets": self.player.tickets, "brawlerID": 0, "skinID": 0, "trophies": self.player.trophies, "highesttrophies": self.player.trophies, "profileIcon": 0, "namecolor": self.player.name_color, "brawlBoxes": self.player.brawl_boxes, "bigBoxes": self.player.big_boxes, "gadget": 255, "starpower": 76, "DoNotDistrub": 0, "roomID": 0, "brawlersSkins": self.player.brawlers_skins, "brawlersTrophies": self.player.brawlers_trophies, "brawlersTrophiesForRank": self.player.brawlers_trophies_in_rank, "brawlersUpgradePoints": self.player.brawlers_upgradium, "brawlerPowerLevel": self.player.Brawler_level, "brawlerStarPower": self.player.Brawler_starPower, "brawlerNewTag": self.player.Brawler_newTag, "UnlockedBrawlers": self.player.BrawlersUnlockedState } } db.insert(data)
def __init__(self, client, address): super().__init__() self.client = client self.address = address self.device = Device(self.client) self.player = Players(self.device)
def createAccount(self): self.player.BrawlersUnlockedState = Players.CreateNewBrawlersList() data = { self.player.token: { "lowID": self.player.low_id, "isFBLinked": 0, "facebookID": self.player.FacebookID, "facebookToken": self.player.FacebookToken, "clubID": 0, "clubRole": 0, "name": self.player.name, "gems": self.player.gems, "gold": self.player.gold, "starpoints": self.player.star_points, "tickets": self.player.tickets, "brawlerID": 0, "skinID": 0, "highesttrophies": self.player.trophies, "trophies": self.player.trophies, "profileIcon": 0, "namecolor": 0, "brawlBoxes": self.player.brawl_boxes, "bigBoxes": self.player.big_boxes, # "contentCreator": "", "shellySkin": 0, "nitaSkin": 0, "coltSkin": 0, "bullSkin": 0, "jessieSkin": 0, "brockSkin": 0, "dynamikeSkin": 0, "boSkin": 0, "elprimoSkin": 0, "barleySkin": 0, "pocoSkin": 0, "ricoSkin": 0, "darrylSkin": 0, "pennySkin": 0, "piperSkin": 0, "pamSkin": 0, "frankSkin": 0, "mortisSkin": 0, "taraSkin": 0, "spikeSkin": 0, "crowSkin": 0, "geneSkin": 0, "tickSkin": 0, "leonSkin": 0, "rosaSkin": 0, "carlSkin": 0, "bibiSkin": 0, "8bitSkin": 0, "sandySkin": 0, "beaSkin": 0, "emzSkin": 0, "mrpSkin": 0, "maxSkin": 0, "jackySkin": 0, "galeSkin": 0, "naniSkin": 0, "sproutSkin": 0, "gadget": 255, "starpower": 76, "DoNotDistrub": 0, "roomID": 0, "brawlersTrophies": self.player.BrawlersTrophies, "brawlersTrophiesForRank": self.player.BrawlersTrophiesForRank, "brawlersUpgradePoints": self.player.BrawlersUpgradePoints, "brawlerPowerLevel": self.player.BrawlerPowerLevel, "UnlockedBrawlers": self.player.BrawlersUnlockedState } } with open('Database/Player/data.db', 'a+') as data_file: json.dump(data, data_file) # writing data for new account data_file.write('\n') # writing a new line