Exemplo n.º 1
0
        /// <summary>
        /// Binds new information to an existing vehicle
        /// </summary>
        static public void Object_VehicleBind(IEnumerable <Player> p, Vehicle vehicle1, Vehicle vehicle2)
        {               //Prepare the packet
            SC_BindVehicle bind = new SC_BindVehicle();

            bind.Vehicle1 = vehicle1;
            bind.Vehicle2 = vehicle2;

            //Send to recipient
            foreach (Player player in p)
            {
                player._client.sendReliable(bind);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Binds new information to an existing vehicle
        /// </summary>
        static public void Object_VehicleBind(IEnumerable <Player> p, Vehicle vehicle)
        {               //Prepare the packet
            SC_BindVehicle bind = new SC_BindVehicle();

            bind.Vehicle1 = vehicle;
            bind.Vehicle2 = ((vehicle._inhabitant == null) ? null : vehicle._inhabitant._baseVehicle);

            //Send to recipient
            foreach (Player player in p)
            {
                player._client.sendReliable(bind);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Binds new information to an existing vehicle
        /// </summary>
        static public void Object_VehicleBind(IEnumerable <Player> p,
                                              Vehicle vehicle1, Vehicle vehicle2, Action completionCallback)
        {               //Prepare the packet
            SC_BindVehicle bind = new SC_BindVehicle();

            bind.Vehicle1 = vehicle1;
            bind.Vehicle2 = vehicle2;

            //Send to recipient
            foreach (Player player in p)
            {                   //If this is the player's new vehicle, watch for completion
                if (vehicle1._inhabitant == player)
                {
                    player._client.sendReliable(bind, completionCallback);
                }
                else
                {
                    player._client.sendReliable(bind);
                }
            }
        }