From 6e11c5edec0ebcec8dd4826da195f8db6adf754c Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 16 Oct 2023 18:43:55 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20round=20=E5=B9=B6=E5=8F=91=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E9=97=AE=E9=A2=98=E5=9B=9E=E6=92=A4=EF=BC=88=E6=AD=BB?= =?UTF-8?q?=E9=94=81=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/fight/round.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/game/fight/round.go b/game/fight/round.go index bd68adb..3b4f9bf 100644 --- a/game/fight/round.go +++ b/game/fight/round.go @@ -5,7 +5,6 @@ import ( "github.com/kercylan98/minotaur/utils/random" "github.com/kercylan98/minotaur/utils/slice" "github.com/kercylan98/minotaur/utils/timer" - "sync" "time" ) @@ -67,7 +66,7 @@ type Round[Data RoundData] struct { actionTimeoutEventHandles []RoundActionTimeoutEvent[Data] // 行动超时事件 actionRefreshEventHandles []RoundActionRefreshEvent[Data] // 行动刷新事件 - actionMutex sync.Mutex + //actionMutex sync.Mutex } // GetData 获取游戏数据 @@ -80,8 +79,8 @@ func (slf *Round[Data]) GetData() Data { func (slf *Round[Data]) Start() { slf.currentEntity = -1 slf.round = 1 - slf.actionMutex.Lock() - defer slf.actionMutex.Unlock() + //slf.actionMutex.Lock() + //defer slf.actionMutex.Unlock() slf.loop(false) } @@ -163,8 +162,8 @@ func (slf *Round[Data]) SkipCamp() { func (slf *Round[Data]) ActionRefresh() { slf.actionTimeoutTime = time.Now().Add(slf.actionTimeout).Unix() slf.ticker.After(slf.actionTimeoutTickerName, slf.actionTimeout, func(timeout bool) { - slf.actionMutex.Lock() - defer slf.actionMutex.Unlock() + //slf.actionMutex.Lock() + //defer slf.actionMutex.Unlock() slf.loop(timeout) }, true) } @@ -175,8 +174,8 @@ func (slf *Round[Data]) ActionFinish() { if slf.shareAction { slf.currentEntity = -1 } - slf.actionMutex.Lock() - defer slf.actionMutex.Unlock() + //slf.actionMutex.Lock() + //defer slf.actionMutex.Unlock() slf.loop(false) }