From 18fb9b1924d4aa4bc1e0c664a8818886866f56ff Mon Sep 17 00:00:00 2001 From: John Date: Fri, 17 Jul 2015 19:48:30 +0300 Subject: [PATCH] Sorry nacib --- toontown/catalog/GiftAvatar.py | 10 +++++----- toontown/estate/DistributedPhoneAI.py | 3 +-- toontown/rpc/ToontownRPCHandlerBase.py | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/toontown/catalog/GiftAvatar.py b/toontown/catalog/GiftAvatar.py index a9771ca5..52d58780 100644 --- a/toontown/catalog/GiftAvatar.py +++ b/toontown/catalog/GiftAvatar.py @@ -1,6 +1,6 @@ from toontown.toon import ToonDNA import CatalogItem, CatalogItemList -import base64, json +import json def createFromJson(jsonData): return createFromFields(json.loads(jsonData)) @@ -35,16 +35,16 @@ class GiftAvatar: def setDNAString(self, dnaString): self.style = ToonDNA.ToonDNA() - self.style.makeFromNetString(base64.b64decode(dnaString)) + self.style.makeFromNetString(dnaString.decode('base64')) def setMailboxContents(self, contents): - self.mailboxContents = CatalogItemList.CatalogItemList(base64.b64decode(contents), store=CatalogItem.Customization) + self.mailboxContents = CatalogItemList.CatalogItemList(contents.decode('base64'), store=CatalogItem.Customization) def setGiftSchedule(self, onOrder): - self.onGiftOrder = CatalogItemList.CatalogItemList(base64.b64decode(onOrder), store=CatalogItem.Customization | CatalogItem.DeliveryDate) + self.onGiftOrder = CatalogItemList.CatalogItemList(onOrder.decode('base64'), store=CatalogItem.Customization | CatalogItem.DeliveryDate) def setDeliverySchedule(self, onOrder): - self.onOrder = CatalogItemList.CatalogItemList(base64.b64decode(onOrder), store=CatalogItem.Customization | CatalogItem.DeliveryDate) + self.onOrder = CatalogItemList.CatalogItemList(onOrder.decode('base64'), store=CatalogItem.Customization | CatalogItem.DeliveryDate) def setHat(self, hat): self.hat = hat diff --git a/toontown/estate/DistributedPhoneAI.py b/toontown/estate/DistributedPhoneAI.py index b836a9e0..6dd24e38 100755 --- a/toontown/estate/DistributedPhoneAI.py +++ b/toontown/estate/DistributedPhoneAI.py @@ -8,7 +8,6 @@ from toontown.catalog import CatalogItem, CatalogInvalidItem, GiftAvatar from toontown.catalog.CatalogItemList import CatalogItemList from toontown.uberdog import TopToonsGlobals -import base64 import json import time @@ -33,7 +32,7 @@ class LoadGiftAvatar: return for key in ('setDNAString', 'setMailboxContents', 'setGiftSchedule', 'setDeliverySchedule'): - fields[key] = base64.b64encode(fields[key][0]) + fields[key] = fields[key][0].encode('base64') newDict = self.copyDict(fields, 'setDNAString', 'setMailboxContents', 'setGiftSchedule', 'setDeliverySchedule', 'setHat', 'setGlasses', 'setBackpack', 'setShoes', 'setHatList', 'setGlassesList', 'setBackpackList', 'setShoes', 'setShoesList', 'setCustomMessages', 'setEmoteAccess', diff --git a/toontown/rpc/ToontownRPCHandlerBase.py b/toontown/rpc/ToontownRPCHandlerBase.py index dbf2ab7c..a5aaec0f 100755 --- a/toontown/rpc/ToontownRPCHandlerBase.py +++ b/toontown/rpc/ToontownRPCHandlerBase.py @@ -1,4 +1,3 @@ -import base64 from direct.directnotify.DirectNotifyGlobal import directNotify import json import time @@ -41,7 +40,7 @@ class ToontownRPCHandlerBase: """ # First, base64 decode the token: try: - token = base64.b64decode(token) + token = token.decode('base64') except TypeError: return (-32001, 'Token decode failure')