Exemplo n.º 1
0
        public void AddLog(string userName, ActionType actionType, decimal operNumber, string remark = "")
        {
            try
            {
                PlayerActionLog log = new PlayerActionLog()
                {
                    UserName   = userName,
                    ActionType = actionType,
                    OperNumber = operNumber,
                    Time       = DateTime.Now,
                    Remark     = remark
                };

                lock (this._lockList)
                {
                    if (list.Count >= maxListCount)
                    {
                        list.RemoveRange(0, 10);
                    }
                    list.Add(log);
                }

                if (PlayerActionAdded != null)
                {
                    PlayerActionAdded();
                }
            }
            catch (Exception exc)
            {
                LogHelper.Instance.AddErrorLog("Add PlayerAction Controller Exception. UserName="******", ActionType=" + actionType.ToString() + ", operNumber=" + operNumber.ToString()
                                               + ", remark=" + remark, exc);
            }
        }
Exemplo n.º 2
0
        private bool JudgeLogExists(PlayerActionLog newLog)
        {
            bool isExists = false;

            for (int i = 0; i < this.ListPlayerActionLog.Count; i++)
            {
                var oldLog = this.ListPlayerActionLog[i];
                if (oldLog.Time < newLog.Time)
                {
                    isExists = false;
                    break;
                }
                if (oldLog.Time == newLog.Time)
                {
                    if (oldLog.ParentObject.UserName == newLog.UserName &&
                        oldLog.ParentObject.ActionType == newLog.ActionType &&
                        oldLog.ParentObject.OperNumber == newLog.OperNumber &&
                        oldLog.ParentObject.Remark == newLog.Remark)
                    {
                        isExists = true;
                        break;
                    }
                }
            }

            return(isExists);
        }
Exemplo n.º 3
0
 public PlayerActionLogUIModel(PlayerActionLog parent)
 {
     this._parentObject = parent;
 }