Example #1
0
        private IEnumerator CompleteCoroutine(Coroutine coroutine,
                                              DungeonScene _this,
                                              ulong playerId,
                                              FubenResult result)
        {
            var trigger = _this.Trggers[(int)eDungeonTimerType.WaitEnd];
            var useSec  = 0;

            if (trigger != null)
            {
                var closeTime = trigger.Time;
                useSec = (int)(_this.mFubenRecord.TimeLimitMinutes * 60 - (int)closeTime.GetDiffSeconds(DateTime.Now));
                if (useSec < 0)
                {
                    useSec = 0;
                }
            }
            result.FubenId    = _this.TableSceneData.FubenId;
            result.UseSeconds = useSec;
            var msg = SceneServer.Instance.LogicAgent.CompleteFuben(playerId, result);

            yield return(msg.SendAndWaitUntilDone(coroutine));

            //后台统计
            try
            {
                var tbFuben   = Table.GetFuben(result.FubenId);
                var character = _this.FindCharacter(playerId);
                if (tbFuben != null && character != null)
                {
                    var level = character.GetLevel();
                    var v     = string.Format("fuben#{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}",
                                              playerId,
                                              result.FubenId,
                                              tbFuben.Name,
                                              tbFuben.AssistType,
                                              1, // 0  进入   1 完成   2 退出
                                              DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"),
                                              level,
                                              character.Attr.GetFightPoint()
                                              ); // 时间
                    PlayerLog.Kafka(v);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
            }
        }