mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-07-04 17:00:56 -05:00
QR2: Fourth attempt to fix this waker bug
This commit is contained in:
parent
4c98fd2e8b
commit
7d9371cd03
|
|
@ -127,9 +127,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
|
|||
login.NeedsExploit = false
|
||||
}
|
||||
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
|
||||
session.MessageAckWaker.Assert()
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -235,17 +235,17 @@ func SendClientMessage(senderIP string, destSearchID uint64, message []byte) {
|
|||
payload = append(payload, message...)
|
||||
|
||||
receiver.MessageMutex.Lock()
|
||||
defer receiver.MessageMutex.Unlock()
|
||||
|
||||
if receiver.Login == nil {
|
||||
receiver.MessageMutex.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
s := sleep.Sleeper{}
|
||||
defer s.Done()
|
||||
|
||||
mutex.Lock()
|
||||
receiver.MessageAckWaker.Clear()
|
||||
s.AddWaker(receiver.MessageAckWaker)
|
||||
mutex.Unlock()
|
||||
|
||||
timeWaker := sleep.Waker{}
|
||||
s.AddWaker(&timeWaker)
|
||||
|
|
@ -275,12 +275,9 @@ func SendClientMessage(senderIP string, destSearchID uint64, message []byte) {
|
|||
login.GPErrorCallback(login.ProfileID, "network_error")
|
||||
receiver.Login = nil
|
||||
}
|
||||
|
||||
receiver.MessageMutex.Unlock()
|
||||
return
|
||||
|
||||
default:
|
||||
receiver.MessageMutex.Unlock()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user