CTT/Server/Hotfix/Game/System/Account/AppConfigSystem.cs

42 lines
1010 B
C#
Executable File

using System;
using System.Collections.Generic;
using System.IO;
namespace ET
{
public class AppConfigAwakeSystem : AwakeSystem<AppConfig>
{
public override void Awake(AppConfig self)
{
self.Awake();
}
}
public class AppConfigLoadSystem : LoadSystem<AppConfig>
{
public override void Load(AppConfig self)
{
self.Load();
}
}
public static class AppConfigSystem
{
public static void Awake(this AppConfig self)
{
self.Load();
}
public static void Load(this AppConfig self)
{
self.AwakeAsync().Coroutine();
}
private static async ETVoid AwakeAsync(this AppConfig self)
{
string path = "../Config/AppConfig.txt";
string str = await File.ReadAllTextAsync(path);
AppConfigInfo appConfigInfo = MongoHelper.FromJson<AppConfigInfo>(str);
AppConfig.inst = appConfigInfo;
}
}
}