New version number.

This commit is contained in:
DenialMC 2015-05-14 20:54:08 +03:00
parent f784a15e1d
commit 8d33330192
9 changed files with 18 additions and 65 deletions

View file

@ -382,10 +382,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.accessoryType = di.getUint16() self.accessoryType = di.getUint16()
if versionNumber >= 6:
self.isSpecial = di.getBool() self.isSpecial = di.getBool()
else:
self.isSpecial = False
str = AccessoryTypes[self.accessoryType][ATString] str = AccessoryTypes[self.accessoryType][ATString]
if self.isHat(): if self.isHat():
defn = ToonDNA.HatStyles[str] defn = ToonDNA.HatStyles[str]

View file

@ -556,10 +556,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.clothingType = di.getUint16() self.clothingType = di.getUint16()
self.colorIndex = di.getUint8() self.colorIndex = di.getUint8()
if versionNumber >= 6:
self.isSpecial = di.getBool() self.isSpecial = di.getBool()
else:
self.isSpecial = False
str = ClothingTypes[self.clothingType][CTString] str = ClothingTypes[self.clothingType][CTString]
if self.isShirt(): if self.isShirt():
color = ToonDNA.ShirtStyles[str][2][self.colorIndex] color = ToonDNA.ShirtStyles[str][2][self.colorIndex]

View file

@ -114,10 +114,7 @@ class CatalogEmoteItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.emoteIndex = di.getUint8() self.emoteIndex = di.getUint8()
if versionNumber >= 6:
self.isSpecial = di.getBool() self.isSpecial = di.getBool()
else:
self.isSpecial = False
if self.emoteIndex > len(OTPLocalizer.EmoteList): if self.emoteIndex > len(OTPLocalizer.EmoteList):
raise ValueError raise ValueError

View file

@ -108,11 +108,8 @@ class CatalogFlooringItem(CatalogSurfaceItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogAtticItem.CatalogAtticItem.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()
if versionNumber < 4 or store & CatalogItem.Customization: if store & CatalogItem.Customization:
self.colorIndex = di.getUint8() self.colorIndex = di.getUint8()
else: else:
self.colorIndex = 0 self.colorIndex = 0

View file

@ -8,7 +8,7 @@ from direct.distributed.PyDatagramIterator import PyDatagramIterator
import types import types
import sys import sys
CatalogReverseType = None CatalogReverseType = None
CatalogItemVersion = 8 CatalogItemVersion = 0
CatalogBackorderMarkup = 1.2 CatalogBackorderMarkup = 1.2
CatalogSaleMarkdown = 0.75 CatalogSaleMarkdown = 0.75
Customization = 1 Customization = 1
@ -274,19 +274,6 @@ class CatalogItem:
x = di.getArg(STInt16, 10) x = di.getArg(STInt16, 10)
y = di.getArg(STInt16, 10) y = di.getArg(STInt16, 10)
z = di.getArg(STInt16, 100) 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) h = di.getArg(STInt8, 256.0 / 360.0)
p = di.getArg(STInt8, 256.0 / 360.0) p = di.getArg(STInt8, 256.0 / 360.0)
r = di.getArg(STInt8, 256.0 / 360.0) r = di.getArg(STInt8, 256.0 / 360.0)
@ -298,10 +285,7 @@ class CatalogItem:
r) r)
if store & GiftTag: if store & GiftTag:
self.giftTag = di.getString() self.giftTag = di.getString()
if versionNumber >= 8:
self.specialEventId = di.getUint8() self.specialEventId = di.getUint8()
else:
self.specialEventId = 0
def encodeDatagram(self, dg, store): def encodeDatagram(self, dg, store):
if store & DeliveryDate: if store & DeliveryDate:

View file

@ -93,9 +93,6 @@ class CatalogMouldingItem(CatalogSurfaceItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogAtticItem.CatalogAtticItem.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() self.colorIndex = di.getUint8()
wtype = MouldingTypes[self.patternIndex] wtype = MouldingTypes[self.patternIndex]

View file

@ -92,10 +92,7 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
if versionNumber >= 7:
self.cost = di.getUint16() self.cost = di.getUint16()
else:
self.cost = 1000
self.duration = di.getUint16() self.duration = di.getUint16()
self.typeIndex = di.getUint16() self.typeIndex = di.getUint16()

View file

@ -84,9 +84,6 @@ class CatalogWainscotingItem(CatalogSurfaceItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogAtticItem.CatalogAtticItem.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() self.colorIndex = di.getUint8()
wtype = WainscotingTypes[self.patternIndex] wtype = WainscotingTypes[self.patternIndex]

View file

@ -665,18 +665,8 @@ class CatalogWallpaperItem(CatalogSurfaceItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogAtticItem.CatalogAtticItem.decodeDatagram(self, di, versionNumber, store) CatalogAtticItem.CatalogAtticItem.decodeDatagram(self, di, versionNumber, store)
self.colorIndex = 0 self.colorIndex = 0
if store & CatalogItem.Customization:
self.borderIndex = 0
else:
self.borderIndex = 0 self.borderIndex = 0
self.borderColorIndex = 0 self.borderColorIndex = 0
if versionNumber < 3:
self.patternIndex = di.getUint8()
self.colorIndex = di.getUint8()
elif versionNumber == 3:
self.patternIndex = di.getUint16()
self.colorIndex = di.getUint8()
else:
self.patternIndex = di.getUint16() self.patternIndex = di.getUint16()
if store & CatalogItem.Customization: if store & CatalogItem.Customization:
self.colorIndex = di.getUint8() self.colorIndex = di.getUint8()