Пример #1
0
 public void Airdrop(int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDrop();
     }
 }
Пример #2
0
 public void AirdropAt(float x, float y, float z, int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDropAt(new Vector3(x, y, z));
     }
 }
Пример #3
0
 /// <summary>
 /// Calls an airdrop to the target vector 'rep' times.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="rep"></param>
 public void AirdropAtOriginal(Vector3 target, int rep = 1)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDropAt(target);
     }
 }
Пример #4
0
 public void AirdropAtPlayer(Player p, int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         SupplyDropZone.CallAirDropAt(p.Location);
     }
 }
Пример #5
0
 /// <summary>
 /// Calls an airdrop N times.
 /// </summary>
 /// <param name="rep"></param>
 public void Airdrop(int rep)
 {
     for (int i = 0; i < rep; i++)
     {
         Vector3 rpog = SupplyDropZone.GetRandomTargetPos();
         SupplyDropZone.CallAirDropAt(rpog);
     }
 }
Пример #6
0
        public void Airdrop(int rep)
        {
            Contract.Requires(rep >= 0);

            for (int i = 0; i < rep; i++)
            {
                SupplyDropZone.CallAirDrop();
            }
        }
Пример #7
0
    static void airdrop_begin()
    {
        int count = int.Parse(rustpp.config.GetSetting("Settings", "amount_of_airdrops"));

        for (int i = 0; i < count; i++)
        {
            SupplyDropZone.CallAirDrop();
        }
    }
Пример #8
0
        private static void airdrop_begin()
        {
            int num = int.Parse(Core.config.GetSetting("Settings", "amount_of_airdrops"));

            for (int i = 0; i < num; i++)
            {
                SupplyDropZone.CallAirDrop();
            }
        }
Пример #9
0
        public void AirdropAtPlayer(Fougerite.Player p, int rep)
        {
            Contract.Requires(p != null);
            Contract.Requires(rep >= 0);

            for (int i = 0; i < rep; i++)
            {
                SupplyDropZone.CallAirDropAt(p.Location);
            }
        }
Пример #10
0
        public void Airdrop(int rep)
        {
            System.Random rand = new System.Random();
            Vector3       rpog;

            for (int i = 0; i < rep; i++)
            {
                RandomPointOnGround(ref rand, out rpog);
                SupplyDropZone.CallAirDropAt(rpog);
            }
        }
Пример #11
0
        void cmdAirdrop(NetUser netUser, string command, string[] args)
        {
            ulong netUserID = netUser.userID;

            if (!(netUser.CanAdmin() || permission.UserHasPermission(netUserID.ToString(), permissionCanCallAirdrop)))
            {
                rust.Notice(netUser, lang.GetMessage("NoPermission", this), lang.GetMessage("FailureIcon", this));
                return;
            }

            if (args.Length == 0 || args == null)
            {
                SupplyDropZone.CallAirDrop();

                rust.Notice(netUser, lang.GetMessage("SuccessAirdropCalledNotice", this), lang.GetMessage("SuccessIcon", this));

                Puts($"{lang.GetMessage("SuccessAirdropCalledBroadcast", this)} {netUser.displayName}.");

                return;
            }

            if (args.Length == 1)
            {
                int amount;

                if (!(Int32.TryParse(args[0], out amount)))
                {
                    rust.Notice(netUser, lang.GetMessage("InvalidInteger", this), lang.GetMessage("FailureIcon", this));
                    return;
                }

                timer.Repeat(0, amount, () => SupplyDropZone.CallAirDrop());

                rust.Notice(netUser, $"{amount} {lang.GetMessage("SuccessAirdropsCalledNotice", this)}", lang.GetMessage("SuccessIcon", this));

                Puts($"{amount} {lang.GetMessage("SuccessAirdropsCalledBroadcast", this)} {netUser.displayName}.");

                return;
            }

            return;
        }
Пример #12
0
        public void AirdropAt(Vector3 target, int rep)
        {
            Vector3 original = target;

            System.Random rand = new System.Random();
            int           r, reset;

            r = reset = 20;
            for (int i = 0; i < rep; i++)
            {
                r--;
                if (r == 0)
                {
                    r      = reset;
                    target = original;
                }
                target.y = original.y + rand.Next(-5, 20) * 20;
                SupplyDropZone.CallAirDropAt(target);
                Jitter(ref target);
            }
        }
Пример #13
0
        void cmdChatBan(NetUser netuser, string command, string[] args)
        {
            if (!hasAccess(netuser, "canairdrop"))
            {
                SendReply(netuser, notAllowed); return;
            }

            // CALL 1 AIRDROP
            if (args.Length == 0)
            {
                SendReply(netuser, calledAirdrop); SupplyDropZone.CallAirDrop(); return;
            }


            // CANCEL ALL AIRDROPS
            if (args.Length == 1 && args[0].ToString() == "cancel")
            {
                int planenumber = 0;
                foreach (SupplyDropPlane plane in UnityEngine.Resources.FindObjectsOfTypeAll <SupplyDropPlane>())
                {
                    if (plane.gameObject.name == "C130")
                    {
                        continue;
                    }
                    planenumber++;
                    plane.NetDestroy();
                }
                SendReply(netuser, string.Format(cancelledAirdrop, planenumber.ToString()));
                return;
            }

            // DESTROY ALL SUPPLY CRATES
            if (args.Length == 1 && args[0].ToString() == "destroy")
            {
                int cratenumber = 0;
                foreach (SupplyCrate crate in UnityEngine.Resources.FindObjectsOfTypeAll <SupplyCrate>())
                {
                    if (crate.gameObject.name == "SupplyCrate")
                    {
                        continue;
                    }
                    cratenumber++;
                    NetCull.Destroy(crate.gameObject);
                }
                SendReply(netuser, string.Format(destroyedCrates, cratenumber.ToString()));
                return;
            }

            // CALL MASS AIRDROP
            int number;

            if (args.Length == 1 && int.TryParse(args[0], out number))
            {
                SendReply(netuser, string.Format(massAirdrop, number.ToString()));
                for (int i = 0; i < number; i++)
                {
                    SupplyDropZone.CallAirDrop();
                }
                return;
            }

            // CALL AN AIRDROP ON POSITION
            float x;
            float z;

            if (args.Length > 1 && float.TryParse(args[0], out x))
            {
                if (args.Length == 2)
                {
                    float.TryParse(args[1], out z);
                }
                else
                {
                    float.TryParse(args[2], out z);
                }

                if (z != default(float))
                {
                    cachedPos = new Vector3(x, 0f, z);
                    SupplyDropZone.CallAirDropAt(cachedPos);
                    SendReply(netuser, string.Format(airdropPos, cachedPos.ToString()));
                }
                return;
            }

            // CALL AN AIRDROP TO A PLAYER POSITION
            NetUser targetuser = rust.FindPlayer(args[0]);

            if (targetuser != null)
            {
                cachedPos = targetuser.playerClient.lastKnownPosition;
                if (cachedPos != default(Vector3))
                {
                    SupplyDropZone.CallAirDropAt(cachedPos);
                    SendReply(netuser, string.Format(airdropPlayer, cachedPos.ToString(), targetuser.playerClient.userName.ToString()));
                }
                return;
            }


            SendReply(netuser, wrongarguments);
        }
Пример #14
0
 public static void DoAirdropEvent()
 {
     if (!Events.bool_2)
     {
         Events.bool_2 = true;
         int tickCount = Environment.TickCount;
         if (Core.Airdrop && Core.AirdropPlanes > 0 && NetCull.connections.Length >= airdrop.min_players)
         {
             bool flag = false;
             int  num  = (int)Math.Abs(EnvironmentControlCenter.Singleton.GetTime());
             if (Core.AirdropInterval && (long)Environment.TickCount >= Events.AirdropNextTime)
             {
                 if (Events.AirdropLastTime != -1L)
                 {
                     flag = true;
                 }
                 Events.AirdropLastTime = (long)Environment.TickCount;
                 Events.AirdropNextTime = Events.AirdropLastTime + (long)(Core.AirdropIntervalTime * 1000);
                 if (server.log > 1)
                 {
                     Helper.Log("[Airdrop.Extended] A next call airdrop after " + Core.AirdropIntervalTime + " second(s).", true);
                 }
             }
             if (Core.AirdropDropTime)
             {
                 if (Events.AirdropNextHour == -1L && Core.AirdropDropTimeHours.Length > 0)
                 {
                     Events.AirdropNextDay = (long)(EnvironmentControlCenter.Singleton.sky.Cycle.Day + 1);
                     if (Core.AirdropDropTimeHours.Length > 2)
                     {
                         Events.AirdropNextHour = (long)Core.AirdropDropTimeHours.Length.Random(0);
                     }
                     else if (Core.AirdropDropTimeHours.Length > 1)
                     {
                         Events.AirdropNextHour = (long)UnityEngine.Random.Range(Core.AirdropDropTimeHours[0], Core.AirdropDropTimeHours[1]);
                     }
                     else
                     {
                         Events.AirdropNextHour = (long)Core.AirdropDropTimeHours[0];
                     }
                     if (server.log > 1)
                     {
                         Helper.Log("[Airdrop.Extended] A next call airdrop set on " + Events.AirdropNextHour + " h.", true);
                     }
                 }
                 else if (Events.AirdropNextHour == (long)num && (long)EnvironmentControlCenter.Singleton.sky.Cycle.Day >= Events.AirdropNextDay)
                 {
                     Events.AirdropNextHour = -1L;
                     flag = true;
                 }
             }
             if (flag)
             {
                 if (Core.AirdropAnnounce)
                 {
                     Broadcast.MessageAll(Config.GetMessage("Airdrop.Incoming", null, null));
                 }
                 for (int i = 0; i < Core.AirdropPlanes; i++)
                 {
                     SupplyDropZone.CallAirDrop();
                 }
             }
         }
         Events.bool_2 = false;
     }
 }
Пример #15
0
 public void AirdropAtOriginal(Vector3 target, int rep = 1)
 {
     SupplyDropZone.CallAirDropAt(target);
 }