Loyalty items cum back. ;(. & add ctime so mongo doesn't complain.

This commit is contained in:
Loudrob 2015-07-23 15:54:46 -04:00
parent 9ab1bd9534
commit 881a8007df
17 changed files with 379 additions and 182 deletions

View file

@ -27,7 +27,7 @@ dclass Account {
uint32 ACCOUNT_AV_SET[] required db;
uint32 ESTATE_ID db;
AvatarPendingDel ACCOUNT_AV_SET_DEL[] db;
uint64 CREATED db;
string CREATED db;
string LAST_LOGIN db;
string ACCOUNT_ID db;
uint16 ACCESS_LEVEL db;
@ -234,6 +234,7 @@ from toontown.shtiker import NewbiePurchaseManager/AI
from toontown.safezone import SafeZoneManager/AI
from toontown.tutorial import TutorialManager/AI
from toontown.catalog import CatalogManager/AI
from toontown.catalog import AccountDate/AI
from toontown.safezone import DistributedTreasure/AI
from toontown.coghq import DistributedCashbotBossTreasure/AI
from toontown.building import DistributedTrophyMgr/AI
@ -1519,6 +1520,11 @@ dclass CatalogManager : DistributedObject {
startCatalog() airecv clsend;
};
dclass AccountDate : DistributedObject {
requestDate() airecv clsend;
requestDateResult(string);
};
dclass DistributedTreasure : DistributedObject {
setTreasureType(uint16) required broadcast ram;
setPosition(int16/10, int16/10, int16/10) required broadcast ram;

View file

@ -18,6 +18,7 @@ from toontown.ai.DistributedReportMgrAI import DistributedReportMgrAI
from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI
from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI
from toontown.catalog.CatalogManagerAI import CatalogManagerAI
from toontown.catalog.AccountDateAI import AccountDateAI
from toontown.coghq import CountryClubManagerAI
from toontown.coghq import FactoryManagerAI
from toontown.coghq import LawOfficeManagerAI
@ -118,6 +119,8 @@ class ToontownAIRepository(ToontownInternalRepository):
self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
self.codeRedemptionMgr.generateWithRequired(2)
self.accountDateMgr = AccountDateAI(self)
self.accountDateMgr.generateWithRequired(2)
self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self)
self.buildingQueryMgr.generateWithRequired(2)
self.groupManager.generateWithRequired(2)

View file

@ -0,0 +1,39 @@
from direct.distributed.DistributedObject import DistributedObject
from direct.directnotify.DirectNotifyGlobal import directNotify
from datetime import datetime
class AccountDate(DistributedObject):
neverDisable = 1
notify = directNotify.newCategory('AccountDate')
def __init__(self, cr):
DistributedObject.__init__(self, cr)
self.accountDays = 0
def announceGenerate(self):
DistributedObject.announceGenerate(self)
base.cr.accountDateMgr = self
taskMgr.doMethodLater(10, self.requestDate, 'request-task')
def delete(self):
if hasattr(base.cr, 'accountDateMgr'):
if base.cr.accountDateMgr is self:
del base.cr.accountDateMgr
DistributedObject.delete(self)
def getAccountDays(self):
return self.accountDays
def requestDate(self, task=None):
self.sendUpdate('requestDate')
if task is not None:
return task.done
def requestDateResult(self, result):
if result is None:
notify.warning('Invalid response from server.')
self.accountDays = 0
else:
date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y")
self.accountDays = (datetime.now() - date).days

View file

@ -0,0 +1,23 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class AccountDateAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI")
def announceGenerate(self):
DistributedObjectAI.announceGenerate(self)
def requestDate(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av:
return
def callback(dclass, fields):
if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'):
self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')])
else:
self.sendUpdateToAvatarId(avId, 'requestDateResult', [None])
self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback)

View file

@ -10,9 +10,9 @@ from panda3d.core import *
class CatalogAccessoryItem(CatalogItem.CatalogItem):
def makeNewItem(self, accessoryType, isSpecial = False):
def makeNewItem(self, accessoryType, loyaltyDays = 0):
self.accessoryType = accessoryType
self.isSpecial = isSpecial
self.loyaltyDays = loyaltyDays
CatalogItem.CatalogItem.makeNewItem(self)
def getPurchaseLimit(self):
@ -328,7 +328,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.accessoryType = di.getUint16()
self.isSpecial = di.getBool()
self.loyaltyDays = di.getUint16()
str = AccessoryTypes[self.accessoryType][ATString]
if self.isHat():
defn = ToonDNA.HatStyles[str]
@ -343,10 +343,17 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
def encodeDatagram(self, dg, store):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint16(self.accessoryType)
dg.addBool(self.isSpecial)
dg.addUint16(self.loyaltyDays)
def isGift(self):
return not self.getEmblemPrices()
if self.getEmblemPrices():
return 0
if self.loyaltyRequirement() > 0:
return 0
elif self.accessoryType in LoyaltyAccessoryItems:
return 0
else:
return 1
def getAllAccessories(*accessoryTypes):
list = []

View file

@ -735,3 +735,4 @@ AccessoryTypes = {101: (AHat,
'shw2',
APriceCool,
7)}
LoyaltyAccessoryItems = []

View file

@ -17,7 +17,8 @@ ABoysShorts = 3
AGirlsShorts = 4
AGirlsSkirt = 5
AShorts = 6
ClothingTypes = {101: (ABoysShirt, 'bss1', 40),
ClothingTypes = {
101: (ABoysShirt, 'bss1', 40),
102: (ABoysShirt, 'bss2', 40),
103: (ABoysShirt, 'bss3', 40),
105: (ABoysShirt, 'bss4', 40),
@ -290,15 +291,23 @@ ClothingTypes = {101: (ABoysShirt, 'bss1', 40),
1817: (AGirlsSkirt, 'sa_gs19', 5000),
1818: (AGirlsSkirt, 'sa_gs20', 5000),
1819: (AGirlsSkirt, 'sa_gs21', 5000),
1820: (AShirt, 'sa_ss55', 5000),
1821: (AShirt, 'weed', 5000)}
1820: (AShirt, 'sa_ss55', 5000)}
LoyaltyClothingItems = (1600,
1601,
1602,
1603,
1604,
1605,
1606,
1607,
1608)
class CatalogClothingItem(CatalogItem.CatalogItem):
def makeNewItem(self, clothingType, colorIndex, isSpecial = False):
def makeNewItem(self, clothingType, colorIndex, loyaltyDays = 0):
self.clothingType = clothingType
self.colorIndex = colorIndex
self.isSpecial = isSpecial
self.loyaltyDays = loyaltyDays
CatalogItem.CatalogItem.makeNewItem(self)
def storedInCloset(self):
@ -338,6 +347,8 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
return 1
if avatar.mailboxContents.count(self) != 0:
return 1
if self in avatar.awardMailboxContents or self in avatar.onAwardOrder:
return 1
str = ClothingTypes[self.clothingType][CTString]
dna = avatar.getStyle()
if self.isShirt():
@ -417,7 +428,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
return ToontownGlobals.P_ItemAvailable
def getDeliveryTime(self):
return 1
return 60
def getPicture(self, avatar):
from toontown.toon import Toon
@ -554,7 +565,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.clothingType = di.getUint16()
self.colorIndex = di.getUint8()
self.isSpecial = di.getBool()
self.loyaltyDays = di.getUint16()
str = ClothingTypes[self.clothingType][CTString]
if self.isShirt():
color = ToonDNA.ShirtStyles[str][2][self.colorIndex]
@ -565,10 +576,18 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint16(self.clothingType)
dg.addUint8(self.colorIndex)
dg.addBool(self.isSpecial)
dg.addUint16(self.loyaltyDays)
def isGift(self):
return not self.getEmblemPrices()
if self.getEmblemPrices():
return 0
if self.loyaltyRequirement() > 0:
return 0
elif self.clothingType in LoyaltyClothingItems:
return 0
else:
return 1
def getAllClothes(*clothingTypes):
list = []

View file

@ -3,21 +3,22 @@ from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from direct.interval.IntervalGlobal import *
LoyaltyEmoteItems = (20, 21, 22, 23, 24, 25, 26)
class CatalogEmoteItem(CatalogItem.CatalogItem):
sequenceNumber = 0
pictureToon = None
def makeNewItem(self, emoteIndex, isSpecial = False):
def makeNewItem(self, emoteIndex, loyaltyDays = 0):
self.emoteIndex = emoteIndex
self.isSpecial = isSpecial
self.loyaltyDays = loyaltyDays
CatalogItem.CatalogItem.makeNewItem(self)
def getPurchaseLimit(self):
return 1
def reachedPurchaseLimit(self, avatar):
if self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder:
if self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder or self in avatar.awardMailboxContents or self in avatar.onAwardOrder:
return 1
if self.emoteIndex >= len(avatar.emoteAccess):
return 0
@ -114,14 +115,21 @@ class CatalogEmoteItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.emoteIndex = di.getUint8()
self.isSpecial = di.getBool()
self.loyaltyDays = di.getUint16()
if self.emoteIndex > len(OTPLocalizer.EmoteList):
raise ValueError
def encodeDatagram(self, dg, store):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint8(self.emoteIndex)
dg.addBool(self.isSpecial)
dg.addUint16(self.loyaltyDays)
def isGift(self):
return not self.getEmblemPrices()
if self.getEmblemPrices():
return 0
if self.loyaltyRequirement() > 0:
return 0
elif self.emoteIndex in LoyaltyEmoteItems:
return 0
else:
return 1

View file

@ -12,8 +12,8 @@ from CatalogMouldingItem import CatalogMouldingItem, getAllMouldings
from CatalogWainscotingItem import CatalogWainscotingItem, getAllWainscotings
from CatalogWindowItem import CatalogWindowItem
from CatalogPoleItem import nextAvailablePole, getAllPoles
from CatalogTankItem import nextAvailableTank, getAllTanks
from CatalogPetTrickItem import CatalogPetTrickItem, getAllPetTricks
from CatalogTankItem import nextAvailableTank, getAllTanks
from CatalogGardenItem import CatalogGardenItem
from CatalogToonStatueItem import CatalogToonStatueItem
from CatalogRentalItem import CatalogRentalItem
@ -26,7 +26,7 @@ from toontown.toonbase import ToontownGlobals
import types
import random
import time
from panda3d.core import *
from pandac.PandaModules import *
MetaItems = {100: getAllClothes(101, 102, 103, 104, 105, 106, 107, 108, 109, 109, 111, 115, 201, 202, 203, 204, 205, 206, 207, 208, 209, 209, 211, 215),
300: getAllClothes(301, 302, 303, 304, 305, 308, 401, 403, 404, 405, 407, 451, 452, 453),
2000: getChatRange(0, 1999),
@ -41,25 +41,20 @@ MetaItems = {100: getAllClothes(101, 102, 103, 104, 105, 106, 107, 108, 109, 109
2921: getChatRange(12050, 12099),
2930: getChatRange(13000, 13099),
2940: getChatRange(14000, 14099),
3000: getWallpapers(1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100),
3010: getWallpapers(2200, 2300, 2400, 2500, 2600, 2700, 2800),
3020: getWallpapers(2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600),
3030: getWallpapers(3700, 3800, 3900),
3500: getAllWainscotings(1000, 1010),
3510: getAllWainscotings(1020),
3520: getAllWainscotings(1030),
3530: getAllWainscotings(1040),
4000: getFloorings(1000, 1010, 1020, 1030, 1040, 1050, 1060, 1070, 1080, 1090, 1100),
4010: getFloorings(1110, 1120, 1130),
4020: getFloorings(1140, 1150, 1160, 1170, 1180, 1190),
4500: getAllMouldings(1000, 1010),
4510: getAllMouldings(1020, 1030, 1040),
4520: getAllMouldings(1070),
5000: getAllPetTricks()}
MetaItemChatKeysSold = (2000,
2010,
@ -401,7 +396,29 @@ MonthlySchedule = ((7,
15,
8,
15,
2010,
2010,
((4, 2940),)),
(9,
1,
9,
30,
(CatalogGardenItem(135, 1),)),
(1,
1,
1,
31,
(CatalogGardenItem(135, 1),)),
(4,
1,
4,
30,
(CatalogGardenItem(135, 1),)),
(6,
1,
6,
30,
(CatalogGardenItem(135, 1),)),
(6,
26,
7,
@ -460,16 +477,22 @@ MonthlySchedule = ((7,
9,
7,
15,
2010,
2010,
(CatalogClothingItem(1751, 0),)),
(6,
14,
7,
15,
2010,
2010,
(CatalogClothingItem(1754, 0), CatalogClothingItem(1755, 0), CatalogClothingItem(1756, 0))),
(7,
21,
8,
17,
2010,
2010,
(CatalogClothingItem(1749, 0),
CatalogClothingItem(1750, 0),
CatalogClothingItem(1757, 0),
@ -478,6 +501,8 @@ MonthlySchedule = ((7,
25,
9,
21,
2010,
2010,
(CatalogClothingItem(1763, 0),)),
(6,
5,
@ -488,43 +513,48 @@ MonthlySchedule = ((7,
1,
12,
31,
(
CatalogGardenItem(100, 1),
(CatalogGardenItem(100, 1),
CatalogGardenItem(101, 1),
CatalogGardenItem(103, 1),
CatalogGardenItem(104, 1),
CatalogToonStatueItem(105, endPoseIndex=108),
CatalogRentalItem(1, 2880, 1000),
CatalogRentalItem(2, 2890, 1000),
CatalogGardenStarterItem(),
CatalogFurnitureItem(1530),
CatalogFurnitureItem(1531),
CatalogFurnitureItem(1532),
CatalogClothingItem(1605, 0, True),
CatalogClothingItem(1602, 0, True),
CatalogClothingItem(1604, 0, True),
CatalogClothingItem(1601, 0, True),
CatalogClothingItem(1603, 0, True),
CatalogClothingItem(1600, 0, True),
CatalogEmoteItem(20, True),
CatalogEmoteItem(21, True),
CatalogEmoteItem(22, True),
CatalogEmoteItem(23, True),
CatalogEmoteItem(24, True),
CatalogEmoteItem(25, True),
CatalogEmoteItem(26, True),
CatalogNametagItem(15, True),
CatalogNametagItem(16, True),
CatalogNametagItem(17, True))),
CatalogFurnitureItem(1532),
CatalogNametagItem(15),
CatalogNametagItem(16),
CatalogNametagItem(17),
CatalogClothingItem(1608, 0, 720),
CatalogClothingItem(1605, 0, 720),
CatalogClothingItem(1602, 0, 720),
CatalogClothingItem(1607, 0, 540),
CatalogClothingItem(1604, 0, 540),
CatalogClothingItem(1601, 0, 540),
CatalogClothingItem(1606, 0, 360),
CatalogClothingItem(1603, 0, 360),
CatalogClothingItem(1600, 0, 360),
CatalogEmoteItem(25, 30),
CatalogEmoteItem(26, 60),
CatalogEmoteItem(20, 90),
CatalogEmoteItem(21, 180),
CatalogEmoteItem(22, 360),
CatalogEmoteItem(23, 540),
CatalogEmoteItem(24, 720))),
(5,
26,
6,
30,
2013,
2013,
(CatalogAccessoryItem(175),)),
(8,
27,
9,
5,
2013,
2013,
((3, 2900),
CatalogChatItem(10003),
CatalogClothingItem(1001, 0),
@ -574,6 +604,8 @@ MonthlySchedule = ((7,
3,
9,
12,
2013,
2013,
((3, 2910),
CatalogFurnitureItem(680),
CatalogFurnitureItem(681),
@ -608,6 +640,8 @@ MonthlySchedule = ((7,
20,
9,
19,
2013,
2013,
(CatalogAccessoryItem(101),
CatalogAccessoryItem(103),
CatalogAccessoryItem(117),
@ -830,9 +864,7 @@ WeeklySchedule = ((100,
CatalogFurnitureItem(1000),
CatalogClothingItem(117, 0),
CatalogClothingItem(217, 0),
nextAvailableCloset,
nextAvailableBank,
nextAvailableTank),
nextAvailableCloset),
(100,
(5, 2000),
CatalogFurnitureItem(1430),
@ -1353,7 +1385,7 @@ WeeklySchedule = ((100,
Sale(CatalogClothingItem(116, 0), CatalogClothingItem(216, 0), CatalogClothingItem(408, 0), CatalogClothingItem(117, 0), CatalogClothingItem(217, 0), CatalogClothingItem(409, 0), CatalogClothingItem(118, 0), CatalogClothingItem(218, 0), CatalogClothingItem(410, 0), CatalogClothingItem(119, 0), CatalogClothingItem(219, 0), CatalogClothingItem(120, 0), CatalogClothingItem(220, 0), CatalogClothingItem(121, 0), CatalogClothingItem(221, 0), CatalogClothingItem(222, 0), CatalogClothingItem(123, 0), CatalogClothingItem(224, 0), CatalogClothingItem(411, 0), CatalogClothingItem(311, 0), CatalogClothingItem(310, 0)),
Sale(CatalogWindowItem(40), CatalogWindowItem(70), CatalogWindowItem(50), CatalogWindowItem(60), CatalogWindowItem(80), CatalogWindowItem(100), CatalogWindowItem(90), CatalogWindowItem(110)),
Sale(CatalogEmoteItem(5), CatalogEmoteItem(9), CatalogEmoteItem(13), CatalogEmoteItem(11), CatalogEmoteItem(6), CatalogEmoteItem(8), CatalogNametagItem(10)),
Sale(CatalogFurnitureItem(600), CatalogFurnitureItem(610), CatalogFurnitureItem(620), CatalogFurnitureItem(630), CatalogFurnitureItem(640), CatalogFurnitureItem(650), CatalogFurnitureItem(660), CatalogFurnitureItem(900), CatalogFurnitureItem(910), CatalogFurnitureItem(920), CatalogFurnitureItem(930), CatalogFurnitureItem(940), CatalogFurnitureItem(1000), CatalogFurnitureItem(1010), CatalogFurnitureItem(1020), CatalogFurnitureItem(1030), CatalogFurnitureItem(1400), CatalogFurnitureItem(1410), CatalogFurnitureItem(1420), CatalogFurnitureItem(1430), CatalogFurnitureItem(1440), CatalogFurnitureItem(1441), CatalogFurnitureItem(1442), CatalogFurnitureItem(1443), CatalogFurnitureItem(1500), CatalogFurnitureItem(1510), CatalogFurnitureItem(1520), CatalogFurnitureItem(1530), CatalogFurnitureItem(1531), CatalogFurnitureItem(1532), CatalogFurnitureItem(1600), CatalogFurnitureItem(1610), CatalogFurnitureItem(1620), CatalogFurnitureItem(1630), CatalogFurnitureItem(1640), CatalogFurnitureItem(1650), CatalogFurnitureItem(1660), CatalogFurnitureItem(1661), CatalogFurnitureItem(1710), CatalogFurnitureItem(1800), CatalogFurnitureItem(1810), CatalogFurnitureItem(1900), CatalogFurnitureItem(1910)),
Sale(CatalogFurnitureItem(600), CatalogFurnitureItem(610), CatalogFurnitureItem(620), CatalogFurnitureItem(630), CatalogFurnitureItem(640), CatalogFurnitureItem(650), CatalogFurnitureItem(660), CatalogFurnitureItem(900), CatalogFurnitureItem(910), CatalogFurnitureItem(920), CatalogFurnitureItem(930), CatalogFurnitureItem(940), CatalogFurnitureItem(1000), CatalogFurnitureItem(1010), CatalogFurnitureItem(1020), CatalogFurnitureItem(1030), CatalogFurnitureItem(1400), CatalogFurnitureItem(1410), CatalogFurnitureItem(1420), CatalogFurnitureItem(1430), CatalogFurnitureItem(1440), CatalogFurnitureItem(1441), CatalogFurnitureItem(1442), CatalogFurnitureItem(1443), CatalogFurnitureItem(1500), CatalogFurnitureItem(1510), CatalogFurnitureItem(1520), CatalogFurnitureItem(1530), CatalogFurnitureItem(1600), CatalogFurnitureItem(1531), CatalogFurnitureItem(1532), CatalogFurnitureItem(1610), CatalogFurnitureItem(1620), CatalogFurnitureItem(1630), CatalogFurnitureItem(1640), CatalogFurnitureItem(1650), CatalogFurnitureItem(1660), CatalogFurnitureItem(1661), CatalogFurnitureItem(1710), CatalogFurnitureItem(1800), CatalogFurnitureItem(1810), CatalogFurnitureItem(1900), CatalogFurnitureItem(1910)),
(300,
(1, 2020),
(2, 2030),
@ -1480,9 +1512,12 @@ class CatalogGenerator:
def __init__(self):
self.__itemLists = {}
self.__releasedItemLists = {}
if config.GetBool('save-catalog-schedule', False):
self.outputSchedule('catalog-schedule.txt')
def getReleasedCatalogList(self, weekStart):
dayNumber = int(weekStart / (24 * 60))
itemLists = self.__getReleasedItemLists(dayNumber, weekStart)
return itemLists
def generateMonthlyCatalog(self, avatar, weekStart):
dayNumber = int(weekStart / (24 * 60))
@ -1512,13 +1547,12 @@ class CatalogGenerator:
if nextAvailableCloset not in schedule:
weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0)
if nextAvailableBank not in schedule:
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0)
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem = 0)
if nextAvailableTank not in schedule:
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem=0)
if True:
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem = 0)
if time.time() < 1096617600.0:
def hasPetTrick(catalog):
for item in catalog:
@ -1528,6 +1562,7 @@ class CatalogGenerator:
return 0
if not hasPetTrick(weeklyCatalog) and not hasPetTrick(avatar.weeklyCatalog) and not hasPetTrick(avatar.backCatalog):
self.notify.debug('Artificially adding pet trick to catalog')
weeklyCatalog += self.__selectItem(avatar, 5000, monthlyCatalog, saleItem=saleItem)
self.notify.debug('Generated catalog: %s' % weeklyCatalog)
return weeklyCatalog
@ -1557,12 +1592,45 @@ class CatalogGenerator:
return backCatalog
def __getReleasedItemLists(self, dayNumber, weekStart):
itemLists = self.__releasedItemLists.get(dayNumber)
if itemLists != None:
return itemLists
else:
self.__releasedItemLists.clear()
testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0)
nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60)
year = nowtuple[0]
month = nowtuple[1]
day = nowtuple[2]
itemLists = []
for monthlyItems in MonthlySchedule:
startMM = monthlyItems[0]
startDD = monthlyItems[1]
endMM = monthlyItems[2]
endDD = monthlyItems[3]
if len(monthlyItems) == 7:
startYYYY = monthlyItems[4]
endYYYY = monthlyItems[5]
list = monthlyItems[6]
else:
startYYYY = 1969
endYYYY = year
list = monthlyItems[4]
pastStart = year > startYYYY or (year == startYYYY and (month > startMM or (month == startMM and day >= startDD)))
if pastStart:
itemLists.append(list)
self.__releasedItemLists[dayNumber] = itemLists
return itemLists
def __getMonthlyItemLists(self, dayNumber, weekStart):
itemLists = self.__itemLists.get(dayNumber)
if itemLists != None:
return itemLists
testDaysAhead = config.GetInt('test-server-holiday-days-ahead', 0)
testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0)
nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60)
year = nowtuple[0]
month = nowtuple[1]
day = nowtuple[2]
self.notify.debug('Generating seasonal itemLists for %s/%s.' % (month, day))
@ -1572,9 +1640,16 @@ class CatalogGenerator:
startDD = monthlyItems[1]
endMM = monthlyItems[2]
endDD = monthlyItems[3]
list = monthlyItems[4]
pastStart = month > startMM or (month == startMM and day >= startDD)
beforeEnd = month < endMM or (month == endMM and day <= endDD)
if len(monthlyItems) == 7:
startYYYY = monthlyItems[4]
endYYYY = monthlyItems[5]
list = monthlyItems[6]
else:
startYYYY = 1969
endYYYY = year
list = monthlyItems[4]
pastStart = year >= startYYYY and (month > startMM or (month == startMM and day >= startDD))
beforeEnd = year <= endYYYY and (month < endMM or (month == endMM and day <= endDD))
if endMM < startMM:
if pastStart or beforeEnd:
itemLists.append(list)
@ -1705,33 +1780,31 @@ class CatalogGenerator:
def __recordSchedule(self, sched, weekCode, schedule):
if isinstance(schedule, Sale):
schedule = schedule.args
try:
for item in list(schedule):
if callable(item):
if item == nextAvailablePole:
item = getAllPoles()
elif item == nextAvailableCloset:
item = getAllClosets()
elif item == nextAvailableBank:
item = getAllBanks()
elif item == nextAvailableTank:
item = getAllTanks()
elif item == get50ItemCloset:
item = getMaxClosets()
else:
self.notify.warning("Don't know how to interpret function " % repr(name))
item = None
elif isinstance(item, types.TupleType):
item = item[1]
if isinstance(item, types.IntType):
item = MetaItems[item]
if isinstance(item, CatalogItem.CatalogItem):
self.__recordScheduleItem(sched, weekCode, None, item)
elif item != None:
for i in item:
self.__recordScheduleItem(sched, None, weekCode, i)
except:
print 'Wrong: %s' % schedule
for item in schedule:
if callable(item):
if item == nextAvailablePole:
item = getAllPoles()
elif item == nextAvailableCloset:
item = getAllClosets()
elif item == nextAvailableBank:
item = getAllBanks()
elif item == nextAvailableTank:
item == getAllTanks()
elif item == get50ItemCloset:
item = getMaxClosets()
else:
self.notify.warning("Don't know how to interpret function " % repr(name))
item = None
elif isinstance(item, types.TupleType):
item = item[1]
if isinstance(item, types.IntType):
item = MetaItems[item]
if isinstance(item, CatalogItem.CatalogItem):
self.__recordScheduleItem(sched, weekCode, None, item)
elif item != None:
for i in item:
self.__recordScheduleItem(sched, None, weekCode, i)
return
def __recordScheduleItem(self, sched, weekCode, maybeWeekCode, item):

View file

@ -20,7 +20,7 @@ CatalogTypeUnspecified = 0
CatalogTypeWeekly = 1
CatalogTypeBackorder = 2
CatalogTypeMonthly = 3
CatalogTypeSpecial = 4
CatalogTypeLoyalty = 4
class CatalogItem:
notify = DirectNotifyGlobal.directNotify.newCategory('CatalogItem')
@ -32,7 +32,6 @@ class CatalogItem:
self.giftTag = None
self.giftCode = 0
self.hasPicture = False
self.isSpecial = False
self.volume = 0
self.specialEventId = 0
if len(args) >= 1 and isinstance(args[0], DatagramIterator):
@ -125,8 +124,14 @@ class CatalogItem:
def forGirlsOnly(self):
return 0
def getIsSpecial(self):
return self.isSpecial
def setLoyaltyRequirement(self, days):
self.loyaltyDays = days
def loyaltyRequirement(self):
if not hasattr(self, 'loyaltyDays'):
return 0
else:
return self.loyaltyDays
def getPrice(self, catalogType):
if catalogType == CatalogTypeBackorder:
@ -375,6 +380,13 @@ class CatalogItem:
def getRequestPurchaseErrorTextTimeout(self):
return 6
def getDaysToGo(self, avatar):
accountDays = avatar.getAccountDays()
daysToGo = self.loyaltyRequirement() - accountDays
if daysToGo < 0:
daysToGo = 0
return int(daysToGo)
def encodeCatalogItem(dg, item, store):
import CatalogItemTypes

View file

@ -306,6 +306,9 @@ class CatalogItemPanel(DirectFrame):
elif hasattr(self['item'], 'isSkillTooLow') and self['item'].isSkillTooLow(base.localAvatar):
auxText = TTLocalizer.SkillTooLow
self.buyButton['state'] = DGG.DISABLED
elif hasattr(self['item'], 'getDaysToGo') and self['item'].getDaysToGo(base.localAvatar):
auxText = TTLocalizer.DaysToGo % self['item'].getDaysToGo(base.localAvatar)
self.buyButton['state'] = DGG.DISABLED
elif self['item'].getEmblemPrices() and not base.localAvatar.isEnoughMoneyAndEmblemsToBuy(self['item'].getPrice(self['type']), self['item'].getEmblemPrices()):
self.buyButton['state'] = DGG.DISABLED
elif hasattr(self['item'], 'houseId') and self['item'].houseId == localAvatar.houseType:

View file

@ -24,7 +24,7 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
return 0
def reachedPurchaseLimit(self, avatar):
return self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder
return self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder #or self in avatar.awardMailboxContents or self in avatar.onAwardOrder
def saveHistory(self):
return 1
@ -45,14 +45,15 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
return TTLocalizer.RentalTypeName
def recordPurchase(self, avatar, optional):
self.notify.debug('rental -- record purchase')
if avatar:
self.notify.debug('rental -- has avatar')
self.notify.debug('rental -- has avater')
estate = simbase.air.estateManager._lookupEstate(avatar)
if estate:
self.notify.debug('rental -- has estate')
estate.rentItem(self.typeIndex, self.duration)
else:
self.notify.warning('rental -- something not there')
self.notify.debug('rental -- something not there')
return ToontownGlobals.P_ItemAvailable
def getPicture(self, avatar):
@ -125,7 +126,5 @@ def getAllRentalItems():
list = []
for rentalType in (ToontownGlobals.RentalCannon,):
list.append(CatalogRentalItem(rentalType, 2880, 1000))
for rentalType in (ToontownGlobals.RentalGameTable,):
list.append(CatalogRentalItem(rentalType, 2890, 1000))
return list

View file

@ -101,8 +101,8 @@ class CatalogScreen(DirectFrame):
def setNumBackPages(self, numBackPages):
self.numBackPages = numBackPages
def setNumSpecialPages(self, numSpecialPages):
self.numSpecialPages = numSpecialPages
def setNumLoyaltyPages(self, numLoyaltyPages):
self.numLoyaltyPages = numLoyaltyPages
def setNumEmblemPages(self, numEmblemPages):
self.numEmblemPages = numEmblemPages
@ -116,49 +116,49 @@ class CatalogScreen(DirectFrame):
def enableBackorderCatalogButton(self):
self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.DISABLED
self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.DISABLED
def enableNewCatalogButton(self):
self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.DISABLED
self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.DISABLED
def enableSpecialCatalogButton(self):
def enableLoyaltyCatalogButton(self):
self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.NORMAL
self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.DISABLED
def enableEmblemCatalogButton(self):
self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.DISABLED
self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.NORMAL
def modeBackorderCatalog(self):
self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.NORMAL
self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.NORMAL
def modeNewCatalog(self):
self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.NORMAL
self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.NORMAL
def modeSpecialCatalog(self):
def modeLoyaltyCatalog(self):
self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.DISABLED
self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.NORMAL
def modeEmblemCatalog(self):
self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.NORMAL
self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.DISABLED
def showNewItems(self, index = None):
@ -195,15 +195,15 @@ class CatalogScreen(DirectFrame):
self.showPageItems()
return
def showSpecialItems(self, index = None):
def showLoyaltyItems(self, index = None):
if config.GetBool('want-qa-regression', 0):
self.notify.info('QA-REGRESSION: CATALOG: Special item')
self.notify.info('QA-REGRESSION: CATALOG: Loyalty item')
taskMgr.remove('clarabelleHelpText1')
messenger.send('wakeup')
self.viewing = 'Special'
self.modeSpecialCatalog()
self.setMaxPageIndex(self.numSpecialPages)
if self.numSpecialPages == 0:
self.viewing = 'Loyalty'
self.modeLoyaltyCatalog()
self.setMaxPageIndex(self.numLoyaltyPages)
if self.numLoyaltyPages == 0:
self.setPageIndex(-1)
elif index is not None:
self.setPageIndex(index)
@ -238,11 +238,11 @@ class CatalogScreen(DirectFrame):
self.viewing == 'New'
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numBackPages > 0:
self.showBackorderItems()
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numSpecialPages > 0:
self.showSpecialItems()
elif self.viewing == 'Backorder' and self.pageIndex > self.maxPageIndex and self.numSpecialPages > 0:
self.showSpecialItems()
elif self.viewing == 'Special' and self.pageIndex > self.maxPageIndex and self.numEmblemPages > 0:
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numLoyaltyPages > 0:
self.showLoyaltyItems()
elif self.viewing == 'Backorder' and self.pageIndex > self.maxPageIndex and self.numLoyaltyPages > 0:
self.showLoyaltyItems()
elif self.viewing == 'Loyalty' and self.pageIndex > self.maxPageIndex and self.numEmblemPages > 0:
self.showEmblemItems()
else:
self.pageIndex = min(self.pageIndex, self.maxPageIndex)
@ -255,10 +255,10 @@ class CatalogScreen(DirectFrame):
self.pageIndex = self.pageIndex - 1
if self.viewing == 'Backorder' and self.pageIndex < 0 and self.numNewPages > 0:
self.showNewItems(self.numNewPages - 1)
elif self.viewing == 'Special' and self.pageIndex < 0 and self.numBackPages > 0:
elif self.viewing == 'Loyalty' and self.pageIndex < 0 and self.numBackPages > 0:
self.showBackorderItems(self.numBackPages - 1)
elif self.viewing == 'Emblem' and self.pageIndex < 0 and self.numSpecialPages > 0:
self.showSpecialItems(self.numSpecialPages - 1)
elif self.viewing == 'Emblem' and self.pageIndex < 0 and self.numLoyaltyPages > 0:
self.showLoyaltyItems(self.numLoyaltyPages - 1)
else:
self.pageIndex = max(self.pageIndex, -1)
self.showPageItems()
@ -274,16 +274,16 @@ class CatalogScreen(DirectFrame):
self.openCover()
if self.viewing == 'New':
page = self.pageList[self.pageIndex]
newOrBackOrSpecial = 0
newOrBackOrLoyalty = 0
elif self.viewing == 'Backorder':
page = self.backPageList[self.pageIndex]
newOrBackOrSpecial = 1
elif self.viewing == 'Special':
page = self.specialPageList[self.pageIndex]
newOrBackOrSpecial = 2
newOrBackOrLoyalty = 1
elif self.viewing == 'Loyalty':
page = self.loyaltyPageList[self.pageIndex]
newOrBackOrLoyalty = 2
elif self.viewing == 'Emblem':
page = self.emblemPageList[self.pageIndex]
newOrBackOrSpecial = 3
newOrBackOrLoyalty = 3
page.show()
for panel in self.panelDict[page.get_key()]:
panel.load()
@ -293,7 +293,7 @@ class CatalogScreen(DirectFrame):
pIndex = 0
randGen = random.Random()
randGen.seed(base.localAvatar.catalogScheduleCurrentWeek + (self.pageIndex << 8) + (newOrBackOrSpecial << 16))
randGen.seed(base.localAvatar.catalogScheduleCurrentWeek + (self.pageIndex << 8) + (newOrBackOrLoyalty << 16))
for i in xrange(NUM_CATALOG_ROWS):
for j in xrange(NUM_CATALOG_COLS):
if pIndex < len(self.visiblePanels):
@ -308,8 +308,8 @@ class CatalogScreen(DirectFrame):
if self.viewing == 'New':
text = TTLocalizer.CatalogNew
elif self.viewing == 'Special':
text = TTLocalizer.CatalogSpecial
elif self.viewing == 'Loyalty':
text = TTLocalizer.CatalogLoyalty
elif self.viewing == 'Backorder':
text = TTLocalizer.CatalogBackorder
elif self.viewing == 'Emblem':
@ -317,13 +317,13 @@ class CatalogScreen(DirectFrame):
self.pageLabel['text'] = text + ' - %d' % (self.pageIndex + 1)
if self.pageIndex < self.maxPageIndex:
self.nextPageButton.show()
elif self.viewing == 'New' and self.numBackPages == 0 and self.numSpecialPages == 0:
elif self.viewing == 'New' and self.numBackPages == 0 and self.numLoyaltyPages == 0:
self.nextPageButton.hide()
elif self.viewing == 'Backorder' and self.numSpecialPages == 0:
elif self.viewing == 'Backorder' and self.numLoyaltyPages == 0:
self.nextPageButton.hide()
elif self.viewing == 'Special' and self.numEmblemPages == 0:
elif self.viewing == 'Loyalty' and self.numEmblemPages == 0:
self.nextPageButton.hide()
elif self.viewing == 'Special' and self.numEmblemPages > 0:
elif self.viewing == 'Loyalty' and self.numEmblemPages > 0:
self.nextPageButton.show()
elif self.viewing == 'Emblem':
self.nextPageButton.hide()
@ -358,7 +358,7 @@ class CatalogScreen(DirectFrame):
for page in self.backPageList:
page.hide()
for page in self.specialPageList:
for page in self.loyaltyPageList:
page.hide()
for page in self.emblemPageList:
@ -389,26 +389,26 @@ class CatalogScreen(DirectFrame):
self.newCatalogButton2.show()
if self.numBackPages > 0:
self.backCatalogButton2.show()
if self.numSpecialPages > 0:
self.specialCatalogButton2.show()
if self.numLoyaltyPages > 0:
self.loyaltyCatalogButton2.show()
if self.numEmblemPages > 0:
self.emblemCatalogButton2.show()
self.newCatalogButton.hide()
self.backCatalogButton.hide()
self.specialCatalogButton.hide()
self.loyaltyCatalogButton.hide()
self.emblemCatalogButton.hide()
def hideDummyTabs(self):
self.newCatalogButton2.hide()
self.backCatalogButton2.hide()
self.specialCatalogButton2.hide()
self.loyaltyCatalogButton2.hide()
self.emblemCatalogButton2.hide()
if self.numNewPages > 0:
self.newCatalogButton.show()
if self.numBackPages > 0:
self.backCatalogButton.show()
if self.numSpecialPages > 0:
self.specialCatalogButton.show()
if self.numLoyaltyPages > 0:
self.loyaltyCatalogButton.show()
if self.numEmblemPages > 0:
self.emblemCatalogButton.show()
@ -442,14 +442,14 @@ class CatalogScreen(DirectFrame):
self.maxPageIndex = 0
self.numNewPages = 0
self.numBackPages = 5
self.numSpecialPages = 0
self.numLoyaltyPages = 0
self.viewing = 'New'
self.panelList = []
self.backPanelList = []
self.pageList = []
self.backPageList = []
self.specialPanelList = []
self.specialPageList = []
self.loyaltyPanelList = []
self.loyaltyPageList = []
self.emblemPanelList = []
self.emblemPageList = []
self.panelDict = {}
@ -505,19 +505,19 @@ class CatalogScreen(DirectFrame):
-0.2,
0.4), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, lift), image=backDown, pressEffect=0, command=self.showBackorderItems, text=TTLocalizer.CatalogBackorder, text_font=ToontownGlobals.getSignFont(), text_pos=(0.25 - lift, 0.132), text_scale=TTLocalizer.CSbackCatalogButton, text_fg=(0.392, 0.549, 0.627, 1.0), text2_fg=(0.392, 0.349, 0.427, 1.0))
self.backCatalogButton2.hide()
self.specialCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
self.loyaltyCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
0.25,
-0.85,
-0.3), image=[newDown,
newDown,
newDown,
newUp], image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), pressEffect=0, command=self.showSpecialItems, text=TTLocalizer.CatalogSpecial, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text3_pos=(1.0 - lift, 0.112), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
self.specialCatalogButton.hide()
self.specialCatalogButton2 = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
newUp], image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), pressEffect=0, command=self.showLoyaltyItems, text=TTLocalizer.CatalogLoyalty, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text3_pos=(1.0 - lift, 0.112), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
self.loyaltyCatalogButton.hide()
self.loyaltyCatalogButton2 = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
0.25,
-0.85,
-0.3), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), image=newDown, pressEffect=0, command=self.showSpecialItems, text=TTLocalizer.CatalogSpecial, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
self.specialCatalogButton2.hide()
-0.3), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), image=newDown, pressEffect=0, command=self.showLoyaltyItems, text=TTLocalizer.CatalogLoyalty, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
self.loyaltyCatalogButton2.hide()
self.emblemCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 1.05), frameSize=(-0.2,
0.25,
-2.0,
@ -564,8 +564,8 @@ class CatalogScreen(DirectFrame):
self.newCatalogButton2.component('text%d' % i).setR(90)
self.backCatalogButton.component('text%d' % i).setR(90)
self.backCatalogButton2.component('text%d' % i).setR(90)
self.specialCatalogButton.component('text%d' % i).setR(90)
self.specialCatalogButton2.component('text%d' % i).setR(90)
self.loyaltyCatalogButton.component('text%d' % i).setR(90)
self.loyaltyCatalogButton2.component('text%d' % i).setR(90)
self.emblemCatalogButton.component('text%d' % i).setR(90)
self.emblemCatalogButton2.component('text%d' % i).setR(90)
@ -609,8 +609,8 @@ class CatalogScreen(DirectFrame):
continue
if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId:
continue
if item.getIsSpecial():
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
if item.loyaltyRequirement() != 0:
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
elif item.getEmblemPrices():
self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly, parentCatalogScreen=self))
else:
@ -627,8 +627,8 @@ class CatalogScreen(DirectFrame):
continue
if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId:
continue
if item.getIsSpecial():
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
if item.loyaltyRequirement() != 0:
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
elif item.getEmblemPrices():
self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder, parentCatalogScreen=self))
else:
@ -638,8 +638,8 @@ class CatalogScreen(DirectFrame):
self.setNumNewPages(numPages)
numPages = self.packPages(self.backPanelList, self.backPageList, 'back')
self.setNumBackPages(numPages)
numPages = self.packPages(self.specialPanelList, self.specialPageList, 'special')
self.setNumSpecialPages(numPages)
numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
self.setNumLoyaltyPages(numPages)
numPages = self.packPages(self.emblemPanelList, self.emblemPageList, 'emblem')
self.setNumEmblemPages(numPages)
currentWeek = base.localAvatar.catalogScheduleCurrentWeek - 1
@ -752,7 +752,7 @@ class CatalogScreen(DirectFrame):
self.clarabelleFrame.setPosHprScale(-0.01, 0.0, -0.01, 0.0, 0.0, 0.0, 1.02, 1.0, 1.02)
def reload(self):
for panel in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList:
for panel in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
panel.destroy()
def priceSort(a, b, type):
@ -764,23 +764,23 @@ class CatalogScreen(DirectFrame):
self.maxPageIndex = 0
self.numNewPages = 0
self.numBackPages = 5
self.numSpecialPages = 0
self.numLoyaltyPages = 0
self.viewing = 'New'
self.panelList = []
self.backPanelList = []
self.specialList = []
self.loyaltyList = []
self.pageList = []
self.backPageList = []
self.specialPanelList = []
self.specialPageList = []
self.loyaltyPanelList = []
self.loyaltyPageList = []
self.panelDict = {}
self.visiblePanels = []
itemList = base.localAvatar.monthlyCatalog + base.localAvatar.weeklyCatalog
itemList.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeWeekly))
itemList.reverse()
for item in itemList:
if item.getIsSpecial():
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
if item.loyaltyRequirement() != 0:
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
else:
self.panelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly))
@ -788,8 +788,8 @@ class CatalogScreen(DirectFrame):
itemList.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeBackorder))
itemList.reverse()
for item in itemList:
if item.getIsSpecial():
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
if item.loyaltyRequirement() != 0:
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
else:
self.backPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder))
@ -797,8 +797,8 @@ class CatalogScreen(DirectFrame):
self.setNumNewPages(numPages)
numPages = self.packPages(self.backPanelList, self.backPageList, 'back')
self.setNumBackPages(numPages)
numPages = self.packPages(self.specialPanelList, self.specialPageList, 'special')
self.setNumSpecialPages(numPages)
numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
self.setNumLoyaltyPages(numPages)
seriesNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) / ToontownGlobals.CatalogNumWeeksPerSeries + 1
self.catalogSeries['text'] = Localizer.CatalogSeriesLabel % seriesNumber
weekNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) % ToontownGlobals.CatalogNumWeeksPerSeries + 1
@ -820,7 +820,7 @@ class CatalogScreen(DirectFrame):
self.destroy()
del self.base
del self.squares
for panel in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList:
for panel in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
panel.destroy()
del self.panelList
@ -838,8 +838,8 @@ class CatalogScreen(DirectFrame):
del self.newCatalogButton2
del self.backCatalogButton
del self.backCatalogButton2
del self.specialCatalogButton
del self.specialCatalogButton2
del self.loyaltyCatalogButton
del self.loyaltyCatalogButton2
del self.pageLabel
if self.createdGiftGui:
del self.giftToggle
@ -878,8 +878,8 @@ class CatalogScreen(DirectFrame):
self.newCatalogButton2.hide()
self.backCatalogButton.hide()
self.backCatalogButton2.hide()
self.specialCatalogButton.hide()
self.specialCatalogButton2.hide()
self.loyaltyCatalogButton.hide()
self.loyaltyCatalogButton2.hide()
self.emblemCatalogButton.hide()
self.emblemCatalogButton2.hide()
self.hangup.hide()
@ -901,7 +901,7 @@ class CatalogScreen(DirectFrame):
self.__giftToggle()
if hasattr(self, 'beanBank'):
self.beanBank['text'] = str(base.localAvatar.getTotalMoney())
for item in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList:
for item in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
if type(item) != type(''):
item.updateButtons(self.gifting)

View file

@ -151,7 +151,7 @@ class DistributedPhoneAI(DistributedFurnitureItemAI):
if isinstance(item, CatalogInvalidItem.CatalogInvalidItem):
self.air.writeServerEvent('suspicious', avId, 'tried purchasing invalid item')
self.notify.warning('%d tried purchasing invalid item' % avId)
return ToontownGlobals.P_NotInCatalog
return ToontownGlobals.P_NotInCatalog
elif (not item.hasEmblemPrices()) and item not in av.backCatalog and item not in av.weeklyCatalog and item not in av.monthlyCatalog:
self.air.writeServerEvent('suspicious', avId, 'tried purchasing non-existing item')
self.notify.warning('%d tried purchasing non-existing item' % avId)

View file

@ -1662,6 +1662,9 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def setPinkSlips(self, pinkSlips):
DistributedToon.DistributedToon.setPinkSlips(self, pinkSlips)
self.inventory.updateTotalPropsText()
def getAccountDays(self):
return base.cr.accountDateMgr.getAccountDays()
def hasActiveBoardingGroup(self):
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty:

View file

@ -5451,7 +5451,7 @@ CatalogCurrency = 'beans'
CatalogHangUp = 'Hang Up'
CatalogNew = 'NEW'
CatalogBackorder = 'BACKORDER'
CatalogSpecial = 'SPECIAL'
CatalogLoyalty = 'SPECIAL'
CatalogEmblem = 'EMBLEM'
CatalogPagePrefix = 'Page'
CatalogGreeting = "Hello! Thanks for calling Clarabelle's Cattlelog. Can I help you?"
@ -8133,6 +8133,7 @@ ElevatorLawBotCourse0 = 'Office A'
ElevatorLawBotCourse1 = 'Office B'
ElevatorLawBotCourse2 = 'Office C'
ElevatorLawBotCourse3 = 'Office D'
DaysToGo = 'Wait\n%s Days'
IceGameTitle = 'Ice Slide'
IceGameInstructions = 'Get as close to the center by the end of the second round. Use arrow keys to change direction and force. Press Ctrl to launch your toon. Hit barrels for extra points and avoid the TNT!'
IceGameInstructionsNoTnt = 'Get as close to the center by the end of the second round. Use arrow keys to change direction and force. Press Ctrl to launch your toon. Hit barrels for extra points.'

View file

@ -329,7 +329,7 @@ class LoginAccountFSM(OperationFSM):
'ACCOUNT_AV_SET': [0] * 6,
'ESTATE_ID': 0,
'ACCOUNT_AV_SET_DEL': [],
'CREATED': time.time(),
'CREATED': time.ctime(),
'LAST_LOGIN': time.ctime(),
'LAST_LOGIN_TS': time.time(),
'ACCOUNT_ID': str(self.userId),