friends: Handle makeFriendsReply
This commit is contained in:
parent
d0920eeee7
commit
77d35d7875
|
|
@ -2853,6 +2853,7 @@ dclass ToontownFriendsManager : DistributedObject {
|
|||
getAvatarDetailsRequest(uint32) clsend;
|
||||
getAvatarDetailsResponse(blob);
|
||||
makeFriends(uint32, uint32, uint8, uint32);
|
||||
makeFriendsResponse(uint8, uint32) airecv;
|
||||
};
|
||||
|
||||
dclass TTSpeedchatRelay : SpeedchatRelay {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,18 @@ class FriendManagerAI(DistributedObjectGlobalAI):
|
|||
self.declineFriends2 = {}
|
||||
self.lastRollTime = 0
|
||||
|
||||
def generate(self):
|
||||
DistributedObjectGlobalAI.generate(self)
|
||||
|
||||
# The FriendManagerAI always listens for these events, which
|
||||
# will be sent in response to secret requests to the database,
|
||||
# via the AIR.
|
||||
self.accept("makeFriendsReply", self.makeFriendsReply)
|
||||
|
||||
def delete(self):
|
||||
self.ignore("makeFriendsReply")
|
||||
DistributedObjectGlobalAI.delete(self)
|
||||
|
||||
### Messages sent from inviter client to AI
|
||||
|
||||
def friendQuery(self, inviteeId):
|
||||
|
|
|
|||
|
|
@ -15,3 +15,6 @@ class ToontownFriendsManagerAI(DistributedObjectGlobalAI):
|
|||
parameters: an integer result code, and the supplied context.
|
||||
"""
|
||||
self.sendUpdate('makeFriends', [avatarAId, avatarBId, flags, context])
|
||||
|
||||
def makeFriendsResponse(self, result, context):
|
||||
messenger.send("makeFriendsReply", [result, context])
|
||||
|
|
|
|||
|
|
@ -237,10 +237,12 @@ class MakeFriendsOperation(FriendsOperation):
|
|||
|
||||
def _handleDone(self):
|
||||
self.resultCode = 1
|
||||
self.friendsManager.sendMakeFriendsResponse(self.resultCode, self.context)
|
||||
FriendsOperation._handleDone(self)
|
||||
|
||||
def _handleError(self, error):
|
||||
self.resultCode = 0
|
||||
self.friendsManager.sendMakeFriendsResponse(self.resultCode, self.context)
|
||||
FriendsOperation._handleError(self, error)
|
||||
|
||||
|
||||
|
|
@ -251,6 +253,9 @@ class ToontownFriendsManagerUD(DistributedObjectGlobalUD):
|
|||
DistributedObjectGlobalUD.__init__(self, air)
|
||||
self.operations = []
|
||||
|
||||
def sendMakeFriendsResponse(self, result, context):
|
||||
self.sendUpdate('makeFriendsResponse', [result, context])
|
||||
|
||||
def sendFriendOnline(self, avId, friendId, commonChatFlags, whitelistChatFlags):
|
||||
datagram = PyDatagram()
|
||||
datagram.addUint32(friendId) # doId
|
||||
|
|
|
|||
Loading…
Reference in New Issue