Esempio n. 1
0
 /// <summary>
 /// 从收到的玩家数据合并到帧行为
 /// 主线程调用
 /// </summary>
 internal void HandleFrameAction(ulong gcNID, Protos.GC2BS_FrameAction action)
 {
     lock (this._gcNIDToAction)
     {
         FrameAction frameAction = this._gcNIDToAction[gcNID];
         frameAction.AddAction(action);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 合并Action
        /// 在两个关键帧之间所有的输入都需要合并
        /// 合并规则是:相同标志位的,后者覆盖前者,不同标志位则使用并操作
        /// 例如:在第n帧输入方向,n+1帧输入skill1,n+2帧再次输入方向,则最终结果是采用n+2帧的方向和skill1
        /// </summary>
        public void AddAction(Protos.GC2BS_FrameAction action)
        {
            if (this._actions.Count == MAX_ACTION)
            {
                return;
            }
            int count = action.Infos.Count;

            for (int i = 0; i < count; i++)
            {
                this._actions.Add(action.Infos[i]);
                if (this._actions.Count == MAX_ACTION)
                {
                    break;
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 处理玩家提交的帧行为
 /// </summary>
 internal void HandleFrameAction(ulong gcNID, Protos.GC2BS_FrameAction message) => this._frameActionMgr.HandleFrameAction(gcNID, message);
Esempio n. 4
0
 /// <summary>
 /// 处理玩家提交的帧行为
 /// </summary>
 internal void HandleFrameAction(ulong gcNID, Battle battle, Protos.GC2BS_FrameAction message) =>
 battle.HandleFrameAction(gcNID, message);