From ab381297ee09fe42270848a11cdd0880e3697469 Mon Sep 17 00:00:00 2001 From: polaris Date: Tue, 15 Apr 2014 15:06:14 -0400 Subject: [PATCH] Send status to friends when going offline part 2 --- gamespy_profile_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gamespy_profile_server.py b/gamespy_profile_server.py index dfbc5e9..2d74ba3 100644 --- a/gamespy_profile_server.py +++ b/gamespy_profile_server.py @@ -448,7 +448,11 @@ class PlayerSession(LineReceiver): # TODO: Cache buddy list so we don't have to query the database every time buddies = self.db.get_buddy_list(self.profileid) - status_msg = "|s|%s|ss|%s|ls|%s|ip|%d|p|0|qm|0" % (self.status, self.statstring, self.locstring, self.get_ip_as_int(self.address.host)) + if self.status == "0" and self.statstring == "Offline": + # Going offline, don't need to send the other information. + status_msg = "|s|%s|ss|%s" % (self.status, self.statstring) + else: + status_msg = "|s|%s|ss|%s|ls|%s|ip|%d|p|0|qm|0" % (self.status, self.statstring, self.locstring, self.get_ip_as_int(self.address.host)) msg_d = [] msg_d.append(('__cmd__', "bm"))