def recvMemberAdded(self, memberInfo, inviterId, inviterName): avatarId, avatarName, rank, isOnline, bandManagerId, bandId = memberInfo if avatarId != localAvatar.getDoId(): if inviterId == localAvatar.getDoId(): base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendInvitedP, inviterId, PLocalizer.You, avatarId, avatarName) elif inviterId: base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendInvited, inviterId, inviterName, avatarId, avatarName) GuildManager.recvMemberAdded(self, memberInfo, inviterId, inviterName)
def recvMemberAdded(self, memberInfo, inviterId, inviterName): (avatarId, avatarName, rank, isOnline, bandManagerId, bandId) = memberInfo if avatarId != localAvatar.getDoId(): if inviterId == localAvatar.getDoId(): base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendInvitedP, inviterId, PLocalizer.You, avatarId, avatarName) elif inviterId: base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendInvited, inviterId, inviterName, avatarId, avatarName) GuildManager.recvMemberAdded(self, memberInfo, inviterId, inviterName)
def recvMemberRemoved(self, avatarId, senderId, avatarName, senderName): if avatarId != localAvatar.getDoId(): if senderId == localAvatar.getDoId(): base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendKickedOutP, senderId, PLocalizer.You, avatarId, avatarName) elif senderId == avatarId: base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendsNoMore, senderId, senderName, 0, '') elif senderId: base.talkAssistant.receiveGuildUpdateMessage(OTPLocalizer.GuildInviterFriendKickedOut, senderId, senderName, avatarId, avatarName) messenger.send('kickedFromGuild-%s' % avatarId) GuildManager.recvMemberRemoved(self, avatarId, senderId, avatarName, senderName)
def recvMemberUpdateRank(self, avatarId, senderId, avatarName, senderName, rank, promote): doShow = 1 if avatarId == localAvatar.getDoId(): avatarName = PLocalizer.LowerYou elif senderId == localAvatar.getDoId(): senderName = PLocalizer.LowerYou if promote: if senderId == localAvatar.getDoId(): senderName = PLocalizer.You if rank == GUILDRANK_GM: if senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendPromotedGMP else: message = OTPLocalizer.GuildInviterFriendPromotedGM elif senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendPromotedP else: message = OTPLocalizer.GuildInviterFriendPromoted elif senderId == localAvatar.getDoId(): senderName = PLocalizer.You if self.id2Rank.get(avatarId) == GUILDRANK_GM: doShow = 0 if senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendDemotedGMP else: message = OTPLocalizer.GuildInviterFriendDemotedGM elif senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendDemotedP else: message = OTPLocalizer.GuildInviterFriendDemoted if doShow: base.talkAssistant.receiveGuildUpdateMessage( message, senderId, senderName, avatarId, avatarName, [PLocalizer.GuildRankNames[rank]]) GuildManager.recvMemberUpdateRank(self, avatarId, senderId, avatarName, senderName, rank, promote)
def recvMemberUpdateRank(self, avatarId, senderId, avatarName, senderName, rank, promote): doShow = 1 if avatarId == localAvatar.getDoId(): avatarName = PLocalizer.LowerYou elif senderId == localAvatar.getDoId(): senderName = PLocalizer.LowerYou if promote: if senderId == localAvatar.getDoId(): senderName = PLocalizer.You if rank == GUILDRANK_GM: if senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendPromotedGMP else: message = OTPLocalizer.GuildInviterFriendPromotedGM elif senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendPromotedP else: message = OTPLocalizer.GuildInviterFriendPromoted elif senderId == localAvatar.getDoId(): senderName = PLocalizer.You if self.id2Rank.get(avatarId) == GUILDRANK_GM: doShow = 0 if senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendDemotedGMP else: message = OTPLocalizer.GuildInviterFriendDemotedGM elif senderId == localAvatar.getDoId(): message = OTPLocalizer.GuildInviterFriendDemotedP else: message = OTPLocalizer.GuildInviterFriendDemoted if doShow: base.talkAssistant.receiveGuildUpdateMessage(message, senderId, senderName, avatarId, avatarName, [ PLocalizer.GuildRankNames[rank]]) GuildManager.recvMemberUpdateRank(self, avatarId, senderId, avatarName, senderName, rank, promote)