mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-08-06 02:18:37 -05:00
GPCM: Fix recursive mutex lock from last commit
This commit is contained in:
parent
e854eb0d6b
commit
820ed8a6ac
|
|
@ -222,7 +222,7 @@ func (g *GameSpySession) setStatus(command common.GameSpyCommand) {
|
|||
g.Status = statusMsg
|
||||
|
||||
if !g.StatusSet && g.User.OpenHost {
|
||||
g.openHostEnabled(false)
|
||||
g.openHostEnabled(false, false)
|
||||
}
|
||||
|
||||
g.StatusSet = true
|
||||
|
|
@ -318,9 +318,11 @@ func (g *GameSpySession) sendLogoutStatus() {
|
|||
}
|
||||
}
|
||||
|
||||
func (g *GameSpySession) openHostEnabled(sendStatus bool) {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
func (g *GameSpySession) openHostEnabled(sendStatus bool, lock bool) {
|
||||
if lock {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
}
|
||||
|
||||
for _, session := range sessions {
|
||||
if session.LoggedIn && session.isFriendAdded(g.User.ProfileId) && !session.isFriendAuthorized(g.User.ProfileId) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ func (g *GameSpySession) updateProfile(command common.GameSpyCommand) {
|
|||
if openHost, ok := command.OtherValues["wwfc_openhost"]; ok {
|
||||
enabled := openHost != "0"
|
||||
if !g.User.OpenHost && enabled {
|
||||
g.openHostEnabled(true)
|
||||
g.openHostEnabled(true, true)
|
||||
} else if g.User.OpenHost && !enabled {
|
||||
g.openHostDisabled()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user