Ejemplo n.º 1
0
 public void PushKeyEvent(MeteorMsg.Command command, int playerId, EKeyList key)
 {
     //GameFrames t = GetFrame(FrameReplay.Instance.NextTurn);
     //for (int i = 0; i < t.commands.Count; i++)
     //{
     //    if ((t.commands[i].command == MeteorMsg.Command.KeyDown ||
     //        t.commands[i].command == MeteorMsg.Command.KeyUp ||
     //        t.commands[i].command == MeteorMsg.Command.KeyLast) &&
     //        playerId == t.commands[i].playerId &&
     //        t.commands[i].LogicFrame == (uint)FrameReplay.Instance.LogicFrameIndex &&
     //        (uint)key == (uint)t.commands[i].data[0])
     //    {
     //        //Debug.LogError("同一帧同一个按键无法响应2次???");
     //        return;
     //    }
     //}
     //FrameCommand cmd = new FrameCommand();
     //cmd.command = command;
     //cmd.LogicFrame = (uint)FrameReplay.Instance.LogicFrameIndex;
     //cmd.playerId = (uint)playerId;
     //cmd.data = new byte[1];
     //cmd.data[0] = (byte)key;
     //t.commands.Add(cmd);
 }
Ejemplo n.º 2
0
 //在下一帧立即发出指令不要等同步
 public void NetEvent <T>(MeteorMsg.Command cmd, T req)
 {
     KcpClient.Ins.Exec((int)cmd, req);
 }