static MetafileManager()
        {
            var files = Directory.GetFiles(Path.Combine(ServerContext.StoragePath, "metafile"));

            Metafiles = new MetafileCollection(short.MaxValue);

            foreach (var file in files)
            {
                var metaFile = CompressableObject.Load <Metafile>(file);

                if (metaFile.Name.StartsWith("SEvent"))
                {
                    continue;
                }

                if (metaFile.Name.StartsWith("SClass"))
                {
                    continue;
                }

                if (metaFile.Name.StartsWith("ItemInfo"))
                {
                    continue;
                }

                Metafiles.Add(metaFile);
            }

            CreateFromTemplates();
            LoadQuestDescriptions();
        }
Exemple #2
0
        //TODO : finish implementation.
        //Note to self: remove *.defalted, uncomment the save and use this to handle the meta information.
        static MetafileManager()
        {
            var path = new FileInfo(Path.Combine(ServerContext.StoragePath, "metafile")).FullName;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }


            var files = Directory.GetFiles(path, "*.deflated", SearchOption.TopDirectoryOnly);

            if (files.Length > 0)
            {
                metafiles = new MetafileCollection(files.Length);
                {
                    foreach (var file in files)
                    {
                        var mf = CompressableObject.Load <Metafile>(file, true);
                        mf.Name = mf.Name.Replace(".deflated", string.Empty).Trim();

                        if (mf.Name.StartsWith("NationDesc"))
                        {
                            mf.Nodes = new System.Collections.ObjectModel.Collection <MetafileNode>
                            {
                                new MetafileNode("nation_1", "Lorule"),
                                new MetafileNode("nation_2", "Lividia"),
                                new MetafileNode("nation_3", "Exiles")
                            };
                        }

                        if (mf.Name.StartsWith("SClass"))
                        {
                            mf.Nodes = new System.Collections.ObjectModel.Collection <MetafileNode>
                            {
                                new MetafileNode("Skill")
                            };

                            foreach (var skill in ServerContext.GlobalSkillTemplateCache)
                            {
                                if (skill.Value.Prerequisites != null)
                                {
                                    var nmf = new MetafileNode(skill.Key, skill.Value.Prerequisites.MetaData);
                                    mf.Nodes.Add(nmf);
                                }
                            }
                            mf.Nodes.Add(new MetafileNode("Skill_End"));
                            mf.Nodes.Add(new MetafileNode(""));
                        }


                        //CompressableObject.Save(file, mf);

                        metafiles.Add(mf);
                    }
                }
            }
        }
Exemple #3
0
        static MetafileManager()
        {
            var files = Directory.GetFiles(Path.Combine(ServerContext.StoragePath, "metafile"));

            metafiles = new MetafileCollection(files.Length);

            foreach (var file in files)
            {
                metafiles.Add(
                    CompressableObject.Load <Metafile>(file, true));
            }
        }
        static MetafileManager()
        {
            var files = Directory.GetFiles($"{ServerContext.STORAGE_PATH}/metafile/");

            metafiles = new MetafileCollection(files.Length);

            foreach (var file in files)
            {
                metafiles.Add(
                    CompressableObject.Load <Metafile>(file, true));
            }
        }