diff --git a/etc/toon.dc b/etc/toon.dc index 60c68b3..efe2ece 100755 --- a/etc/toon.dc +++ b/etc/toon.dc @@ -2857,6 +2857,7 @@ dclass ToontownFriendsManager : DistributedObject { getFriendsListResponse(blob); friendOnline(blob); friendOffline(blob); + goingOffline(uint32); getAvatarDetailsRequest(uint32) clsend; getAvatarDetailsResponse(blob); makeFriends(uint32, uint32, uint8, uint32); diff --git a/otp/login/AstronLoginManagerUD.py b/otp/login/AstronLoginManagerUD.py index bdc6c93..d1d1c5a 100644 --- a/otp/login/AstronLoginManagerUD.py +++ b/otp/login/AstronLoginManagerUD.py @@ -751,8 +751,8 @@ class LoadAvatarOperation(AvatarOperation): # Get the client channel. channel = self.loginManager.GetAccountConnectionChannel(self.sender) - # We will first assign a POST_REMOVE that will unload the - # avatar in the event of them disconnecting while we are working. + # We will first assign a POST_REMOVE that will unload the + # avatar in the event of them disconnecting while we are working. cleanupDatagram = PyDatagram() cleanupDatagram.addServerHeader(self.avId, channel, STATESERVER_OBJECT_DELETE_RAM) cleanupDatagram.addUint32(self.avId) @@ -784,7 +784,15 @@ class LoadAvatarOperation(AvatarOperation): self.loginManager.air.setOwner(self.avId, channel) friendsList = [friendId for friendId, _ in self.avatar['setFriendsList'][0]] - self.loginManager.air.toontownFriendsManager.comingOnline(self.avId, friendsList) + friendsManager = self.loginManager.air.toontownFriendsManager + friendsManager.comingOnline(self.avId, friendsList) + + cleanupDatagram = friendsManager.dclass.aiFormatUpdate('goingOffline', friendsManager.doId, friendsManager.doId, self.loginManager.air.ourChannel, [self.avId]) + datagram = PyDatagram() + datagram.addServerHeader(channel, self.loginManager.air.ourChannel, CLIENTAGENT_ADD_POST_REMOVE) + datagram.addUint16(cleanupDatagram.getLength()) + datagram.appendData(cleanupDatagram.getMessage()) + self.loginManager.air.send(datagram) self._handleDone()