QR2: Changes to help detect mutex deadlock

This commit is contained in:
mkwcat 2023-12-24 16:46:34 -05:00
parent eac15559ac
commit 7b8352c17f
No known key found for this signature in database
GPG Key ID: 7A505679CE9E7AA9
3 changed files with 4 additions and 3 deletions

View File

@ -220,7 +220,7 @@ func GetGroups(gameName string) []GroupInfo {
groupInfo.MKWRegion = group.MKWRegion
}
for session, _ := range group.Players {
for session := range group.Players {
mapData := map[string]string{}
for k, v := range session.Data {
mapData[k] = v

View File

@ -90,10 +90,10 @@ func heartbeat(moduleName string, conn net.PacketConn, addr net.Addr, buffer []b
if !session.Authenticated {
logging.Notice(moduleName, "Sending challenge")
sendChallenge(conn, addr, session, lookupAddr)
return
} else if !session.ExploitReceived && session.Login != nil && session.Login.NeedsExploit && statechanged == "1" {
logging.Notice(moduleName, "Sending SBCM exploit to DNS patcher client")
sendClientExploit(moduleName, session)
return
}
logging.Info(moduleName, "Heartbeat ok")
}

View File

@ -289,6 +289,7 @@ func sendClientExploit(moduleName string, sessionCopy Session) {
mutex.Lock()
session, sessionExists := sessions[makeLookupAddr(sessionCopy.Addr.String())]
if !sessionExists {
mutex.Unlock()
logging.Error(moduleName, "Session not found")
return
}