//获取古战场今日游戏时间,并设置定时器(时间到了,要把玩家踢出副本) private IEnumerator FetchPlayerExDataCoroutine(Coroutine co, ObjPlayer player) { var msg = SceneServer.Instance.LogicAgent.SSFetchExdata(player.ObjId, mIdList); yield return(msg.SendAndWaitUntilDone(co)); if (msg.State != MessageState.Reply) { Logger.Error("In FetchPlayerExDataCoroutine(), SSFetchExdata() not replied! msg.State = {0}", msg.State); player.ExitDungeon(); yield break; } if (msg.ErrorCode != (int)ErrorCodes.OK) { Logger.Error("In FetchPlayerExDataCoroutine(), SSFetchExdata() reply with errCode = {0}", msg.ErrorCode); player.ExitDungeon(); yield break; } var exData = msg.Response.Items; var playedTimeSec = exData[0]; var enterTime = PlayerEnterTimes[player.ObjId]; var dueTime = enterTime.AddSeconds(mMaxTimeOneDaySec - playedTimeSec); //添加queuePlayer var queuePlayer = new QueuePlayer(); queuePlayer.DueTime = dueTime; queuePlayer.Player = player; mKickQueue.Add(ref queuePlayer.Handle, queuePlayer); mQueuePlayerMap.Add(player.ObjId, queuePlayer); //检查并修改踢人的定时器 mMinQueuePlayer = mKickQueue.FindMin(); if (mKickTimer == null || mKickTimer.T == null) { mKickTimer = SceneServerControl.Timer.CreateTrigger(mMinQueuePlayer.DueTime, KickPlayers); } else { var trigger = mKickTimer; if (trigger.Time != mMinQueuePlayer.DueTime) { SceneServerControl.Timer.ChangeTime(ref mKickTimer, mMinQueuePlayer.DueTime); } } //通知客户端倒计时 player.Proxy.NotifyDungeonTime((int)State, (ulong)dueTime.ToBinary()); }
public override void ExitDungeon(ObjPlayer player) { CoroutineFactory.NewCoroutine(ResultOver, player, false).MoveNext(); // 玩家手动退出副本? player.ExitDungeon(); }
public override void ExitDungeon(ObjPlayer player) { if (player == null) { return; } player.ExitDungeon(); }
private void OnDeadExit(ObjPlayer player) { mDeadWaitExitTrigger = null; player.ExitDungeon(); }
public override void ExitDungeon(ObjPlayer player) { player.ExitDungeon(); }