static TemplateStorage()
        {
            if (ServerContextBase.StoragePath == null)
            {
                ServerContextBase.LoadConstants();
            }

            StoragePath = $@"{ServerContextBase.StoragePath}\templates";

            var tmp = new T();

            StoragePath = Path.Combine(StoragePath, "%");

            if (tmp is SkillTemplate)
            {
                StoragePath = StoragePath.Replace("%", "Skills");
            }

            if (tmp is SpellTemplate)
            {
                StoragePath = StoragePath.Replace("%", "Spells");
            }

            if (tmp is MonsterTemplate)
            {
                StoragePath = StoragePath.Replace("%", "Monsters");
            }

            if (tmp is ItemTemplate)
            {
                StoragePath = StoragePath.Replace("%", "Items");
            }

            if (tmp is MundaneTemplate)
            {
                StoragePath = StoragePath.Replace("%", "Mundanes");
            }

            if (tmp is WorldMapTemplate)
            {
                StoragePath = StoragePath.Replace("%", "WorldMaps");
            }

            if (tmp is Reactor)
            {
                StoragePath = StoragePath.Replace("%", "Reactors");
            }

            if (tmp is PopupTemplate)
            {
                StoragePath = StoragePath.Replace("%", "Popups");
            }


            if (!Directory.Exists(StoragePath))
            {
                Directory.CreateDirectory(StoragePath);
            }
        }
Пример #2
0
        static AreaStorage()
        {
            if (ServerContextBase.StoragePath == null)
            {
                ServerContextBase.LoadConstants();
            }

            StoragePath = $@"{ServerContextBase.StoragePath}\areas";

            if (!Directory.Exists(StoragePath))
            {
                Directory.CreateDirectory(StoragePath);
            }
        }
Пример #3
0
        static WarpStorage()
        {
            if (ServerContextBase.StoragePath == null)
            {
                ServerContextBase.LoadConstants();
            }

            StoragePath = $@"{ServerContextBase.StoragePath}\templates\warps";

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