File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 66 "fmt"
77 "os"
88 "strings"
9+ "time"
910 "wwfc/common"
1011 "wwfc/database"
1112 "wwfc/logging"
6869 mutex = deadlock.Mutex {}
6970
7071 allowDefaultDolphinKeys bool
71- config common.Config
72+ config common.Config
7273)
7374
74-
7575func StartServer (reload bool ) {
7676 qr2 .SetGPErrorCallback (func (pid uint32 , reason string ) {
7777 kickPlayer (pid , reason , resolveWWFCMessage (reason ))
@@ -127,6 +127,21 @@ func CloseConnection(index uint64) {
127127
128128 logging .Notice (session .ModuleName , "Connection closed" )
129129
130+ ip , _ := common .IPFormatToInt (session .RemoteAddr )
131+ kickInfo := []qr2.PIDIPPair {
132+ {
133+ PID : session .User .ProfileId ,
134+ IP : uint32 (ip ),
135+ },
136+ }
137+
138+ // Defer by 3 seconds just in case!
139+ go func () {
140+ time .AfterFunc (3 * time .Second , func () {
141+ qr2 .OrderKickFromGroups (kickInfo )
142+ })
143+ }()
144+
130145 if session .LoggedIn {
131146 qr2 .Logout (session .User .ProfileId )
132147 if session .QR2IP != 0 {
You can’t perform that action at this time.
0 commit comments