mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-07-09 13:56:01 -05:00
QR2: Fix wrong mutex used
This commit is contained in:
parent
0cbf5e431c
commit
0edfa96b92
11
qr2/main.go
11
qr2/main.go
|
|
@ -120,9 +120,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
|
|||
case ClientMessageAckRequest:
|
||||
logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_MESSAGE_ACK"))
|
||||
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
|
||||
// In case ClientExploitReply is lost, this can be checked as well
|
||||
// This would be sent either after the payload is downloaded, or the client is already patched
|
||||
session.ExploitReceived = true
|
||||
|
|
@ -130,16 +127,15 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
|
|||
login.NeedsExploit = false
|
||||
}
|
||||
|
||||
session.MessageMutex.Lock()
|
||||
session.MessageAckWaker.Assert()
|
||||
session.MessageMutex.Unlock()
|
||||
return
|
||||
|
||||
case KeepAliveRequest:
|
||||
logging.Info(moduleName, "Command:", aurora.Yellow("KEEPALIVE"))
|
||||
conn.WriteTo(createResponseHeader(KeepAliveRequest, 0), addr)
|
||||
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
|
||||
session.LastKeepAlive = time.Now().Unix()
|
||||
return
|
||||
|
||||
|
|
@ -155,9 +151,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
|
|||
case ClientExploitReply:
|
||||
logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_EXPLOIT_ACK"))
|
||||
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
|
||||
session.ExploitReceived = true
|
||||
if login := session.Login; login != nil {
|
||||
login.NeedsExploit = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user