diff --git a/etc/toon.dc b/etc/toon.dc index efe2ece..ef62ac1 100755 --- a/etc/toon.dc +++ b/etc/toon.dc @@ -2863,6 +2863,7 @@ dclass ToontownFriendsManager : DistributedObject { makeFriends(uint32, uint32, uint8, uint32); makeFriendsResponse(uint32, uint32, uint8, uint32) airecv; removeFriend(uint32) clsend; + requestSecret(uint32); }; dclass TTSpeedchatRelay : SpeedchatRelay { diff --git a/otp/friends/FriendManagerAI.py b/otp/friends/FriendManagerAI.py index 5082c89..ab4a1e0 100644 --- a/otp/friends/FriendManagerAI.py +++ b/otp/friends/FriendManagerAI.py @@ -186,8 +186,8 @@ class FriendManagerAI(DistributedObjectGlobalAI): Sent by the client to the AI to request a new "secret" for the user. """ - # TODO - self.notify.info('TODO: requestSecret') + avId = self.air.getAvatarIdFromSender() + self.air.requestSecret(avId) ### Messages sent from AI to inviter client diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index d3989ad..6e3ea8b 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -490,3 +490,18 @@ class ToontownAIRepository(ToontownInternalRepository): """ if __astron__: self.toontownFriendsManager.sendMakeFriends(avatarAId, avatarBId, flags, context) + + def requestSecret(self, requesterId): + """ + Requests a "secret" from the friends manager. This is a + unique string that will be associated with the indicated + requesterId, for the purposes of authenticating true-life + friends. + + When the secret is ready, a "requestSecretReply" message will + be thrown with three parameters: the result code (0 or 1, + indicating failure or success), the generated secret, and the + requesterId again. + """ + if __astron__: + self.toontownFriendsManager.sendRequestSecret(requesterId) diff --git a/toontown/friends/ToontownFriendsManagerAI.py b/toontown/friends/ToontownFriendsManagerAI.py index 0ec104d..6797050 100644 --- a/toontown/friends/ToontownFriendsManagerAI.py +++ b/toontown/friends/ToontownFriendsManagerAI.py @@ -25,3 +25,6 @@ class ToontownFriendsManagerAI(DistributedObjectGlobalAI): self.sendFriendOnline(avatarBId, avatarAId, 0, 1) messenger.send("makeFriendsReply", [result, context]) + + def sendRequestSecret(self, requesterId): + self.sendUpdate('requestSecret', [requesterId]) diff --git a/toontown/friends/ToontownFriendsManagerUD.py b/toontown/friends/ToontownFriendsManagerUD.py index bc4a9c3..53d94b3 100644 --- a/toontown/friends/ToontownFriendsManagerUD.py +++ b/toontown/friends/ToontownFriendsManagerUD.py @@ -421,6 +421,7 @@ class ToontownFriendsManagerUD(DistributedObjectGlobalUD): def __init__(self, air): DistributedObjectGlobalUD.__init__(self, air) self.operations = [] + self.secrets = [] def sendMakeFriendsResponse(self, avatarAId, avatarBId, result, context): self.sendUpdate('makeFriendsResponse', [avatarAId, avatarBId, result, context]) @@ -499,3 +500,6 @@ class ToontownFriendsManagerUD(DistributedObjectGlobalUD): def goingOffline(self, avId): self.runServerOperation(GoingOfflineOperation, avId) + + def requestSecret(self, requesterId): + print('requestSecret')