Ejemplo n.º 1
0
        public void AfterDeserialize()
        {
            var reader   = new Deserializer(inputDatas);
            var inputLen = reader.ReadByte();

            _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.ReadByte();
                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.ReadBytes_255();
        }
Ejemplo n.º 2
0
 public bool Equals(Msg_PlayerInput other)
 {
     if (other == null)
     {
         return(false);
     }
     if (Tick != other.Tick)
     {
         return(false);
     }
     return(Commands.EqualsEx(other.Commands));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// TODO     合并 输入
 /// </summary>
 /// <param name="inputb"></param>
 public void Combine(Msg_PlayerInput inputb)
 {
 }
Ejemplo n.º 4
0
 public void SendInput(Msg_PlayerInput msg)
 {
     SendUdp(EMsgSC.C2G_PlayerInput, msg);
 }