Beispiel #1
0
        public override void Load()
        {
            Harmony.PatchAll();

            VersionsList.Add("Pets", Version, true);

            StandardPets.Load();
        }
Beispiel #2
0
        internal static void Register(XenoMod Mod)
        {
            Mod.InternalId = CurrentId;
            CurrentId++;

            ModsList.Add(Mod);
            Mods.Add(Mod.InternalId, Mod);
            VersionsList.Refresh();
        }
Beispiel #3
0
        public PackageDetailControl()
        {
            InitializeComponent();

            Loaded += (sender, args) =>
            {
                VersionsList.RegisterSort(nameof(IPackageVersion.Version), ListSortDirection.Descending);
                ReferencingPackages.RegisterSort("Value", nameof(IPackageVersion.Package), nameof(IPackage.Name));
                ReferencingProjects.RegisterSort("Value", nameof(IPackage.Name));
            };
        }
Beispiel #4
0
        public override void Load()
        {
            Harmony.PatchAll();

            VersionsList.Add("DreamTeam", Version, true);

            ServerUtils.AddRegion("LocalHost", "127.0.0.1");
            ServerUtils.AddRegion("InternalDreams", "13.69.244.214");
            ServerUtils.AddRegion("AmongDreams", "40.114.236.130");

            ServerUtils.AddLocalServer("LocalHost", "127.0.0.1");
            ServerUtils.AddLocalServer("Михаил", "26.35.19.189");
            ServerUtils.AddLocalServer("медичка", "26.71.226.160");
            ServerUtils.AddLocalServer("Gera", "26.37.40.219");
            ServerUtils.AddLocalServer("Белка", "26.91.123.129");
            ServerUtils.AddLocalServer("Гроза", "26.91.137.125");
            ServerUtils.AddLocalServer("Moon359", "26.102.69.175");
            ServerUtils.AddLocalServer("ALFox", "26.71.226.220");
        }
Beispiel #5
0
        public override void Load()
        {
            Harmony.PatchAll();

            ConfirmExtraRoles.Group = ER_GROUP;
            ShowExtraRoles.Group    = ER_GROUP;

            LanguageManager.Load(Assembly.GetExecutingAssembly(), "ExtraRoles.Lang.");
            Role.Load();
            VersionsList.Add("ExtraRoles", Version, true);

            CommandsController.Register(new WinCommand());

            HandleRpcPatch.AddListener(new RPCExtraRoles());

            EventsController.RESET_ALL.Register(() => {
                Role.ResetAll();
                KilledPlayers.Clear();
            });
        }
Beispiel #6
0
        /// <summary>
        ///     Parse a bukget plugin from the json result
        /// </summary>
        /// <param name="jsonCode"></param>
        /// <returns></returns>
        public BukgetPlugin(string jsonCode)
        {
            InitFields();
            if (string.IsNullOrEmpty(jsonCode))
            {
                throw new FormatException("Invalid JSON supplied: string is empty");
            }

            if (Equals(jsonCode, "[]"))
            {
                throw new FormatException("Invalid JSON supplied: array is empty");
            }
            // Load the string into a json object
            JsonObject json;

            // In case of an array, load the first entry
            try
            {
                if (jsonCode.StartsWith("["))
                {
                    json = (JsonObject)JsonConvert.Import <JsonArray>(jsonCode)[0];
                }
                else
                {
                    json = JsonConvert.Import <JsonObject>(jsonCode);
                }
            }
            catch (Exception exception)
            {
                throw new FormatException("Invalid JSON supplied: " + exception);
            }

            if (json["main"] != null)
            {
                Main = (string)json["main"];
            }


            if (json["plugin_name"] != null)
            {
                Name = (string)json["plugin_name"];
            }

            // If no name or mainspace, return
            if (string.IsNullOrEmpty(Main) || string.IsNullOrEmpty(Name))
            {
                return;
            }

            Logger.Log(LogLevel.Info, "BukGetAPI", "parsing plugin:" + Name, Main);

            // Slug
            if (json["slug"] != null)
            {
                Slug = (String)json["slug"];
            }
            // Description
            if (json["description"] != null)
            {
                Description = (String)json["description"];
            }
            // BukkitDev link
            if (json["dbo_page"] != null)
            {
                BukkitDevLink = (String)json["dbo_page"];
            }
            // Website
            if (json["link"] != null)
            {
                Website = (String)json["link"];
            }
            // Stage
            if (json["stage"] != null)
            {
                try
                {
                    Status = (PluginStatus)Enum.Parse(typeof(PluginStatus), json["stage"].ToString());
                }
                catch (Exception e)
                {
                    Logger.Log(LogLevel.Warning, "BukgetV3", "Couldn't parse plugin status", e.Message);
                }
            }
            // Authors
            AuthorsList = JsonParser.ParseJsonStringList(json["authors"]);

            // Categories
            // load strings
            List <String> categories = JsonParser.ParseJsonStringList(json["categories"]);

            // convert to enum values
            foreach (string category in categories)
            {
                CategoryList.Add((PluginCategory)Enum.Parse(typeof(PluginCategory), category));
            }

            // Versions
            IEnumerable <JsonObject> versions = JsonParser.ParseJsonObjectList(json["versions"]);

            foreach (JsonObject jsonObject in versions)
            {
                BukgetPluginVersion v = new BukgetPluginVersion(this, jsonObject.ToString());
                if (v.VersionNumber != null)
                {
                    VersionsList.Add(v);
                }
            }
            LastParsedPlugin = this;
        }