Esempio n. 1
0
        public void send_key_commands(scheduled_movement t)
        {
            NetOutgoingMessage m = udp_client.CreateMessage();

            m.Write((byte)7);
            m.Write((byte)Exilania.game_my_user_id);
            t.send_movement(m);
            udp_client.SendMessage(m, NetDeliveryMethod.UnreliableSequenced, 2);
        }
Esempio n. 2
0
        public void relay_key_commands(NetIncomingMessage p, Display d, World w)
        {
            int player_id        = p.ReadByte();
            scheduled_movement t = new scheduled_movement(p);

            if (player_id != Exilania.game_my_user_id)
            {
                w.players[player_id].avatar.input.movement_schedule.Add(t);
            }
            NetOutgoingMessage i = udp_server.CreateMessage();

            i.Write((byte)7);
            i.Write((byte)player_id);
            i.WriteTime(true);
            i.Write(w.world_time);
            t.send_movement(i);
            udp_server.SendToAll(i, p.SenderConnection, NetDeliveryMethod.ReliableSequenced, 2);
        }