示例#1
0
        public void AfterDeserialize()
        {
            var reader   = new Deserializer(inputDatas);
            var inputLen = reader.GetByte();

            _inputs = new Msg_PlayerInput[inputLen];
            for (byte i = 0; i < inputLen; i++)
            {
                var input = new Msg_PlayerInput();
                input.Tick    = tick;
                input.ActorId = i;
                _inputs[i]    = input;
                var len = reader.GetByte();
                if (len == 0)
                {
                    input.Commands = null;
                    continue;
                }

                input.Commands = new InputCmd[len];
                for (int cmdIdx = 0; cmdIdx < len; cmdIdx++)
                {
                    var cmd = new InputCmd();
                    cmd.Deserialize(reader);
                    input.Commands[cmdIdx] = cmd;
                }
            }

            _serverInputs = reader.GetBytes_255();
        }
示例#2
0
        public override void Deserialize(Deserializer reader)
        {
            tick = reader.GetUInt();
            var len = reader.GetInt();

            inputs = new Msg_PlayerInput[len];
            for (int i = 0; i < len; i++)
            {
                inputs[i] = new Msg_PlayerInput();
                inputs[i].Deserialize(reader);
            }
        }
 public bool Equals(Msg_PlayerInput other)
 {
     if (other == null)
     {
         return(false);
     }
     if (Tick != other.Tick)
     {
         return(false);
     }
     return(Commands.EqualsEx(other.Commands));
 }
 /// <summary>
 /// TODO     合并 输入
 /// </summary>
 /// <param name="inputb"></param>
 public void Combine(Msg_PlayerInput inputb)
 {
 }