Ignoring!

This commit is contained in:
DenialMC 2015-04-07 21:43:25 +03:00
parent 9568591627
commit 3ec488f39c
41 changed files with 102 additions and 552 deletions

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -24,10 +24,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -26,10 +26,6 @@ uberdogs:
id: 4501
anonymous: false
- class: AvatarFriendsManager
id: 4686
anonymous: false
- class: PlayerFriendsManager
id: 4687
anonymous: false

View file

@ -9,7 +9,6 @@ from otp.ai import MagicWordManager/AI
from otp.avatar import DistributedAvatar/AI/UD
from otp.avatar import DistributedPlayer/AI
from otp.friends import FriendManager/AI
from otp.friends import AvatarFriendsManager/UD
from otp.friends import PlayerFriendsManager/UD
from otp.friends import GuildManager/AI/UD
from otp.friends import FriendInfo
@ -401,22 +400,6 @@ dclass GuildManager : DistributedObject, LeaderBoardReceiver, TalkPath_group {
avatarDeleted(uint32);
};
dclass AvatarFriendsManager : DistributedObject {
online();
requestInvite(uint32) airecv clsend;
friendConsidering(uint32) airecv clsend;
invitationFrom(uint32, string);
retractInvite(uint32);
rejectInvite(uint32, uint32);
requestRemove(uint32) airecv clsend;
rejectRemove(uint32, uint32);
updateAvatarFriend(uint32, AvatarFriendInfo);
removeAvatarFriend(uint32);
updateAvatarName(uint32, string);
avatarOnline(uint32, uint32, string, bool, bool, string, string);
avatarOffline(uint32);
};
dclass PlayerFriendsManager : DistributedObject, TalkPath_account {
requestInvite(uint32, uint32, uint8) airecv clsend;
invitationFrom(uint32, string);
@ -712,10 +695,6 @@ from toontown.uberdog.DistributedPartyManager/AI/UD import DistributedPartyManag
from toontown.rpc.AwardManager/UD import AwardManager/UD
from toontown.coderedemption.TTCodeRedemptionMgr/AI import TTCodeRedemptionMgr/AI
from toontown.friends.TrueFriendsMgr/AI import TrueFriendsMgr/AI
from toontown.ai.DistributedPhaseEventMgr/AI import DistributedPhaseEventMgr/AI
from toontown.ai.DistributedHydrantZeroMgr/AI import DistributedHydrantZeroMgr/AI
from toontown.ai.DistributedMailboxZeroMgr/AI import DistributedMailboxZeroMgr/AI
from toontown.ai.DistributedTrashcanZeroMgr/AI import DistributedTrashcanZeroMgr/AI
from toontown.ai import DistributedSillyMeterMgr/AI
from toontown.cogdominium import DistributedCogdoInterior/AI
from toontown.cogdominium import DistributedCogdoBattleBldg/AI
@ -875,6 +854,7 @@ dclass DistributedToon : DistributedPlayer {
setBattleId(uint32 = 0) required broadcast ram;
setExperience(blob = [0*14]) required broadcast db;
setTrueFriends(uint32[]) required ownrecv db;
setIgnored(uint32[]) required clsend airecv ownrecv db;
setMaxCarry(uint8 = 20) required ownrecv db;
setTrackAccess(uint16[] = [0,0,0,0,1,1,0]) required broadcast ownrecv db;
setTrackProgress(int8 = -1, uint32 = 0) required ownrecv db;
@ -3192,9 +3172,6 @@ dclass DistributedVineGame : DistributedMinigame {
setVineSections(uint8[]) required broadcast ram;
};
dclass TTAvatarFriendsManager : AvatarFriendsManager {
};
dclass TTPlayerFriendsManager : PlayerFriendsManager {
};
@ -3687,21 +3664,9 @@ dclass TTUFriendsManager : DistributedObjectGlobal {
};
dclass DistributedPhaseEventMgr : DistributedObject {
dclass DistributedSillyMeterMgr : DistributedObject {
setNumPhases(uint8) required broadcast ram;
setDates(datetime []) broadcast required;
setCurPhase(int8) required broadcast ram;
setIsRunning(bool) required broadcast ram;
};
dclass DistributedHydrantZeroMgr : DistributedPhaseEventMgr {
};
dclass DistributedMailboxZeroMgr : DistributedPhaseEventMgr {
};
dclass DistributedTrashcanZeroMgr : DistributedPhaseEventMgr {
};
dclass DistributedSillyMeterMgr : DistributedPhaseEventMgr {
};

View file

@ -41,7 +41,6 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
self.friendsList = []
self.oldFriendsList = None
self.timeFriendsListChanged = None
self.ignoreList = []
self.lastFailedTeleportMessage = {}
self._districtWeAreGeneratedOn = None
self.DISLname = ''
@ -149,13 +148,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
def setWhisperSCFrom(self, fromId, msgIndex):
handle = base.cr.identifyAvatar(fromId)
if handle == None:
return
if base.cr.avatarFriendsManager.checkIgnored(fromId):
self.d_setWhisperIgnored(fromId)
return
if fromId in self.ignoreList:
self.d_setWhisperIgnored(fromId)
if handle == None or base.localAvatar.isIgnored(fromId):
return
chatString = SCDecoders.decodeSCStaticTextMsg(msgIndex)
if chatString:
@ -177,11 +170,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
if not self._isValidWhisperSource(handle):
self.notify.warning('displayWhisper from non-toon %s' % fromId)
return
if base.cr.avatarFriendsManager.checkIgnored(fromId):
self.d_setWhisperIgnored(fromId)
return
if fromId in self.ignoreList:
self.d_setWhisperIgnored(fromId)
if base.localAvatar.isIgnored(fromId):
return
chatString = SCDecoders.decodeSCCustomMsg(msgIndex)
if chatString:
@ -195,10 +184,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
def setWhisperSCEmoteFrom(self, fromId, emoteId):
handle = base.cr.identifyAvatar(fromId)
if handle == None:
return
if base.cr.avatarFriendsManager.checkIgnored(fromId):
self.d_setWhisperIgnored(fromId)
if handle == None or base.localAvatar.isIgnored(fromId):
return
chatString = SCDecoders.decodeSCEmoteWhisperMsg(emoteId, handle.getName())
if chatString:
@ -206,9 +192,6 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
base.talkAssistant.receiveAvatarWhisperSpeedChat(TalkAssistant.SPEEDCHAT_EMOTE, emoteId, fromId)
return
def d_setWhisperIgnored(self, sendToId):
pass
def setChatAbsolute(self, chatString, chatFlags, dialogue = None, interrupt = 1, quiet = 0):
DistributedAvatar.DistributedAvatar.setChatAbsolute(self, chatString, chatFlags, dialogue, interrupt)
if not quiet:
@ -232,6 +215,8 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
self.sendUpdate('setChat', [chatString, chatFlags, 0])
def setTalk(self, fromAV, fromAC, avatarName, chat, mods, flags):
if base.localAvatar.isIgnored(fromAV):
return
newText, scrubbed = self.scrubTalk(chat, mods)
self.displayTalk(newText)
if base.talkAssistant.isThought(newText):
@ -242,6 +227,8 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
return
def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags):
if base.localAvatar.isIgnored(fromAV):
return
newText, scrubbed = self.scrubTalk(chat, mods)
self.displayTalkWhisper(fromAV, avatarName, chat, mods)
base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.doId, self.getName(), newText, scrubbed)
@ -256,7 +243,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
def setChat(self, chatString, chatFlags, DISLid):
self.notify.error('Should call setTalk')
chatString = base.talkAssistant.whiteListFilterMessage(chatString)
if base.cr.avatarFriendsManager.checkIgnored(self.doId):
if base.localAvatar.isIgnored(self.doId):
return
if base.localAvatar.garbleChat and not self.isUnderstandable():
chatString = self.chatGarbler.garble(self, chatString)
@ -276,9 +263,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
self.sendUpdate('setSC', [msgIndex])
def setSC(self, msgIndex):
if base.cr.avatarFriendsManager.checkIgnored(self.doId):
return
if self.doId in base.localAvatar.ignoreList:
if base.localAvatar.isIgnored(self.doId):
return
chatString = SCDecoders.decodeSCStaticTextMsg(msgIndex)
if chatString:
@ -294,9 +279,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
self.sendUpdate('setSCCustom', [msgIndex])
def setSCCustom(self, msgIndex):
if base.cr.avatarFriendsManager.checkIgnored(self.doId):
return
if self.doId in base.localAvatar.ignoreList:
if base.localAvatar.isIgnored(self.doId):
return
chatString = SCDecoders.decodeSCCustomMsg(msgIndex)
if chatString:
@ -335,12 +318,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
avatar = base.cr.playerFriendsManager.identifyFriend(requesterId)
if avatar != None:
teleportNotify.debug('avatar is not None')
if base.cr.avatarFriendsManager.checkIgnored(requesterId):
teleportNotify.debug('avatar ignored via avatarFriendsManager')
self.d_teleportResponse(self.doId, 2, 0, 0, 0, sendToId=requesterId)
return
if requesterId in self.ignoreList:
teleportNotify.debug('avatar ignored via ignoreList')
if base.localAvatar.isIgnored(requesterId):
self.d_teleportResponse(self.doId, 2, 0, 0, 0, sendToId=requesterId)
return
if hasattr(base, 'distributedParty'):

View file

@ -267,10 +267,6 @@ class TalkAssistant(DirectObject.DirectObject):
if remoteAvatarOrHandleOrInfo.isUnderstandable():
return True
info = base.cr.playerFriendsManager.findPlayerInfoFromAvId(avatarId)
if info:
if info.understandableYesNo:
return True
info = base.cr.avatarFriendsManager.getFriendInfo(avatarId)
if info:
if info.understandableYesNo:
return True

View file

@ -36,6 +36,8 @@ class TalkHandle(AvatarHandle):
self.accountName = message.getReceiverAccountName()
def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags):
if base.localAvatar.isIgnored(fromAV):
return
newText, scrubbed = localAvatar.scrubTalk(chat, mods)
base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed)
return

View file

@ -2,25 +2,23 @@
from pandac.PandaModules import *
hashVal = 1472811447
hashVal = 1846521813
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot
from toontown.golf import DistributedPhysicsWorld, DistributedGolfHole, DistributedGolfCourse
from toontown.building import DistributedAnimatedProp, DistributedTrophyMgr, DistributedBuilding, DistributedAnimBuilding, DistributedBuildingQueryMgr, DistributedToonInterior, DistributedToonHallInterior, DistributedSuitInterior, DistributedHQInterior, DistributedGagshopInterior, DistributedPetshopInterior, DistributedKartShopInterior, DistributedBankInterior, DistributedBankCollectable, DistributedLibraryInterior, DistributedDoor, DistributedAnimDoor, DistributedKnockKnockDoor, DistributedElevator, DistributedElevatorFSM, DistributedElevatorExt, DistributedElevatorInt, DistributedElevatorFloor, DistributedBossElevator, DistributedVPElevator, DistributedCFOElevator, DistributedCJElevator, DistributedBBElevator, DistributedBoardingParty, DistributedTutorialInterior, DistributedClubElevator
from toontown.uberdog.DistributedPartyManager import DistributedPartyManager
from otp.friends import FriendManager, AvatarFriendsManager, PlayerFriendsManager, GuildManager, FriendInfo, AvatarFriendInfo
from otp.friends import FriendManager, PlayerFriendsManager, GuildManager, FriendInfo, AvatarFriendInfo
from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiveEntity
from toontown.shtiker import DeleteManager, PurchaseManager, NewbiePurchaseManager
from toontown.groups import GroupManager
from toontown.uberdog.ClientServicesManager import ClientServicesManager
from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedPolarBearMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedSillyMeterMgr
from toontown.ai.DistributedTrashcanZeroMgr import DistributedTrashcanZeroMgr
from toontown.uberdog.DistributedMailManager import DistributedMailManager
from otp.chat import ChatAgent
from toontown.parties.GlobalPartyManager import GlobalPartyManager
from toontown.racing.DistributedStartingBlock import DistributedViewingBlock
from toontown.ai.DistributedPhaseEventMgr import DistributedPhaseEventMgr
from toontown.pets.PetDCImports import *
from toontown.suit import DistributedSuitPlanner, DistributedSuitBase, DistributedSuit, DistributedTutorialSuit, DistributedFactorySuit, DistributedMintSuit, DistributedStageSuit, DistributedSellbotBoss, DistributedCashbotBoss, DistributedCashbotBossGoon, DistributedGoon, DistributedGridGoon, DistributedLawbotBoss, DistributedLawbotBossSuit, DistributedBossbotBoss
from toontown.distributed import ToontownDistrict, ToontownDistrictStats, DistributedTimer
@ -31,7 +29,6 @@ from toontown.fishing import DistributedFishingPond, DistributedFishingTarget, D
from toontown.minigame import DistributedMinigame, DistributedMinigameTemplate, DistributedRaceGame, DistributedCannonGame, DistributedPhotoGame, DistributedPatternGame, DistributedRingGame, DistributedTagGame, DistributedMazeGame, DistributedTugOfWarGame, DistributedCatchGame, DistributedDivingGame, DistributedTargetGame, DistributedTravelGame, DistributedPairingGame, DistributedVineGame, DistributedIceGame, DistributedCogThiefGame, DistributedTwoDGame
from toontown.racing import DistributedVehicle, DistributedStartingBlock, DistributedRace, DistributedKartPad, DistributedRacePad, DistributedViewPad, DistributedStartingBlock, DistributedLeaderBoard, DistributedGag, DistributedProjectile
from toontown.catalog import CatalogManager, AccountDate
from toontown.ai.DistributedHydrantZeroMgr import DistributedHydrantZeroMgr
from toontown.rpc.AwardManager import AwardManager
from toontown.parties import DistributedParty, DistributedPartyActivity, DistributedPartyTeamActivity, DistributedPartyCannon, DistributedPartyCannonActivity, DistributedPartyCatchActivity, DistributedPartyWinterCatchActivity, DistributedPartyCogActivity, DistributedPartyWinterCogActivity, DistributedPartyFireworksActivity, DistributedPartyDanceActivityBase, DistributedPartyDanceActivity, DistributedPartyDance20Activity, DistributedPartyValentineDanceActivity, DistributedPartyValentineDance20Activity, DistributedPartyTrampolineActivity, DistributedPartyValentineTrampolineActivity, DistributedPartyVictoryTrampolineActivity, DistributedPartyWinterTrampolineActivity, DistributedPartyTugOfWarActivity, DistributedPartyJukeboxActivityBase, DistributedPartyJukeboxActivity, DistributedPartyJukebox40Activity, DistributedPartyValentineJukeboxActivity, DistributedPartyValentineJukebox40Activity
from toontown.friends.TrueFriendsMgr import TrueFriendsMgr
@ -44,7 +41,6 @@ from toontown.toon import DistributedToon, DistributedNPCToonBase, DistributedNP
from toontown.tutorial import DistributedBattleTutorial, TutorialManager
from toontown.pets import DistributedPetProxy
from toontown.coderedemption.TTCodeRedemptionMgr import TTCodeRedemptionMgr
from toontown.ai.DistributedMailboxZeroMgr import DistributedMailboxZeroMgr
from toontown.uberdog.DistributedDeliveryManager import DistributedDeliveryManager
from direct.distributed import DistributedObject, DistributedNode, DistributedSmoothNode, DistributedCartesianGrid, DistributedCamera, DistributedObjectGlobal
from otp.ai import TimeManager, MagicWordManager

View file

@ -35,7 +35,6 @@ OTP_DO_ID_TOONTOWN_AVATAR_MANAGER = 4682
OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER = 4683
OTP_DO_ID_TOONTOWN_TEMP_STORE_MANAGER = 4684
OTP_DO_ID_SWITCHBOARD_MANAGER = 4685
OTP_DO_ID_AVATAR_FRIENDS_MANAGER = 4686
OTP_DO_ID_PLAYER_FRIENDS_MANAGER = 4687
OTP_DO_ID_CENTRAL_LOGGER = 4688
OTP_DO_ID_CARS_AVATAR_MANAGER = 4689

View file

@ -1,110 +0,0 @@
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.directnotify.DirectNotifyGlobal import directNotify
from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer
class AvatarFriendsManager(DistributedObjectGlobal):
notify = directNotify.newCategory('AvatarFriendsManager')
def __init__(self, cr):
DistributedObjectGlobal.__init__(self, cr)
self.reset()
def reset(self):
self.avatarFriendsList = set()
self.avatarId2Info = {}
self.invitedAvatarsList = []
self.ignoredAvatarList = []
def addIgnore(self, avId):
if avId not in self.ignoredAvatarList:
self.ignoredAvatarList.append(avId)
base.cr.centralLogger.writeClientEvent(
'addIgnore', sender=base.localAvatar.doId, receiver=avId)
messenger.send('AvatarIgnoreChange')
def removeIgnore(self, avId):
if avId in self.ignoredAvatarList:
self.ignoredAvatarList.remove(avId)
base.cr.centralLogger.writeClientEvent(
'removeIgnore', sender=base.localAvatar.doId, receiver=avId)
messenger.send('AvatarIgnoreChange')
def checkIgnored(self, avId):
return avId and avId in self.ignoredAvatarList
def sendRequestInvite(self, avId):
self.notify.debugCall()
self.sendUpdate('requestInvite', [avId])
self.invitedAvatarsList.append(avId)
def sendRequestRemove(self, avId):
self.notify.debugCall()
self.sendUpdate('requestRemove', [avId])
if avId in self.invitedAvatarsList:
self.invitedAvatarsList.remove(avId)
def friendConsidering(self, avId):
self.notify.debugCall()
messenger.send(OTPGlobals.AvatarFriendConsideringEvent, [1, avId])
def invitationFrom(self, avId, avatarName):
self.notify.debugCall()
messenger.send(OTPGlobals.AvatarFriendInvitationEvent, [avId, avatarName])
def retractInvite(self, avId):
self.notify.debugCall()
messenger.send(OTPGlobals.AvatarFriendRetractInviteEvent, [avId])
if avId in self.invitedAvatarsList:
self.invitedAvatarsList.remove(avId)
def rejectInvite(self, avId, reason):
self.notify.debugCall()
messenger.send(OTPGlobals.AvatarFriendRejectInviteEvent, [avId, reason])
if avId in self.invitedAvatarsList:
self.invitedAvatarsList.remove(avId)
def rejectRemove(self, avId, reason):
self.notify.debugCall()
messenger.send(OTPGlobals.AvatarFriendRejectRemoveEvent, [avId, reason])
def updateAvatarFriend(self, avId, info):
if hasattr(info, 'avatarId') and not info.avatarId and avId:
info.avatarId = avId
if avId not in self.avatarFriendsList:
self.avatarFriendsList.add(avId)
self.avatarId2Info[avId] = info
messenger.send(OTPGlobals.AvatarFriendAddEvent, [avId, info])
if self.avatarId2Info[avId].onlineYesNo != info.onlineYesNo:
base.talkAssistant.receiveFriendUpdate(avId, info.getName(), info.onlineYesNo)
self.avatarId2Info[avId] = info
messenger.send(OTPGlobals.AvatarFriendUpdateEvent, [avId, info])
if avId in self.invitedAvatarsList:
self.invitedAvatarsList.remove(avId)
messenger.send(OTPGlobals.AvatarNewFriendAddEvent, [avId])
def removeAvatarFriend(self, avId):
self.avatarFriendsList.remove(avId)
self.avatarId2Info.pop(avId, None)
messenger.send(OTPGlobals.AvatarFriendRemoveEvent, [avId])
return
def setFriends(self, avatarIds):
self.notify.debugCall()
def isFriend(self, avId):
return self.isAvatarFriend(avId)
def isAvatarFriend(self, avId):
return avId in self.avatarFriendsList
def getFriendInfo(self, avId):
return self.avatarId2Info.get(avId)
def countTrueFriends(self):
count = 0
for id in self.avatarId2Info:
if self.avatarId2Info[id].openChatFriendshipYesNo:
count += 1
return count

View file

@ -1,45 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectUD import DistributedObjectUD
class AvatarFriendsManagerUD(DistributedObjectUD):
notify = DirectNotifyGlobal.directNotify.newCategory("AvatarFriendsManagerUD")
def online(self):
pass
def requestInvite(self, todo0):
pass
def friendConsidering(self, todo0):
pass
def invitationFrom(self, todo0, todo1):
pass
def retractInvite(self, todo0):
pass
def rejectInvite(self, todo0, todo1):
pass
def requestRemove(self, todo0):
pass
def rejectRemove(self, todo0, todo1):
pass
def updateAvatarFriend(self, todo0, todo1):
pass
def removeAvatarFriend(self, todo0):
pass
def updateAvatarName(self, todo0, todo1):
pass
def avatarOnline(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6):
pass
def avatarOffline(self, todo0):
pass

View file

@ -85,7 +85,7 @@ class FriendManager(DistributedObject.DistributedObject):
if not hasattr(base, 'localAvatar'):
self.up_inviteeFriendConsidering(0, context)
return
if inviterId in base.localAvatar.ignoreList:
if base.localAvatar.isIgnored(inviterId):
self.up_inviteeFriendConsidering(4, context)
return
if not base.localAvatar.acceptingNewFriends:

View file

@ -202,7 +202,7 @@ class GuildManager(DistributedObjectGlobal):
self.id2BandId[id] = tuple(guy[4:6])
for id, msg in self.pendingMsgs:
if not self.cr.avatarFriendsManager.checkIgnored(id):
if not base.localAvatar.isIgnored(id):
base.talkAssistant.receiveGuildMessage(msg, id, self.id2Name.get(id, 'Unknown'))
if localAvatar.getGuildId():
@ -253,7 +253,7 @@ class GuildManager(DistributedObjectGlobal):
def recvSC(self, senderId, msgIndex):
senderName = self.id2Name.get(senderId, None)
if senderName:
if not self.cr.avatarFriendsManager.checkIgnored(senderId):
if not base.localAvatar.isIgnored(senderId):
displayMess = '%s %s %s' % (senderName, OTPLocalizer.GuildPrefix, OTPLocalizer.SpeedChatStaticText[msgIndex])
message = OTPLocalizer.SpeedChatStaticText[msgIndex]
base.talkAssistant.receiveGuildMessage(message, senderId, senderName)
@ -266,7 +266,7 @@ class GuildManager(DistributedObjectGlobal):
senderName = self.id2Name.get(senderId, None)
message = base.talkAssistant.SCDecoder.decodeSCQuestMsgInt(questInt, msgType, taskNum)
if senderName:
if not self.cr.avatarFriendsManager.checkIgnored(senderId):
if not base.localAvatar.isIgnored(senderId):
displayMess = '%s %s %s' % (senderName, OTPLocalizer.GuildPrefix, message)
base.talkAssistant.receiveGuildMessage(message, senderId, senderName)
else:
@ -277,7 +277,7 @@ class GuildManager(DistributedObjectGlobal):
def recvAvatarOnline(self, avatarId, avatarName, bandManagerId, bandId):
self.id2Online[avatarId] = True
if hasattr(base, 'localAvatar') and avatarId != base.localAvatar.doId:
if not self.cr.avatarFriendsManager.checkIgnored(avatarId):
if not base.localAvatar.isIgnored(avatarId):
base.talkAssistant.receiveGuildUpdate(avatarId, avatarName, True)
else:
return
@ -287,7 +287,7 @@ class GuildManager(DistributedObjectGlobal):
self.id2BandId[avatarId] = (0, 0)
self.id2Online[avatarId] = False
if hasattr(base, 'localAvatar') and avatarId != base.localAvatar.doId:
if not self.cr.avatarFriendsManager.checkIgnored(avatarId):
if not base.localAvatar.isIgnored(avatarId):
base.talkAssistant.receiveGuildUpdate(avatarId, avatarName, False)
messenger.send('guildMemberOnlineStatus', [avatarId, 0])

View file

@ -29,7 +29,6 @@ WhisperComingToVisit = '%s is coming to visit you.'
WhisperFailedVisit = '%s tried to visit you.'
WhisperTargetLeftVisit = '%s has gone somewhere else. Try again!'
WhisperGiveupVisit = "%s couldn't find you because you're moving around!"
WhisperIgnored = '%s is ignoring you!'
TeleportGreeting = 'Hi, %s.'
WhisperFriendComingOnline = '%s is coming online!'
WhisperFriendLoggedOut = '%s has logged out.'

View file

@ -1,30 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from toontown.ai import DistributedPhaseEventMgr
class DistributedHydrantZeroMgr(DistributedPhaseEventMgr.DistributedPhaseEventMgr):
neverDisable = 1
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedHydrantZeroMgr')
def __init__(self, cr):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.__init__(self, cr)
cr.hydrantZeroMgr = self
def announceGenerate(self):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.announceGenerate(self)
messenger.send('hydrantZeroIsRunning', [self.isRunning])
def delete(self):
self.notify.debug('deleting hydrantzeromgr')
messenger.send('hydrantZeroIsRunning', [False])
DistributedPhaseEventMgr.DistributedPhaseEventMgr.delete(self)
if hasattr(self.cr, 'hydrantZeroMgr'):
del self.cr.hydrantZeroMgr
def setCurPhase(self, newPhase):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setCurPhase(self, newPhase)
messenger.send('hydrantZeroPhase', [newPhase])
def setIsRunning(self, isRunning):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setIsRunning(self, isRunning)
messenger.send('hydrantZeroIsRunning', [isRunning])

View file

@ -1,6 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from toontown.ai.DistributedPhaseEventMgrAI import DistributedPhaseEventMgrAI
class DistributedHydrantZeroMgrAI(DistributedPhaseEventMgrAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedHydrantZeroMgrAI")

View file

@ -1,30 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from toontown.ai import DistributedPhaseEventMgr
class DistributedMailboxZeroMgr(DistributedPhaseEventMgr.DistributedPhaseEventMgr):
neverDisable = 1
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedMailboxZeroMgr')
def __init__(self, cr):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.__init__(self, cr)
cr.mailboxZeroMgr = self
def announceGenerate(self):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.announceGenerate(self)
messenger.send('mailboxZeroIsRunning', [self.isRunning])
def delete(self):
self.notify.debug('deleting mailboxzeromgr')
messenger.send('mailboxZeroIsRunning', [False])
DistributedPhaseEventMgr.DistributedPhaseEventMgr.delete(self)
if hasattr(self.cr, 'mailboxZeroMgr'):
del self.cr.mailboxZeroMgr
def setCurPhase(self, newPhase):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setCurPhase(self, newPhase)
messenger.send('mailboxZeroPhase', [newPhase])
def setIsRunning(self, isRunning):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setIsRunning(self, isRunning)
messenger.send('mailboxZeroIsRunning', [isRunning])

View file

@ -1,6 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from toontown.ai.DistributedPhaseEventMgrAI import DistributedPhaseEventMgrAI
class DistributedMailboxZeroMgrAI(DistributedPhaseEventMgrAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedMailboxZeroMgrAI")

View file

@ -1,32 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
import datetime
class DistributedPhaseEventMgr(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedPhaseEventMgr')
def __init__(self, cr):
DistributedObject.DistributedObject.__init__(self, cr)
self.holidayDates = []
def setIsRunning(self, isRunning):
self.isRunning = isRunning
def setNumPhases(self, numPhases):
self.numPhases = numPhases
def setCurPhase(self, curPhase):
self.curPhase = curPhase
def getIsRunning(self):
return self.isRunning
def getNumPhases(self):
return self.numPhases
def getCurPhase(self):
return self.curPhase
def setDates(self, holidayDates):
for holidayDate in holidayDates:
self.holidayDates.append(datetime.datetime(holidayDate[0], holidayDate[1], holidayDate[2], holidayDate[3], holidayDate[4], holidayDate[5]))

View file

@ -1,18 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class DistributedPhaseEventMgrAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPhaseEventMgrAI")
def setNumPhases(self, todo0):
pass
def setDates(self, todo0):
pass
def setCurPhase(self, todo0):
pass
def setIsRunning(self, todo0):
pass

View file

@ -1,55 +1,26 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from toontown.ai import DistributedPhaseEventMgr
import time
class DistributedSillyMeterMgr(DistributedPhaseEventMgr.DistributedPhaseEventMgr):
class DistributedSillyMeterMgr(DistributedObject.DistributedObject):
neverDisable = 1
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedSillyMeterMgr')
def __init__(self, cr):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.__init__(self, cr)
DistributedObject.DistributedObject.__init__(self, cr)
cr.SillyMeterMgr = self
def announceGenerate(self):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.announceGenerate(self)
messenger.send('SillyMeterIsRunning', [self.isRunning])
def delete(self):
self.notify.debug('deleting SillyMetermgr')
messenger.send('SillyMeterIsRunning', [False])
DistributedPhaseEventMgr.DistributedPhaseEventMgr.delete(self)
if hasattr(self.cr, 'SillyMeterMgr'):
del self.cr.SillyMeterMgr
DistributedObject.DistributedObject.delete(self)
cr.SillyMeterMgr = None
def setCurPhase(self, newPhase):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setCurPhase(self, newPhase)
messenger.send('SillyMeterPhase', [newPhase])
pass
def setIsRunning(self, isRunning):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setIsRunning(self, isRunning)
messenger.send('SillyMeterIsRunning', [isRunning])
pass
def getCurPhaseDuration(self):
if len(self.holidayDates) > 0:
startHolidayDate = self.holidayDates[self.curPhase]
if self.curPhase + 1 >= len(self.holidayDates):
self.notify.error('No end date for phase %' % self.curPhase)
return -1
else:
endHolidayDate = self.holidayDates[self.curPhase + 1]
startHolidayTime = time.mktime(startHolidayDate.timetuple())
endHolidayTime = time.mktime(endHolidayDate.timetuple())
holidayDuration = endHolidayTime - startHolidayTime
if holidayDuration < 0:
self.notify.error('Duration not set for phase %' % self.curPhase)
return -1
else:
return holidayDuration
else:
self.notify.warning('Phase dates not yet known')
return -1
return -1
def getCurPhaseStartDate(self):
if len(self.holidayDates) > 0:
return self.holidayDates[self.curPhase]
return -1

View file

@ -1,30 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from toontown.ai import DistributedPhaseEventMgr
class DistributedTrashcanZeroMgr(DistributedPhaseEventMgr.DistributedPhaseEventMgr):
neverDisable = 1
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedTrashcanZeroMgr')
def __init__(self, cr):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.__init__(self, cr)
cr.trashcanZeroMgr = self
def announceGenerate(self):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.announceGenerate(self)
messenger.send('trashcanZeroIsRunning', [self.isRunning])
def delete(self):
self.notify.debug('deleting trashcanzeromgr')
messenger.send('trashcanZeroIsRunning', [False])
DistributedPhaseEventMgr.DistributedPhaseEventMgr.delete(self)
if hasattr(self.cr, 'trashcanZeroMgr'):
del self.cr.trashcanZeroMgr
def setCurPhase(self, newPhase):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setCurPhase(self, newPhase)
messenger.send('trashcanZeroPhase', [newPhase])
def setIsRunning(self, isRunning):
DistributedPhaseEventMgr.DistributedPhaseEventMgr.setIsRunning(self, isRunning)
messenger.send('trashcanZeroIsRunning', [isRunning])

View file

@ -1,6 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from toontown.ai.DistributedPhaseEventMgrAI import DistributedPhaseEventMgrAI
class DistributedTrashcanZeroMgrAI(DistributedPhaseEventMgrAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedTrashcanZeroMgrAI")

View file

@ -160,7 +160,7 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
def postInvite(self, leaderId, inviterId, merger):
self.notify.debug('post Invite')
if not base.cr.avatarFriendsManager.checkIgnored(inviterId):
if not base.localAvatar.isIgnored(inviterId):
inviter = base.cr.doId2do.get(inviterId)
if inviter:
if self.inviterPanels.isInvitingPanelUp() or self.inviterPanels.isInvitationRejectedPanelUp():

View file

@ -88,7 +88,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.toontownTimeManager = ToontownTimeManager.ToontownTimeManager()
self.csm = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager')
self.avatarFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_AVATAR_FRIENDS_MANAGER, 'AvatarFriendsManager')
self.playerFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_PLAYER_FRIENDS_MANAGER, 'TTPlayerFriendsManager')
self.ttuFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TTU_FRIENDS_MANAGER, 'TTUFriendsManager')
self.deliveryManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')

View file

@ -59,16 +59,7 @@ class FriendInvitee(ToonHeadDialog.ToonHeadDialog):
return
def __handleButton(self, value):
if value == DGG.DIALOG_OK:
if base.friendMode == 0:
base.cr.friendManager.up_inviteeFriendResponse(1, self.context)
elif base.friendMode == 1:
print 'sending Request Invite'
base.cr.avatarFriendsManager.sendRequestInvite(self.avId)
elif base.friendMode == 0:
base.cr.friendManager.up_inviteeFriendResponse(0, self.context)
elif base.friendMode == 1:
base.cr.avatarFriendsManager.sendRequestRemove(self.avId)
base.cr.friendManager.up_inviteeFriendResponse(value == DGG.DIALOG_OK, self.context)
self.context = None
self.cleanup()
return

View file

@ -448,9 +448,6 @@ class FriendInviter(DirectFrame):
unloadFriendInviter()
def __handleCancel(self):
if base.friendMode == 1:
if self.avId:
base.cr.avatarFriendsManager.sendRequestRemove(self.avId)
unloadFriendInviter()
def __handleStop(self):

View file

@ -138,7 +138,7 @@ class FriendsListManager:
def __handleFriendInvitation(self, avId, avName, inviterDna, context):
dna = ToonDNA.ToonDNA()
dna.makeFromNetString(inviterDna)
if not base.cr.avatarFriendsManager.checkIgnored(avId):
if not base.localAvatar.isIgnored(avId):
FriendInvitee.FriendInvitee(avId, avName, dna, context)
def __handlePlayerFriendInvitation(self, avId, avName, inviterDna = None, context = None):
@ -161,7 +161,7 @@ class FriendsListManager:
if askerToon:
self.notify.debug('got toon')
dna = askerToon.getStyle()
if not base.cr.avatarFriendsManager.checkIgnored(avId):
if not base.localAvatar.isIgnored(avId):
FriendInvitee.FriendInvitee(avId, avName, dna, context)
else:
self.notify.debug('no toon')

View file

@ -269,7 +269,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
self.accept('friendPlayers', self.__friendPlayers)
self.accept('friendOffline', self.__friendOffline)
self.accept('friendsListChanged', self.__friendsListChanged)
self.accept('ignoreListChanged', self.__ignoreListChanged)
self.accept('friendsMapComplete', self.__friendsListChanged)
self.accept(OTPGlobals.PlayerFriendAddEvent, self.__friendsListChanged)
self.accept(OTPGlobals.PlayerFriendUpdateEvent, self.__friendsListChanged)
@ -285,7 +284,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
self.ignore('friendOnline')
self.ignore('friendOffline')
self.ignore('friendsListChanged')
self.ignore('ignoreListChanged')
self.ignore('friendsMapComplete')
self.ignore(OTPGlobals.PlayerFriendAddEvent)
self.ignore(OTPGlobals.PlayerFriendUpdateEvent)
@ -482,14 +480,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
playerId,
0))
elif base.friendMode == 1:
for friendId in base.cr.avatarFriendsManager.avatarFriendsList:
playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(friendId)
newFriends.append((friendId,
0,
playerId,
0))
if self.panelType == FLPOnline:
if base.friendMode == 0:
for friendPair in base.localAvatar.friendsList:
@ -538,16 +528,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
playerId,
0))
elif base.friendMode == 1:
for friendId in base.cr.avatarFriendsManager.avatarFriendsList:
friendInfo = base.cr.avatarFriendsManager.avatarId2Info[friendId]
playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(friendPair[0])
if friendInfo.onlineYesNo:
newFriends.insert(0, (friendId,
0,
playerId,
0))
if self.panelType == FLPPets:
for objId, obj in base.cr.doId2do.items():
from toontown.pets import DistributedPet
@ -555,10 +535,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
friendPair = (objId, 0)
petFriends.append(friendPair)
if self.panelType == FLPEnemies:
for ignored in base.localAvatar.ignoreList:
newFriends.append((ignored, 0))
if self.panelType == FLPAll or self.panelType == FLPOnline:
if base.wantPets and base.localAvatar.hasPet():
petFriends.insert(0, (base.localAvatar.getPetId(), 0))
@ -667,7 +643,3 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
def __friendsListChanged(self, arg1 = None, arg2 = None):
if self.panelType != FLPEnemies:
self.__updateScrollList()
def __ignoreListChanged(self):
if self.panelType == FLPEnemies:
self.__updateScrollList()

View file

@ -17,7 +17,7 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel):
return
def getIgnoreButtonInfo(self):
if base.cr.avatarFriendsManager.checkIgnored(self.avId):
if base.localAvatar.isIgnored(self.avId):
return (TTLocalizer.AvatarPanelStopIgnoring, self.handleStopIgnoring, STOP_IGNORE_SCALE)
else:
return (TTLocalizer.AvatarPanelIgnore, self.handleIgnore, IGNORE_SCALE)
@ -69,7 +69,7 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel):
if value == -1:
self.freeLocalAvatar()
return
base.cr.avatarFriendsManager.addIgnore(self.avId)
base.localAvatar.addIgnore(self.avId)
self.dialog = TTDialog.TTGlobalDialog(style=TTDialog.Acknowledge, text=TTLocalizer.IgnorePanelIgnore % self.avName, text_wordwrap=18.5, text_scale=0.06, topPad=0.1, doneEvent='IgnoreComplete', command=self.handleDoneIgnoring)
DirectLabel(parent=self.dialog, relief=None, pos=(0, TTLocalizer.APBdirectLabelPosY, 0.15), text=TTLocalizer.IgnorePanelTitle, textMayChange=0, text_scale=0.08)
self.dialog.show()
@ -81,7 +81,7 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel):
if value == -1:
self.freeLocalAvatar()
return
base.cr.avatarFriendsManager.removeIgnore(self.avId)
base.localAvatar.removeIgnore(self.avId)
self.dialog = TTDialog.TTGlobalDialog(style=TTDialog.Acknowledge, text=TTLocalizer.IgnorePanelEndIgnore % self.avName, text_wordwrap=18.5, text_scale=0.06, topPad=0.1, doneEvent='StopIgnoringComplete', command=self.handleDoneIgnoring)
DirectLabel(parent=self.dialog, relief=None, pos=(0, TTLocalizer.APBdirectLabelPosY, 0.15), text=TTLocalizer.IgnorePanelTitle, textMayChange=0, text_scale=0.08)
self.dialog.show()

View file

@ -186,6 +186,8 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.promotionStatus = [0, 0, 0, 0]
self.buffs = []
self.redeemedCodes = []
self.trueFriends = []
self.ignored = []
def disable(self):
for soundSequence in self.soundSequenceList:
@ -337,7 +339,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
msgIndex])
def setSCToontask(self, taskId, toNpcId, toonProgress, msgIndex):
if self.doId in base.localAvatar.ignoreList:
if base.localAvatar.isIgnored(self.doId):
return
chatString = TTSCDecoders.decodeTTSCToontaskMsg(taskId, toNpcId, toonProgress, msgIndex)
if chatString:
@ -479,18 +481,13 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
return Task.cont
def setTalk(self, fromAV, fromAC, avatarName, chat, mods, flags):
if base.localAvatar.isIgnored(fromAV):
return
timestamp = time.strftime('%m-%d-%Y %H:%M:%S', time.localtime())
if fromAV == 0:
print ':%s: setTalk: %r, %r, %r' % (timestamp, self.doId, self.name, chat)
else:
print ':%s: setTalk: %r, %r, %r' % (timestamp, fromAV, avatarName, chat)
if base.cr.avatarFriendsManager.checkIgnored(fromAV):
self.d_setWhisperIgnored(fromAV)
return
if fromAV in self.ignoreList:
self.d_setWhisperIgnored(fromAV)
return
if base.config.GetBool('want-sleep-reply-on-regular-chat', 0):
if base.localAvatar.sleepFlag == 1:
base.cr.ttuFriendsManager.d_sleepAutoReply(fromAV)
@ -505,11 +502,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if not localAvatar.acceptingNonFriendWhispers:
if not self.isAvFriend(fromAV):
return
if base.cr.avatarFriendsManager.checkIgnored(fromAV):
self.d_setWhisperIgnored(fromAV)
return
if fromAV in self.ignoreList:
self.d_setWhisperIgnored(fromAV)
if base.localAvatar.isIgnored(fromAV):
return
if base.config.GetBool('ignore-whispers', 0):
return
@ -538,8 +531,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if not localAvatar.acceptingNonFriendWhispers:
if not self.isAvFriend(fromId):
return
if base.cr.avatarFriendsManager.checkIgnored(fromId):
self.d_setWhisperIgnored(fromId)
if base.localAvatar.isIgnored(fromId):
return
if base.localAvatar.sleepFlag == 1:
if not base.cr.identifyAvatar(fromId) == base.localAvatar:
@ -560,11 +552,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if not localAvatar.acceptingNonFriendWhispers:
if not self.isAvFriend(fromId):
return
if base.cr.avatarFriendsManager.checkIgnored(fromId):
self.d_setWhisperIgnored(fromId)
return
if fromId in self.ignoreList:
self.d_setWhisperIgnored(fromId)
if base.localAvatar.isIgnored(fromId):
return
if base.localAvatar.sleepFlag == 1:
if not base.cr.identifyAvatar(fromId) == base.localAvatar:
@ -600,8 +588,8 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if not self.isAvFriend(fromId):
return
if fromId in self.ignoreList:
self.d_setWhisperIgnored(fromId)
if base.localAvatar.isIgnored(fromId):
return
chatString = TTSCDecoders.decodeTTSCToontaskMsg(taskId, toNpcId, toonProgress, msgIndex)
if chatString:
@ -2639,6 +2627,35 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def setRedeemedCodes(self, redeemedCodes):
self.redeemedCodes = redeemedCodes
def setTrueFriends(self, trueFriends):
self.trueFriends = trueFriends
def isTrueFriend(self, doId):
return doId in self.trueFriends
def b_setIgnored(self, ignored):
self.setIgnored(ignored)
self.d_setIgnored(ignored)
def setIgnored(self, ignored):
self.ignored = ignored
def d_setIgnored(self, ignored):
self.sendUpdate('setIgnored', [ignored])
def isIgnored(self, doId):
return doId in self.ignored
def addIgnore(self, doId):
if not self.isIgnored(doId):
self.ignored.append(doId)
self.d_setIgnored(self.ignored)
def removeIgnore(self, doId):
if self.isIgnored(doId):
self.ignored.remove(doId)
self.d_setIgnored(self.ignored)
def applyBuffs(self):
for id, timestamp in enumerate(self.buffs):
if id == ToontownGlobals.BMovementSpeed:

View file

@ -196,6 +196,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.buffs = []
self.redeemedCodes = []
self.trueFriends = []
self.ignored = []
def generate(self):
DistributedPlayerAI.DistributedPlayerAI.generate(self)
@ -465,10 +466,26 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
return doId in self.trueFriends
def addTrueFriend(self, doId):
if not isTrueFriend(doId):
if not self.isTrueFriend(doId):
self.trueFriends.append(doId)
self.d_setTrueFriends(self.trueFriends)
def b_setIgnored(self, ignored):
self.d_setIgnored(ignored)
self.setIgnored(ignored)
def d_setIgnored(self, ignored):
self.sendUpdate('setIgnored', [ignored])
def setIgnored(self, ignored):
self.ignored = ignored
def getIgnored(self):
return self.ignored
def isIgnored(self, doId):
return doId in self.ignored
def b_setInventory(self, inventory):
self.setInventory(inventory)
self.d_setInventory(self.getInventory())

View file

@ -2056,7 +2056,7 @@ class Toon(Avatar.Avatar, ToonHead):
def doEmote(self, emoteIndex, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
if not self.isLocal():
if base.cr.avatarFriendsManager.checkIgnored(self.doId):
if base.localAvatar.isIgnored(self.doId):
return
duration = 0
if self.isLocal():

View file

@ -134,7 +134,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
self.friendButton['state'] = DGG.DISABLED
if base.cr.avatarFriendsManager.checkIgnored(self.avId):
if base.localAvatar.isIgnored(self.avId):
self.friendButton['state'] = DGG.DISABLED
self.goToButton = DirectButton(
@ -160,7 +160,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
if base.cr.avatarFriendsManager.checkIgnored(self.avId):
if base.localAvatar.isIgnored(self.avId):
self.goToButton['state'] = DGG.DISABLED
self.whisperButton = DirectButton(
@ -186,7 +186,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
if base.cr.avatarFriendsManager.checkIgnored(self.avId):
if base.localAvatar.isIgnored(self.avId):
self.whisperButton['state'] = DGG.DISABLED
self.secretsButton = DirectButton(
@ -212,7 +212,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
if base.cr.avatarFriendsManager.checkIgnored(self.avId):
if base.localAvatar.isIgnored(self.avId):
self.secretsButton['state'] = DGG.DISABLED

View file

@ -1945,7 +1945,7 @@ ReportPanelRemovedFriend = 'We have automatically removed %s from your Toon Frie
ReportPanelRemovedPlayerFriend = 'We have automatically removed %s as a Player friend so as such you will not see them as your friend in any Toontown United product.'
ReportPanelAlreadyReported = 'You have already reported %s during this session. A Moderator will review your previous report.'
IgnorePanelTitle = 'Ignore A Player'
IgnorePanelAddIgnore = 'Would you like to ignore %s for the rest of this session?'
IgnorePanelAddIgnore = 'Would you like to ignore %s?'
IgnorePanelIgnore = 'You are now ignoring %s.'
IgnorePanelRemoveIgnore = 'Would you like to stop ignoring %s?'
IgnorePanelEndIgnore = 'You are no longer ignoring %s.'