diff --git a/astron/config/clientagent-0.yml b/astron/config/clientagent-0.yml index fab5d392..c4c6a700 100644 --- a/astron/config/clientagent-0.yml +++ b/astron/config/clientagent-0.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-1.yml b/astron/config/clientagent-1.yml index b3c70b0c..9549b6f6 100644 --- a/astron/config/clientagent-1.yml +++ b/astron/config/clientagent-1.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-2.yml b/astron/config/clientagent-2.yml index df23b6d8..b671201b 100644 --- a/astron/config/clientagent-2.yml +++ b/astron/config/clientagent-2.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-3.yml b/astron/config/clientagent-3.yml index 811837e2..3fabcc4a 100644 --- a/astron/config/clientagent-3.yml +++ b/astron/config/clientagent-3.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-4.yml b/astron/config/clientagent-4.yml index b99a122a..d1402e41 100644 --- a/astron/config/clientagent-4.yml +++ b/astron/config/clientagent-4.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-5.yml b/astron/config/clientagent-5.yml index ef034083..18484f46 100644 --- a/astron/config/clientagent-5.yml +++ b/astron/config/clientagent-5.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-6.yml b/astron/config/clientagent-6.yml index 2bcb2f3f..f8375932 100644 --- a/astron/config/clientagent-6.yml +++ b/astron/config/clientagent-6.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/clientagent-7.yml b/astron/config/clientagent-7.yml index ca93110b..4d6bb36c 100644 --- a/astron/config/clientagent-7.yml +++ b/astron/config/clientagent-7.yml @@ -20,18 +20,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/config/cluster.yml b/astron/config/cluster.yml index 41b8d948..b626b0d2 100644 --- a/astron/config/cluster.yml +++ b/astron/config/cluster.yml @@ -22,18 +22,10 @@ uberdogs: id: 4501 anonymous: false - - class: PlayerFriendsManager - id: 4687 - anonymous: false - - class: TTUFriendsManager id: 4666 anonymous: false - - class: TTCodeRedemptionMgr - id: 4695 - anonymous: false - - class: GlobalPartyManager id: 4477 anonymous: false diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index 02171907..1ce0ac99 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -9,9 +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 PlayerFriendsManager/UD -from otp.friends import FriendInfo -from otp.friends import AvatarFriendInfo from otp.distributed import DistributedDistrict/AI/UD from otp.distributed import DistributedDirectory/AI from otp.chat import ChatAgent/UD @@ -247,38 +244,6 @@ dclass FriendManager : DistributedObject { submitSecretResponse(int8, int32); }; -struct FriendInfo { - string avatarName; - uint32 avatarId; - string playerName; - uint8 onlineYesNo; - uint8 openChatEnabledYesNo; - uint8 openChatFriendshipYesNo; - uint8 wlChatEnabledYesNo; - string location; - string sublocation; - uint32 timestamp; -}; - -struct AvatarFriendInfo { - string avatarName; - string playerName; - uint32 playerId; - uint8 onlineYesNo; - uint8 openChatEnabledYesNo; - uint8 openChatFriendshipYesNo; - uint8 wlChatEnabledYesNo; -}; - -struct MemberInfo { - uint32 avatarId; - string avatarName; - uint8 avatarRank; - uint8 avatarOnline; - uint32 bandManagerId; - uint32 bandId; -}; - struct leaderBoardRecordResponces { char found; uint32 id; @@ -307,21 +272,6 @@ dclass LeaderBoard : LeaderBoardReceiver { getTopTenRespondTo(string, uint32); }; -dclass PlayerFriendsManager : DistributedObject { - requestInvite(uint32, uint32, uint8) airecv clsend; - invitationFrom(uint32, string); - retractInvite(uint32); - invitationResponse(uint32, uint16, uint32); - requestDecline(uint32, uint32) airecv clsend; - requestDeclineWithReason(uint32, uint32, uint32) airecv clsend; - requestRemove(uint32, uint32) airecv clsend; - secretResponse(string); - rejectSecret(string); - rejectUseSecret(string); - updatePlayerFriend(uint32, FriendInfo, uint8); - removePlayerFriend(uint32); -}; - dclass CallbackObject { callback(uint32, bool, uint8); }; @@ -559,7 +509,6 @@ from toontown.parties import DistributedPartyJukeboxActivity/AI from toontown.parties import DistributedPartyJukebox40Activity/AI from toontown.parties import DistributedPartyValentineJukeboxActivity/AI from toontown.parties import DistributedPartyValentineJukebox40Activity/AI -from toontown.friends import TTPlayerFriendsManager/UD from toontown.friends import TTUFriendsManager/UD from toontown.safezone import DistributedGolfKart/AI from toontown.safezone import DistributedPicnicBasket/AI @@ -1723,7 +1672,7 @@ dclass NewsManager : DistributedObject { }; dclass PurchaseManager : DistributedObject { - setPlayerIds(uint32, uint32, uint32, uint32) required broadcast ram; + setAvIds(uint32, uint32, uint32, uint32) required broadcast ram; setNewbieIds(uint32[]) required broadcast ram; setMinigamePoints(uint8, uint8, uint8, uint8) required broadcast ram; setPlayerMoney(uint16, uint16, uint16, uint16) required broadcast ram; @@ -1793,7 +1742,7 @@ dclass DistributedLargeBlobSender : DistributedObject { dclass DistributedLevel : DistributedObject { setLevelZoneId(uint32) required broadcast ram; - setPlayerIds(uint32[]) required broadcast ram; + setAvIds(uint32[]) required broadcast ram; setEntranceId(uint8) required broadcast ram; setZoneIds(uint32[]) broadcast ram; setStartTimestamp(int32) broadcast ram; @@ -3009,9 +2958,6 @@ dclass DistributedVineGame : DistributedMinigame { setVineSections(uint8[]) required broadcast ram; }; -dclass TTPlayerFriendsManager : PlayerFriendsManager { -}; - dclass DistributedGolfKart : DistributedObject { setState(string, int16) broadcast ram; fillSlot0(uint32) broadcast ram; diff --git a/otp/ai/AIBase.py b/otp/ai/AIBase.py index 22415dc4..f53b4d48 100644 --- a/otp/ai/AIBase.py +++ b/otp/ai/AIBase.py @@ -83,8 +83,6 @@ class AIBase: self.waitShardDelete = self.config.GetBool('wait-shard-delete', 1) self.blinkTrolley = self.config.GetBool('blink-trolley', 0) self.fakeDistrictPopulations = self.config.GetBool('fake-district-populations', 0) - self.wantSwitchboard = self.config.GetBool('want-switchboard', 0) - self.wantSwitchboardHacks = self.config.GetBool('want-switchboard-hacks', 0) self.GEMdemoWhisperRecipientDoid = self.config.GetBool('gem-demo-whisper-recipient-doid', 0) self.sqlAvailable = self.config.GetBool('sql-available', 1) self.backups = BackupManager.BackupManager( diff --git a/otp/ai/AIMsgTypes.py b/otp/ai/AIMsgTypes.py index a9bfb405..71f8d2e9 100644 --- a/otp/ai/AIMsgTypes.py +++ b/otp/ai/AIMsgTypes.py @@ -1,10 +1,8 @@ from otp.distributed.OtpDoGlobals import * from direct.showbase.PythonUtil import invertDictLossless -OTP_SERVER_ROOT_DO_ID = 4007 CHANNEL_CLIENT_BROADCAST = 4014 BAD_CHANNEL_ID = 0 BAD_ZONE_ID = 0 -BAD_DO_ID = 0 CONTROL_MESSAGE = 4001 CONTROL_SET_CHANNEL = 2001 CONTROL_REMOVE_CHANNEL = 2002 diff --git a/otp/avatar/Avatar.py b/otp/avatar/Avatar.py index a03f1677..e832bcad 100644 --- a/otp/avatar/Avatar.py +++ b/otp/avatar/Avatar.py @@ -169,19 +169,6 @@ class Avatar(Actor, ShadowCaster): elif base.cr.getFriendFlags(self.doId) & OTPGlobals.FriendChat: self.understandable = 1 self.setPlayerType(NametagGlobals.CCFreeChat) - elif base.cr.playerFriendsManager.findPlayerIdFromAvId(self.doId) is not None: - playerInfo = base.cr.playerFriendsManager.findPlayerInfoFromAvId(self.doId) - if playerInfo.openChatFriendshipYesNo: - self.understandable = 1 - nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCFreeChat] - self.nametag.setNametagColor(nametagColor) - chatColor = NametagGlobals.ChatColors[NametagGlobals.CCFreeChat] - self.nametag.setChatColor(chatColor) - self.nametag.updateAll() - elif playerInfo.isUnderstandable(): - self.understandable = 1 - else: - self.understandable = 0 elif hasattr(base, 'localAvatar') and self.whitelistChatFlags & base.localAvatar.whitelistChatFlags: self.understandable = 1 else: diff --git a/otp/avatar/AvatarPanel.py b/otp/avatar/AvatarPanel.py index 4e4eea0a..2fad2ca4 100644 --- a/otp/avatar/AvatarPanel.py +++ b/otp/avatar/AvatarPanel.py @@ -21,7 +21,7 @@ class AvatarPanel(DirectObject.DirectObject): self.avName = avatar.getName() else: self.avatar = None - self.avName = 'Player' + self.avName = 'Avatar' if hasattr(avatar, 'uniqueName'): self.avId = avatar.doId self.avDisableName = avatar.uniqueName('disable') diff --git a/otp/avatar/DistributedPlayer.py b/otp/avatar/DistributedPlayer.py index 3434b48a..bba5985d 100644 --- a/otp/avatar/DistributedPlayer.py +++ b/otp/avatar/DistributedPlayer.py @@ -17,12 +17,6 @@ from otp.speedchat import SCDecoders from toontown.chat.ChatGlobals import * from toontown.chat.WhisperPopup import WhisperPopup - -if base.config.GetBool('want-chatfilter-hacks', 0): - from otp.switchboard import badwordpy - import os - badwordpy.init(os.environ.get('OTP') + '\\src\\switchboard\\', '') - class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBase, TelemetryLimited): TeleportFailureTimeout = 60.0 chatGarbler = ChatGarbler.ChatGarbler() @@ -139,10 +133,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa def displayWhisper(self, fromId, chatString, whisperType): print 'Whisper type %s from %s: %s' % (whisperType, fromId, chatString) - def displayWhisperPlayer(self, playerId, chatString, whisperType): - print 'WhisperPlayer type %s from %s: %s' % (whisperType, playerId, chatString) - - def whisperSCTo(self, msgIndex, sendToId, toPlayer): + def whisperSCTo(self, msgIndex, sendToId): messenger.send('wakeup') base.cr.ttuFriendsManager.d_whisperSCTo(sendToId, msgIndex) @@ -156,7 +147,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa base.talkAssistant.receiveAvatarWhisperSpeedChat(TalkAssistant.SPEEDCHAT_NORMAL, msgIndex, fromId) return - def whisperSCCustomTo(self, msgIndex, sendToId, toPlayer): + def whisperSCCustomTo(self, msgIndex, sendToId): messenger.send('wakeup') base.cr.ttuFriendsManager.d_whisperSCCustomTo(sendToId, msgIndex) @@ -178,7 +169,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa base.talkAssistant.receiveAvatarWhisperSpeedChat(TalkAssistant.SPEEDCHAT_CUSTOM, msgIndex, fromId) return - def whisperSCEmoteTo(self, emoteId, sendToId, toPlayer): + def whisperSCEmoteTo(self, emoteId, sendToId): messenger.send('wakeup') base.cr.ttuFriendsManager.d_whisperSCEmoteTo(sendToId, emoteId) @@ -314,34 +305,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa base.cr.ttuFriendsManager.d_teleportQuery(sendToId) def teleportQuery(self, requesterId): - teleportNotify.debug('receieved teleportQuery(%s)' % requesterId) - avatar = base.cr.playerFriendsManager.identifyFriend(requesterId) - if avatar != None: - teleportNotify.debug('avatar is not None') - if base.localAvatar.isIgnored(requesterId): - self.d_teleportResponse(self.doId, 2, 0, 0, 0, sendToId=requesterId) - return - if hasattr(base, 'distributedParty'): - if base.distributedParty.partyInfo.isPrivate: - if requesterId not in base.distributedParty.inviteeIds: - teleportNotify.debug('avatar not in inviteeIds') - self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId) - return - if base.distributedParty.isPartyEnding: - teleportNotify.debug('party is ending') - self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId) - return - if self.__teleportAvailable and not self.ghostMode and base.config.GetBool('can-be-teleported-to', 1): - teleportNotify.debug('teleport initiation successful') - self.setSystemMessage(requesterId, OTPLocalizer.WhisperComingToVisit % avatar.getName()) - messenger.send('teleportQuery', [avatar, self]) - return - teleportNotify.debug('teleport initiation failed') - if self.failedTeleportMessageOk(requesterId): - self.setSystemMessage(requesterId, OTPLocalizer.WhisperFailedVisit % avatar.getName()) - teleportNotify.debug('sending try-again-later message') - self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId) - return + pass def failedTeleportMessageOk(self, fromId): now = globalClock.getFrameTime() diff --git a/otp/avatar/LocalAvatar.py b/otp/avatar/LocalAvatar.py index a11b67ae..28b81f7c 100644 --- a/otp/avatar/LocalAvatar.py +++ b/otp/avatar/LocalAvatar.py @@ -70,8 +70,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis self.accept('friendOnline', self.__friendOnline) self.accept('friendOffline', self.__friendOffline) self.accept('clickedWhisper', self.clickedWhisper) - self.accept('playerOnline', self.__playerOnline) - self.accept('playerOffline', self.__playerOffline) self.sleepCallback = None self.accept('wakeup', self.wakeUp) self.jumpLandAnimFixTask = None @@ -917,22 +915,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis whisper.manage(base.marginManager) base.playSfx(sfx) - def displayWhisperPlayer(self, fromId, chatString, whisperType): - sender = None - playerInfo = None - sfx = self.soundWhisper - playerInfo = base.cr.playerFriendsManager.playerId2Info.get(fromId, None) - if playerInfo == None: - return - senderName = playerInfo.playerName - if whisperType == WTNormal or whisperType == WTQuickTalker: - chatString = senderName + ': ' + chatString - whisper = WhisperPopup(chatString, OTPGlobals.getInterfaceFont(), whisperType) - if sender != None: - whisper.setClickable(senderName, fromId) - whisper.manage(base.marginManager) - base.playSfx(sfx) - def setAnimMultiplier(self, value): self.animMultiplier = value @@ -1128,7 +1110,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis def startChat(self): self.chatMgr.start() - self.accept(OTPGlobals.WhisperIncomingEvent, self.handlePlayerFriendWhisper) self.accept(OTPGlobals.ThinkPosHotkey, self.thinkPos) self.accept(OTPGlobals.PrintCamPosHotkey, self.printCamPos) if self.__enableMarkerPlacement: @@ -1190,36 +1171,16 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis self.setSystemMessage(0, OTPLocalizer.WhisperFriendLoggedOut % friend.getName()) return - def __playerOnline(self, playerId): - playerInfo = base.cr.playerFriendsManager.playerId2Info[playerId] - if playerInfo: - self.setSystemMessage(playerId, OTPLocalizer.WhisperPlayerOnline % (playerInfo.playerName, playerInfo.location)) - - def __playerOffline(self, playerId): - playerInfo = base.cr.playerFriendsManager.playerId2Info[playerId] - if playerInfo: - self.setSystemMessage(playerId, OTPLocalizer.WhisperPlayerOffline % playerInfo.playerName) - - def clickedWhisper(self, doId, isPlayer = None): - if not isPlayer: - friend = base.cr.identifyFriend(doId) - if friend != None: - messenger.send('clickedNametag', [friend]) - self.chatMgr.whisperTo(friend.getName(), doId) - else: - friend = base.cr.playerFriendsManager.getFriendInfo(doId) - if friend: - messenger.send('clickedNametagPlayer', [None, doId]) - self.chatMgr.whisperTo(friend.getName(), None, doId) - return + def clickedWhisper(self, doId): + friend = base.cr.identifyFriend(doId) + + if friend != None: + messenger.send('clickedNametag', [friend]) + self.chatMgr.whisperTo(friend.getName(), doId) def d_setParent(self, parentToken): DistributedSmoothNode.DistributedSmoothNode.d_setParent(self, parentToken) - def handlePlayerFriendWhisper(self, playerId, charMessage): - print 'handlePlayerFriendWhisper' - self.displayWhisperPlayer(playerId, charMessage, WTNormal) - def canChat(self): return 0 diff --git a/otp/chat/ChatInputNormal.py b/otp/chat/ChatInputNormal.py index dd775e4d..5bc9f4f0 100644 --- a/otp/chat/ChatInputNormal.py +++ b/otp/chat/ChatInputNormal.py @@ -15,7 +15,6 @@ class ChatInputNormal(DirectObject.DirectObject): self.whisperPos = Vec3(0.0, 0, 0.71) self.whisperAvatarName = None self.whisperAvatarId = None - self.toPlayer = 0 wantHistory = 0 if __dev__: wantHistory = 1 @@ -39,11 +38,10 @@ class ChatInputNormal(DirectObject.DirectObject): del self.whisperLabel del self.chatMgr - def activateByData(self, whisperAvatarId = None, toPlayer = 0): - self.toPlayer = toPlayer + def activateByData(self, whisperAvatarId = None): self.whisperAvatarId = whisperAvatarId if self.whisperAvatarId: - self.whisperAvatarName = base.talkAssistant.findName(self.whisperAvatarId, self.toPlayer) + self.whisperAvatarName = base.talkAssistant.findAvatarName(self.whisperAvatarId) self.chatFrame.setPos(self.whisperPos) self.whisperLabel['text'] = OTPLocalizer.ChatInputWhisperLabel % self.whisperAvatarName self.whisperLabel.show() @@ -76,12 +74,7 @@ class ChatInputNormal(DirectObject.DirectObject): self.deactivate() self.chatMgr.fsm.request('mainMenu') if text: - if self.toPlayer: - if self.whisperAvatarId: - self.whisperAvatarName = None - self.whisperAvatarId = None - self.toPlayer = 0 - elif self.whisperAvatarId: + if self.whisperAvatarId: self.chatMgr.sendWhisperString(text, self.whisperAvatarId) self.whisperAvatarName = None self.whisperAvatarId = None @@ -89,7 +82,6 @@ class ChatInputNormal(DirectObject.DirectObject): base.talkAssistant.sendOpenTalk(text) if self.wantHistory: self.addToHistory(text) - return def chatOverflow(self, overflowText): self.sendChat(self.chatEntry.get()) diff --git a/otp/chat/ChatInputTyped.py b/otp/chat/ChatInputTyped.py index e3051863..9a8cc899 100644 --- a/otp/chat/ChatInputTyped.py +++ b/otp/chat/ChatInputTyped.py @@ -12,7 +12,6 @@ class ChatInputTyped(DirectObject.DirectObject): def __init__(self, mainEntry = 0): self.whisperName = None self.whisperId = None - self.toPlayer = 0 self.mainEntry = mainEntry wantHistory = 0 if __dev__: @@ -37,12 +36,11 @@ class ChatInputTyped(DirectObject.DirectObject): del self.whisperLabel del self.chatMgr - def show(self, whisperId = None, toPlayer = 0): - self.toPlayer = toPlayer + def show(self, whisperId = None): self.whisperId = whisperId self.whisperName = None if self.whisperId: - self.whisperName = base.talkAssistant.findName(whisperId, toPlayer) + self.whisperName = base.talkAssistant.findAvatarName(whisperId) if hasattr(self, 'whisperPos'): self.chatFrame.setPos(self.whisperPos) self.whisperLabel['text'] = OTPLocalizer.ChatInputWhisperLabel % self.whisperName @@ -82,14 +80,9 @@ class ChatInputTyped(DirectObject.DirectObject): self.cancelButton.show() self.typedChatButton.hide() self.typedChatBar.hide() - if self.whisperId: - if self.toPlayer: - if not base.talkAssistant.checkWhisperTypedChatPlayer(self.whisperId): - messenger.send('Chat-Failed player typed chat test') - self.deactivate() - elif not base.talkAssistant.checkWhisperTypedChatAvatar(self.whisperId): - messenger.send('Chat-Failed avatar typed chat test') - self.deactivate() + if self.whisperId and not base.talkAssistant.checkWhisperTypedChatAvatar(self.whisperId): + messenger.send('Chat-Failed avatar typed chat test') + self.deactivate() def deactivate(self): self.chatEntry.set('') @@ -103,10 +96,7 @@ class ChatInputTyped(DirectObject.DirectObject): def sendChat(self, text): self.deactivate() if text: - if self.toPlayer: - if self.whisperId: - pass - elif self.whisperId: + if self.whisperId: pass else: base.talkAssistant.sendOpenTalk(text) diff --git a/otp/chat/ChatInputWhiteListFrame.py b/otp/chat/ChatInputWhiteListFrame.py index 16b15d41..d53609f4 100644 --- a/otp/chat/ChatInputWhiteListFrame.py +++ b/otp/chat/ChatInputWhiteListFrame.py @@ -91,11 +91,6 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame): messenger.send('Chat-Failed open typed chat test') self.notify.warning('Chat-Failed open typed chat test') return None - elif request == 'PlayerWhisper': - if not base.talkAssistant.checkWhisperTypedChatPlayer(self.whisperId): - messenger.send('Chat-Failed player typed chat test') - self.notify.warning('Chat-Failed player typed chat test') - return None elif request == 'AvatarWhisper': if not base.talkAssistant.checkWhisperTypedChatAvatar(self.whisperId): messenger.send('Chat-Failed avatar typed chat test') @@ -117,15 +112,6 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame): def exitAllChat(self): pass - def enterPlayerWhisper(self): - self.tempText = self.chatEntry.get() - self.activate() - - def exitPlayerWhisper(self): - self.chatEntry.set(self.tempText) - self.whisperId = None - return - def enterAvatarWhisper(self): self.tempText = self.chatEntry.get() self.activate() @@ -135,18 +121,14 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame): self.whisperId = None return - def activateByData(self, receiverId = None, toPlayer = 0): + def activateByData(self, receiverId = None): self.receiverId = receiverId - self.toPlayer = toPlayer result = None if not self.receiverId: result = self.requestMode('AllChat') - elif self.receiverId and not self.toPlayer: + elif self.receiverId: self.whisperId = receiverId result = self.requestMode('AvatarWhisper') - elif self.receiverId and self.toPlayer: - self.whisperId = receiverId - result = self.requestMode('PlayerWhisper') return result def activate(self): @@ -203,17 +185,15 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame): self.sendChatByMode(text) def sendChatByData(self, text): - if not self.receiverId: - base.talkAssistant.sendOpenTalk(text) - elif self.receiverId and not self.toPlayer: + if self.receiverId: base.talkAssistant.sendWhisperTalk(text, self.receiverId) + else: + base.talkAssistant.sendOpenTalk(text) def sendChatByMode(self, text): state = self.getCurrentOrNextState() messenger.send('sentRegularChat') - if state == 'PlayerWhisper': - base.talkAssistant.sendPlayerWhisperWLChat(text, self.whisperId) - elif state == 'AvatarWhisper': + if state == 'AvatarWhisper': base.talkAssistant.sendAvatarWhisperWLChat(text, self.whisperId) else: base.talkAssistant.sendOpenTalk(text) diff --git a/otp/chat/ChatManager.py b/otp/chat/ChatManager.py index ff5759a5..31304e5b 100644 --- a/otp/chat/ChatManager.py +++ b/otp/chat/ChatManager.py @@ -51,15 +51,12 @@ class ChatManager(DirectObject.DirectObject): State.State('normalChat', self.enterNormalChat, self.exitNormalChat), State.State('whisper', self.enterWhisper, self.exitWhisper), State.State('whisperChat', self.enterWhisperChat, self.exitWhisperChat), - State.State('whisperChatPlayer', self.enterWhisperChatPlayer, self.exitWhisperChatPlayer), State.State('whisperSpeedChat', self.enterWhisperSpeedChat, self.exitWhisperSpeedChat), - State.State('whisperSpeedChatPlayer', self.enterWhisperSpeedChatPlayer, self.exitWhisperSpeedChatPlayer), State.State('noSecretChatAtAll', self.enterNoSecretChatAtAll, self.exitNoSecretChatAtAll), State.State('noSecretChatAtAllAndNoWhitelist', self.enterNoSecretChatAtAllAndNoWhitelist, self.exitNoSecretChatAtAllAndNoWhitelist), State.State('otherDialog', self.enterOtherDialog, self.exitOtherDialog), State.State('whiteListOpenChat', self.enterWhiteListOpenChat, self.exitWhiteListOpenChat), - State.State('whiteListAvatarChat', self.enterWhiteListAvatarChat, self.exitWhiteListAvatarChat), - State.State('whiteListPlayerChat', self.enterWhiteListPlayerChat, self.exitWhiteListPlayerChat)], 'off', 'off') + State.State('whiteListAvatarChat', self.enterWhiteListAvatarChat, self.exitWhiteListAvatarChat)], 'off', 'off') self.fsm.enterInitialState() return @@ -109,10 +106,6 @@ class ChatManager(DirectObject.DirectObject): def sendChatString(self, message): chatFlags = CFSpeech | CFTimeout - if base.cr.wantSwitchboardHacks: - from otp.switchboard import badwordpy - badwordpy.init('', '') - message = badwordpy.scrub(message) if isThought(message): message = removeThoughtPrefix(message) chatFlags = CFThought @@ -125,29 +118,20 @@ class ChatManager(DirectObject.DirectObject): def sendSCChatMessage(self, msgIndex): base.talkAssistant.sendOpenSpeedChat(1, msgIndex) - def sendSCWhisperMessage(self, msgIndex, whisperAvatarId, toPlayer): - if toPlayer: - base.talkAssistant.sendPlayerWhisperSpeedChat(1, msgIndex, whisperAvatarId) - else: - base.talkAssistant.sendAvatarWhisperSpeedChat(1, msgIndex, whisperAvatarId) + def sendSCWhisperMessage(self, msgIndex, whisperAvatarId): + base.talkAssistant.sendAvatarWhisperSpeedChat(1, msgIndex, whisperAvatarId) def sendSCCustomChatMessage(self, msgIndex): base.talkAssistant.sendOpenSpeedChat(3, msgIndex) - def sendSCCustomWhisperMessage(self, msgIndex, whisperAvatarId, toPlayer): - if toPlayer: - base.talkAssistant.sendPlayerWhisperSpeedChat(3, msgIndex, whisperAvatarId) - else: - base.talkAssistant.sendAvatarWhisperSpeedChat(3, msgIndex, whisperAvatarId) + def sendSCCustomWhisperMessage(self, msgIndex, whisperAvatarId): + base.talkAssistant.sendAvatarWhisperSpeedChat(3, msgIndex, whisperAvatarId) def sendSCEmoteChatMessage(self, emoteId): base.talkAssistant.sendOpenSpeedChat(2, emoteId) - def sendSCEmoteWhisperMessage(self, emoteId, whisperAvatarId, toPlayer): - if toPlayer: - base.talkAssistant.sendPlayerWhisperSpeedChat(2, emoteId, whisperAvatarId) - else: - base.talkAssistant.sendAvatarWhisperSpeedChat(2, emoteId, whisperAvatarId) + def sendSCEmoteWhisperMessage(self, emoteId, whisperAvatarId): + base.talkAssistant.sendAvatarWhisperSpeedChat(2, emoteId, whisperAvatarId) def enterOff(self): self.scButton.hide() @@ -177,8 +161,8 @@ class ChatManager(DirectObject.DirectObject): if self.wantBackgroundFocus: self.chatInputNormal.chatEntry['backgroundFocus'] = 0 - def whisperTo(self, avatarName, avatarId, playerId = None): - self.fsm.request('whisper', [avatarName, avatarId, playerId]) + def whisperTo(self, avatarName, avatarId): + self.fsm.request('whisper', [avatarName, avatarId]) def noWhisper(self): self.fsm.request('mainMenu') @@ -198,54 +182,28 @@ class ChatManager(DirectObject.DirectObject): def enterWhiteListAvatarChat(self, receiverId): if self.wantBackgroundFocus: self.chatInputNormal.chatEntry['backgroundFocus'] = 0 - base.localAvatar.chatMgr.chatInputWhiteList.activateByData(receiverId, 0) + base.localAvatar.chatMgr.chatInputWhiteList.activateByData(receiverId) def exitWhiteListAvatarChat(self): pass - def enterWhiteListPlayerChat(self, receiverId): - if self.wantBackgroundFocus: - self.chatInputNormal.chatEntry['backgroundFocus'] = 0 - base.localAvatar.chatMgr.chatInputWhiteList.activateByData(receiverId, 1) - - def exitWhiteListPlayerChat(self): - pass - - def enterWhisper(self, avatarName, avatarId, playerId = None): - self.whisperScButton['extraArgs'] = [avatarName, avatarId, playerId] - self.whisperButton['extraArgs'] = [avatarName, avatarId, playerId] - playerName = None - chatToToon = 1 + def enterWhisper(self, avatarName, avatarId): + self.whisperScButton['extraArgs'] = [avatarName, avatarId] + self.whisperButton['extraArgs'] = [avatarName, avatarId] online = 0 if avatarId in self.cr.doId2do: online = 1 elif self.cr.isFriend(avatarId): online = self.cr.isFriendOnline(avatarId) - hasManager = hasattr(base.cr, 'playerFriendsManager') - if hasManager: - if base.cr.playerFriendsManager.askAvatarOnline(avatarId): - online = 1 avatarUnderstandable = 0 - playerUnderstandable = 0 av = None if avatarId: av = self.cr.identifyAvatar(avatarId) if av != None: avatarUnderstandable = av.isUnderstandable() - if playerId: - if playerId in base.cr.playerFriendsManager.playerId2Info: - playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) - playerName = playerInfo.playerName - online = 1 - playerUnderstandable = playerInfo.understandableYesNo - if playerUnderstandable or not avatarId: - chatToToon = 0 - if chatToToon: - chatName = avatarName - else: - chatName = playerName + chatName = avatarName normalButtonObscured, scButtonObscured = self.isObscured() - if (avatarUnderstandable or playerUnderstandable) and online and not normalButtonObscured: + if avatarUnderstandable and online and not normalButtonObscured: self.whisperButton['state'] = 'normal' self.enablewhisperButton() else: @@ -261,16 +219,10 @@ class ChatManager(DirectObject.DirectObject): self.changeFrameText(OTPLocalizer.ChatManagerWhisperOffline % chatName) self.whisperFrame.show() self.refreshWhisperFrame() - if avatarUnderstandable or playerUnderstandable: - if playerId and not chatToToon: - if self.wantBackgroundFocus: - self.chatInputNormal.chatEntry['backgroundFocus'] = 1 - self.acceptOnce('enterNormalChat', self.fsm.request, ['whisperChatPlayer', [avatarName, playerId]]) - elif online and chatToToon: - if self.wantBackgroundFocus: - self.chatInputNormal.chatEntry['backgroundFocus'] = 1 - self.acceptOnce('enterNormalChat', self.fsm.request, ['whisperChat', [avatarName, avatarId]]) - return + if avatarUnderstandable and online: + if self.wantBackgroundFocus: + self.chatInputNormal.chatEntry['backgroundFocus'] = 1 + self.acceptOnce('enterNormalChat', self.fsm.request, ['whisperChat', [avatarName, avatarId]]) def disablewhisperButton(self): pass @@ -299,16 +251,6 @@ class ChatManager(DirectObject.DirectObject): self.whisperFrame.hide() self.chatInputSpeedChat.hide() - def enterWhisperSpeedChatPlayer(self, playerId): - self.whisperFrame.show() - if self.wantBackgroundFocus: - self.chatInputNormal.chatEntry['backgroundFocus'] = 0 - self.chatInputSpeedChat.show(playerId, 1) - - def exitWhisperSpeedChatPlayer(self): - self.whisperFrame.hide() - self.chatInputSpeedChat.hide() - def enterWhisperChat(self, avatarName, avatarId): result = self.chatInputNormal.activateByData(avatarId) return result @@ -316,16 +258,6 @@ class ChatManager(DirectObject.DirectObject): def exitWhisperChat(self): self.chatInputNormal.deactivate() - def enterWhisperChatPlayer(self, avatarName, playerId): - playerInfo = base.cr.playerFriendsManager.getFriendInfo(playerId) - if playerInfo: - avatarName = playerInfo.playerName - result = self.chatInputNormal.activateByData(playerId, 1) - return result - - def exitWhisperChatPlayer(self): - self.chatInputNormal.deactivate() - def enterSpeedChat(self): messenger.send('enterSpeedChat') if not self.__scObscured: diff --git a/otp/chat/TalkAssistant.py b/otp/chat/TalkAssistant.py index 9ccb269c..f851d4ff 100644 --- a/otp/chat/TalkAssistant.py +++ b/otp/chat/TalkAssistant.py @@ -30,7 +30,6 @@ class TalkAssistant(DirectObject.DirectObject): self.floodThreshold = 10.0 self.useWhiteListFilter = base.config.GetBool('white-list-filter-openchat', 0) self.lastWhisperDoId = None - self.lastWhisperPlayerId = None self.lastWhisper = None self.SCDecoder = SCDecoders self.whiteList = TTWhiteList() @@ -146,25 +145,10 @@ class TalkAssistant(DirectObject.DirectObject): def stampTime(self): return globalClock.getRealTime() - self.zeroTimeGame - def findName(self, id, isPlayer = 0): - if isPlayer: - return self.findPlayerName(id) - else: - return self.findAvatarName(id) - def findAvatarName(self, id): info = base.cr.identifyAvatar(id) - if info: - return info.getName() - else: - return '' - - def findPlayerName(self, id): - info = base.cr.playerFriendsManager.getFriendInfo(id) - if info: - return info.playerName - else: - return '' + + return info.getName() if info else '' def whiteListFilterMessage(self, text): if not self.useWhiteListFilter: @@ -246,10 +230,6 @@ class TalkAssistant(DirectObject.DirectObject): if remoteAvatarOrHandleOrInfo and hasattr(remoteAvatarOrHandleOrInfo, 'isUnderstandable'): if remoteAvatarOrHandleOrInfo.isUnderstandable(): return True - info = base.cr.playerFriendsManager.findPlayerInfoFromAvId(avatarId) - if info: - if info.understandableYesNo: - return True if base.cr.getFriendFlags(avatarId) & OTPGlobals.FriendChat: return True return False @@ -257,36 +237,17 @@ class TalkAssistant(DirectObject.DirectObject): def checkWhisperSpeedChatAvatar(self, avatarId): return True - def checkWhisperTypedChatPlayer(self, playerId): - info = base.cr.playerFriendsManager.getFriendInfo(playerId) - if info: - if info.understandableYesNo: - return True - return False - - def checkWhisperSpeedChatPlayer(self, playerId): - if base.cr.playerFriendsManager.isPlayerFriend(playerId): - return True - return False - def checkOpenSpeedChat(self): return True def checkWhisperSpeedChatAvatar(self, avatarId): return True - def checkWhisperSpeedChatPlayer(self, playerId): - if base.cr.playerFriendsManager.isPlayerFriend(playerId): - return True - return False - def receiveOpenTalk(self, senderAvId, avatarName, accountId, accountName, message, scrubbed = 0): error = None if not avatarName and senderAvId: localAvatar.sendUpdate('logSuspiciousEvent', ['receiveOpenTalk: invalid avatar name (%s)' % senderAvId]) avatarName = self.findAvatarName(senderAvId) - if not accountName and accountId: - accountName = self.findPlayerName(accountId) newMessage = TalkMessage(self.countMessage(), self.stampTime(), message, senderAvId, avatarName, accountId, accountName, None, None, None, None, TALK_OPEN, None) if senderAvId != localAvatar.doId: self.addHandle(senderAvId, newMessage) @@ -313,8 +274,6 @@ class TalkAssistant(DirectObject.DirectObject): error = None if not avatarName and avatarId: avatarName = self.findAvatarName(avatarId) - if not accountName and accountId: - accountName = self.findPlayerName(accountId) newMessage = TalkMessage(self.countMessage(), self.stampTime(), message, avatarId, avatarName, accountId, accountName, toId, toName, None, None, TALK_WHISPER, None) if avatarId == localAvatar.doId: self.addHandle(toId, newMessage) @@ -332,8 +291,6 @@ class TalkAssistant(DirectObject.DirectObject): error = None if not avatarName and avatarId: avatarName = self.findAvatarName(avatarId) - if not accountName and accountId: - accountName = self.findPlayerName(accountId) newMessage = TalkMessage(self.countMessage(), self.stampTime(), message, avatarId, avatarName, accountId, accountName, None, None, None, None, AVATAR_THOUGHT, None) if avatarId != localAvatar.doId: self.addHandle(avatarId, newMessage) @@ -394,7 +351,7 @@ class TalkAssistant(DirectObject.DirectObject): def receiveOpenSpeedChat(self, type, messageIndex, senderAvId, name = None): error = None if not name and senderAvId: - name = self.findName(senderAvId, 0) + name = self.findAvatarName(senderAvId) if type == SPEEDCHAT_NORMAL: message = self.SCDecoder.decodeSCStaticTextMsg(messageIndex) elif type == SPEEDCHAT_EMOTE: @@ -413,7 +370,7 @@ class TalkAssistant(DirectObject.DirectObject): def receiveAvatarWhisperSpeedChat(self, type, messageIndex, senderAvId, name = None): error = None if not name and senderAvId: - name = self.findName(senderAvId, 0) + name = self.findAvatarName(senderAvId) if type == SPEEDCHAT_NORMAL: message = self.SCDecoder.decodeSCStaticTextMsg(messageIndex) elif type == SPEEDCHAT_EMOTE: @@ -427,23 +384,6 @@ class TalkAssistant(DirectObject.DirectObject): messenger.send('NewOpenMessage', [newMessage]) return error - def receivePlayerWhisperSpeedChat(self, type, messageIndex, senderAvId, name = None): - error = None - if not name and senderAvId: - name = self.findName(senderAvId, 1) - if type == SPEEDCHAT_NORMAL: - message = self.SCDecoder.decodeSCStaticTextMsg(messageIndex) - elif type == SPEEDCHAT_EMOTE: - message = self.SCDecoder.decodeSCEmoteWhisperMsg(messageIndex, name) - elif type == SPEEDCHAT_CUSTOM: - message = self.SCDecoder.decodeSCCustomMsg(messageIndex) - newMessage = TalkMessage(self.countMessage(), self.stampTime(), message, None, None, senderAvId, name, localAvatar.doId, localAvatar.getName(), localAvatar.DISLid, localAvatar.DISLname, TALK_WHISPER, None) - self.historyComplete.append(newMessage) - self.historyOpen.append(newMessage) - self.addToHistoryDISLId(newMessage, senderAvId) - messenger.send('NewOpenMessage', [newMessage]) - return error - def sendOpenTalk(self, message): error = None doId = base.localAvatar.doId @@ -517,16 +457,4 @@ class TalkAssistant(DirectObject.DirectObject): self.historyComplete.append(newMessage) self.addToHistoryDoId(newMessage, localAvatar.doId) messenger.send('NewOpenMessage', [newMessage]) - return error - - def sendPlayerWhisperSpeedChat(self, type, messageIndex, receiverId): - # TODO: Remove Player system - return None - - def getWhisperReplyId(self): - if self.lastWhisper: - toPlayer = 0 - if self.lastWhisper == self.lastWhisperPlayerId: - toPlayer = 1 - return (self.lastWhisper, toPlayer) - return (0, 0) + return error \ No newline at end of file diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 75f6780c..e70db52d 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,14 +2,14 @@ from pandac.PandaModules import * -hashVal = 3280849111L +hashVal = 3070829445L 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, DistributedBuildingQueryMgr, DistributedToonInterior, DistributedToonHallInterior, DistributedSuitInterior, DistributedHQInterior, DistributedGagshopInterior, DistributedPetshopInterior, DistributedKartShopInterior, DistributedLibraryInterior, DistributedDoor, 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, PlayerFriendsManager, FriendInfo, AvatarFriendInfo +from otp.friends import FriendManager from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiveEntity from toontown.shtiker import DeleteManager, PurchaseManager, NewbiePurchaseManager from toontown.groups import GroupManager @@ -31,7 +31,7 @@ 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 from toontown.coghq.InGameEditorDCImports import * -from toontown.friends import TTPlayerFriendsManager, TTUFriendsManager +from toontown.friends import TTUFriendsManager from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog from otp.distributed import Account, DistributedDistrict, DistributedDirectory from toontown.estate import DistributedCannon, DistributedTarget, EstateManager, DistributedEstate, DistributedHouse, DistributedHouseInterior, DistributedGarden, DistributedHouseDoor, DistributedMailbox, DistributedFurnitureManager, DistributedFurnitureItem, DistributedBank, DistributedCloset, DistributedTrunk, DistributedPhone, DistributedFireworksCannon, DistributedLawnDecor, DistributedGardenPlot, DistributedGardenBox, DistributedFlower, DistributedGagTree, DistributedStatuary, DistributedToonStatuary, DistributedChangingStatuary, DistributedAnimatedStatuary, DistributedPlantBase, DistributedLawnDecor diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index 35d2e395..182f7937 100644 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -254,8 +254,6 @@ class OTPClientRepository(ClientRepositoryBase): self.playGame = playGame(self.gameFSM, self.gameDoneEvent) self.shardListHandle = None self.uberZoneInterest = None - self.wantSwitchboard = config.GetBool('want-switchboard', 0) - self.wantSwitchboardHacks = base.config.GetBool('want-switchboard-hacks', 0) self.__pendingGenerates = {} self.__pendingMessages = {} @@ -1540,9 +1538,6 @@ class OTPClientRepository(ClientRepositoryBase): def identifyFriend(self, doId): pass - def identifyPlayer(self, playerId): - pass - def identifyAvatar(self, doId): info = self.doId2do.get(doId) if info: diff --git a/otp/distributed/OtpDoGlobals.py b/otp/distributed/OtpDoGlobals.py index 0cfcf1c2..097f1dfd 100644 --- a/otp/distributed/OtpDoGlobals.py +++ b/otp/distributed/OtpDoGlobals.py @@ -1,71 +1,12 @@ from direct.distributed.MsgTypes import * -OTP_DO_ID_SERVER_ROOT = 4007 OTP_DO_ID_FRIEND_MANAGER = 4501 -OTP_DO_ID_LEADERBOARD_MANAGER = 4502 -OTP_DO_ID_SERVER = 4600 -OTP_DO_ID_UBER_DOG = 4601 -OTP_CHANNEL_AI_AND_UD_BROADCAST = 4602 -OTP_CHANNEL_UD_BROADCAST = 4603 -OTP_CHANNEL_AI_BROADCAST = 4604 -OTP_NET_MSGR_CHANNEL_ID_ALL_AI = 4605 -OTP_NET_MSGR_CHANNEL_ID_UBER_DOG = 4606 -OTP_NET_MSGR_CHANNEL_ID_AI_ONLY = 4607 -OTP_DO_ID_COMMON = 4615 -OTP_DO_ID_GATEWAY = 4616 OTP_DO_ID_TOONTOWN = 4618 -OTP_DO_ID_AVATARS = 4630 -OTP_DO_ID_FRIENDS = 4640 -OTP_DO_ID_ESCROW = 4660 OTP_DO_ID_CLIENT_SERVICES_MANAGER = 4665 OTP_DO_ID_TTU_FRIENDS_MANAGER = 4666 OPT_DO_ID_GROUP_MANAGER = 4667 OTP_DO_ID_GLOBAL_PARTY_MANAGER = 4477 OTP_DO_ID_CHAT_MANAGER = 4681 -OTP_DO_ID_TOONTOWN_AVATAR_MANAGER = 4682 -OTP_DO_ID_TOONTOWN_TEMP_STORE_MANAGER = 4684 -OTP_DO_ID_SWITCHBOARD_MANAGER = 4685 -OTP_DO_ID_PLAYER_FRIENDS_MANAGER = 4687 -OTP_DO_ID_TOONTOWN_MAIL_MANAGER = 4690 -OTP_DO_ID_TOONTOWN_PARTY_MANAGER = 4691 -OTP_DO_ID_TOONTOWN_RAT_MANAGER = 4692 -OTP_DO_ID_STATUS_DATABASE = 4693 -OTP_DO_ID_TOONTOWN_AWARD_MANAGER = 4694 -OTP_DO_ID_TOONTOWN_CODE_REDEMPTION_MANAGER = 4695 -OTP_DO_ID_TOONTOWN_NON_REPEATABLE_RANDOM_SOURCE = 4697 -OTP_DO_ID_AI_TRADE_AVATAR = 4698 -OTP_DO_ID_TOONTOWN_WHITELIST_MANAGER = 4699 -OTP_DO_ID_TOONTOWN_CPU_INFO_MANAGER = 4713 -OTP_DO_ID_TOONTOWN_SECURITY_MANAGER = 4714 -OTP_DO_ID_SNAPSHOT_DISPATCHER = 4800 -OTP_DO_ID_SNAPSHOT_RENDERER = 4801 -OTP_DO_ID_SNAPSHOT_RENDERER_01 = 4801 -OTP_DO_ID_SNAPSHOT_RENDERER_02 = 4802 -OTP_DO_ID_SNAPSHOT_RENDERER_03 = 4803 -OTP_DO_ID_SNAPSHOT_RENDERER_04 = 4804 -OTP_DO_ID_SNAPSHOT_RENDERER_05 = 4805 -OTP_DO_ID_SNAPSHOT_RENDERER_06 = 4806 -OTP_DO_ID_SNAPSHOT_RENDERER_07 = 4807 -OTP_DO_ID_SNAPSHOT_RENDERER_08 = 4808 -OTP_DO_ID_SNAPSHOT_RENDERER_09 = 4809 -OTP_DO_ID_SNAPSHOT_RENDERER_10 = 4810 -OTP_DO_ID_SNAPSHOT_RENDERER_11 = 4811 -OTP_DO_ID_SNAPSHOT_RENDERER_12 = 4812 -OTP_DO_ID_SNAPSHOT_RENDERER_13 = 4813 -OTP_DO_ID_SNAPSHOT_RENDERER_14 = 4814 -OTP_DO_ID_SNAPSHOT_RENDERER_15 = 4815 -OTP_DO_ID_SNAPSHOT_RENDERER_16 = 4816 -OTP_DO_ID_SNAPSHOT_RENDERER_17 = 4817 -OTP_DO_ID_SNAPSHOT_RENDERER_18 = 4818 -OTP_DO_ID_SNAPSHOT_RENDERER_19 = 4819 -OTP_DO_ID_SNAPSHOT_RENDERER_20 = 4820 -OTP_ZONE_ID_INVALID = 0 -OTP_ZONE_ID_OLD_QUIET_ZONE = 1 -OTP_ZONE_ID_MANAGEMENT = 2 -OTP_ZONE_ID_DISTRICTS = 3 OTP_ZONE_ID_DISTRICTS_STATS = 4 -OTP_ZONE_ID_ELEMENTS = 5 -OTP_NET_MESSENGER_CHANNEL = (OTP_DO_ID_UBER_DOG << 32) + OTP_ZONE_ID_MANAGEMENT OTP_MOD_CHANNEL = 6200 OTP_ADMIN_CHANNEL = 6400 -OTP_SYSADMIN_CHANNEL = 6500 - +OTP_SYSADMIN_CHANNEL = 6500 \ No newline at end of file diff --git a/otp/friends/AvatarFriendInfo.py b/otp/friends/AvatarFriendInfo.py deleted file mode 100644 index 0bb704e6..00000000 --- a/otp/friends/AvatarFriendInfo.py +++ /dev/null @@ -1,41 +0,0 @@ -from otp.avatar.AvatarHandle import AvatarHandle - -class AvatarFriendInfo(AvatarHandle): - - def __init__(self, avatarName = '', playerName = '', playerId = 0, onlineYesNo = 0, openChatEnabledYesNo = 0, openChatFriendshipYesNo = 0, wlChatEnabledYesNo = 0): - self.avatarName = avatarName - self.playerName = playerName - self.playerId = playerId - self.onlineYesNo = onlineYesNo - self.openChatEnabledYesNo = openChatEnabledYesNo - self.openChatFriendshipYesNo = openChatFriendshipYesNo - self.wlChatEnabledYesNo = wlChatEnabledYesNo - self.understandableYesNo = self.isUnderstandable() - - def calcUnderstandableYesNo(self): - self.understandableYesNo = self.isUnderstandable() - - def getName(self): - if self.avatarName: - return self.avatarName - elif self.playerName: - return self.playerName - else: - return '' - - def isUnderstandable(self): - result = False - try: - if self.openChatFriendshipYesNo: - result = True - elif self.openChatEnabledYesNo and base.cr.openChatEnabled: - result = True - elif self.wlChatEnabledYesNo and settings['speedchatPlus']: - result = True - except: - pass - - return result - - def isOnline(self): - return self.onlineYesNo diff --git a/otp/friends/FriendInfo.py b/otp/friends/FriendInfo.py deleted file mode 100644 index 44ca7a29..00000000 --- a/otp/friends/FriendInfo.py +++ /dev/null @@ -1,46 +0,0 @@ -from otp.avatar.AvatarHandle import AvatarHandle - -class FriendInfo(AvatarHandle): - - def __init__(self, avatarName = '', playerName = '', onlineYesNo = 0, openChatEnabledYesNo = 0, openChatFriendshipYesNo = 0, wlChatEnabledYesNo = 0, location = '', sublocation = '', timestamp = 0, avatarId = 0, friendPrivs = 0, tokenPrivs = 0): - self.avatarName = avatarName - self.playerName = playerName - self.onlineYesNo = onlineYesNo - self.openChatEnabledYesNo = openChatEnabledYesNo - self.openChatFriendshipYesNo = openChatFriendshipYesNo - self.wlChatEnabledYesNo = wlChatEnabledYesNo - self.location = location - self.sublocation = sublocation - self.timestamp = timestamp - self.avatarId = avatarId - self.friendPrivs = friendPrivs - self.tokenPrivs = tokenPrivs - self.understandableYesNo = self.isUnderstandable() - - def calcUnderstandableYesNo(self): - self.understandableYesNo = self.isUnderstandable() - - def getName(self): - if self.avatarName: - return self.avatarName - elif self.playerName: - return self.playerName - else: - return '' - - def isUnderstandable(self): - result = False - try: - if self.openChatFriendshipYesNo: - result = True - elif self.openChatEnabledYesNo and base.cr.openChatEnabled: - result = True - elif self.wlChatEnabledYesNo and settings['speedchatPlus']: - result = True - except: - pass - - return result - - def isOnline(self): - return self.onlineYesNo diff --git a/otp/friends/FriendManager.py b/otp/friends/FriendManager.py index c4f349bb..d8cff435 100644 --- a/otp/friends/FriendManager.py +++ b/otp/friends/FriendManager.py @@ -11,24 +11,13 @@ class FriendManager(DistributedObject.DistributedObject): DistributedObject.DistributedObject.__init__(self, cr) self.__available = 0 self.otherToon = 0 - self.gameSpecificFunction = None - return def setAvailable(self, available): self.__available = available - if self.__available and self.gameSpecificFunction: - self.gameSpecificFunction() def getAvailable(self): return self.__available - def setGameSpecificFunction(self, function): - self.gameSpecificFunction = function - - def executeGameSpecificFunction(self): - if self.__available and self.gameSpecificFunction: - self.gameSpecificFunction() - def generate(self): if base.cr.friendManager != None: base.cr.friendManager.delete() @@ -42,7 +31,6 @@ class FriendManager(DistributedObject.DistributedObject): return def delete(self): - self.gameSpecificFunction = None base.cr.friendManager = None DistributedObject.DistributedObject.delete(self) return diff --git a/otp/friends/FriendResponseCodes.py b/otp/friends/FriendResponseCodes.py deleted file mode 100644 index e0e846c2..00000000 --- a/otp/friends/FriendResponseCodes.py +++ /dev/null @@ -1,6 +0,0 @@ -INVITATION_RESP_OK = 0 -INVITATION_RESP_DECLINE = 1 -INVITATION_RESP_RETRACT = 2 -INVITATION_RESP_CANCEL = 3 -INVITATION_RESP_ALREADY_FRIENDS = 4 -INVITATION_RESP_NEW_FRIENDS = 5 diff --git a/otp/friends/PlayerFriendsManager.py b/otp/friends/PlayerFriendsManager.py deleted file mode 100644 index c0eb308b..00000000 --- a/otp/friends/PlayerFriendsManager.py +++ /dev/null @@ -1,243 +0,0 @@ -from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal -from direct.directnotify.DirectNotifyGlobal import directNotify -from otp.otpbase import OTPGlobals -from otp.avatar.Avatar import teleportNotify -from otp.friends import FriendResponseCodes - -class PlayerFriendsManager(DistributedObjectGlobal): - notify = directNotify.newCategory('PlayerFriendsManager') - - def __init__(self, cr): - DistributedObjectGlobal.__init__(self, cr) - self.playerFriendsList = set() - self.playerId2Info = {} - self.playerAvId2avInfo = {} - self.accept('gotExtraFriendHandles', self.__handleFriendHandles) - - def delete(self): - self.ignoreAll() - - def sendRequestInvite(self, playerId): - print 'PFM sendRequestInvite id:%s' % playerId - self.sendUpdate('requestInvite', [0, playerId, True]) - - def sendRequestDecline(self, playerId): - self.sendUpdate('requestDecline', [0, playerId]) - - def sendRequestRemove(self, playerId): - self.sendUpdate('requestRemove', [0, playerId]) - - def sendRequestUnlimitedSecret(self): - self.sendUpdate('requestUnlimitedSecret', [0]) - - def sendRequestUseUnlimitedSecret(self, secret): - pass - - def sendSCWhisper(self, recipientId, msgId): - self.sendUpdate('whisperSCTo', [0, recipientId, msgId]) - - def sendSCCustomWhisper(self, recipientId, msgId): - self.sendUpdate('whisperSCCustomTo', [0, recipientId, msgId]) - - def sendSCEmoteWhisper(self, recipientId, msgId): - self.sendUpdate('whisperSCEmoteTo', [0, recipientId, msgId]) - - def invitationFrom(self, playerId, avatarName): - messenger.send(OTPGlobals.PlayerFriendInvitationEvent, [playerId, avatarName]) - - def retractInvite(self, playerId): - messenger.send(OTPGlobals.PlayerFriendRetractInviteEvent, [playerId]) - - def rejectInvite(self, playerId, reason): - messenger.send(OTPGlobals.PlayerFriendRejectInviteEvent, [playerId, reason]) - - def rejectRemove(self, playerId, reason): - messenger.send(OTPGlobals.PlayerFriendRejectRemoveEvent, [playerId, reason]) - - def secretResponse(self, secret): - print 'secretResponse %s' % secret - messenger.send(OTPGlobals.PlayerFriendNewSecretEvent, [secret]) - - def rejectSecret(self, reason): - print 'rejectSecret %s' % reason - messenger.send(OTPGlobals.PlayerFriendRejectNewSecretEvent, [reason]) - - def rejectUseSecret(self, reason): - print 'rejectUseSecret %s' % reason - messenger.send(OTPGlobals.PlayerFriendRejectUseSecretEvent, [reason]) - - def invitationResponse(self, playerId, respCode, context): - if respCode == FriendResponseCodes.INVITATION_RESP_DECLINE: - messenger.send(OTPGlobals.PlayerFriendRejectInviteEvent, [playerId, respCode]) - elif respCode == FriendResponseCodes.INVITATION_RESP_NEW_FRIENDS: - pass - - def updatePlayerFriend(self, id, info, isNewFriend): - self.notify.warning('updatePlayerFriend: %s, %s, %s' % (id, info, isNewFriend)) - info.calcUnderstandableYesNo() - if info.playerName[0:5] == 'Guest': - info.playerName = 'Guest ' + info.playerName[5:] - if id not in self.playerFriendsList: - self.playerFriendsList.add(id) - self.playerId2Info[id] = info - messenger.send(OTPGlobals.PlayerFriendAddEvent, [id, info, isNewFriend]) - elif id in self.playerId2Info: - if not self.playerId2Info[id].onlineYesNo and info.onlineYesNo: - self.playerId2Info[id] = info - messenger.send('playerOnline', [id]) - base.talkAssistant.receiveFriendAccountUpdate(id, info.playerName, info.onlineYesNo) - elif self.playerId2Info[id].onlineYesNo and not info.onlineYesNo: - self.playerId2Info[id] = info - messenger.send('playerOffline', [id]) - base.talkAssistant.receiveFriendAccountUpdate(id, info.playerName, info.onlineYesNo) - if not self.askAvatarKnownHere(info.avatarId): - self.requestAvatarInfo(info.avatarId) - self.playerId2Info[id] = info - av = base.cr.doId2do.get(info.avatarId, None) - if av is not None: - av.considerUnderstandable() - messenger.send(OTPGlobals.PlayerFriendUpdateEvent, [id, info]) - return - - def removePlayerFriend(self, id): - if id not in self.playerFriendsList: - return - self.playerFriendsList.remove(id) - info = self.playerId2Info.pop(id, None) - if info is not None: - av = base.cr.doId2do.get(info.avatarId, None) - if av is not None: - av.considerUnderstandable() - messenger.send(OTPGlobals.PlayerFriendRemoveEvent, [id]) - return - - def whisperSCFrom(self, playerId, msg): - base.talkAssistant.receivePlayerWhisperSpeedChat(msg, playerId) - - def isFriend(self, pId): - return self.isPlayerFriend(pId) - - def isPlayerFriend(self, pId): - if not pId: - return 0 - return pId in self.playerFriendsList - - def isAvatarOwnerPlayerFriend(self, avId): - pId = self.findPlayerIdFromAvId(avId) - if pId and self.isPlayerFriend(pId): - return True - else: - return False - - def getFriendInfo(self, pId): - return self.playerId2Info.get(pId) - - def findPlayerIdFromAvId(self, avId): - for playerId in self.playerId2Info: - if self.playerId2Info[playerId].avatarId == avId: - if self.playerId2Info[playerId].onlineYesNo: - return playerId - - return None - - def findAvIdFromPlayerId(self, pId): - pInfo = self.playerId2Info.get(pId) - if pInfo: - return pInfo.avatarId - else: - return None - return None - - def findPlayerInfoFromAvId(self, avId): - playerId = self.findPlayerIdFromAvId(avId) - if playerId: - return self.getFriendInfo(playerId) - else: - return None - return None - - def askAvatarOnline(self, avId): - returnValue = 0 - if avId in self.cr.doId2do: - returnValue = 1 - if avId in self.playerAvId2avInfo: - playerId = self.findPlayerIdFromAvId(avId) - if playerId in self.playerId2Info: - playerInfo = self.playerId2Info[playerId] - if playerInfo.onlineYesNo: - returnValue = 1 - return returnValue - - def countTrueFriends(self): - count = 0 - for id in self.playerId2Info: - if self.playerId2Info[id].openChatFriendshipYesNo: - count += 1 - - return count - - def askTransientFriend(self, avId): - if (avId in self.playerAvId2avInfo) and (not base.cr.isAvatarFriend(avId)): - return 1 - else: - return 0 - - def askAvatarKnown(self, avId): - if self.askAvatarKnownElseWhere(avId) or self.askAvatarKnownHere(avId): - return 1 - else: - return 0 - - def askAvatarKnownElseWhere(self, avId): - if hasattr(base, 'cr'): - if base.cr.askAvatarKnown(avId): - return 1 - return 0 - - def askAvatarKnownHere(self, avId): - if avId in self.playerAvId2avInfo: - return 1 - else: - return 0 - - def requestAvatarInfo(self, avId): - if hasattr(base, 'cr'): - base.cr.queueRequestAvatarInfo(avId) - - def __handleFriendHandles(self, handleList): - for handle in handleList: - self.playerAvId2avInfo[handle.getDoId()] = handle - - messenger.send('friendsListChanged') - - def getAvHandleFromId(self, avId): - if avId in self.playerAvId2avInfo: - return self.playerAvId2avInfo[avId] - - def identifyFriend(self, avId): - handle = None - teleportNotify.debug('identifyFriend(%s)' % avId) - handle = base.cr.identifyFriend(avId) - if not handle: - teleportNotify.debug('getAvHandleFromId(%s)' % avId) - handle = self.getAvHandleFromId(avId) - return handle - - def getAllOnlinePlayerAvatars(self): - returnList = [] - for avatarId in self.playerAvId2avInfo: - playerId = self.findPlayerIdFromAvId(avatarId) - if playerId: - if self.playerId2Info[playerId].onlineYesNo: - returnList.append(avatarId) - - return returnList - - def identifyAvatar(self, doId): - if doId in base.cr.doId2do: - return base.cr.doId2do[doId] - else: - return self.identifyFriend(doId) - - def friendsListFull(self): - return len(self.playerFriendsList) >= OTPGlobals.MaxPlayerFriends diff --git a/otp/friends/PlayerFriendsManagerUD.py b/otp/friends/PlayerFriendsManagerUD.py deleted file mode 100644 index 8b95bb02..00000000 --- a/otp/friends/PlayerFriendsManagerUD.py +++ /dev/null @@ -1,42 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectUD import DistributedObjectUD - -class PlayerFriendsManagerUD(DistributedObjectUD): - notify = DirectNotifyGlobal.directNotify.newCategory("PlayerFriendsManagerUD") - - def requestInvite(self, todo0, todo1, todo2): - pass - - def invitationFrom(self, todo0, todo1): - pass - - def retractInvite(self, todo0): - pass - - def invitationResponse(self, todo0, todo1, todo2): - pass - - def requestDecline(self, todo0, todo1): - pass - - def requestDeclineWithReason(self, todo0, todo1, todo2): - pass - - def requestRemove(self, todo0, todo1): - pass - - def secretResponse(self, todo0): - pass - - def rejectSecret(self, todo0): - pass - - def rejectUseSecret(self, todo0): - pass - - def updatePlayerFriend(self, todo0, todo1, todo2): - pass - - def removePlayerFriend(self, todo0): - pass - diff --git a/otp/level/DistributedLevel.py b/otp/level/DistributedLevel.py index c401e662..c4395847 100644 --- a/otp/level/DistributedLevel.py +++ b/otp/level/DistributedLevel.py @@ -51,7 +51,7 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level): def setLevelZoneId(self, zoneId): self.levelZone = zoneId - def setPlayerIds(self, avIdList): + def setAvIds(self, avIdList): self.avIdList = avIdList def setEntranceId(self, entranceId): diff --git a/otp/level/DistributedLevelAI.py b/otp/level/DistributedLevelAI.py index c9a913d9..59b74443 100644 --- a/otp/level/DistributedLevelAI.py +++ b/otp/level/DistributedLevelAI.py @@ -41,7 +41,7 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): def getLevelZoneId(self): return self.zoneId - def getPlayerIds(self): + def getAvIds(self): return self.avIdList def getEntranceId(self): diff --git a/otp/otpbase/OTPGlobals.py b/otp/otpbase/OTPGlobals.py index 6a34e01d..b741c6b4 100644 --- a/otp/otpbase/OTPGlobals.py +++ b/otp/otpbase/OTPGlobals.py @@ -21,8 +21,6 @@ AICollMovePriority = 8 # But since we told people that we are allowing "unlimited" friends, we instead can give them a # high amount. MaxFriends = 200 - -MaxPlayerFriends = 300 MaxBackCatalog = 48 FriendChat = 1 CommonChat = 1 @@ -310,25 +308,15 @@ AvatarFriendAddEvent = 'avatarFriendAddEvent' AvatarNewFriendAddEvent = 'avatarNewFriendAddEvent' AvatarFriendUpdateEvent = 'avatarFriendUpdateEvent' AvatarFriendRemoveEvent = 'avatarFriendRemoveEvent' -PlayerFriendAddEvent = 'playerFriendAddEvent' -PlayerFriendUpdateEvent = 'playerFriendUpdateEvent' -PlayerFriendRemoveEvent = 'playerFriendRemoveEvent' AvatarFriendConsideringEvent = 'avatarFriendConsideringEvent' AvatarFriendInvitationEvent = 'avatarFriendInvitationEvent' AvatarFriendRejectInviteEvent = 'avatarFriendRejectInviteEvent' AvatarFriendRetractInviteEvent = 'avatarFriendRetractInviteEvent' AvatarFriendRejectRemoveEvent = 'avatarFriendRejectRemoveEvent' -PlayerFriendInvitationEvent = 'playerFriendInvitationEvent' -PlayerFriendRejectInviteEvent = 'playerFriendRejectInviteEvent' -PlayerFriendRetractInviteEvent = 'playerFriendRetractInviteEvent' -PlayerFriendRejectRemoveEvent = 'playerFriendRejectRemoveEvent' -PlayerFriendNewSecretEvent = 'playerFriendNewSecretEvent' -PlayerFriendRejectNewSecretEvent = 'playerFriendRejectNewSecretEvent' -PlayerFriendRejectUseSecretEvent = 'playerFriendRejectUseSecretEvent' WhisperIncomingEvent = 'whisperIncomingEvent' ChatFeedback_PassedBlacklist = 32 ChatFeedback_Whitelist = 64 ChatFeedback_OpenChat = 128 AvatarPendingCreate = -1 AvatarSlotUnavailable = -2 -AvatarSlotAvailable = -3 +AvatarSlotAvailable = -3 \ No newline at end of file diff --git a/otp/otpbase/OTPLocalizerEnglish.py b/otp/otpbase/OTPLocalizerEnglish.py index b66d840c..2dd8a901 100644 --- a/otp/otpbase/OTPLocalizerEnglish.py +++ b/otp/otpbase/OTPLocalizerEnglish.py @@ -32,9 +32,6 @@ WhisperGiveupVisit = "%s couldn't find you because you're moving around!" TeleportGreeting = 'Hi, %s.' WhisperFriendComingOnline = '%s is coming online!' WhisperFriendLoggedOut = '%s has logged out.' -WhisperPlayerOnline = '%s logged into %s' -WhisperPlayerOffline = '%s is offline.' -WhisperUnavailable = 'That player is no longer available for whispers.' DialogSpecial = 'ooo' DialogExclamation = '!' DialogQuestion = '?' @@ -216,7 +213,6 @@ SCMenuIdesOfMarch = 'GREEN' ScMenuBugs = 'Bugs' FriendInviteeTooManyFriends = '%s would like to be your friend, but you already have too many friends on your list!' FriendInviteeInvitation = '%s would like to be your friend.' -FriendInviteeInvitationPlayer = "%s's player would like to be your friend." FriendNotifictation = '%s is now your friend.' FriendInviteeOK = lOK FriendInviteeNo = lNo @@ -231,7 +227,6 @@ FriendInviterNo = lNo FriendInviterClickToon = 'Click on the toon you would like to make friends with.' FriendInviterTooMany = 'You have too many friends on your list to add another one now. You will have to remove some friends if you want to make friends with %s.' FriendInviterToonTooMany = 'You have too many toon friends on your list to add another one now. You will have to remove some toon friends if you want to make friends with %s.' -FriendInviterPlayerTooMany = 'You have too many player friends on your list to add another one now. You will have to remove some player friends if you want to make friends with %s.' FriendInviterNotYet = 'Would you like to make friends with %s?' FriendInviterCheckAvailability = 'Seeing if %s is available.' FriendInviterNotAvailable = '%s is busy right now; try again later.' @@ -250,7 +245,6 @@ FriendInviterSelf = "You are already 'friends' with yourself!" FriendInviterIgnored = '%s is ignoring you.' FriendInviterAsking = 'Asking %s to be your friend.' FriendInviterFriendSaidYes = 'You are now friends with %s!' -FriendInviterPlayerFriendSaidYes = "You are now friends with %s's player, %s!" FriendInviterFriendSaidNo = '%s said no, thank you.' FriendInviterFriendSaidNoNewFriends = "%s isn't looking for new friends right now." FriendInviterOtherTooMany = '%s has too many friends already!' @@ -2346,7 +2340,6 @@ AvatarDetailPanelCancel = lCancel AvatarDetailPanelClose = lClose AvatarDetailPanelLookup = 'Looking up details for %s.' AvatarDetailPanelFailedLookup = 'Unable to get details for %s.' -AvatarDetailPanelPlayer = 'Player: %(player)s\nWorld: %(world)s\nLocation: %(location)s' AvatarDetailPanelOnline = 'District: %(district)s\nLocation: %(location)s' AvatarDetailPanelOffline = 'District: offline\nLocation: offline' AvatarPanelFriends = 'Friends' diff --git a/toontown/building/DistributedBuilding.py b/toontown/building/DistributedBuilding.py index 10f889e9..b00abfc3 100644 --- a/toontown/building/DistributedBuilding.py +++ b/toontown/building/DistributedBuilding.py @@ -163,7 +163,7 @@ class DistributedBuilding(DistributedObject.DistributedObject): anyOthers = 1 if anyOthers: - self.waitingMessage = DirectLabel(text=TTLocalizer.BuildingWaitingForVictors, text_fg=VBase4(1, 1, 1, 1), text_align=TextNode.ACenter, relief=None, pos=(0, 0, 0.35), scale=0.1) + self.waitingMessage = DirectLabel(text=TTLocalizer.WaitingForOtherToons, text_fg=VBase4(1, 1, 1, 1), text_align=TextNode.ACenter, relief=None, pos=(0, 0, 0.35), scale=0.1) elif victorCount == 0: pass else: @@ -201,7 +201,7 @@ class DistributedBuilding(DistributedObject.DistributedObject): anyOthers = 1 if anyOthers: - self.waitingMessage = DirectLabel(text=TTLocalizer.BuildingWaitingForVictors, text_fg=VBase4(1, 1, 1, 1), text_align=TextNode.ACenter, relief=None, pos=(0, 0, 0.35), scale=0.1) + self.waitingMessage = DirectLabel(text=TTLocalizer.WaitingForOtherToons, text_fg=VBase4(1, 1, 1, 1), text_align=TextNode.ACenter, relief=None, pos=(0, 0, 0.35), scale=0.1) elif victorCount == 0: pass else: diff --git a/toontown/catalog/CatalogItemTypes.py b/toontown/catalog/CatalogItemTypes.py index 88bbde83..b1c7443d 100644 --- a/toontown/catalog/CatalogItemTypes.py +++ b/toontown/catalog/CatalogItemTypes.py @@ -83,7 +83,6 @@ CatalogItemType2multipleAllowed = {INVALID_ITEM: False, ANIMATED_FURNITURE_ITEM: True, ACCESSORY_ITEM: False, HOUSE_ITEM: False} -SingleCodeRedemption = (BEAN_ITEM,) CatalogItemTypeMask = 31 CatalogItemSaleFlag = 128 CatalogItemGiftTag = 64 diff --git a/toontown/catalog/MailboxScreen.py b/toontown/catalog/MailboxScreen.py index aa11d778..dbafd661 100644 --- a/toontown/catalog/MailboxScreen.py +++ b/toontown/catalog/MailboxScreen.py @@ -347,13 +347,6 @@ class MailboxScreen(DirectObject.DirectObject): self.currentItem = None return - def checkFamily(self, doId): - for familyMember in base.cr.avList: - if familyMember.id == doId: - return familyMember - - return None - def __showCurrentItem(self): self.__clearCurrentItem() if len(self.items) < 1: @@ -519,20 +512,5 @@ class MailboxScreen(DirectObject.DirectObject): def getSenderName(self, avId): sender = base.cr.identifyFriend(avId) - nameOfSender = '' - if sender: - nameOfSender = sender.getName() - else: - sender = self.checkFamily(avId) - if sender: - nameOfSender = sender.name - elif hasattr(base.cr, 'playerFriendsManager'): - sender = base.cr.playerFriendsManager.getAvHandleFromId(avId) - if sender: - nameOfSender = sender.getName() - if not sender: - nameOfSender = TTLocalizer.MailboxGiftTagAnonymous - if hasattr(base.cr, 'playerFriendsManager'): - base.cr.playerFriendsManager.requestAvatarInfo(avId) - self.accept('friendsListChanged', self.__showCurrentItem) - return nameOfSender + + return sender.getName() if sender else TTLocalizer.MailboxGiftTagAnonymous \ No newline at end of file diff --git a/toontown/chat/TTChatInputSpeedChat.py b/toontown/chat/TTChatInputSpeedChat.py index 3224af2e..cefeda09 100644 --- a/toontown/chat/TTChatInputSpeedChat.py +++ b/toontown/chat/TTChatInputSpeedChat.py @@ -338,7 +338,6 @@ class TTChatInputSpeedChat(DirectObject.DirectObject): self.chatMgr = chatMgr self.firstTime = 0 self.whisperAvatarId = None - self.toPlayer = 0 buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui') okButtonImage = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')) self.emoteNoAccessPanel = DirectFrame(parent=hidden, relief=None, state='normal', text=OTPLocalizer.SCEmoteNoAccessMsg, frameSize=(-1, 1, -1, 1), geom=DGG.getDefaultDialogGeom(), geom_color=OTPGlobals.GlobalDialogColor, geom_scale=(0.92, 1, 0.6), geom_pos=(0, 0, -.08), text_scale=0.08) @@ -402,9 +401,8 @@ class TTChatInputSpeedChat(DirectObject.DirectObject): del self.fsm del self.chatMgr - def show(self, whisperAvatarId = None, toPlayer = 0): + def show(self, whisperAvatarId = None): self.whisperAvatarId = whisperAvatarId - self.toPlayer = toPlayer self.fsm.request('active') def hide(self): @@ -469,33 +467,25 @@ class TTChatInputSpeedChat(DirectObject.DirectObject): if self.whisperAvatarId is None: self.chatMgr.sendSCChatMessage(textId) else: - self.chatMgr.sendSCWhisperMessage(textId, self.whisperAvatarId, self.toPlayer) - self.toPlayer = 0 - return + self.chatMgr.sendSCWhisperMessage(textId, self.whisperAvatarId) def handleSingingMsg(self, textId): if self.whisperAvatarId is None: self.chatMgr.sendSCSingingChatMessage(textId) else: self.chatMgr.sendSCSingingWhisperMessage(textId) - self.toPlayer = 0 - return def handleCustomMsg(self, textId): if self.whisperAvatarId is None: self.chatMgr.sendSCCustomChatMessage(textId) else: - self.chatMgr.sendSCCustomWhisperMessage(textId, self.whisperAvatarId, self.toPlayer) - self.toPlayer = 0 - return + self.chatMgr.sendSCCustomWhisperMessage(textId, self.whisperAvatarId) def handleEmoteMsg(self, emoteId): if self.whisperAvatarId is None: self.chatMgr.sendSCEmoteChatMessage(emoteId) else: - self.chatMgr.sendSCEmoteWhisperMessage(emoteId, self.whisperAvatarId, self.toPlayer) - self.toPlayer = 0 - return + self.chatMgr.sendSCEmoteWhisperMessage(emoteId, self.whisperAvatarId) def handleEmoteNoAccess(self): if self.whisperAvatarId is None: @@ -512,9 +502,7 @@ class TTChatInputSpeedChat(DirectObject.DirectObject): if self.whisperAvatarId is None: self.chatMgr.sendSCToontaskChatMessage(taskId, toNpcId, toonProgress, msgIndex) else: - self.chatMgr.sendSCToontaskWhisperMessage(taskId, toNpcId, toonProgress, msgIndex, self.whisperAvatarId, self.toPlayer) - self.toPlayer = 0 - return + self.chatMgr.sendSCToontaskWhisperMessage(taskId, toNpcId, toonProgress, msgIndex, self.whisperAvatarId) def handleResistanceMsg(self, textId): self.chatMgr.sendSCResistanceChatMessage(textId) diff --git a/toontown/chat/TTChatInputWhiteList.py b/toontown/chat/TTChatInputWhiteList.py index 4fbee6b0..fac48f69 100644 --- a/toontown/chat/TTChatInputWhiteList.py +++ b/toontown/chat/TTChatInputWhiteList.py @@ -112,11 +112,10 @@ class TTChatInputWhiteList(ChatInputWhiteListFrame): for friendId, flags in base.localAvatar.friendsList: if flags & ToontownGlobals.FriendChat: self.sendWhisperByFriend(friendId, text) - - elif not self.receiverId: - base.talkAssistant.sendOpenTalk(text) - elif self.receiverId and not self.toPlayer: + elif self.receiverId: base.talkAssistant.sendWhisperTalk(text, self.receiverId) + else: + base.talkAssistant.sendOpenTalk(text) def sendWhisperByFriend(self, avatarId, text): online = 0 @@ -149,14 +148,6 @@ class TTChatInputWhiteList(ChatInputWhiteListFrame): def exitAllChat(self): ChatInputWhiteListFrame.exitAllChat(self) - def enterPlayerWhisper(self): - ChatInputWhiteListFrame.enterPlayerWhisper(self) - self.labelWhisper() - - def exitPlayerWhisper(self): - ChatInputWhiteListFrame.exitPlayerWhisper(self) - self.whisperLabel.hide() - def enterAvatarWhisper(self): ChatInputWhiteListFrame.enterAvatarWhisper(self) self.labelWhisper() @@ -167,7 +158,7 @@ class TTChatInputWhiteList(ChatInputWhiteListFrame): def labelWhisper(self): if self.receiverId: - self.whisperName = base.talkAssistant.findName(self.receiverId, self.toPlayer) + self.whisperName = base.talkAssistant.findAvatarName(self.receiverId) self.whisperLabel['text'] = OTPLocalizer.ChatInputWhisperLabel % self.whisperName self.whisperLabel.show() else: diff --git a/toontown/chat/TTSCWhiteListTerminal.py b/toontown/chat/TTSCWhiteListTerminal.py index dfff6c7d..5c0c88e2 100644 --- a/toontown/chat/TTSCWhiteListTerminal.py +++ b/toontown/chat/TTSCWhiteListTerminal.py @@ -19,7 +19,5 @@ class TTSCWhiteListTerminal(SCTerminal): SCTerminal.handleSelect(self) if not self.parentClass.whisperAvatarId: base.localAvatar.chatMgr.fsm.request('whiteListOpenChat') - elif self.parentClass.toPlayer: - base.localAvatar.chatMgr.fsm.request('whiteListPlayerChat', [self.parentClass.whisperAvatarId]) else: base.localAvatar.chatMgr.fsm.request('whiteListAvatarChat', [self.parentClass.whisperAvatarId]) diff --git a/toontown/chat/TTTalkAssistant.py b/toontown/chat/TTTalkAssistant.py index cb37fff6..bf6d4b63 100644 --- a/toontown/chat/TTTalkAssistant.py +++ b/toontown/chat/TTTalkAssistant.py @@ -24,10 +24,6 @@ class TTTalkAssistant(TalkAssistant): def clearHistory(self): TalkAssistant.clearHistory(self) - def sendPlayerWhisperToonTaskSpeedChat(self, taskId, toNpcId, toonProgress, msgIndex, receiverId): - # TODO: Remove Player system. - return None - def sendToonTaskSpeedChat(self, taskId, toNpcId, toonProgress, msgIndex): error = None messenger.send(SCChatEvent) @@ -35,4 +31,4 @@ class TTTalkAssistant(TalkAssistant): toNpcId, toonProgress, msgIndex]) - return error + return error \ No newline at end of file diff --git a/toontown/chat/ToontownChatManager.py b/toontown/chat/ToontownChatManager.py index e1d2a42e..59b96917 100644 --- a/toontown/chat/ToontownChatManager.py +++ b/toontown/chat/ToontownChatManager.py @@ -84,15 +84,12 @@ class ToontownChatManager(ChatManager.ChatManager): msgIndex]) self.announceSCChat() - def sendSCToontaskWhisperMessage(self, taskId, toNpcId, toonProgress, msgIndex, whisperAvatarId, toPlayer): - if toPlayer: - base.talkAssistant.sendPlayerWhisperToonTaskSpeedChat(taskId, toNpcId, toonProgress, msgIndex, whisperAvatarId) - else: - messenger.send('whisperUpdateSCToontask', [taskId, - toNpcId, - toonProgress, - msgIndex, - whisperAvatarId]) + def sendSCToontaskWhisperMessage(self, taskId, toNpcId, toonProgress, msgIndex, whisperAvatarId): + messenger.send('whisperUpdateSCToontask', [taskId, + toNpcId, + toonProgress, + msgIndex, + whisperAvatarId]) def enterMainMenu(self): self.chatInputNormal.setPos(self.normalPos) @@ -130,10 +127,8 @@ class ToontownChatManager(ChatManager.ChatManager): else: self.fsm.request('speedChat') - def __whisperButtonPressed(self, avatarName, avatarId, playerId): + def __whisperButtonPressed(self, avatarName, avatarId): messenger.send('wakeup') - if playerId: - playerInfo = base.cr.playerFriendsManager.getFriendInfo(playerId) if avatarId: self.enterWhisperChat(avatarName, avatarId) self.whisperFrame.hide() @@ -146,14 +141,6 @@ class ToontownChatManager(ChatManager.ChatManager): self.fsm.request('mainMenu') return - def enterWhisperChatPlayer(self, avatarName, playerId): - result = ChatManager.ChatManager.enterWhisperChatPlayer(self, avatarName, playerId) - self.chatInputNormal.setPos(self.whisperPos) - if result == None: - self.notify.warning('something went wrong in enterWhisperChatPlayer, falling back to main menu') - self.fsm.request('mainMenu') - return - def enterWhisperChat(self, avatarName, avatarId): result = ChatManager.ChatManager.enterWhisperChat(self, avatarName, avatarId) self.chatInputNormal.reparentTo(base.a2dTopCenter) @@ -177,25 +164,13 @@ class ToontownChatManager(ChatManager.ChatManager): def exitNoSecretChatAtAllAndNoWhitelist(self): self.noSecretChatAtAllAndNoWhitelist.hide() - def __whisperScButtonPressed(self, avatarName, avatarId, playerId): + def __whisperScButtonPressed(self, avatarName, avatarId): messenger.send('wakeup') - hasManager = hasattr(base.cr, 'playerFriendsManager') - transientFriend = 0 - if hasManager: - transientFriend = base.cr.playerFriendsManager.askTransientFriend(avatarId) - if transientFriend: - playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(avatarId) - if avatarId and not transientFriend: + if avatarId: if self.fsm.getCurrentState().getName() == 'whisperSpeedChat': - self.fsm.request('whisper', [avatarName, avatarId, playerId]) + self.fsm.request('whisper', [avatarName, avatarId]) else: self.fsm.request('whisperSpeedChat', [avatarId]) - elif playerId: - if self.fsm.getCurrentState().getName() == 'whisperSpeedChatPlayer': - self.fsm.request('whisper', [avatarName, avatarId, playerId]) - else: - self.fsm.request('whisperSpeedChatPlayer', [playerId]) - # Do more work here for position of SCWhisperpos def __whisperCancelPressed(self): self.fsm.request('mainMenu') diff --git a/toontown/cogdominium/CogdoFlyingLocalPlayer.py b/toontown/cogdominium/CogdoFlyingLocalPlayer.py index 3442288d..5477a78d 100644 --- a/toontown/cogdominium/CogdoFlyingLocalPlayer.py +++ b/toontown/cogdominium/CogdoFlyingLocalPlayer.py @@ -163,7 +163,7 @@ class CogdoFlyingLocalPlayer(CogdoFlyingPlayer): self.deathInterval = Sequence(Func(self.resetVelocities), Parallel(Parallel(Func(self._deathSfx.play), LerpHprInterval(self.toon, 1.0, Vec3(720, 0, 0)), LerpFunctionInterval(self.toon.setScale, fromData=1.0, toData=0.1, duration=1.0), self.toon.posInterval(0.5, Vec3(0, 0, -25), other=self.toon)), Sequence(Wait(0.5), Func(base.transitions.irisOut))), Func(self.toon.stash), Wait(1.0), Func(self.toonSpawnFunc), name='%s.deathInterval' % self.__class__.__name__) self.outOfTimeInterval = Sequence(Func(messenger.send, CogdoFlyingLocalPlayer.PlayWaitingMusicEventName), Func(self._loseSfx.play), Func(base.transitions.irisOut), Wait(1.0), Func(self.resetVelocities), Func(self._guiMgr.setMessage, '', transition=None), Func(self.toon.stash), Func(self.toonSpawnFunc), name='%s.outOfTimeInterval' % self.__class__.__name__) self.spawnInterval = Sequence(Func(self.resetToonFunc), Func(self._cameraMgr.update, 0.0), Func(self._level.update), Func(self.toon.cnode.broadcastPosHprFull), Func(base.transitions.irisIn), Wait(0.5), Func(self.toon.setAnimState, 'TeleportIn'), Func(self.toon.unstash), Wait(1.5), Func(self.requestPostSpawnState), name='%s.spawnInterval' % self.__class__.__name__) - self.waitingForWinInterval = Sequence(Func(self._guiMgr.setMessage, TTLocalizer.CogdoFlyingGameWaiting % '.'), Wait(1.5), Func(self._guiMgr.setMessage, TTLocalizer.CogdoFlyingGameWaiting % '..'), Wait(1.5), Func(self._guiMgr.setMessage, TTLocalizer.CogdoFlyingGameWaiting % '...'), Wait(1.5), name='%s.waitingForWinInterval' % self.__class__.__name__) + self.waitingForWinInterval = Sequence(Func(self._guiMgr.setMessage, TTLocalizer.WaitingForOtherToonsDots % '.'), Wait(1.5), Func(self._guiMgr.setMessage, TTLocalizer.WaitingForOtherToonsDots % '..'), Wait(1.5), Func(self._guiMgr.setMessage, TTLocalizer.WaitingForOtherToonsDots % '...'), Wait(1.5), name='%s.waitingForWinInterval' % self.__class__.__name__) self.waitingForWinSeq = Sequence(Func(self.setWaitingForWinState), Wait(4.0), Func(self.removeAllMemos), Wait(2.0), Func(self.game.distGame.d_sendRequestAction, Globals.AI.GameActions.LandOnWinPlatform, 0), Func(self.playWaitingForWinInterval), name='%s.waitingForWinSeq' % self.__class__.__name__) self.winInterval = Sequence(Func(self._guiMgr.setMessage, ''), Wait(4.0), Func(self.game.distGame.d_sendRequestAction, Globals.AI.GameActions.WinStateFinished, 0), name='%s.winInterval' % self.__class__.__name__) self.goSadSequence = Sequence(Wait(2.5), Func(base.transitions.irisOut, 1.5), name='%s.goSadSequence' % self.__class__.__name__) diff --git a/toontown/cogdominium/CogdoMazeGame.py b/toontown/cogdominium/CogdoMazeGame.py index d950c618..b2849595 100644 --- a/toontown/cogdominium/CogdoMazeGame.py +++ b/toontown/cogdominium/CogdoMazeGame.py @@ -465,9 +465,9 @@ class CogdoMazeGame(DirectObject): self.gags.append(gag) return - def handleToonMeetsGag(self, playerId, gag): + def handleToonMeetsGag(self, avId, gag): self.removeGag(gag) - self.distGame.b_toonHitByGag(playerId) + self.distGame.b_toonHitByGag(avId) def toonHitByGag(self, toonId, hitToon, elapsedTime = 0.0): if toonId not in self.toonId2Player.keys() or hitToon not in self.toonId2Player.keys(): diff --git a/toontown/cogdominium/CogdoMazeLocalPlayer.py b/toontown/cogdominium/CogdoMazeLocalPlayer.py index c5d15b49..8d79ce6b 100644 --- a/toontown/cogdominium/CogdoMazeLocalPlayer.py +++ b/toontown/cogdominium/CogdoMazeLocalPlayer.py @@ -247,7 +247,7 @@ class CogdoMazeLocalPlayer(CogdoMazePlayer): self.exited = True message = '' if door.getPlayerCount() < len(self.game.players): - message = TTLocalizer.CogdoMazeGameWaitingForToons + message = TTLocalizer.WaitingForOtherToons if toonId == self.toon.doId: self._guiMgr.setMessage(message) self._winSfx.play() diff --git a/toontown/coghq/DistributedGolfGreenGameAI.py b/toontown/coghq/DistributedGolfGreenGameAI.py index ee42dc51..e24e9900 100644 --- a/toontown/coghq/DistributedGolfGreenGameAI.py +++ b/toontown/coghq/DistributedGolfGreenGameAI.py @@ -250,8 +250,8 @@ class DistributedGolfGreenGameAI(BattleBlockerAI.BattleBlockerAI, NodePath, Basi roomId = self.getLevelDoId() room = simbase.air.doId2do.get(roomId) if room: - playerIds = self.everJoinedToons - for avId in playerIds: + avIds = self.everJoinedToons + for avId in avIds: av = simbase.air.doId2do.get(avId) if av: av.takeDamage(self.DamageOnFailure, quietly=0) diff --git a/toontown/coghq/DistributedMazeAI.py b/toontown/coghq/DistributedMazeAI.py index 390acd74..d1ebdff2 100644 --- a/toontown/coghq/DistributedMazeAI.py +++ b/toontown/coghq/DistributedMazeAI.py @@ -67,8 +67,8 @@ class DistributedMazeAI(DistributedEntityAI.DistributedEntityAI): roomId = self.getLevelDoId() room = simbase.air.doId2do.get(roomId) if room: - playerIds = room.presentAvIds - for avId in playerIds: + avIds = room.presentAvIds + for avId in avIds: av = simbase.air.doId2do.get(avId) if av and avId not in self.finishedList: self.finishedList.append(avId) @@ -81,7 +81,7 @@ class DistributedMazeAI(DistributedEntityAI.DistributedEntityAI): roomId = self.getLevelDoId() room = simbase.air.doId2do.get(roomId) if room: - playerIds = room.presentAvIds - if av and senderId in playerIds: + avIds = room.presentAvIds + if av and senderId in avIds: av.takeDamage(self.DamageOnFailure, quietly=0) room.sendUpdate('forceOuch', [self.DamageOnFailure]) diff --git a/toontown/coghq/DistributedMoleFieldAI.py b/toontown/coghq/DistributedMoleFieldAI.py index 0e3e0b3c..90501deb 100644 --- a/toontown/coghq/DistributedMoleFieldAI.py +++ b/toontown/coghq/DistributedMoleFieldAI.py @@ -107,8 +107,8 @@ class DistributedMoleFieldAI(DistributedEntityAI.DistributedEntityAI, MoleFieldB return senderId = self.air.getAvatarIdFromSender() av = simbase.air.doId2do.get(senderId) - playerIds = room.presentAvIds - if av and senderId in playerIds: + avIds = room.presentAvIds + if av and senderId in avIds: av.takeDamage(self.DamageOnFailure, quietly=0) room.sendUpdate('forceOuch', [self.DamageOnFailure]) diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index 060aaa01..57e80702 100644 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -76,7 +76,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self.toontownTimeManager = ToontownTimeManager.ToontownTimeManager() self.csm = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CLIENT_SERVICES_MANAGER, 'ClientServicesManager') - 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.furnitureManager = None @@ -658,9 +657,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): elif self.cache.contains(doId): teleportNotify.debug('found friend %s in cache' % doId) avatar = self.cache.dict[doId] - elif self.playerFriendsManager.getAvHandleFromId(doId): - teleportNotify.debug('found friend %s in playerFriendsManager' % doId) - avatar = base.cr.playerFriendsManager.getAvHandleFromId(doId) else: self.notify.warning("Don't know who friend %s is." % doId) return @@ -681,9 +677,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self.friendsMap[doId] = handle return handle - def identifyPlayer(self, pId): - return base.cr.playerFriendsManager.getFriendInfo(pId) - def identifyAvatar(self, doId): if doId in self.doId2do: return self.doId2do[doId] diff --git a/toontown/friends/FriendInvitee.py b/toontown/friends/FriendInvitee.py index d391320e..df822f17 100644 --- a/toontown/friends/FriendInvitee.py +++ b/toontown/friends/FriendInvitee.py @@ -54,9 +54,6 @@ class FriendInvitee(ToonHeadDialog.ToonHeadDialog): if self.context != None: base.cr.friendManager.up_inviteeFriendResponse(2, self.context) self.context = None - if base.friendMode == 1: - base.cr.friendManager.executeGameSpecificFunction() - return def __handleButton(self, value): base.cr.friendManager.up_inviteeFriendResponse(value == DGG.DIALOG_OK, self.context) diff --git a/toontown/friends/FriendInviter.py b/toontown/friends/FriendInviter.py index 8795dcf2..36b6f928 100644 --- a/toontown/friends/FriendInviter.py +++ b/toontown/friends/FriendInviter.py @@ -44,19 +44,12 @@ class FriendInviter(DirectFrame): notify = DirectNotifyGlobal.directNotify.newCategory('FriendInviter') def __init__(self, avId, avName, avDisableName): - self.wantPlayerFriends = base.config.GetBool('want-player-friends', 0) DirectFrame.__init__(self, pos=(-1.033, 0.1, -0.35), parent=base.a2dTopRight, image_color=GlobalDialogColor, image_scale=(1.0, 1.0, 0.6), text='', text_wordwrap=TTLocalizer.FIdirectFrameWordwrap, text_scale=TTLocalizer.FIdirectFrame, text_pos=TTLocalizer.FIdirectFramePos) self['image'] = DGG.getDefaultDialogGeom() self.avId = avId self.toonName = avName avatar = base.cr.doId2do.get(self.avId) - self.playerId = None - self.playerName = None - if avatar: - self.playerId = avatar.DISLid - self.playerName = avatar.DISLname + ' ' + str(avatar.DISLid) self.avDisableName = avDisableName - self.playerFriend = 0 self.fsm = ClassicFSM.ClassicFSM('FriendInviter', [State.State('off', self.enterOff, self.exitOff), State.State('getNewFriend', self.enterGetNewFriend, self.exitGetNewFriend), State.State('begin', self.enterBegin, self.exitBegin), @@ -97,13 +90,9 @@ class FriendInviter(DirectFrame): self.bNo = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=OTPLocalizer.FriendInviterNo, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.15, 0.0, -0.1), command=self.__handleNo) self.bNo.hide() self.bToon = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.FriendInviterToon, text_scale=0.05, text_pos=(0.0, -0.1), pos=(-0.35, 0.0, -0.05), command=self.__handleToon) - toonText = DirectLabel(parent=self, relief=None, pos=Vec3(0.35, 0, -0.2), text=TTLocalizer.FriendInviterToonFriendInfo, text_fg=(0, 0, 0, 1), text_pos=(0, 0), text_scale=0.045, text_align=TextNode.ACenter) + toonText = DirectLabel(parent=self, relief=None, pos=Vec3(0.35, 0, -0.2), text='Hello niggers', text_fg=(0, 0, 0, 1), text_pos=(0, 0), text_scale=0.045, text_align=TextNode.ACenter) toonText.reparentTo(self.bToon.stateNodePath[2]) self.bToon.hide() - self.bPlayer = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.FriendInviterPlayer, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, 0.0, -0.05), command=self.__handlePlayer) - playerText = DirectLabel(parent=self, relief=None, pos=Vec3(0, 0, -0.2), text=TTLocalizer.FriendInviterPlayerFriendInfo, text_fg=(0, 0, 0, 1), text_pos=(0, 0), text_scale=0.045, text_align=TextNode.ACenter) - playerText.reparentTo(self.bPlayer.stateNodePath[2]) - self.bPlayer.hide() buttons.removeNode() gui.removeNode() self.fsm.enterInitialState() @@ -119,14 +108,11 @@ class FriendInviter(DirectFrame): self.destroy() def getName(self): - if self.playerFriend: - name = self.playerName - if name == None: - name = TTLocalizer.FriendInviterThatPlayer - else: - name = self.toonName - if name == None: - name = TTLocalizer.FriendInviterThatToon + name = self.toonName + + if name == None: + name = TTLocalizer.FriendInviterThatToon + return name def enterOff(self): @@ -147,9 +133,6 @@ class FriendInviter(DirectFrame): def __handleClickedNametag(self, avatar): self.avId = avatar.doId self.toonName = avatar.getName() - if hasattr(avatar, 'DISLid'): - self.playerId = avatar.DISLid - self.playerName = avatar.DISLname self.avDisableName = avatar.uniqueName('disable') self.fsm.request('begin') @@ -159,17 +142,12 @@ class FriendInviter(DirectFrame): self.bCancel.setPos(0.35, 0.0, -0.05) self.bCancel.show() self.bToon.show() - if self.wantPlayerFriends: - self.bPlayer.show() - else: - self.__handleToon() + self.__handleToon() self.accept(self.avDisableName, self.__handleDisableAvatar) def exitBegin(self): self.ignore(self.avDisableName) self.bToon.hide() - if self.wantPlayerFriends: - self.bPlayer.hide() self.bCancel.setPos(0.0, 0.0, -0.1) self.bCancel.hide() @@ -178,16 +156,10 @@ class FriendInviter(DirectFrame): self.accept(self.avDisableName, self.__handleDisableAvatar) if self.avId == myId: self.fsm.request('self') - elif not self.playerFriend and base.cr.isFriend(self.avId): - self.fsm.request('already') - elif self.playerFriend and base.cr.playerFriendsManager.isPlayerFriend(self.avId): + elif base.cr.isFriend(self.avId): self.fsm.request('already') else: - if not self.playerFriend: - tooMany = len(base.localAvatar.friendsList) >= MaxFriends - elif self.playerFriend: - tooMany = base.cr.playerFriendsManager.friendsListFull() - if tooMany: + if len(base.localAvatar.friendsList) >= MaxFriends: self.fsm.request('tooMany') else: self.fsm.request('checkAvailability') @@ -196,12 +168,8 @@ class FriendInviter(DirectFrame): self.ignore(self.avDisableName) def enterTooMany(self): - if self.playerFriend: - text = OTPLocalizer.FriendInviterPlayerTooMany - name = self.playerName - else: - text = OTPLocalizer.FriendInviterToonTooMany - name = self.toonName + text = OTPLocalizer.FriendInviterToonTooMany + name = self.toonName self['text'] = text % name self.bCancel.show() self.bCancel.setPos(0.0, 0.0, -0.16) @@ -211,10 +179,6 @@ class FriendInviter(DirectFrame): def enterCheckAvailability(self): self.accept(self.avDisableName, self.__handleDisableAvatar) - if not self.playerFriend: - if self.avId not in base.cr.doId2do: - self.fsm.request('wentAway') - return if self.avId not in base.cr.doId2do: self.fsm.request('wentAway') return @@ -226,23 +190,14 @@ class FriendInviter(DirectFrame): if isinstance(avatar, Pet.Pet): self.fsm.request('askingPet') return - if not self.playerFriend: - if not base.cr.friendManager: - self.notify.warning('No FriendManager available.') - self.fsm.request('down') - return - if self.playerFriend: - self.notify.info('Inviter requesting player friend') - self['text'] = OTPLocalizer.FriendInviterAsking % self.playerName - base.cr.playerFriendsManager.sendRequestInvite(self.playerId) - self.accept(OTPGlobals.PlayerFriendRejectInviteEvent, self.__playerFriendRejectResponse) - self.accept(OTPGlobals.PlayerFriendAddEvent, self.__playerFriendAcceptResponse) - self.bOk.show() - else: - base.cr.friendManager.up_friendQuery(self.avId) - self['text'] = OTPLocalizer.FriendInviterCheckAvailability % self.toonName - self.accept('friendResponse', self.__friendResponse) - self.bCancel.show() + if not base.cr.friendManager: + self.notify.warning('No FriendManager available.') + self.fsm.request('down') + return + base.cr.friendManager.up_friendQuery(self.avId) + self['text'] = OTPLocalizer.FriendInviterCheckAvailability % self.toonName + self.accept('friendResponse', self.__friendResponse) + self.bCancel.show() self.accept('friendConsidering', self.__friendConsidering) def exitCheckAvailability(self): @@ -271,10 +226,9 @@ class FriendInviter(DirectFrame): def enterWentAway(self): self['text'] = OTPLocalizer.FriendInviterWentAway % self.getName() - if not self.playerFriend: - if self.context != None: - base.cr.friendManager.up_cancelFriendQuery(self.context) - self.context = None + if self.context != None: + base.cr.friendManager.up_cancelFriendQuery(self.context) + self.context = None self.bOk.show() return @@ -282,12 +236,8 @@ class FriendInviter(DirectFrame): self.bOk.hide() def enterAlready(self): - if self.playerFriend: - self['text'] = TTLocalizer.FriendInviterPlayerAlready % self.getName() - self.bStop['text'] = TTLocalizer.FriendInviterStopBeingPlayerFriends - else: - self['text'] = TTLocalizer.FriendInviterToonAlready % self.getName() - self.bStop['text'] = TTLocalizer.FriendInviterStopBeingToonFriends + self['text'] = TTLocalizer.FriendInviterToonAlready % self.getName() + self.bStop['text'] = TTLocalizer.FriendInviterStopBeingToonFriends self.context = None self.bStop.show() self.bCancel.show() @@ -324,14 +274,7 @@ class FriendInviter(DirectFrame): self.bOk.hide() def enterEndFriendship(self): - if self.playerFriend: - self['text'] = TTLocalizer.FriendInviterEndFriendshipPlayer % self.getName() - if base.cr.isFriend(self.avId): - self['text'] = self['text'] + TTLocalizer.FriendInviterRemainToon % self.toonName - else: - self['text'] = TTLocalizer.FriendInviterEndFriendshipToon % self.getName() - if base.cr.playerFriendsManager.isPlayerFriend(self.playerId): - self['text'] = self['text'] + TTLocalizer.FriendInviterRemainPlayer % self.playerName + self['text'] = TTLocalizer.FriendInviterEndFriendshipToon % self.getName() self.context = None self.bYes.show() self.bNo.show() @@ -342,12 +285,7 @@ class FriendInviter(DirectFrame): self.bNo.hide() def enterFriendsNoMore(self): - if self.playerFriend: - self.notify.info('### send player remove') - base.cr.playerFriendsManager.sendRequestRemove(self.playerId) - else: - self.notify.info('### send avatar remove') - base.cr.removeFriend(self.avId) + base.cr.removeFriend(self.avId) self['text'] = OTPLocalizer.FriendInviterFriendsNoMore % self.getName() self.bOk.show() if self.avId not in base.cr.doId2do: @@ -431,10 +369,9 @@ class FriendInviter(DirectFrame): self.bOk.hide() def enterCancel(self): - if not self.playerFriend: - if self.context != None: - base.cr.friendManager.up_cancelFriendQuery(self.context) - self.context = None + if self.context != None: + base.cr.friendManager.up_cancelFriendQuery(self.context) + self.context = None self.fsm.request('off') return @@ -466,13 +403,6 @@ class FriendInviter(DirectFrame): else: unloadFriendInviter() - def __handlePlayer(self): - if self.fsm.getCurrentState().getName() == 'begin': - self.playerFriend = 1 - self.fsm.request('check') - else: - unloadFriendInviter() - def __handleNo(self): unloadFriendInviter() @@ -515,11 +445,5 @@ class FriendInviter(DirectFrame): self.notify.warning('Got unexpected response to friendResponse: %s' % yesNoMaybe) self.fsm.request('maybe') - def __playerFriendRejectResponse(self, avId, reason): - self.fsm.request('maybe') - - def __playerFriendAcceptResponse(self): - self.fsm.request('yes') - def __handleDisableAvatar(self): self.fsm.request('wentAway') diff --git a/toontown/friends/FriendsListManager.py b/toontown/friends/FriendsListManager.py index 260a9ac6..d1f2b06c 100644 --- a/toontown/friends/FriendsListManager.py +++ b/toontown/friends/FriendsListManager.py @@ -8,11 +8,9 @@ from toontown.toon import ToonTeleportPanel from toontown.friends import ToontownFriendSecret from toontown.pets import PetAvatarPanel from toontown.toon import ToonAvatarPanel -from toontown.toon import PlayerInfoPanel from toontown.suit import SuitAvatarPanel from toontown.toon import ToonDNA from toontown.toon import ToonAvatarDetailPanel -from toontown.toon import PlayerDetailPanel from toontown.toonbase import ToontownGlobals from toontown.toon import Toon import FriendHandle @@ -30,11 +28,9 @@ class FriendsListManager: return def load(self): - #base.cr.friendManager.setGameSpecificFunction(self.processQueuedRequests) self.accept(OTPGlobals.AvatarNewFriendAddEvent, self.__friendAdded) def unload(self): - #base.cr.friendManager.setGameSpecificFunction(None) self.exitFLM() if self.avatarPanel: del self.avatarPanel @@ -51,15 +47,12 @@ class FriendsListManager: self._entered = True self.accept('openFriendsList', self.__openFriendsList) self.accept('clickedNametag', self.__handleClickedNametag) - self.accept('clickedNametagPlayer', self.__handleClickedNametagPlayer) base.localAvatar.setFriendsListButtonActive(1) NametagGlobals.setWantActiveNametags(True) self.accept('gotoAvatar', self.__handleGotoAvatar) self.accept('friendAvatar', self.__handleFriendAvatar) self.accept('avatarDetails', self.__handleAvatarDetails) - self.accept('playerDetails', self.__handlePlayerDetails) self.accept('friendInvitation', self.__handleFriendInvitation) - self.accept(OTPGlobals.PlayerFriendInvitationEvent, self.__handlePlayerFriendInvitation) if base.cr.friendManager: base.cr.friendManager.setAvailable(1) @@ -72,7 +65,6 @@ class FriendsListManager: self._entered = False self.ignore('openFriendsList') self.ignore('clickedNametag') - self.ignore('clickedNametagPlayer') base.localAvatar.setFriendsListButtonActive(0) NametagGlobals.setWantActiveNametags(False) if self.avatarPanel: @@ -81,7 +73,6 @@ class FriendsListManager: self.ignore('gotoAvatar') self.ignore('friendAvatar') self.ignore('avatarDetails') - self.ignore('playerDetails') FriendsListPanel.hideFriendsList() ToontownFriendSecret.hideFriendSecret() if base.cr.friendManager: @@ -95,7 +86,7 @@ class FriendsListManager: def __openFriendsList(self): FriendsListPanel.showFriendsList() - def __handleClickedNametag(self, avatar, playerId = None): + def __handleClickedNametag(self, avatar): self.notify.debug('__handleClickedNametag. doId = %s' % avatar.doId) if avatar.isPet(): self.avatarPanel = PetAvatarPanel.PetAvatarPanel(avatar) @@ -106,29 +97,10 @@ class FriendsListManager: if not self.avatarPanel.isHidden(): if self.avatarPanel.getType() == 'toon': return - self.avatarPanel = ToonAvatarPanel.ToonAvatarPanel(avatar, playerId) + self.avatarPanel = ToonAvatarPanel.ToonAvatarPanel(avatar) else: self.avatarPanel = SuitAvatarPanel.SuitAvatarPanel(avatar) - def __handleClickedNametagPlayer(self, avatar, playerId, showType = 1): - self.notify.debug('__handleClickedNametagPlayer PlayerId%s' % playerId) - if showType == 1: - if hasattr(self, 'avatarPanel'): - if self.avatarPanel: - if not hasattr(self.avatarPanel, 'getPlayerId') or self.avatarPanel.getPlayerId() == playerId: - if not self.avatarPanel.isHidden(): - if self.avatarPanel.getType() == 'player': - return - self.avatarPanel = PlayerInfoPanel.PlayerInfoPanel(playerId) - elif isinstance(avatar, Toon.Toon) or isinstance(avatar, FriendHandle.FriendHandle): - if hasattr(self, 'avatarPanel'): - if self.avatarPanel: - if not hasattr(self.avatarPanel, 'getAvId') or self.avatarPanel.getAvId() == avatar.doId: - if not self.avatarPanel.isHidden(): - if self.avatarPanel.getType() == 'toon': - return - self.avatarPanel = ToonAvatarPanel.ToonAvatarPanel(avatar, playerId) - def __handleGotoAvatar(self, avId, avName, avDisableName): ToonTeleportPanel.showTeleportPanel(avId, avName, avDisableName) @@ -141,15 +113,6 @@ class FriendsListManager: if not base.localAvatar.isIgnored(avId): FriendInvitee.FriendInvitee(avId, avName, dna, context) - def __handlePlayerFriendInvitation(self, avId, avName, inviterDna = None, context = None): - self.notify.debug('incoming switchboard friend event') - self.friendsRequestQueue.append((avId, - avName, - inviterDna, - context)) - #if base.cr.friendManager.getAvailable(): - self.processQueuedRequests() - def processQueuedRequests(self): if len(self.friendsRequestQueue): request = self.friendsRequestQueue.pop(0) @@ -166,11 +129,8 @@ class FriendsListManager: else: self.notify.debug('no toon') - def __handleAvatarDetails(self, avId, avName, playerId = None): - ToonAvatarDetailPanel.showAvatarDetail(avId, avName, playerId) - - def __handlePlayerDetails(self, avId, avName, playerId = None): - PlayerDetailPanel.showPlayerDetail(avId, avName, playerId) + def __handleAvatarDetails(self, avId, avName): + ToonAvatarDetailPanel.showAvatarDetail(avId, avName) def preserveFriendsList(self): self.notify.debug('Preserving Friends List') diff --git a/toontown/friends/FriendsListPanel.py b/toontown/friends/FriendsListPanel.py index a546074f..58f08750 100644 --- a/toontown/friends/FriendsListPanel.py +++ b/toontown/friends/FriendsListPanel.py @@ -10,33 +10,14 @@ from otp.otpbase import OTPGlobals FLPPets = 1 FLPOnline = 2 FLPAll = 3 -FLPOnlinePlayers = 4 -FLPPlayers = 5 -FLPEnemies = 6 globalFriendsList = None def determineFriendName(friendTuple): - friendName = None - if len(friendTuple) == 2: - avId, flags = friendTuple - playerId = None - showType = 0 - elif len(friendTuple) == 3: - avId, flags, playerId = friendTuple - showType = 0 - elif len(friendTuple) == 4: - avId, flags, playerId, showType = friendTuple - if showType == 1 and playerId: - playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) - friendName = playerInfo.playerName - else: - hasManager = hasattr(base.cr, 'playerFriendsManager') - handle = base.cr.identifyFriend(avId) - if not handle and hasManager: - handle = base.cr.playerFriendsManager.getAvHandleFromId(avId) - if handle: - friendName = handle.getName() - return friendName + if len(friendTuple) < 0: + return None + + handle = base.cr.identifyFriend(friendTuple[0]) + return handle.getName() if handle else None def compareFriends(f1, f2): @@ -100,7 +81,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData): def __init__(self): self.leftmostPanel = FLPPets - self.rightmostPanel = FLPPlayers + self.rightmostPanel = FLPAll DirectFrame.__init__(self, relief=None) self.listScrollIndex = [0, 0, @@ -181,54 +162,20 @@ class FriendsListPanel(DirectFrame, StateData.StateData): return None def makeFriendButton(self, friendTuple, colorChoice = None, bold = 0): - playerName = None toonName = None if len(friendTuple) == 2: avId, flags = friendTuple - playerId = None - showType = 0 - elif len(friendTuple) == 3: - avId, flags, playerId = friendTuple - showType = 0 - elif len(friendTuple) == 4: - avId, flags, playerId, showType = friendTuple command = self.__choseFriend - playerName = None - if playerId: - playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId, None) - if playerInfo: - playerName = playerInfo.playerName - toonName = None - hasManager = hasattr(base.cr, 'playerFriendsManager') handle = base.cr.identifyFriend(avId) - if not handle and hasManager: - handle = base.cr.playerFriendsManager.getAvHandleFromId(avId) if handle: toonName = handle.getName() - if showType == 1 and playerId: - if not playerName: - return - friendName = playerName - rolloverName = toonName - else: - if not toonName: - base.cr.fillUpFriendsMap() - return - friendName = toonName - if playerName: - rolloverName = playerName - else: - rolloverName = 'Unknown' - if playerId: - command = self.__chosePlayerFriend - thing = playerId - else: - thing = avId + if not toonName: + base.cr.fillUpFriendsMap() + return + thing = avId fg = ToontownGlobals.ColorNoChat if flags & ToontownGlobals.FriendChat: fg = ToontownGlobals.ColorAvatar - if playerId: - fg = ToontownGlobals.ColorPlayer if colorChoice: fg = colorChoice fontChoice = ToontownGlobals.getToonFont() @@ -241,10 +188,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData): colorChoice[1] * colorS, colorChoice[2] * colorS, colorChoice[3]) - db = DirectButton(relief=None, text=friendName, text_scale=fontScale, text_align=TextNode.ALeft, text_fg=fg, text_shadow=bg, text1_bg=self.textDownColor, text2_bg=self.textRolloverColor, text3_fg=self.textDisabledColor, text_font=fontChoice, textMayChange=0, command=command, extraArgs=[thing, showType]) - if playerId: - accountName = DirectLabel(parent=db, pos=Vec3(-0.02, 0, 0), text=rolloverName, text_fg=(0, 0, 0, 1), text_bg=(1, 1, 1, 1), text_pos=(0, 0), text_scale=0.045, text_align=TextNode.ARight) - accountName.reparentTo(db.stateNodePath[2]) + db = DirectButton(relief=None, text=toonName, text_scale=fontScale, text_align=TextNode.ALeft, text_fg=fg, text_shadow=bg, text1_bg=self.textDownColor, text2_bg=self.textRolloverColor, text3_fg=self.textDisabledColor, text_font=fontChoice, textMayChange=0, command=command, extraArgs=[avId]) return db def enter(self): @@ -262,12 +206,9 @@ class FriendsListPanel(DirectFrame, StateData.StateData): self.__updateArrows() self.show() self.accept('friendOnline', self.__friendOnline) - self.accept('friendPlayers', self.__friendPlayers) self.accept('friendOffline', self.__friendOffline) self.accept('friendsListChanged', self.__friendsListChanged) self.accept('friendsMapComplete', self.__friendsListChanged) - self.accept(OTPGlobals.PlayerFriendAddEvent, self.__friendsListChanged) - self.accept(OTPGlobals.PlayerFriendUpdateEvent, self.__friendsListChanged) return def exit(self): @@ -281,8 +222,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData): self.ignore('friendOffline') self.ignore('friendsListChanged') self.ignore('friendsMapComplete') - self.ignore(OTPGlobals.PlayerFriendAddEvent) - self.ignore(OTPGlobals.PlayerFriendUpdateEvent) base.localAvatar.obscureFriendsListButton(-1) messenger.send(self.doneEvent) return None @@ -318,29 +257,11 @@ class FriendsListPanel(DirectFrame, StateData.StateData): messenger.send('friendAvatar', [None, None, None]) return - def __choseFriend(self, friendId, showType = 0): + def __choseFriend(self, friendId): messenger.send('wakeup') - hasManager = hasattr(base.cr, 'playerFriendsManager') handle = base.cr.identifyFriend(friendId) - if not handle and hasManager: - handle = base.cr.playerFriendsManager.getAvHandleFromId(friendId) if handle != None: - self.notify.info("Clicked on name in friend's list. doId = %s" % handle.doId) messenger.send('clickedNametag', [handle]) - return - - def __chosePlayerFriend(self, friendId, showType = 1): - messenger.send('wakeup') - hasManager = hasattr(base.cr, 'playerFriendsManager') - handle = None - playerFriendInfo = base.cr.playerFriendsManager.playerId2Info.get(friendId) - handle = base.cr.identifyFriend(playerFriendInfo.avatarId) - if not handle and hasManager: - handle = base.cr.playerFriendsManager.getAvHandleFromId(playerFriendInfo.avatarId) - if playerFriendInfo != None: - self.notify.info("Clicked on name in player friend's list. Id = %s" % friendId) - messenger.send('clickedNametagPlayer', [handle, friendId, showType]) - return def __updateScrollList(self): newFriends = [] @@ -350,101 +271,11 @@ class FriendsListPanel(DirectFrame, StateData.StateData): freeChatDouble = [] speedChatDouble = [] offlineFriends = [] - if self.panelType == FLPPlayers: - playerFriendList = base.cr.playerFriendsManager.playerFriendsList - for playerFriendId in playerFriendList: - if playerFriendId in base.cr.playerFriendsManager.playerId2Info: - playerFriendInfo = base.cr.playerFriendsManager.playerId2Info.get(playerFriendId) - if playerFriendInfo.onlineYesNo: - if playerFriendInfo.understandableYesNo: - if playerFriendInfo.avatarId: - freeChatDouble.insert(0, (playerFriendInfo.avatarId, - 0, - playerFriendId, - 1)) - else: - freeChatOneRef.insert(0, (0, - 0, - playerFriendId, - 1)) - elif playerFriendInfo.avatarId: - speedChatDouble.insert(0, (playerFriendInfo.avatarId, - 0, - playerFriendId, - 1)) - else: - speedChatOneRef.insert(0, (0, - 0, - playerFriendId, - 1)) - elif playerFriendInfo.understandableYesNo: - freeChatOneRef.insert(0, (0, - 0, - playerFriendId, - 1)) - else: - speedChatOneRef.insert(0, (0, - 0, - playerFriendId, - 1)) - - if self.panelType == FLPOnlinePlayers: - playerFriendList = base.cr.playerFriendsManager.playerFriendsList - for playerFriendId in playerFriendList: - if playerFriendId in base.cr.playerFriendsManager.playerId2Info: - playerFriendInfo = base.cr.playerFriendsManager.playerId2Info.get(playerFriendId) - if playerFriendInfo.onlineYesNo: - if playerFriendInfo.understandableYesNo: - if playerFriendInfo.avatarId: - freeChatDouble.insert(0, (playerFriendInfo.avatarId, - 0, - playerFriendId, - 1)) - else: - freeChatOneRef.insert(0, (0, - 0, - playerFriendId, - 1)) - elif playerFriendInfo.avatarId: - speedChatDouble.insert(0, (playerFriendInfo.avatarId, - 0, - playerFriendId, - 1)) - else: - speedChatOneRef.insert(0, (0, - 0, - playerFriendId, - 1)) - if self.panelType == FLPAll: - if base.friendMode == 0: + if True: for friendPair in base.localAvatar.friendsList: - playerId = 0 - if hasattr(base.cr, 'playerFriendsManager'): - playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(friendPair[0]) - if playerId: - if friendPair[1] & ToontownGlobals.FriendChat: - freeChatDouble.insert(0, (friendPair[0], - friendPair[1], - playerId, - 0)) - else: - speedChatDouble.insert(0, (friendPair[0], - friendPair[1], - playerId, - 0)) - elif base.cr.isFriendOnline(friendPair[0]): - if friendPair[1] & ToontownGlobals.FriendChat: - freeChatOneRef.insert(0, (friendPair[0], - friendPair[1], - 0, - 0)) - else: - speedChatOneRef.insert(0, (friendPair[0], - friendPair[1], - 0, - 0)) - elif friendPair[1] & ToontownGlobals.FriendChat: + if base.cr.isFriendOnline(friendPair[0]): + if friendPair[1] & ToontownGlobals.FriendChat: freeChatOneRef.insert(0, (friendPair[0], friendPair[1], 0, @@ -454,76 +285,26 @@ class FriendsListPanel(DirectFrame, StateData.StateData): friendPair[1], 0, 0)) - else: - offlineFriends.append((friendPair[0], + elif friendPair[1] & ToontownGlobals.FriendChat: + freeChatOneRef.insert(0, (friendPair[0], friendPair[1], - playerId, + 0, + 0)) + else: + speedChatOneRef.insert(0, (friendPair[0], + friendPair[1], + 0, 0)) - - if hasattr(base.cr, 'playerFriendsManager'): - for avatarId in base.cr.playerFriendsManager.getAllOnlinePlayerAvatars(): - playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(avatarId) - playerFriendInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) - if not base.cr.playerFriendsManager.askAvatarKnownElseWhere(avatarId): - if playerFriendInfo.understandableYesNo: - freeChatDouble.insert(0, (avatarId, - 0, - playerId, - 0)) - else: - speedChatDouble.insert(0, (avatarId, - 0, - playerId, - 0)) if self.panelType == FLPOnline: - if base.friendMode == 0: + if True: for friendPair in base.localAvatar.friendsList: - if hasattr(base.cr, 'playerFriendsManager') and base.cr.isFriendOnline(friendPair[0]): - playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(friendPair[0]) - if playerId: - if friendPair[1] & ToontownGlobals.FriendChat: - freeChatDouble.insert(0, (friendPair[0], - friendPair[1], - playerId, - 0)) - else: - speedChatDouble.insert(0, (friendPair[0], - friendPair[1], - playerId, - 0)) - elif friendPair[1] & ToontownGlobals.FriendChat: - freeChatOneRef.insert(0, (friendPair[0], - friendPair[1], - 0, - 0)) - else: - speedChatOneRef.insert(0, (friendPair[0], - friendPair[1], - 0, - 0)) - elif base.cr.isFriendOnline(friendPair[0]): + if base.cr.isFriendOnline(friendPair[0]): offlineFriends.append((friendPair[0], friendPair[1], 0, 0)) - if hasattr(base.cr, 'playerFriendsManager'): - for avatarId in base.cr.playerFriendsManager.getAllOnlinePlayerAvatars(): - playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(avatarId) - playerFriendInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) - if not base.cr.playerFriendsManager.askAvatarKnownElseWhere(avatarId): - if playerFriendInfo.understandableYesNo: - freeChatDouble.insert(0, (avatarId, - 0, - playerId, - 0)) - else: - speedChatDouble.insert(0, (avatarId, - 0, - playerId, - 0)) - if self.panelType == FLPPets: for objId, obj in base.cr.doId2do.items(): from toontown.pets import DistributedPet @@ -604,14 +385,8 @@ class FriendsListPanel(DirectFrame, StateData.StateData): self.title['text'] = TTLocalizer.FriendsListPanelOnlineFriends elif self.panelType == FLPAll: self.title['text'] = TTLocalizer.FriendsListPanelAllFriends - elif self.panelType == FLPPets: - self.title['text'] = TTLocalizer.FriendsListPanelPets - elif self.panelType == FLPPlayers: - self.title['text'] = TTLocalizer.FriendsListPanelPlayers - elif self.panelType == FLPOnlinePlayers: - self.title['text'] = TTLocalizer.FriendsListPanelOnlinePlayers else: - self.title['text'] = TTLocalizer.FriendsListPanelIgnoredFriends + self.title['text'] = TTLocalizer.FriendsListPanelPets self.title.resetFrameSize() def __updateArrows(self): @@ -632,10 +407,5 @@ class FriendsListPanel(DirectFrame, StateData.StateData): if self.panelType == FLPOnline: self.__updateScrollList() - def __friendPlayers(self, doId): - if self.panelType == FLPPlayers: - self.__updateScrollList() - def __friendsListChanged(self, arg1 = None, arg2 = None): - if self.panelType != FLPEnemies: - self.__updateScrollList() \ No newline at end of file + self.__updateScrollList() \ No newline at end of file diff --git a/toontown/friends/TTPlayerFriendsManager.py b/toontown/friends/TTPlayerFriendsManager.py deleted file mode 100644 index 3c0fcf53..00000000 --- a/toontown/friends/TTPlayerFriendsManager.py +++ /dev/null @@ -1,12 +0,0 @@ -from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal -from direct.directnotify.DirectNotifyGlobal import directNotify -from otp.otpbase import OTPGlobals -from otp.friends.PlayerFriendsManager import PlayerFriendsManager - -class TTPlayerFriendsManager(PlayerFriendsManager): - - def __init__(self, cr): - PlayerFriendsManager.__init__(self, cr) - - def sendRequestInvite(self, playerId): - self.sendUpdate('requestInvite', [0, playerId, False]) \ No newline at end of file diff --git a/toontown/friends/TTPlayerFriendsManagerUD.py b/toontown/friends/TTPlayerFriendsManagerUD.py deleted file mode 100644 index acf99433..00000000 --- a/toontown/friends/TTPlayerFriendsManagerUD.py +++ /dev/null @@ -1,6 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from otp.friends.PlayerFriendsManagerUD import PlayerFriendsManagerUD - -class TTPlayerFriendsManagerUD(PlayerFriendsManagerUD): - notify = DirectNotifyGlobal.directNotify.newCategory("TTPlayerFriendsManagerUD") - diff --git a/toontown/golf/DistributedGolfHoleAI.py b/toontown/golf/DistributedGolfHoleAI.py index 7ea04bfe..b3fb03af 100644 --- a/toontown/golf/DistributedGolfHoleAI.py +++ b/toontown/golf/DistributedGolfHoleAI.py @@ -40,7 +40,7 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, 0, 0] self.barrierPlayback = None - self.trustedPlayerId = None + self.trustedAvId = None self.activeGolferIndex = None self.activeGolferId = None self.holeInfo = GolfGlobals.HoleInfo[self.holeId] @@ -263,8 +263,8 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, dirX, dirY] self.commonHoldData = commonObjectData - self.trustedPlayerId = self.choosePlayerToSimulate() - self.sendUpdateToAvatarId(self.trustedPlayerId, 'assignRecordSwing', [avId, + self.trustedAvId = self.chooseAvatarToSimulate() + self.sendUpdateToAvatarId(self.trustedAvId, 'assignRecordSwing', [avId, cycleTime, power, x, @@ -275,19 +275,14 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, commonObjectData]) self.golfCourse.addAimTime(avId, curAimTime) - def choosePlayerToSimulate(self): + def chooseAvatarToSimulate(self): stillPlaying = self.golfCourse.getStillPlayingAvIds() - playerId = 0 - if simbase.air.config.GetBool('golf-trust-driver-first', 0): - if stillPlaying: - playerId = stillPlaying[0] - else: - playerId = random.choice(stillPlaying) - return playerId + + return stillPlaying[0] if stillPlaying else 0 def ballMovie2AI(self, cycleTime, avId, movie, spinMovie, ballInFrame, ballTouchedHoleFrame, ballFirstTouchedHoleFrame, commonObjectData): sentFromId = self.air.getAvatarIdFromSender() - if sentFromId == self.trustedPlayerId: + if sentFromId == self.trustedAvId: lastFrameNum = len(movie) - 2 if lastFrameNum < 0: lastFrameNum = 0 @@ -309,11 +304,11 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, if self.state == 'WaitPlayback' or self.state == 'WaitTee': self.notify.warning('ballMovie2AI requesting from %s to WaitPlayback' % self.state) self.request('WaitPlayback') - elif self.trustedPlayerId == None: + elif self.trustedAvId == None: return else: self.doAction() - self.trustedPlayerId = None + self.trustedAvId = None return def performReadyAction(self): @@ -344,7 +339,7 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, self.ballFirstTouchedHoleFrame, self.commonHoldData]) self.ballPos[avId] = newPos - self.trustedPlayerId = None + self.trustedAvId = None return def postResult(self, cycleTime, avId, recording, aVRecording, ballInHoleFrame, ballTouchedHoleFrame, ballFirstTouchedHoleFrame): @@ -422,7 +417,7 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI.DistributedPhysicsWorldAI, if self.barrierPlayback: self.barrierPlayback.clear(avId) else: - if avId == self.trustedPlayerId: + if avId == self.trustedAvId: self.doAction() if avId == self.activeGolferId and not self.golfCourse.haveAllGolfersExited(): self.selectNextGolfer() diff --git a/toontown/hood/ToonHood.py b/toontown/hood/ToonHood.py index 7fd1f6e8..e758e3c9 100644 --- a/toontown/hood/ToonHood.py +++ b/toontown/hood/ToonHood.py @@ -118,13 +118,13 @@ class ToonHood(Hood): self.doneStatus = doneStatus messenger.send(self.doneEvent) - def enterPurchase(self, pointsAwarded, playerMoney, playerIds, playerStates, remain, metagameRound = -1, votesArray = None): + def enterPurchase(self, pointsAwarded, playerMoney, avIds, playerStates, remain, metagameRound = -1, votesArray = None): messenger.send('enterSafeZone') DistributedAvatar.DistributedAvatar.HpTextEnabled = 0 base.localAvatar.laffMeter.start() self.purchaseDoneEvent = 'purchaseDone' self.accept(self.purchaseDoneEvent, self.handlePurchaseDone) - self.purchase = Purchase.Purchase(base.localAvatar, pointsAwarded, playerMoney, playerIds, playerStates, remain, self.purchaseDoneEvent, metagameRound, votesArray) + self.purchase = Purchase.Purchase(base.localAvatar, pointsAwarded, playerMoney, avIds, playerStates, remain, self.purchaseDoneEvent, metagameRound, votesArray) self.purchase.load() self.purchase.enter() diff --git a/toontown/minigame/DistributedIceGame.py b/toontown/minigame/DistributedIceGame.py index a20aaf3c..7bef3d7c 100644 --- a/toontown/minigame/DistributedIceGame.py +++ b/toontown/minigame/DistributedIceGame.py @@ -47,9 +47,9 @@ class DistributedIceGame(DistributedMinigame.DistributedMinigame, DistributedIce self.curMatch = 0 self.controlKeyWarningLabel = DirectLabel(text=TTLocalizer.IceGameControlKeyWarning, text_fg=VBase4(1, 0, 0, 1), relief=None, pos=(0.0, 0, 0), scale=0.15) self.controlKeyWarningLabel.hide() - self.waitingMoveLabel = DirectLabel(text=TTLocalizer.IceGameWaitingForPlayersToFinishMove, text_fg=VBase4(1, 1, 1, 1), relief=None, pos=(-0.6, 0, -0.75), scale=0.075) + self.waitingMoveLabel = DirectLabel(text=TTLocalizer.WaitingForOtherToons, text_fg=VBase4(1, 1, 1, 1), relief=None, pos=(-0.6, 0, -0.75), scale=0.075) self.waitingMoveLabel.hide() - self.waitingSyncLabel = DirectLabel(text=TTLocalizer.IceGameWaitingForAISync, text_fg=VBase4(1, 1, 1, 1), relief=None, pos=(-0.6, 0, -0.75), scale=0.075) + self.waitingSyncLabel = DirectLabel(text=TTLocalizer.WaitingForOtherToons, text_fg=VBase4(1, 1, 1, 1), relief=None, pos=(-0.6, 0, -0.75), scale=0.075) self.waitingSyncLabel.hide() self.infoLabel = DirectLabel(text='', text_fg=VBase4(0, 0, 0, 1), relief=None, pos=(0.0, 0, 0.7), scale=0.075) self.updateInfoLabel() diff --git a/toontown/minigame/DistributedPatternGame.py b/toontown/minigame/DistributedPatternGame.py index 21969338..ed9e6850 100644 --- a/toontown/minigame/DistributedPatternGame.py +++ b/toontown/minigame/DistributedPatternGame.py @@ -33,7 +33,7 @@ class DistributedPatternGame(DistributedMinigame): strWrong = TTLocalizer.PatternGameWrong strPerfect = TTLocalizer.PatternGamePerfect strBye = TTLocalizer.PatternGameBye - strWaitingOtherPlayers = TTLocalizer.PatternGameWaitingOtherPlayers + strWaitingOtherPlayers = TTLocalizer.WaitingForOtherToons strPleaseWait = TTLocalizer.PatternGamePleaseWait strRound = TTLocalizer.PatternGameRound toonAnimNames = ['up', diff --git a/toontown/minigame/DistributedPhotoGame.py b/toontown/minigame/DistributedPhotoGame.py index 279c6e45..358be66a 100644 --- a/toontown/minigame/DistributedPhotoGame.py +++ b/toontown/minigame/DistributedPhotoGame.py @@ -543,13 +543,13 @@ class DistributedPhotoGame(DistributedMinigame, PhotoGameBase.PhotoGameBase): self.notify.debug('Viewfinder to screen angles with math H:%s V:%s' % (hMDegree, vMDegree)) return - def newAIPhotoScore(self, playerId, assignmentIndex, score): + def newAIPhotoScore(self, avId, assignmentIndex, score): if len(self.assignments) > assignmentIndex: assignment = self.assignments[assignmentIndex] assignmentData = self.assignmentDataDict[assignment] if score > assignmentData[2]: assignmentData[2] = score - assignmentData[3] = playerId + assignmentData[3] = avId self.updateAssignmentPanels() def determinePhotoContent(self, subject): diff --git a/toontown/minigame/Purchase.py b/toontown/minigame/Purchase.py index 3e626d08..d28d4169 100644 --- a/toontown/minigame/Purchase.py +++ b/toontown/minigame/Purchase.py @@ -238,7 +238,7 @@ class Purchase(PurchaseBase): self.toon.inventory.hide() taskMgr.remove('resetStatusText') taskMgr.remove('showBrokeMsgTask') - self.statusLabel['text'] = TTLocalizer.GagShopWaitingOtherPlayers + self.statusLabel['text'] = TTLocalizer.WaitingForOtherToons messenger.send('purchasePlayAgain') def handleDone(self, playAgain): diff --git a/toontown/racing/DistributedRace.py b/toontown/racing/DistributedRace.py index 45503211..d77f5bd6 100644 --- a/toontown/racing/DistributedRace.py +++ b/toontown/racing/DistributedRace.py @@ -469,7 +469,7 @@ class DistributedRace(DistributedObject.DistributedObject): def enterWaiting(self): self.waitingLabel = DirectLabel() - self.waitingLabel['text'] = TTLocalizer.BuildingWaitingForVictors + self.waitingLabel['text'] = TTLocalizer.WaitingForOtherToons self.waitingLabel.setScale(TTLocalizer.DRenterWaiting) def exitWaiting(self): diff --git a/toontown/shtiker/NewbiePurchaseManagerAI.py b/toontown/shtiker/NewbiePurchaseManagerAI.py index 6d8cc660..a55897e5 100644 --- a/toontown/shtiker/NewbiePurchaseManagerAI.py +++ b/toontown/shtiker/NewbiePurchaseManagerAI.py @@ -2,10 +2,10 @@ import PurchaseManagerAI class NewbiePurchaseManagerAI(PurchaseManagerAI.PurchaseManagerAI): - def __init__(self, air, newbieId, playerArray, mpArray, previousMinigameId, trolleyZone): + def __init__(self, air, newbieId, avArray, mpArray, previousMinigameId, trolleyZone): self.ownedNewbieId = newbieId newbieList = [] - PurchaseManagerAI.PurchaseManagerAI.__init__(self, air, playerArray, mpArray, previousMinigameId, trolleyZone, newbieList) + PurchaseManagerAI.PurchaseManagerAI.__init__(self, air, avArray, mpArray, previousMinigameId, trolleyZone, newbieList) def startCountdown(self): pass @@ -13,7 +13,7 @@ class NewbiePurchaseManagerAI(PurchaseManagerAI.PurchaseManagerAI): def getOwnedNewbieId(self): return self.ownedNewbieId - def getInvolvedPlayerIds(self): + def getInvolvedAvIds(self): return [self.ownedNewbieId] def handlePlayerLeaving(self, avId): diff --git a/toontown/shtiker/PurchaseManager.py b/toontown/shtiker/PurchaseManager.py index 6707bfd6..0d9ae947 100644 --- a/toontown/shtiker/PurchaseManager.py +++ b/toontown/shtiker/PurchaseManager.py @@ -16,9 +16,9 @@ class PurchaseManager(DistributedObject.DistributedObject): DistributedObject.DistributedObject.disable(self) self.ignoreAll() - def setPlayerIds(self, *playerIds): - self.notify.debug('setPlayerIds: %s' % (playerIds,)) - self.playerIds = playerIds + def setAvIds(self, *avIds): + self.notify.debug('setAvIds: %s' % (avIds,)) + self.avIds = avIds def setNewbieIds(self, newbieIds): self.notify.debug('setNewbieIds: %s' % (newbieIds,)) @@ -57,16 +57,16 @@ class PurchaseManager(DistributedObject.DistributedObject): self.accept('boughtGag', self.__handleBoughtGag) base.cr.playGame.hood.fsm.request('purchase', [self.mpArray, self.moneyArray, - self.playerIds, + self.avIds, self.playerStates, remain, self.metagameRound, self.votesArray]) def calcHasLocalToon(self): - retval = base.localAvatar.doId not in self.newbieIds and base.localAvatar.doId in self.playerIds + retval = base.localAvatar.doId not in self.newbieIds and base.localAvatar.doId in self.avIds if self.metagameRound > -1 and self.metagameRound < TravelGameGlobals.FinalMetagameRoundIndex: - retval = base.localAvatar.doId in self.playerIds + retval = base.localAvatar.doId in self.avIds self.notify.debug('calcHasLocalToon returning %s' % retval) return retval diff --git a/toontown/shtiker/PurchaseManagerAI.py b/toontown/shtiker/PurchaseManagerAI.py index 1d945674..f9967d73 100644 --- a/toontown/shtiker/PurchaseManagerAI.py +++ b/toontown/shtiker/PurchaseManagerAI.py @@ -13,9 +13,9 @@ from toontown.minigame import MinigameGlobals class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory('PurchaseManagerAI') - def __init__(self, air, playerArray, mpArray, previousMinigameId, trolleyZone, newbieIdList = [], votesArray = None, metagameRound = -1, desiredNextGame = None): + def __init__(self, air, avArray, mpArray, previousMinigameId, trolleyZone, newbieIdList = [], votesArray = None, metagameRound = -1, desiredNextGame = None): DistributedObjectAI.DistributedObjectAI.__init__(self, air) - self.playerIds = copy.deepcopy(playerArray) + self.avIds = copy.deepcopy(avArray) self.minigamePoints = copy.deepcopy(mpArray) self.previousMinigameId = previousMinigameId self.trolleyZone = trolleyZone @@ -27,8 +27,8 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): self.votesArray = [] self.metagameRound = metagameRound self.desiredNextGame = desiredNextGame - for i in xrange(len(self.playerIds), 4): - self.playerIds.append(0) + for i in xrange(len(self.avIds), 4): + self.avIds.append(0) for i in xrange(len(self.minigamePoints), 4): self.minigamePoints.append(0) @@ -45,13 +45,13 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): 0, 0, 0] - for i in xrange(len(self.playerIds)): - avId = self.playerIds[i] + for i in xrange(len(self.avIds)): + avId = self.avIds[i] if avId <= 3: self.playerStates[i] = PURCHASE_NO_CLIENT_STATE self.playersReported[i] = PURCHASE_CANTREPORT_STATE elif avId in self.air.doId2do: - if avId not in self.getInvolvedPlayerIds(): + if avId not in self.getInvolvedAvIds(): self.playerStates[i] = PURCHASE_EXIT_STATE self.playersReported[i] = PURCHASE_REPORTED_STATE else: @@ -61,7 +61,7 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): self.playerStates[i] = PURCHASE_DISCONNECTED_STATE self.playersReported[i] = PURCHASE_CANTREPORT_STATE - for avId in self.getInvolvedPlayerIds(): + for avId in self.getInvolvedAvIds(): if avId > 3 and avId in self.air.doId2do: self.acceptOnce(self.air.getAvatarExitEvent(avId), self.__handleUnexpectedExit, extraArgs=[avId]) av = self.air.doId2do[avId] @@ -77,7 +77,7 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): av.addMoney(self.minigamePoints[avIndex]) self.air.writeServerEvent('minigame', avId, '%s|%s|%s|%s' % (self.previousMinigameId, self.trolleyZone, - self.playerIds, + self.avIds, self.minigamePoints[avIndex])) if self.metagameRound == TravelGameGlobals.FinalMetagameRoundIndex: numPlayers = len(self.votesArray) @@ -87,7 +87,7 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): av.addMoney(extraBeans) self.air.writeServerEvent('minigame_extraBeans', avId, '%s|%s|%s|%s' % (self.previousMinigameId, self.trolleyZone, - self.playerIds, + self.avIds, extraBeans)) self.receivingInventory = 1 @@ -99,9 +99,9 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): self.ignoreAll() DistributedObjectAI.DistributedObjectAI.delete(self) - def getInvolvedPlayerIds(self): + def getInvolvedAvIds(self): avIds = [] - for avId in self.playerIds: + for avId in self.avIds: if avId not in self.newbieIds: avIds.append(avId) elif self.metagameRound > -1 and self.metagameRound < TravelGameGlobals.FinalMetagameRoundIndex: @@ -112,8 +112,8 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): def getMinigamePoints(self): return self.minigamePoints - def getPlayerIds(self): - return self.playerIds + def getavIds(self): + return self.avIds def getNewbieIds(self): return self.newbieIds @@ -259,7 +259,7 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): retval = [] for playAgainIndex in xrange(len(playAgainList)): avId = playAgainList[playAgainIndex] - origIndex = self.playerIds.index(avId) + origIndex = self.avIds.index(avId) if self.votesArray and origIndex < len(self.votesArray): retval.append(self.votesArray[origIndex]) else: @@ -296,8 +296,8 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): return None def findAvIndex(self, avId): - for i in xrange(len(self.playerIds)): - if avId == self.playerIds[i]: + for i in xrange(len(self.avIds)): + if avId == self.avIds[i]: return i return None @@ -314,7 +314,7 @@ class PurchaseManagerAI(DistributedObjectAI.DistributedObjectAI): playAgainList = [] for i in xrange(len(self.playerStates)): if self.playerStates[i] == PURCHASE_PLAYAGAIN_STATE: - playAgainList.append(self.playerIds[i]) + playAgainList.append(self.avIds[i]) return playAgainList diff --git a/toontown/suit/DistributedBossCog.py b/toontown/suit/DistributedBossCog.py index 8ae50c90..d9be5adf 100644 --- a/toontown/suit/DistributedBossCog.py +++ b/toontown/suit/DistributedBossCog.py @@ -1054,7 +1054,7 @@ class DistributedBossCog(DistributedAvatar.DistributedAvatar, BossCog.BossCog): if place and hasattr(place, 'fsm'): FriendsListManager.FriendsListManager._FriendsListManager__handleFriendAvatar(place, avId, avName, avDisableName) - def __handleAvatarDetails(self, avId, avName, playerId = None): + def __handleAvatarDetails(self, avId, avName): self.notify.debug('__handleAvatarDetails') if not (self.state == 'BattleThree' or self.state == 'BattleFour'): return @@ -1063,7 +1063,7 @@ class DistributedBossCog(DistributedAvatar.DistributedAvatar, BossCog.BossCog): if self.cr: place = self.cr.playGame.getPlace() if place and hasattr(place, 'fsm'): - FriendsListManager.FriendsListManager._FriendsListManager__handleAvatarDetails(place, avId, avName, playerId) + FriendsListManager.FriendsListManager._FriendsListManager__handleAvatarDetails(place, avId, avName) def enterBattleFour(self): self.cleanupIntervals() diff --git a/toontown/suit/DistributedLawbotBoss.py b/toontown/suit/DistributedLawbotBoss.py index 969c5c04..3cfe8951 100644 --- a/toontown/suit/DistributedLawbotBoss.py +++ b/toontown/suit/DistributedLawbotBoss.py @@ -381,7 +381,7 @@ class DistributedLawbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM): def __showWaitingMessage(self, task): self.notify.debug('----- __showWaitingMessage') - self.__showOnscreenMessage(TTLocalizer.BuildingWaitingForVictors) + self.__showOnscreenMessage(TTLocalizer.WaitingForOtherToons) def loadEnvironment(self): self.notify.debug('----- loadEnvironment') diff --git a/toontown/suit/DistributedSellbotBoss.py b/toontown/suit/DistributedSellbotBoss.py index 29aed644..1cbe26a5 100644 --- a/toontown/suit/DistributedSellbotBoss.py +++ b/toontown/suit/DistributedSellbotBoss.py @@ -501,7 +501,7 @@ class DistributedSellbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM): self.onscreenMessage = None def __showWaitingMessage(self, task): - self.__showOnscreenMessage(TTLocalizer.BuildingWaitingForVictors) + self.__showOnscreenMessage(TTLocalizer.WaitingForOtherToons) def __placeCageShadow(self): if self.cageShadow == None: diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 3a0ea9f4..bb577313 100644 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -494,7 +494,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute base.talkAssistant.receiveOpenTalk(fromAV, avatarName, fromAC, None, newText) def isAvFriend(self, avId): - return base.cr.isFriend(avId) or base.cr.playerFriendsManager.isAvatarOwnerPlayerFriend(avId) + return base.cr.isFriend(avId) def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags): if not localAvatar.acceptingNonFriendWhispers: diff --git a/toontown/toon/PlayerDetailPanel.py b/toontown/toon/PlayerDetailPanel.py deleted file mode 100644 index f1a29c5c..00000000 --- a/toontown/toon/PlayerDetailPanel.py +++ /dev/null @@ -1,126 +0,0 @@ -from pandac.PandaModules import * -from toontown.toonbase.ToontownGlobals import * -from direct.gui.DirectGui import * -from pandac.PandaModules import * -from direct.showbase import DirectObject -from direct.fsm import ClassicFSM, State -from direct.fsm import State -from direct.directnotify import DirectNotifyGlobal -import DistributedToon -from toontown.friends import FriendInviter -import ToonTeleportPanel -from toontown.toonbase import TTLocalizer -from toontown.hood import ZoneUtil -from toontown.toonbase.ToontownBattleGlobals import Tracks, Levels -globalAvatarDetail = None - -def showPlayerDetail(avId, avName, playerId = None): - global globalAvatarDetail - if globalAvatarDetail != None: - globalAvatarDetail.cleanup() - globalAvatarDetail = None - globalAvatarDetail = PlayerDetailPanel(avId, avName, playerId) - return - - -def hidePlayerDetail(): - global globalAvatarDetail - if globalAvatarDetail != None: - globalAvatarDetail.cleanup() - globalAvatarDetail = None - return - - -def unloadPlayerDetail(): - global globalAvatarDetail - if globalAvatarDetail != None: - globalAvatarDetail.cleanup() - globalAvatarDetail = None - return - - -class PlayerDetailPanel(DirectFrame): - notify = DirectNotifyGlobal.directNotify.newCategory('ToonAvatarDetailPanel') - - def __init__(self, avId, avName, playerId = None, parent = aspect2dp, **kw): - self.playerId = playerId - self.isPlayer = 0 - self.playerInfo = None - if playerId: - self.isPlayer = 1 - if playerId in base.cr.playerFriendsManager.playerId2Info: - self.playerInfo = base.cr.playerFriendsManager.playerId2Info[playerId] - if not self.playerInfo.onlineYesNo: - avId = None - else: - avId = None - self.avId = avId - self.avName = avName - self.avatar = None - self.createdAvatar = None - buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui') - gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui') - detailPanel = gui.find('**/avatarInfoPanel') - textScale = 0.132 - textWrap = 10.4 - if self.playerId: - textScale = 0.1 - textWrap = 18.0 - optiondefs = (('pos', (0.525, 0.0, 0.525), None), - ('scale', 0.5, None), - ('relief', None, None), - ('image', detailPanel, None), - ('image_color', GlobalDialogColor, None), - ('text', '', None), - ('text_wordwrap', textWrap, None), - ('text_scale', textScale, None), - ('text_pos', (-0.125, 0.75), None)) - self.defineoptions(kw, optiondefs) - DirectFrame.__init__(self, parent) - self.dataText = DirectLabel(self, text='', text_scale=0.085, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.725)) - if self.avId: - self.avText = DirectLabel(self, text=TTLocalizer.PlayerToonName % {'toonname': self.avName}, text_scale=0.09, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.56)) - guiButton = loader.loadModel('phase_3/models/gui/quit_button') - self.gotoToonButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.15, text=TTLocalizer.PlayerShowToon, text_scale=0.08, text_pos=(0.0, -0.02), textMayChange=0, pos=(0.43, 0, 0.415), command=self.__showToon) - ToonTeleportPanel.hideTeleportPanel() - FriendInviter.hideFriendInviter() - self.bCancel = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=TTLocalizer.AvatarDetailPanelCancel, text_scale=0.05, text_pos=(0.12, -0.01), pos=(-0.865, 0.0, -0.765), scale=2.0, command=self.__handleCancel) - self.bCancel.show() - self.initialiseoptions(PlayerDetailPanel) - self.__showData() - buttons.removeNode() - gui.removeNode() - return - - def cleanup(self): - if self.createdAvatar: - self.avatar.delete() - self.createdAvatar = None - self.destroy() - return - - def __handleCancel(self): - unloadPlayerDetail() - - def __showData(self): - if self.isPlayer and self.playerInfo: - if self.playerInfo.onlineYesNo: - someworld = self.playerInfo.location - else: - someworld = TTLocalizer.OfflineLocation - text = TTLocalizer.AvatarDetailPanelPlayer % {'player': self.playerInfo.playerName, - 'world': someworld} - else: - text = TTLocalizer.AvatarDetailPanelOffline - self.dataText['text'] = text - - def __showToon(self): - messenger.send('wakeup') - hasManager = hasattr(base.cr, 'playerFriendsManager') - handle = base.cr.identifyFriend(self.avId) - if not handle and hasManager: - handle = base.cr.playerFriendsManager.getAvHandleFromId(self.avId) - if handle != None: - self.notify.info("Clicked on name in friend's list. doId = %s" % handle.doId) - messenger.send('clickedNametagPlayer', [handle, self.playerId, 0]) - return diff --git a/toontown/toon/PlayerInfoPanel.py b/toontown/toon/PlayerInfoPanel.py deleted file mode 100644 index 8c5507cc..00000000 --- a/toontown/toon/PlayerInfoPanel.py +++ /dev/null @@ -1,393 +0,0 @@ -from pandac.PandaModules import * -from direct.gui.DirectGui import * -from pandac.PandaModules import * -from direct.showbase import DirectObject -from toontown.friends import FriendHandle -from otp.avatar import Avatar -from direct.distributed import DistributedObject -from direct.directnotify import DirectNotifyGlobal -from toontown.toonbase import ToontownGlobals -from toontown.toonbase import TTLocalizer -from toontown.friends import ToontownFriendSecret -import ToonAvatarDetailPanel -import AvatarPanelBase -import PlayerDetailPanel -from otp.otpbase import OTPGlobals -GAME_LOGO_NAMES = {'Default': 'GameLogo_Toontown'} -GAME_LOGO_FILE = 'phase_3/models/misc/game_logo_card' - -class PlayerInfoPanel(AvatarPanelBase.AvatarPanelBase): - notify = DirectNotifyGlobal.directNotify.newCategory('PlayerInfoPanel') - - def __init__(self, playerId): - from toontown.friends import FriendsListPanel - AvatarPanelBase.AvatarPanelBase.__init__(self, None, FriendsListPanel=FriendsListPanel) - self.setup(playerId) - self.avId = 0 - self.avName = None - return - - def setup(self, playerId): - from toontown.friends import FriendsListPanel - self.playerId = playerId - self.playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) - if not self.playerInfo: - return - avId = None - avatar = None - if playerId: - if self.playerInfo.onlineYesNo: - avId = self.playerInfo.avatarId - avatar = base.cr.playerFriendsManager.identifyFriend(avId) - self.notify.debug('Opening player panel, %s' % self.playerInfo) - self.avatar = avatar - self.noAv = 0 - if not avatar: - self.noAv = 1 - self.accountText = None - self.listName = ' ' - world = self.playerInfo.location - if self.playerInfo.onlineYesNo == 0: - world = TTLocalizer.AvatarDetailPanelRealLife - self.accountText = self.playerInfo.playerName - if self.noAv: - avButtonState = DGG.DISABLED - else: - avButtonState = DGG.NORMAL - self.online = self.playerInfo.onlineYesNo - if self.online: - onlineButtonState = DGG.NORMAL - else: - onlineButtonState = DGG.DISABLED - base.localAvatar.obscureFriendsListButton(1) - gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui') - self.frame = DirectFrame( - image=gui.find('**/avatar_panel'), - relief=None, - pos=(1.1, 100, 0.525)) - disabledImageColor = Vec4(1, 1, 1, 0.4) - text0Color = Vec4(1, 1, 1, 1) - text1Color = Vec4(0.5, 1, 0.5, 1) - text2Color = Vec4(1, 1, 0.5, 1) - text3Color = Vec4(0.6, 0.6, 0.6, 1) - if self.playerInfo: - logoImageName = GAME_LOGO_NAMES['Default'] - if not self.playerInfo.onlineYesNo: - logoImageName = GAME_LOGO_NAMES['Default'] - elif self.playerInfo.location in GAME_LOGO_NAMES: - logoImageName = GAME_LOGO_NAMES[self.playerInfo.location] - model = loader.loadModel(GAME_LOGO_FILE) - logoImage = model.find('**/' + logoImageName) - del model - self.outsideLogo = DirectLabel( - parent=self.frame, - relief=None, - image=logoImage, - pos=(0.0125, 0.0, 0.25), - image_color=(1.0, 1.0, 1.0, 1), - scale=(0.175, 1, 0.175)) - font = ToontownGlobals.getInterfaceFont() - textScale = 0.047 - textWrap = 7.5 - textAlign = TextNode.ACenter - textPos = (0, 0) - self.nameLabel = DirectLabel( - parent=self.frame, - pos=(0.0125, 0, 0.385), - relief=None, - text=self.listName, - text_font=font, - text_fg=Vec4(0, 0, 0, 1), - text_pos=textPos, - text_scale=textScale, - text_wordwrap=textWrap, - text_align=textAlign, - text_shadow=(1, 1, 1, 1)) - if self.accountText: - self.accountLabel = DirectLabel( - parent=self.frame, - pos=(0.0125, 0, 0.385), - text=self.accountText, - relief=None, - text_font=font, - text_fg=Vec4(0, 0, 0, 1), - text_pos=textPos, - text_scale=textScale, - text_wordwrap=textWrap, - text_align=textAlign, - text_shadow=(1, 1, 1, 1)) - self.accountLabel.show() - self.closeButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/CloseBtn_UP'), - gui.find('**/CloseBtn_DN'), - gui.find('**/CloseBtn_Rllvr'), - gui.find('**/CloseBtn_UP')), - relief=None, - pos=(0.157644, 0, -0.379167), - command=self.__handleClose) - self.friendButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/Frnds_Btn_UP'), - gui.find('**/Frnds_Btn_DN'), - gui.find('**/Frnds_Btn_RLVR'), - gui.find('**/Frnds_Btn_UP')), - image3_color=disabledImageColor, - image_scale=0.9, - relief=None, - text=TTLocalizer.AvatarPanelFriends, - text_scale=0.06, - pos=(-0.103, 0, 0.133), - text0_fg=text0Color, - text1_fg=text1Color, - text2_fg=text2Color, - text3_fg=text3Color, - text_pos=(0.06, -0.02), - text_align=TextNode.ALeft, - state=avButtonState, - command=self.__handleFriend) - self.friendButton['state'] = DGG.DISABLED - self.goToButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/Go2_Btn_UP'), - gui.find('**/Go2_Btn_DN'), - gui.find('**/Go2_Btn_RLVR'), - gui.find('**/Go2_Btn_UP')), - image3_color=disabledImageColor, - image_scale=0.9, - relief=None, - pos=(-0.103, 0, 0.045), - text=TTLocalizer.AvatarPanelGoTo, - text0_fg=text0Color, - text1_fg=text1Color, - text2_fg=text2Color, - text3_fg=text3Color, - text_scale=0.06, - text_pos=(0.06, -0.015), - text_align=TextNode.ALeft, - state=avButtonState, - command=self.__handleGoto) - self.goToButton['state'] = DGG.DISABLED - self.whisperButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/ChtBx_ChtBtn_UP'), - gui.find('**/ChtBx_ChtBtn_DN'), - gui.find('**/ChtBx_ChtBtn_RLVR'), - gui.find('**/ChtBx_ChtBtn_UP')), - image3_color=disabledImageColor, - relief=None, - image_scale=0.9, - pos=(-0.103, 0, -0.0375), - text=TTLocalizer.AvatarPanelWhisper, - text0_fg=text0Color, - text1_fg=text1Color, - text2_fg=text2Color, - text3_fg=text3Color, - text_scale=TTLocalizer.PIPwisperButton, - text_pos=(0.06, -0.0125), - text_align=TextNode.ALeft, - state=onlineButtonState, - command=self.__handleWhisper) - self.secretsButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/ChtBx_ChtBtn_UP'), - gui.find('**/ChtBx_ChtBtn_DN'), - gui.find('**/ChtBx_ChtBtn_RLVR'), - gui.find('**/ChtBx_ChtBtn_UP')), - image3_color=disabledImageColor, - image_scale=0.9, - relief=None, - pos=(-0.103, 0, -0.13), - text=TTLocalizer.AvatarPanelSecrets, - text0_fg=text0Color, - text1_fg=text1Color, - text2_fg=text2Color, - text3_fg=text3Color, - text_scale=TTLocalizer.PIPsecretsButton, - text_pos=(0.055, -0.01), - text_align=TextNode.ALeft, - state=avButtonState, - command=self.__handleSecrets) - self.secretsButton['state'] = DGG.DISABLED - if not base.localAvatar.isTeleportAllowed(): - self.goToButton['state'] = DGG.DISABLED - ignoreStr, ignoreCmd, ignoreSize = self.getIgnoreButtonInfo() - self.ignoreButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/Ignore_Btn_UP'), - gui.find('**/Ignore_Btn_DN'), - gui.find('**/Ignore_Btn_RLVR'), - gui.find('**/Ignore_Btn_UP')), - image3_color=disabledImageColor, - image_scale=0.9, - relief=None, - pos=(-0.103697, 0, -0.21), - text=ignoreStr, - text0_fg=text0Color, - text1_fg=text1Color, - text2_fg=text2Color, - text3_fg=text3Color, - text_scale=ignoreSize, - text_pos=(0.06, -0.015), - text_align=TextNode.ALeft, - state=avButtonState, - command=ignoreCmd) - self.reportButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/report_BtnUP'), - gui.find('**/report_BtnDN'), - gui.find('**/report_BtnRLVR'), - gui.find('**/report_BtnUP')), - image3_color=disabledImageColor, - image_scale=0.65, - relief=None, - pos=(-0.103, 0, -0.29738), - text=TTLocalizer.AvatarPanelReport, - text0_fg=text0Color, - text1_fg=text1Color, - text2_fg=text2Color, - text3_fg=text3Color, - text_scale=0.06, - text_pos=(0.06, -0.015), - text_align=TextNode.ALeft, - command=self.handleReport) - self.detailButton = DirectButton( - parent=self.frame, - image=( - gui.find('**/ChtBx_BackBtn_UP'), - gui.find('**/ChtBx_BackBtn_DN'), - gui.find('**/ChtBx_BackBtn_Rllvr'), - gui.find('**/ChtBx_BackBtn_UP')), - relief=None, - text=('', TTLocalizer.PlayerPanelDetail, - TTLocalizer.PlayerPanelDetail, ''), - text_fg=text2Color, - text_shadow=(0, 0, 0, 1), - text_scale=TTLocalizer.PIPdetailButton, - text_pos=(0.085, 0.055), - text_align=TextNode.ACenter, - pos=(-0.133773, 0, -0.387132), - state=DGG.NORMAL, - command=self.__handleDetails) - gui.removeNode() - menuX = -0.05 - menuScale = 0.064 - self.frame.show() - messenger.send('avPanelDone') - self.accept('playerOnline', self.__handlePlayerChanged) - self.accept('playerOffline', self.__handlePlayerChanged) - self.accept(OTPGlobals.PlayerFriendUpdateEvent, self.__handlePlayerChanged) - self.accept(OTPGlobals.PlayerFriendRemoveEvent, self.__handlePlayerUnfriend) - return - - def disableAll(self): - self.detailButton['state'] = DGG.DISABLED - self.ignoreButton['state'] = DGG.DISABLED - self.reportButton['state'] = DGG.DISABLED - self.goToButton['state'] = DGG.DISABLED - self.secretsButton['state'] = DGG.DISABLED - self.whisperButton['state'] = DGG.DISABLED - self.friendButton['state'] = DGG.DISABLED - self.closeButton['state'] = DGG.DISABLED - - def cleanup(self): - self.unsetup() - self.ignore('playerOnline') - self.ignore('playerOffline') - self.ignore(OTPGlobals.PlayerFriendUpdateEvent) - self.ignore(OTPGlobals.PlayerFriendRemoveEvent) - AvatarPanelBase.AvatarPanelBase.cleanup(self) - - def unsetup(self): - if not hasattr(self, 'frame') or self.frame == None: - return - PlayerDetailPanel.unloadPlayerDetail() - self.frame.destroy() - del self.frame - self.frame = None - base.localAvatar.obscureFriendsListButton(-1) - self.laffMeter = None - self.ignore('updateLaffMeter') - if hasattr(self.avatar, 'bFake') and self.avatar.bFake: - self.avatar.delete() - return - - def __handleGoto(self): - if base.localAvatar.isTeleportAllowed(): - base.localAvatar.chatMgr.noWhisper() - messenger.send('gotoAvatar', [self.avId, self.avName, self.avDisableName]) - - def __handleWhisper(self): - if self.noAv: - base.localAvatar.chatMgr.whisperTo(self.listName, 0, self.playerId) - else: - base.localAvatar.chatMgr.whisperTo(self.avName, self.avId, self.playerId) - - def __handleSecrets(self): - base.localAvatar.chatMgr.noWhisper() - ToontownFriendSecret.showFriendSecret(ToontownFriendSecret.BothSecrets) - - def __handleFriend(self): - base.localAvatar.chatMgr.noWhisper() - self.__getAvInfo() - messenger.send('friendAvatar', [self.avId, self.avName, self.avDisableName]) - - def __getAvInfo(self): - if self.playerId: - self.avId = self.playerInfo.avatarId - if self.avId: - avatar = base.cr.playerFriendsManager.identifyFriend(self.avId) - if avatar: - self.avName = avatar.getName() - if not self.avDisableName: - self.avDisableName = avatar.uniqueName('disable') - - def __handleDetails(self): - base.localAvatar.chatMgr.noWhisper() - self.__getAvInfo() - messenger.send('playerDetails', [self.avId, self.avName, self.playerId]) - - def handleDisableAvatar(self): - pass - - def __handlePlayerChanged(self, playerId, info = None): - if playerId == self.playerId: - self.unsetup() - self.setup(playerId) - - def __handlePlayerUnfriend(self, playerId): - if playerId == self.playerId: - self.__handleClose() - - def __handleClose(self): - self.cleanup() - AvatarPanelBase.currentAvatarPanel = None - if self.friendsListShown: - self.FriendsListPanel.showFriendsList() - return - - def getAvId(self): - if hasattr(self, 'avatar'): - if self.avatar: - return self.avatar.doId - return None - - def getPlayerId(self): - if hasattr(self, 'playerId'): - return self.playerId - return None - - def isHidden(self): - if not hasattr(self, 'frame') or not self.frame: - return 1 - return self.frame.isHidden() - - def getType(self): - return 'player' diff --git a/toontown/toon/ToonAvatarDetailPanel.py b/toontown/toon/ToonAvatarDetailPanel.py index 13fab0f6..5a649921 100644 --- a/toontown/toon/ToonAvatarDetailPanel.py +++ b/toontown/toon/ToonAvatarDetailPanel.py @@ -14,14 +14,12 @@ from toontown.hood import ZoneUtil from toontown.toonbase.ToontownBattleGlobals import Tracks, Levels globalAvatarDetail = None -def showAvatarDetail(avId, avName, playerId = None): +def showAvatarDetail(avId, avName): global globalAvatarDetail if globalAvatarDetail != None: globalAvatarDetail.cleanup() globalAvatarDetail = None - playerId = base.cr.playerFriendsManager.findPlayerIdFromAvId(avId) - globalAvatarDetail = ToonAvatarDetailPanel(avId, avName, playerId) - return + globalAvatarDetail = ToonAvatarDetailPanel(avId, avName) def hideAvatarDetail(): @@ -43,16 +41,12 @@ def unloadAvatarDetail(): class ToonAvatarDetailPanel(DirectFrame): notify = DirectNotifyGlobal.directNotify.newCategory('ToonAvatarDetailPanel') - def __init__(self, avId, avName, playerId = None, parent = base.a2dTopRight, **kw): + def __init__(self, avId, avName, parent = base.a2dTopRight, **kw): buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui') gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui') detailPanel = gui.find('**/avatarInfoPanel') - self.playerId = playerId textScale = 0.095 textWrap = 16.4 - self.playerInfo = None - if self.playerId: - self.playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) optiondefs = (('pos', (-0.79, 0.0, -0.47), None), ('scale', 0.5, None), ('relief', None, None), @@ -166,35 +160,13 @@ class ToonAvatarDetailPanel(DirectFrame): if online: shardName = base.cr.getShardName(av.defaultShard) hoodName = base.cr.hoodMgr.getFullnameFromId(av.lastHood) - if ZoneUtil.isWelcomeValley(av.lastHood): - shardName = '%s (%s)' % (TTLocalizer.WelcomeValley[-1], shardName) - if self.playerInfo: - guiButton = loader.loadModel('phase_3/models/gui/quit_button') - self.gotoAvatarButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.1, text=TTLocalizer.AvatarShowPlayer, text_scale=0.07, text_pos=(0.0, -0.02), textMayChange=0, pos=(0.44, 0, 0.41), command=self.__showAvatar) - text = TTLocalizer.AvatarDetailPanelOnlinePlayer % {'district': shardName, - 'location': hoodName, - 'player': self.playerInfo.playerName} - else: - text = TTLocalizer.AvatarDetailPanelOnline % {'district': shardName, - 'location': hoodName} + text = TTLocalizer.AvatarDetailPanelOnline % {'district': shardName, 'location': hoodName} else: text = TTLocalizer.AvatarDetailPanelOffline self.dataText['text'] = text self.__updateTrackInfo() self.__updateTrophyInfo() self.__updateLaffInfo() - return - - def __showAvatar(self): - messenger.send('wakeup') - hasManager = hasattr(base.cr, 'playerFriendsManager') - handle = base.cr.identifyFriend(self.avId) - if not handle and hasManager: - handle = base.cr.playerFriendsManager.getAvHandleFromId(self.avId) - if handle != None: - self.notify.info("Clicked on name in friend's list. doId = %s" % handle.doId) - messenger.send('clickedNametagPlayer', [handle, self.playerId, 1]) - return def __updateLaffInfo(self): avatar = self.avatar diff --git a/toontown/toon/ToonAvatarPanel.py b/toontown/toon/ToonAvatarPanel.py index d3920631..007cc3e3 100644 --- a/toontown/toon/ToonAvatarPanel.py +++ b/toontown/toon/ToonAvatarPanel.py @@ -19,7 +19,7 @@ from otp.otpbase import OTPGlobals class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): notify = DirectNotifyGlobal.directNotify.newCategory('ToonAvatarPanel') - def __init__(self, avatar, playerId = None): + def __init__(self, avatar): from toontown.friends import FriendsListPanel if base.cr.doId2do.get(avatar.getDoId()): @@ -27,18 +27,6 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): AvatarPanelBase.AvatarPanelBase.__init__(self, avatar, FriendsListPanel=FriendsListPanel) self.notify.debug('Opening toon panel, avId=%d' % self.avId) - self.playerId = playerId - - if not self.playerId: - av = base.cr.doId2do.get(self.avId) - if av: - self.playerId = avatar.DISLid - else: - self.playerId = 0 - - self.playerInfo = None - if self.playerId: - self.playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId) self.laffMeter = None wantsLaffMeter = hasattr(avatar, 'hp') @@ -128,12 +116,6 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): text_align=TextNode.ALeft, command=self.__handleFriend) - - - if base.cr.playerFriendsManager.askTransientFriend(self.avId) and self.avId not in base.cr.doId2do: - self.friendButton['state'] = DGG.DISABLED - - if base.localAvatar.isIgnored(self.avId): self.friendButton['state'] = DGG.DISABLED @@ -396,7 +378,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): def __handleDetails(self): base.localAvatar.chatMgr.noWhisper() - messenger.send('avatarDetails', [self.avId, self.avName, self.playerId]) + messenger.send('avatarDetails', [self.avId, self.avName]) def __handleDisableAvatar(self): if not base.cr.isFriend(self.avId): @@ -450,11 +432,6 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase): return self.avatar.doId return None - def getPlayerId(self): - if hasattr(self, 'playerId'): - return self.playerId - return None - def isHidden(self): if not hasattr(self, 'frame') or not self.frame: return 1 diff --git a/toontown/toon/ToonTeleportPanel.py b/toontown/toon/ToonTeleportPanel.py index 04480dbf..f9a03cb2 100644 --- a/toontown/toon/ToonTeleportPanel.py +++ b/toontown/toon/ToonTeleportPanel.py @@ -118,7 +118,6 @@ class ToonTeleportPanel(DirectFrame): def enterBegin(self): myId = base.localAvatar.doId - hasManager = hasattr(base.cr, 'playerFriendsManager') if self.avId == myId: self.fsm.request('self') elif self.avId in base.cr.doId2do: @@ -128,16 +127,6 @@ class ToonTeleportPanel(DirectFrame): self.fsm.request('checkAvailability') else: self.fsm.request('notOnline') - elif hasManager and base.cr.playerFriendsManager.getAvHandleFromId(self.avId): - id = base.cr.playerFriendsManager.findPlayerIdFromAvId(self.avId) - info = base.cr.playerFriendsManager.getFriendInfo(id) - if info: - if info.onlineYesNo: - self.fsm.request('checkAvailability') - else: - self.fsm.request('notOnline') - else: - self.fsm.request('wentAway') else: self.fsm.request('wentAway') diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index f2f43e0d..529cc3e4 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -1895,17 +1895,10 @@ AvatarDetailPanelCancel = lCancel AvatarDetailPanelClose = lClose AvatarDetailPanelLookup = 'Looking up details for %s.' AvatarDetailPanelFailedLookup = 'Unable to get details for %s.' -AvatarDetailPanelPlayer = 'Player: %(player)s\nWorld: %(world)s' -AvatarDetailPanelPlayerShort = '%(player)s\nWorld: %(world)s\nLocation: %(location)s' AvatarDetailPanelRealLife = 'Offline' AvatarDetailPanelOnline = 'District: %(district)s\nLocation: %(location)s' -AvatarDetailPanelOnlinePlayer = 'District: %(district)s\nLocation: %(location)s\nPlayer: %(player)s' AvatarDetailPanelOffline = 'District: offline\nLocation: offline' -AvatarShowPlayer = 'Show Player' OfflineLocation = 'Offline' -PlayerToonName = 'Toon: %(toonname)s' -PlayerShowToon = 'Show Toon' -PlayerPanelDetail = 'Player Details' AvatarPanelFriends = 'Friends' AvatarPanelWhisper = 'Whisper' AvatarPanelSecrets = 'True Friends' @@ -2035,8 +2028,6 @@ ToonHealJokes = [['What goes TICK-TICK-TICK-WOOF?', 'A watchdog! '], ['What do people do in clock factories?', 'They make faces all day.'], ['What do you call a blind dinosaur?', "An I-don't-think-he-saurus."], ['If you drop a white hat into the Red Sea, what does it become?', 'Wet.'], - ['Why was Cinderella thrown off the basketball team?', 'She ran away from the ball.'], - ['Why was Cinderella such a bad player?', 'She had a pumpkin for a coach.'], ["What two things can't you have for breakfast?", 'Lunch and dinner.'], ['What do you give an elephant with big feet?', 'Big shoes.'], ['Where do baby ghosts go during the day?', 'Day-scare centers.'], @@ -3046,7 +3037,8 @@ SuitAttackTaunts = {'Audit': ["I believe your books don't balance.", "I'll shuffle your accounts around.", "You're about to suffer some losses.", 'This is going to hurt your bottom line.']} -BuildingWaitingForVictors = ('Waiting for other players...',) +WaitingForOtherToons = 'Waiting for other toons...' +WaitingForOtherToonsDots = 'Waiting for other toons%s' ElevatorHopOff = 'Hop off' ElevatorStayOff = "If you hop off, you'll need to wait\nfor the elevator to leave or empty." ElevatorLeaderOff = 'Only your leader can decide when to hop off.' @@ -3075,9 +3067,9 @@ FADoorCodes_TALK_TO_HQ_TOM = 'Go get your reward from Toon Headquarters!' FADoorCodes_SUIT_APPROACHING = None FADoorCodes_BUILDING_TAKEOVER = "Watch out! There's a Cog in there!" FADoorCodes_SB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Sellbot Disguise first!\n\nBuild your Sellbot Disguise out of parts from the Factory." -FADoorCodes_CB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Cashbot Disguise first!\n\nBuild your Cashbot Disguise out of parts from the Mints." -FADoorCodes_LB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Lawbot Disguise first!\n\nBuild your Lawbot Disguise out of parts from the DA Offices." -FADoorCodes_BB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Bossbot Disguise first!\n\nBuild your Bossbot Disguise out of parts from the Cog Golf Courses." +FADoorCodes_CB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Cashbot Disguise first!\n\nBuild your Cashbot Disguise by doing ToonTasks in Donald's Dreamland." +FADoorCodes_LB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Lawbot Disguise first!\n\nBuild your Lawbot Disguise by doing the ToonTasks after Donald's Dreamland." +FADoorCodes_BB_DISGUISE_INCOMPLETE = "You'll get caught going in there as a Toon! You need to complete your Bossbot Disguise first!\n\nBuild your Bossbot Disguise by doing the ToonTasks after Donald's Dreamland." KnockKnockJokes = [['Who', "Bad echo in here, isn't there?"], ['Dozen', 'Dozen anybody want to let me in?'], ['Freddie', 'Freddie or not, here I come.'], @@ -3301,28 +3293,16 @@ FriendsListPanelNewFriend = 'New Friend' FriendsListPanelSecrets = 'True Friend' FriendsListPanelOnlineFriends = 'ONLINE TOON\nFRIENDS' FriendsListPanelAllFriends = 'ALL TOON\nFRIENDS' -FriendsListPanelIgnoredFriends = 'IGNORED\nTOONS' FriendsListPanelPets = 'NEARBY\nPETS' -FriendsListPanelPlayers = 'ALL PLAYER\nFRIENDS' -FriendsListPanelOnlinePlayers = 'ONLINE PLAYER\nFRIENDS' FriendInviterClickToon = 'Click on the toon you would like to make friends with.\n\n(You have %s friends)' FriendInviterToon = 'Toon' FriendInviterThatToon = 'That toon' -FriendInviterPlayer = 'Player' -FriendInviterThatPlayer = 'That player' FriendInviterBegin = 'What type of friend would you like to make?' -FriendInviterToonFriendInfo = 'A friend only in Toontown' -FriendInviterPlayerFriendInfo = 'A friend across the Toontown United network' -FriendInviterToonTooMany = 'You have too many toon friends to add another one now. You will have to remove some toon friends if you want to make friends with %s. You could also try making player friends them.' -FriendInviterPlayerTooMany = 'You have too many player friends to add another one now. You will have to remove some player friends if you want to make friends with %s. You could also try making toon friends with them.' +FriendInviterToonTooMany = 'You have too many toon friends to add another one now. You will have to remove some toon friends if you want to make friends with %s.' FriendInviterToonAlready = '%s is already your toon friend.' -FriendInviterPlayerAlready = '%s is already your player friend.' FriendInviterStopBeingToonFriends = 'Stop being toon friends' -FriendInviterStopBeingPlayerFriends = 'Stop being player friends' FriendInviterEndFriendshipToon = 'Are you sure you want to stop being toon friends with %s?' -FriendInviterEndFriendshipPlayer = 'Are you sure you want to stop being player friends with %s?' FriendInviterRemainToon = '\n(You will still be toon friends with %s)' -FriendInviterRemainPlayer = '\n(You will still be player friends with %s)' AvatarChoiceMakeAToon = 'Make A\nToon' AvatarChoicePlayThisToon = 'Play\nThis Toon' AvatarChoiceDelete = 'Delete' @@ -3720,7 +3700,7 @@ PartyGateRightSign = 'Public Parties Here!' PartyGatePartyUnavailable = 'Sorry. That party is no longer available.' PartyGatePartyFull = 'Sorry. That party is full.' PartyGateInstructions = 'Click on a host, then click on "Go to Party"' -PartyActivityWaitingForOtherPlayers = 'Waiting for other players to join the party game...' +PartyActivityWaitingForOtherPlayers = 'Waiting for other toons to join the party game...' PartyActivityPleaseWait = 'Please wait...' DefaultPartyActivityTitle = 'Party Game Title' DefaultPartyActivityInstructions = 'PartyGame Instructions' @@ -3794,9 +3774,9 @@ PartyTrampolineBestHeight = 'Best Height So Far:\n%s\n%d ft' PartyTrampolineNoHeightYet = 'How high\ncan you jump?' PartyTrampolineGetHeight = '%d ft' PartyTeamActivityForMorePlural = 's' -PartyTeamActivityForMore = 'Waiting for %d player%s\non each side...' -PartyTeamActivityForMoreWithBalance = 'Waiting for %d more player%s...' -PartyTeamActivityWaitingForOtherPlayers = 'Waiting for other players...' +PartyTeamActivityForMore = 'Waiting for %d toon%s\non each side...' +PartyTeamActivityForMoreWithBalance = 'Waiting for %d more toon%s...' +PartyTeamActivityWaitingForOtherPlayers = 'Waiting for other toons...' PartyTeamActivityWaitingToStart = 'Starting in...' PartyTeamActivityExitButton = 'Hop Off' PartyTeamActivitySwitchTeamsButton = 'Switch\nTeams' @@ -4085,7 +4065,7 @@ NPCForceAcknowledgeMessage3 = "Remember to ride the trolley.\n\n\n\n\n\n\n\nYou NPCForceAcknowledgeMessage4 = 'Congratulations! You found and rode the trolley!\n\n\n\n\n\n\n\n\n\nNow report back to Toon Headquarters.' NPCForceAcknowledgeMessage5 = "Don't forget your ToonTask!\n\n\n\n\n\n\n\n\n\n\nYou can find Cogs to defeat on the other side of tunnels like this." NPCForceAcknowledgeMessage6 = 'Great job defeating those Cogs!\n\n\n\n\n\n\n\n\nHead back to Toon Headquarters as soon as possible.' -NPCForceAcknowledgeMessage7 = "Don't forget to make a friend!\n\n\n\n\n\n\nClick on another player and use the New Friend button." +NPCForceAcknowledgeMessage7 = "Don't forget to make a friend!\n\n\n\n\n\n\nClick on another toon and use the New Friend button." NPCForceAcknowledgeMessage8 = 'Great! You made a new friend!\n\n\n\n\n\n\n\n\nYou should go back at Toon Headquarters now.' NPCForceAcknowledgeMessage9 = 'Good job using the phone!\n\n\n\n\n\n\n\n\nReturn to Toon Headquarters to claim your reward.' ToonSleepString = '. . . ZZZ . . .' @@ -4281,7 +4261,7 @@ TownBattleToonSOS = 'SOS' TownBattleToonFire = 'Fire' TownBattleUndecided = '?' TownBattleHealthText = '%(hitPoints)s/%(maxHit)s' -TownBattleWaitTitle = 'Waiting for\nother players...' +TownBattleWaitTitle = 'Waiting for\nother toons...' TownSoloBattleWaitTitle = 'Please wait...' TownBattleWaitBack = 'BACK' TownBattleSOSPetSearchTitle = 'Searching for doodle\n%s...' @@ -4359,7 +4339,7 @@ MintBossConfrontedMsg = '%s is battling the Supervisor!' StageBossConfrontedMsg = '%s is battling the District Attorney!' stageToonEnterElevator = '%s \nhas entered the elevator' ForcedLeaveStageAckMsg = 'The Law Clerk was defeated before you could reach him. You did not recover any Jury Notices.' -MinigameWaitingForOtherPlayers = 'Waiting for other players to join...' +MinigameWaitingForOtherToons = 'Waiting for other toons to join...' MinigamePleaseWait = 'Please wait...' DefaultMinigameTitle = 'Minigame Title' DefaultMinigameInstructions = 'Minigame Instructions' @@ -4390,7 +4370,6 @@ PatternGameRight = 'Good, %s!' PatternGameWrong = 'Oops!' PatternGamePerfect = 'That was perfect, %s!' PatternGameBye = 'Thanks for playing!' -PatternGameWaitingOtherPlayers = 'Waiting for other players...' PatternGamePleaseWait = 'Please wait...' PatternGameFaster = 'You were\nfaster!' PatternGameFastest = 'You were\nthe fastest!' @@ -4402,7 +4381,7 @@ PatternGameRound = 'Round %s!' PatternGameImprov = 'You did great! Now Improv!' RaceGameTitle = 'Race Game' RaceGameInstructions = 'Click a number. Choose wisely! You only advance if no one else picked the same number.' -RaceGameWaitingChoices = 'Waiting for other players to choose...' +RaceGameWaitingChoices = 'Waiting for other toons to choose...' RaceGameCardText = '%(name)s draws: %(reward)s' RaceGameCardTextBeans = '%(name)s receives: %(reward)s' RaceGameCardTextHi1 = '%(name)s is one Fabulous Toon!' @@ -4420,7 +4399,7 @@ RaceGameJellybeans4 = '4 Jellybeans' RaceGameJellybeans10 = '10 Jellybeans!' RingGameTitle = 'Ring Game' RingGameInstructionsSinglePlayer = 'Try to swim through as many of the %s rings as you can. Use the arrow keys to swim.' -RingGameInstructionsMultiPlayer = 'Try to swim through the %s rings. Other players will try for the other colored rings. Use the arrow keys to swim.' +RingGameInstructionsMultiPlayer = 'Try to swim through the %s rings. Other toons will try for the other colored rings. Use the arrow keys to swim.' RingGameMissed = 'MISSED' RingGameGroupPerfect = 'GROUP\nPERFECT!!' RingGamePerfect = 'PERFECT!' @@ -4490,7 +4469,6 @@ GagShopInsufficientSkill = 'You do not have enough skill for that yet' GagShopNotEnoughJellybeans = 'You do not have enough Jellybeans for that gag' GagShopYouPurchased = 'You purchased %s' GagShopOutOfJellybeans = 'Sorry, you are all out of Jellybeans!' -GagShopWaitingOtherPlayers = 'Waiting for other players...' GagShopPlayerDisconnected = '%s has disconnected' GagShopPlayerExited = '%s has exited' GagShopPlayerPlayAgain = 'Play Again' @@ -4753,7 +4731,7 @@ QuestScript141_1 = 'Oh, yes, this book almost completes my collection.\x07Let me QuestScript145_1 = 'I see you had no problem with the trolley!\x07Listen, the Cogs have stolen our blackboard eraser.\x07Go into the streets and fight Cogs until you recover the eraser.\x07To reach the streets go through one of the tunnels like this:' QuestScript145_2 = "When you find our eraser, bring it back here.\x07Don't forget, if you need gags, ride the trolley.\x07Also, if you need to recover Laff points, collect ice cream cones in the Playground." QuestScript150_1 = 'Great work!\x07Toontown is more fun when you have friends!' -QuestScript150_2 = 'To make friends, find another player, and use the New Friend button.' +QuestScript150_2 = 'To make friends, find another toon, and use the New Friend button.' QuestScript150_3 = 'Once you have made a friend, come back here.' QuestScript150_4 = 'Some tasks are too difficult to do alone!' MissingKeySanityCheck = 'Ignore me' @@ -8309,7 +8287,7 @@ TravelGameVoteToGo = 'vote to go' TravelGameUp = 'UP.' TravelGameDown = 'DOWN.' TravelGameVoteWithExclamation = 'Vote!' -TravelGameWaitingChoices = 'Waiting for other players to vote...' +TravelGameWaitingChoices = 'Waiting for other toons to vote...' TravelGameDirections = ['UP', 'DOWN'] TravelGameTotals = 'Totals ' TravelGameReasonVotes = 'The trolley is moving %(dir)s, winning by %(numVotes)d votes.' @@ -8323,10 +8301,10 @@ TravelGamePlaying = 'Up next, the %(game)s trolley game.' TravelGameGotBonus = '%(name)s got a bonus of %(numBeans)s Jellybeans!' TravelGameNoOneGotBonus = 'No one reached their secret goal. Everyone gets 1 Jellybean.' TravelGameConvertingVotesToBeans = 'Converting some votes to Jellybeans...' -TravelGameGoingBackToShop = "Only 1 player left. Going to Goofy's Gag Shop." +TravelGameGoingBackToShop = "Only 1 toon left. Going to Goofy's Gag Shop." PairingGameTitle = 'Toon Memory Game' PairingGameInstructions = 'Press Delete to open a card. Match 2 cards to score a point. Make a match with the bonus glow and earn an extra point. Earn more points by keeping the flips low.' -PairingGameInstructionsMulti = 'Press Delete to open a card. Press Control to signal another player to open a card. Match 2 cards to score a point. Make a match with the bonus glow and earn an extra point. Earn more points by keeping the flips low.' +PairingGameInstructionsMulti = 'Press Delete to open a card. Press Control to signal another toon to open a card. Match 2 cards to score a point. Make a match with the bonus glow and earn an extra point. Earn more points by keeping the flips low.' PairingGamePerfect = 'PERFECT!!' PairingGameFlips = 'Flips:' PairingGamePoints = 'Points:' @@ -8487,7 +8465,7 @@ MoreXpHolidayEnd = 'Exclusive Test Toon double gag experience time has ended. Th JellybeanDayHolidayStart = "It's Jellybean Day! Get Double Jellybean rewards at Parties!" JellybeanDayHolidayEnd = "That's all for Jellybean Day. See you next year." PartyRewardDoubledJellybean = 'Double Jellybeans!' -GrandPrixWeekendHolidayStart = "It's Grand Prix Weekend at Goofy Speedway! Players collect the most points in three consecutive races." +GrandPrixWeekendHolidayStart = "It's Grand Prix Weekend at Goofy Speedway! Toons collect the most points in three consecutive races." GrandPrixWeekendHolidayEnd = "That's all for Grand Prix Weekend. See you next year." KartRace_DoubleTickets = 'Double Tickets' SellbotNerfHolidayStart = 'Operation: Storm Sellbot is happening now! Battle the VP today!' @@ -8649,8 +8627,6 @@ 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.' -IceGameWaitingForPlayersToFinishMove = 'Waiting for other players...' -IceGameWaitingForAISync = 'Waiting for other players...' IceGameInfo = 'Match %(curMatch)d/%(numMatch)d, Round %(curRound)d/%(numRound)d' IceGameControlKeyWarning = 'Remember to press the Ctrl key!' PicnicTableJoinButton = 'Join' @@ -8685,10 +8661,10 @@ ChineseTutorialTitle2 = 'How to Play' ChineseTutorialPrev = 'Previous Page' ChineseTutorialNext = 'Next Page' ChineseTutorialDone = 'Done' -ChinesePage1 = 'The goal of Chinese Checkers is to be the first player to move all of your marbles from the bottom triangle across the board and into the triangle at the top. The first player to do so wins!' -ChinesePage2 = 'Players take turns moving any marble of their own color. A marble can move into an adjacent hole or it can hop over other marbles. Hops must go over a marble and end in an empty hole. It is possible to chain hops together for longer moves!' +ChinesePage1 = 'The goal of Chinese Checkers is to be the first toon to move all of your marbles from the bottom triangle across the board and into the triangle at the top. The first toon to do so wins!' +ChinesePage2 = 'Toons take turns moving any marble of their own color. A marble can move into an adjacent hole or it can hop over other marbles. Hops must go over a marble and end in an empty hole. It is possible to chain hops together for longer moves!' CheckersPage1 = 'The goal of Checkers is to leave the opponent without any possible moves. To do this you can either capture all of his peices or block them in such that he has no available moves.' -CheckersPage2 = 'Players take turns moving any peice of their own color. A peice can move one square diagonal and forward. A peice can only move into a square that is not occupied by another peice. Kings follow the same rules but are allowed to move backwards.' +CheckersPage2 = 'Toons take turns moving any peice of their own color. A peice can move one square diagonal and forward. A peice can only move into a square that is not occupied by another peice. Kings follow the same rules but are allowed to move backwards.' CheckersPage3 = 'To capture an opponents peice your peice must jump over it diagonally into the vacant square beyond it. If you have any jump moves during a turn, you must do one of them. You can chain jump moves together as long as it is with the same peice.' CheckersPage4 = 'A peice becomes a king when it reaches the last row on the board. A peice that has just become a king cannot continue jumping until the next turn. Additionally, kings are allowed to move all directions and are allowed to change directions while jumping.' CheckersGetUpButton = 'Get Up' @@ -8762,7 +8738,7 @@ HolidayNamesInCalendar = {1: ('Summer Fireworks', 'Celebrate Summer with a firew 9: ('Black Cat Day', 'Happy Halloween! Create a Toontastic Black Cat Toon - Today Only!'), 13: ('Trick or Treat', 'Happy Halloween! Trick or treat throughout Toontown to get a nifty Halloween pumpkin head reward!'), 14: ('Grand Prix', 'Grand Prix Monday at Goofy Speedway! To win, collect the most points in three consecutive races!'), - 16: ('Grand Prix Weekend', 'Players compete in circuit races at Goofy Speedway!'), + 16: ('Grand Prix Weekend', 'Toons compete in circuit races at Goofy Speedway!'), 17: ('Trolley Tracks', 'Trolley Tracks Thursday! Board any Trolley with two or more Toons to play.'), 19: ('Silly Saturdays', 'Saturdays are silly with Fish Bingo and Grand Prix throughout the day!'), 24: ('Ides of March', 'Beware the Ides of March! Stop the Backstabber Cogs from invading Toontown!'), @@ -8836,7 +8812,6 @@ CogdoMazeGameInstructions = 'The big Mover & Shaker COGs have the code to open t CogdoMazeIntroMovieDialogue = (("This should give you Toons a shiver! We're powering our offices with your Jokes, and you're powerless to stop us!", "This will make you Toons quake! We've stolen your Jokes, and you cannot stop us!", "This may come as an aftershock, but we've stolen your Jokes, and there's nothing you can do about it!"), ("Don't get rattled, Toons! Fill your water balloons, splash the BIG COGs, and retrieve the PASS CODE that opens the exit! Good luck from the Toon Resistance!", 'Are you ready to rumble, Toons? Go to the water coolers and fill up balloons to throw at COGs. Hit the BIG COGs to get the pass code for the exit! Toon Resistance out!', 'Want some good vibrations? Fill your balloons at the water coolers, splash the BIG Movers & Shakers, complete the PASS CODE, and find the way out! Good luck, Toons!'), ("Hmph! I'm a Silver Sprocket Award winner, I don't need this!", "You're on shaky ground, Toons!", "Before you know it, you'll all be trembling!")) CogdoMazeGameDoorOpens = "The Pass Code opened the Exit!\nGet there before it's too late!" CogdoMazeGameLocalToonFoundExit = "The exit will open when\nyou've busted all four BIG COGS!" -CogdoMazeGameWaitingForToons = 'Waiting for other Toons...' CogdoMazeGameTimeOut = 'Oh no, time ran out! You lost your jokes.' CogdoMazeGameTimeAlert = 'Hurry up! 60 seconds to go!' CogdoMazeGameBossGuiTitle = 'Pass Code:' @@ -8849,7 +8824,6 @@ CogdoMazeGameElevatorRewardLaff = 'Great job, Toons!\nYou get a Toon-Up from the CogdoFlyingGameTitle = 'Legal Eagle Offices' CogdoFlyingGameInstructions = "Fly through the Legal Eagles' lair. Watch out for obstacles and COGs along the way, and don't forget to refuel your helicopter!" CogdoFlyingIntroMovieDialogue = (("You won't ruffle our feathers, Toons! We're destroying barrels of your Laff, and you cannot stop us!", "A flock of Toons! We're crushing barrels of your Laff in our %s, and there's nothing you can do about it!" % CogdoStomperName, "You can't egg us on, Toons! We're powering our offices with your Laff, and you're powerless to stop us!"), ('This is the Toon Resistance! A little bird told me you can use propellers to fly around, grab Barrel Destruction Memos, and keep Laff from being destroyed! Good luck, Toons!', 'Attention Toons! Wing it with a propeller and collect Barrel Destruction Memos to keep our Laff from being stomped! Toon Resistance out!', 'Toon Resistance here! Cause a flap by finding propellers, flying to the Barrel Destruction Memos, and keeping our Laff from being smashed! Have fun!'), ("Squawk! I'm a Silver Sprocket Award winner, I don't need this!", 'Do your best, Toons! You will find us to be quite talon-ted!', "We'll teach you to obey the pecking order, Toons!")) -CogdoFlyingGameWaiting = 'Waiting for other Toons%s' CogdoFlyingGameFuelLabel = 'Fuel' CogdoFlyingGameLegalEagleTargeting = 'A Legal Eagle has noticed you!' CogdoFlyingGameLegalEagleAttacking = 'Incoming Eagle!' diff --git a/toontown/toonbase/ToonBase.py b/toontown/toonbase/ToonBase.py index 58ad4c07..e7d3c6b8 100644 --- a/toontown/toonbase/ToonBase.py +++ b/toontown/toonbase/ToonBase.py @@ -162,7 +162,6 @@ class ToonBase(OTPBase.OTPBase): oldLoader.destroy() self.accept('PandaPaused', self.disableAllAudio) self.accept('PandaRestarted', self.enableAllAudio) - self.friendMode = self.config.GetBool('switchboard-friends', 0) self.wantPets = self.config.GetBool('want-pets', 1) self.wantBingo = self.config.GetBool('want-fish-bingo', 1) self.wantKarts = self.config.GetBool('want-karts', 1) diff --git a/toontown/town/TownBattleSOSPanel.py b/toontown/town/TownBattleSOSPanel.py index 04df9ba0..91c3094e 100644 --- a/toontown/town/TownBattleSOSPanel.py +++ b/toontown/town/TownBattleSOSPanel.py @@ -78,7 +78,7 @@ class TownBattleSOSPanel(DirectFrame, StateData.StateData): def makeFriendButton(self, friendPair): friendId, flags = friendPair - handle = base.cr.playerFriendsManager.identifyFriend(friendId) + handle = base.cr.identifyFriend(friendId) if handle == None: base.cr.fillUpFriendsMap() return @@ -169,11 +169,6 @@ class TownBattleSOSPanel(DirectFrame, StateData.StateData): if self.factoryToonIdList is None or friendPair[0] in self.factoryToonIdList: newFriends.append(friendPair) - if hasattr(base.cr, 'playerFriendsManager'): - for avatarId in base.cr.playerFriendsManager.getAllOnlinePlayerAvatars(): - if not base.cr.playerFriendsManager.askAvatarKnownElseWhere(avatarId): - newFriends.append((avatarId, 0)) - for friendPair in self.friends.keys(): if friendPair not in newFriends: friendButton = self.friends[friendPair]