From 8d333301926ac36a3c55bb6f267d11f3d0a0f11f Mon Sep 17 00:00:00 2001 From: DenialMC Date: Thu, 14 May 2015 20:54:08 +0300 Subject: [PATCH] New version number. --- toontown/catalog/CatalogAccessoryItem.py | 5 +---- toontown/catalog/CatalogClothingItem.py | 5 +---- toontown/catalog/CatalogEmoteItem.py | 5 +---- toontown/catalog/CatalogFlooringItem.py | 7 ++---- toontown/catalog/CatalogItem.py | 26 +++++----------------- toontown/catalog/CatalogMouldingItem.py | 5 +---- toontown/catalog/CatalogRentalItem.py | 5 +---- toontown/catalog/CatalogWainscotingItem.py | 5 +---- toontown/catalog/CatalogWallpaperItem.py | 20 +++++------------ 9 files changed, 18 insertions(+), 65 deletions(-) diff --git a/toontown/catalog/CatalogAccessoryItem.py b/toontown/catalog/CatalogAccessoryItem.py index 2ec3cca8..366fa278 100644 --- a/toontown/catalog/CatalogAccessoryItem.py +++ b/toontown/catalog/CatalogAccessoryItem.py @@ -382,10 +382,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem): def decodeDatagram(self, di, versionNumber, store): CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) self.accessoryType = di.getUint16() - if versionNumber >= 6: - self.isSpecial = di.getBool() - else: - self.isSpecial = False + self.isSpecial = di.getBool() str = AccessoryTypes[self.accessoryType][ATString] if self.isHat(): defn = ToonDNA.HatStyles[str] diff --git a/toontown/catalog/CatalogClothingItem.py b/toontown/catalog/CatalogClothingItem.py index 544dae3d..2a1ef3b7 100644 --- a/toontown/catalog/CatalogClothingItem.py +++ b/toontown/catalog/CatalogClothingItem.py @@ -556,10 +556,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem): CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) self.clothingType = di.getUint16() self.colorIndex = di.getUint8() - if versionNumber >= 6: - self.isSpecial = di.getBool() - else: - self.isSpecial = False + self.isSpecial = di.getBool() str = ClothingTypes[self.clothingType][CTString] if self.isShirt(): color = ToonDNA.ShirtStyles[str][2][self.colorIndex] diff --git a/toontown/catalog/CatalogEmoteItem.py b/toontown/catalog/CatalogEmoteItem.py index bd21122b..fa173bc6 100644 --- a/toontown/catalog/CatalogEmoteItem.py +++ b/toontown/catalog/CatalogEmoteItem.py @@ -114,10 +114,7 @@ class CatalogEmoteItem(CatalogItem.CatalogItem): def decodeDatagram(self, di, versionNumber, store): CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) self.emoteIndex = di.getUint8() - if versionNumber >= 6: - self.isSpecial = di.getBool() - else: - self.isSpecial = False + self.isSpecial = di.getBool() if self.emoteIndex > len(OTPLocalizer.EmoteList): raise ValueError diff --git a/toontown/catalog/CatalogFlooringItem.py b/toontown/catalog/CatalogFlooringItem.py index e5fc7144..93fd53d0 100644 --- a/toontown/catalog/CatalogFlooringItem.py +++ b/toontown/catalog/CatalogFlooringItem.py @@ -108,11 +108,8 @@ class CatalogFlooringItem(CatalogSurfaceItem): def decodeDatagram(self, di, versionNumber, store): CatalogAtticItem.CatalogAtticItem.decodeDatagram(self, di, versionNumber, store) - if versionNumber < 3: - self.patternIndex = di.getUint8() - else: - self.patternIndex = di.getUint16() - if versionNumber < 4 or store & CatalogItem.Customization: + self.patternIndex = di.getUint16() + if store & CatalogItem.Customization: self.colorIndex = di.getUint8() else: self.colorIndex = 0 diff --git a/toontown/catalog/CatalogItem.py b/toontown/catalog/CatalogItem.py index 01a86d93..bba97cda 100644 --- a/toontown/catalog/CatalogItem.py +++ b/toontown/catalog/CatalogItem.py @@ -8,7 +8,7 @@ from direct.distributed.PyDatagramIterator import PyDatagramIterator import types import sys CatalogReverseType = None -CatalogItemVersion = 8 +CatalogItemVersion = 0 CatalogBackorderMarkup = 1.2 CatalogSaleMarkdown = 0.75 Customization = 1 @@ -274,22 +274,9 @@ class CatalogItem: x = di.getArg(STInt16, 10) y = di.getArg(STInt16, 10) z = di.getArg(STInt16, 100) - if versionNumber < 2: - h = di.getArg(STInt16, 10) - p = 0.0 - r = 0.0 - elif versionNumber < 5: - h = di.getArg(STInt8, 256.0 / 360.0) - p = di.getArg(STInt8, 256.0 / 360.0) - r = di.getArg(STInt8, 256.0 / 360.0) - hpr = oldToNewHpr(VBase3(h, p, r)) - h = hpr[0] - p = hpr[1] - r = hpr[2] - else: - h = di.getArg(STInt8, 256.0 / 360.0) - p = di.getArg(STInt8, 256.0 / 360.0) - r = di.getArg(STInt8, 256.0 / 360.0) + h = di.getArg(STInt8, 256.0 / 360.0) + p = di.getArg(STInt8, 256.0 / 360.0) + r = di.getArg(STInt8, 256.0 / 360.0) self.posHpr = (x, y, z, @@ -298,10 +285,7 @@ class CatalogItem: r) if store & GiftTag: self.giftTag = di.getString() - if versionNumber >= 8: - self.specialEventId = di.getUint8() - else: - self.specialEventId = 0 + self.specialEventId = di.getUint8() def encodeDatagram(self, dg, store): if store & DeliveryDate: diff --git a/toontown/catalog/CatalogMouldingItem.py b/toontown/catalog/CatalogMouldingItem.py index 858c9041..d3472e6c 100644 --- a/toontown/catalog/CatalogMouldingItem.py +++ b/toontown/catalog/CatalogMouldingItem.py @@ -93,10 +93,7 @@ class CatalogMouldingItem(CatalogSurfaceItem): def decodeDatagram(self, di, versionNumber, store): CatalogAtticItem.CatalogAtticItem.decodeDatagram(self, di, versionNumber, store) - if versionNumber < 3: - self.patternIndex = di.getUint8() - else: - self.patternIndex = di.getUint16() + self.patternIndex = di.getUint16() self.colorIndex = di.getUint8() wtype = MouldingTypes[self.patternIndex] diff --git a/toontown/catalog/CatalogRentalItem.py b/toontown/catalog/CatalogRentalItem.py index 48b0c073..51dd0ae2 100644 --- a/toontown/catalog/CatalogRentalItem.py +++ b/toontown/catalog/CatalogRentalItem.py @@ -92,10 +92,7 @@ class CatalogRentalItem(CatalogItem.CatalogItem): def decodeDatagram(self, di, versionNumber, store): CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) - if versionNumber >= 7: - self.cost = di.getUint16() - else: - self.cost = 1000 + self.cost = di.getUint16() self.duration = di.getUint16() self.typeIndex = di.getUint16() diff --git a/toontown/catalog/CatalogWainscotingItem.py b/toontown/catalog/CatalogWainscotingItem.py index accd3951..9fff0f3b 100644 --- a/toontown/catalog/CatalogWainscotingItem.py +++ b/toontown/catalog/CatalogWainscotingItem.py @@ -84,10 +84,7 @@ class CatalogWainscotingItem(CatalogSurfaceItem): def decodeDatagram(self, di, versionNumber, store): CatalogAtticItem.CatalogAtticItem.decodeDatagram(self, di, versionNumber, store) - if versionNumber < 3: - self.patternIndex = di.getUint8() - else: - self.patternIndex = di.getUint16() + self.patternIndex = di.getUint16() self.colorIndex = di.getUint8() wtype = WainscotingTypes[self.patternIndex] diff --git a/toontown/catalog/CatalogWallpaperItem.py b/toontown/catalog/CatalogWallpaperItem.py index 486b5638..ae6aed86 100644 --- a/toontown/catalog/CatalogWallpaperItem.py +++ b/toontown/catalog/CatalogWallpaperItem.py @@ -665,23 +665,13 @@ class CatalogWallpaperItem(CatalogSurfaceItem): def decodeDatagram(self, di, versionNumber, store): CatalogAtticItem.CatalogAtticItem.decodeDatagram(self, di, versionNumber, store) self.colorIndex = 0 - if store & CatalogItem.Customization: - self.borderIndex = 0 - else: - self.borderIndex = 0 + self.borderIndex = 0 self.borderColorIndex = 0 - if versionNumber < 3: - self.patternIndex = di.getUint8() + self.patternIndex = di.getUint16() + if store & CatalogItem.Customization: self.colorIndex = di.getUint8() - elif versionNumber == 3: - self.patternIndex = di.getUint16() - self.colorIndex = di.getUint8() - else: - self.patternIndex = di.getUint16() - if store & CatalogItem.Customization: - self.colorIndex = di.getUint8() - self.borderIndex = di.getUint16() - self.borderColorIndex = di.getUint8() + self.borderIndex = di.getUint16() + self.borderColorIndex = di.getUint8() wtype = WallpaperTypes[self.patternIndex] return