GPCM: Only send logout status to authenticated friends

This commit is contained in:
mkwcat
2023-11-22 15:43:36 -05:00
parent 2630e37f9d
commit 7dcb4109ad
2 changed files with 4 additions and 4 deletions

View File

@@ -239,7 +239,7 @@ func (g *GameSpySession) sendLogoutStatus() {
ip := strconv.FormatInt(int64(int32(rawIP)), 10)
mutex.Lock()
for _, storedPid := range g.FriendList {
for _, storedPid := range g.AuthFriendList {
sendMessageToProfileId("100", g.User.ProfileId, storedPid, "|s|0|ss|Offline|ls||ip|"+ip+"|p|0|qm|0")
}
mutex.Unlock()

View File

@@ -122,7 +122,7 @@ func handleRequest(conn net.Conn) {
conn.Write([]byte(payload))
logging.Notice(session.ModuleName, "Connection established from", conn.RemoteAddr())
common.OnlineStatUpdate(1)
common.OnlineStatUpdate(1)
// Here we go into the listening loop
for {
@@ -133,12 +133,12 @@ func handleRequest(conn net.Conn) {
if errors.Is(err, io.EOF) {
// Client closed connection, terminate.
logging.Notice(session.ModuleName, "Client closed connection")
common.OnlineStatUpdate(-1)
common.OnlineStatUpdate(-1)
return
}
logging.Error(session.ModuleName, "Connection lost")
common.OnlineStatUpdate(-1)
common.OnlineStatUpdate(-1)
return
}