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):
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]

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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]

View file

@ -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()

View file

@ -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]

View file

@ -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