Иконка ресурса

FREE WFakeOnline : 0.0.1 0.0.1

Нет прав для скачивания
C#:
using System.Collections.Generic;
using System;
using System.Linq;

using Steamworks;
using Oxide.Core.Plugins;
using System.Reflection;
using Newtonsoft.Json;
using UnityEngine;
using ProtoBuf;
using Oxide.Core;

namespace Oxide.Plugins
{
    [Info("Fake Online", "https://discord.gg/jb5puPzmnY", "0.0.1")]
    class WFakeOnline : RustPlugin
    {
        private class Configuration
        {
            
            [JsonProperty("'Time': Online")]
            public Dictionary<Int32, Int32> ManualTimeOnline = new Dictionary<Int32, Int32>();

            public static Configuration Generate()
            {
                return new Configuration
                {
                    
                    ManualTimeOnline = new Dictionary<int, int>
                    {
                        [00] = 3,
                        [01] = 3,
                        [02] = 3,
                        [03] = 3,
                        [04] = 2,
                        [05] = 2,
                        [06] = 5,
                        [07] = 4,
                        [08] = 5,
                        [09] = 7,
                        [10] = 7, 
                        [11] = 8,
                        [12] = 12,
                        [13] = 13,
                        [14] = 16,
                        [15] = 19,
                        [16] = 20,
                        [17] = 21,
                        [18] = 24,
                        [19] = 27,
                        [20] = 29,
                        [21] = 22,
                        [22] = 15,
                        [23] = 7,
                    }
                };
            }
        }
        private static Configuration Settings;

        protected override void LoadConfig()
        {
            base.LoadConfig();
            try
            {
                Settings = Config.ReadObject<Configuration>();
            }
            catch
            {
                PrintWarning($"Error reading config, creating one new config!");
                LoadDefaultConfig();
            }

            SaveConfig();
        }

        protected override void LoadDefaultConfig() => Settings = Configuration.Generate();
        protected override void SaveConfig() => Config.WriteObject(Settings);
        public int FakeOnline = 0;
        private Timer timerGenerateOnline;
        
        public class FakePlayer
        {
            public String UserID;
            public string DisplayName;
        }
        void OnServerInitialized()
        {
            timerGenerateOnline = timer.Every(20, () =>
            {
                Int32 Time = DateTime.Now.Hour;
                Int32 ManualOnline = Settings.ManualTimeOnline.ContainsKey(Time) ? Settings.ManualTimeOnline[Time] : 0;
                FakeOnline = ManualOnline;
                IOnUpdateServerInformation(FakeOnline);
            });
        }
        void Unload()
        {
            if (timerGenerateOnline != null && !timerGenerateOnline.Destroyed)
                timerGenerateOnline.Destroy();
        }
        
        private void IOnUpdateServerInformation(int count)
        {
            int pirateOnline = count;
            for (var i = 0; i < BasePlayer.activePlayerList.Count; i++)
            {
                  pirateOnline++;
            }
            string newTagsLine = "";
            string[] tags = SteamServer.GameTags.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (var i = 0; i < tags.Length; i++)
            {
                if (tags[i].Substring(0, 2) == "cp")
                {
                    newTagsLine += (newTagsLine.Length > 0 ? "," : "") + "cp" + (BasePlayer.activePlayerList.Count - pirateOnline);
                }
                else
                {
                    newTagsLine += (newTagsLine.Length > 0 ? "," : "") + tags[i];
                }
            }

            newTagsLine += $",ai{pirateOnline},fl{BasePlayer.activePlayerList.Count},kkk";
            SteamServer.GameTags = newTagsLine;
        }



        int GetOnline() => FakeOnline;

    }
}

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок
Сверху