mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-09-07 16:15:30 -05:00
GPCM: Send regular keep alive commands
This commit is contained in:
@@ -306,7 +306,17 @@ func (g *GameSpySession) login(command common.GameSpyCommand) {
|
||||
|
||||
g.Conn.Write([]byte(payload))
|
||||
|
||||
// g.sendFriendRequests()
|
||||
// Now start sending keep alive packets every 5 minutes
|
||||
go func() {
|
||||
for {
|
||||
time.Sleep(5 * time.Minute)
|
||||
if !g.LoggedIn {
|
||||
return
|
||||
}
|
||||
|
||||
g.Conn.Write([]byte(`\ka\\final\`))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (g *GameSpySession) exLogin(command common.GameSpyCommand) {
|
||||
|
||||
@@ -122,6 +122,7 @@ func (g *GameSpySession) closeSession() {
|
||||
|
||||
g.Conn.Close()
|
||||
if g.LoggedIn {
|
||||
g.LoggedIn = false
|
||||
delete(sessions, g.User.ProfileId)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user