예제 #1
0
파일: Player.cs 프로젝트: trjate/Infantry
        /// <summary>
        /// Notifies a group of players of a player kill
        /// </summary>
        static public void Player_RouteKill(
            IEnumerable <Player> p, CS_VehicleDeath death, Player dead,
            int cash, int points, int personalPoints, int experience)
        {               //Prepare a death packet
            SC_VehicleDeath not = new SC_VehicleDeath();

            not.type = death.type;

            not.playerID  = dead._id;
            not.vehicleID = (dead._occupiedVehicle == null ? dead._id : dead._occupiedVehicle._id);
            not.killerID  = death.killerPlayerID;
            not.positionX = death.positionX;
            not.positionY = death.positionY;
            not.yaw       = dead._state.yaw;

            not.points         = (short)points;
            not.personalCash   = (short)cash;
            not.personalPoints = (short)personalPoints;
            not.personalExp    = (short)experience;

            //Send it to each player
            foreach (Player player in p)
            {
                player._client.sendReliable(not);
            }
        }
예제 #2
0
    {           // Member Classes
        //////////////////////////////////////////////////


        ///////////////////////////////////////////////////
        // Member Functions
        //////////////////////////////////////////////////
        /// <summary>
        /// Notifies a player of a vehicle death
        /// </summary>
        static public void Vehicle_RouteDeath(
            Player p, Player killer, Vehicle dead, Player occupier)
        {               //Prepare a death packet
            SC_VehicleDeath not = new SC_VehicleDeath();

            not.type = KillType.Player;

            not.playerID  = (occupier == null) ? (ushort)0 : occupier._id;
            not.vehicleID = dead._id;
            not.killerID  = (killer == null) ? 0 : (uint)killer._id;
            not.positionX = dead._state.positionX;
            not.positionY = dead._state.positionY;
            not.yaw       = dead._state.yaw;

            //Send it to each player
            p._client.sendReliable(not);
        }