friends: Handle makeFriendsReply
This commit is contained in:
parent
d0920eeee7
commit
77d35d7875
|
|
@ -2853,6 +2853,7 @@ dclass ToontownFriendsManager : DistributedObject {
|
||||||
getAvatarDetailsRequest(uint32) clsend;
|
getAvatarDetailsRequest(uint32) clsend;
|
||||||
getAvatarDetailsResponse(blob);
|
getAvatarDetailsResponse(blob);
|
||||||
makeFriends(uint32, uint32, uint8, uint32);
|
makeFriends(uint32, uint32, uint8, uint32);
|
||||||
|
makeFriendsResponse(uint8, uint32) airecv;
|
||||||
};
|
};
|
||||||
|
|
||||||
dclass TTSpeedchatRelay : SpeedchatRelay {
|
dclass TTSpeedchatRelay : SpeedchatRelay {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,18 @@ class FriendManagerAI(DistributedObjectGlobalAI):
|
||||||
self.declineFriends2 = {}
|
self.declineFriends2 = {}
|
||||||
self.lastRollTime = 0
|
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
|
### Messages sent from inviter client to AI
|
||||||
|
|
||||||
def friendQuery(self, inviteeId):
|
def friendQuery(self, inviteeId):
|
||||||
|
|
|
||||||
|
|
@ -15,3 +15,6 @@ class ToontownFriendsManagerAI(DistributedObjectGlobalAI):
|
||||||
parameters: an integer result code, and the supplied context.
|
parameters: an integer result code, and the supplied context.
|
||||||
"""
|
"""
|
||||||
self.sendUpdate('makeFriends', [avatarAId, avatarBId, flags, 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):
|
def _handleDone(self):
|
||||||
self.resultCode = 1
|
self.resultCode = 1
|
||||||
|
self.friendsManager.sendMakeFriendsResponse(self.resultCode, self.context)
|
||||||
FriendsOperation._handleDone(self)
|
FriendsOperation._handleDone(self)
|
||||||
|
|
||||||
def _handleError(self, error):
|
def _handleError(self, error):
|
||||||
self.resultCode = 0
|
self.resultCode = 0
|
||||||
|
self.friendsManager.sendMakeFriendsResponse(self.resultCode, self.context)
|
||||||
FriendsOperation._handleError(self, error)
|
FriendsOperation._handleError(self, error)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -251,6 +253,9 @@ class ToontownFriendsManagerUD(DistributedObjectGlobalUD):
|
||||||
DistributedObjectGlobalUD.__init__(self, air)
|
DistributedObjectGlobalUD.__init__(self, air)
|
||||||
self.operations = []
|
self.operations = []
|
||||||
|
|
||||||
|
def sendMakeFriendsResponse(self, result, context):
|
||||||
|
self.sendUpdate('makeFriendsResponse', [result, context])
|
||||||
|
|
||||||
def sendFriendOnline(self, avId, friendId, commonChatFlags, whitelistChatFlags):
|
def sendFriendOnline(self, avId, friendId, commonChatFlags, whitelistChatFlags):
|
||||||
datagram = PyDatagram()
|
datagram = PyDatagram()
|
||||||
datagram.addUint32(friendId) # doId
|
datagram.addUint32(friendId) # doId
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue