public void Run(int AfterSec, GameServer GameServer, EGameInfo gi) { if (gi.GameTurn == GameModel.Enums.GameTurn.Send3Card) { AfterSec = AfterSec * 3; } Task Task = new Task(() => { // Thread.Sleep(AfterSec * 1000); SpinWait.SpinUntil(() => { return(false); }, AfterSec * 1000); GameTaskManager.WaitBetUser(GameServer, gi.CurBetUserOpenId); }); Task.Start(); }
public void Run(int AfterSec, GameServer GameServer, int weight) { //洗牌,并获取洗牌结束消息 var msgList = CreateShuffleEndMessage(weight); Task SubTask = new Task(() => { // Thread.Sleep(AfterSec * 1000); SpinWait.SpinUntil(() => { return(false); }, AfterSec * 1000); //将洗牌的消息发送出去 _GameMessageHandle.Push(msgList); var r = _GameMessageHandle.Run(GameServer); if (r == false) { return; } //EGameInfo gi = null; //if (msgList[0] is ResultGameShuffleEnd) //{ // var rgseMsg = msgList[0] as ResultGameShuffleEnd; // rgseMsg.GameInfo = gi; //} var gi = _GameManager.GetGameBasic(); // gi.GameStatus = GameStatus.Playing; //gi.GameTurn = GameTurn.FirstTurn; //_GameManager.SetGameInfo(gi); GameTaskManager.WaitBetUser(GameServer, gi.CurBetUserOpenId); }); SubTask.Start(); }