public LazynetAppManager Builder() { try { // 获取配置文件配置 var configInfo = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true) .Build(); var luaScriptConfiguration = configInfo.GetSection("Script"); // 配置参数 this.Context = new LazynetAppContext(); this.Context.Config = new LazynetAppConfig(); // 初始化 this.Context.Timer = new LazynetTimerManager(); // log this.Context.Logger = new LazynetLogger("log4net.config"); // 服务 this.Context.ActionProxy = new LazynetActionProxy(this.Context); // lua this.Context.Lua = new LazynetLua(); this.Context.Lua.DoFile(luaScriptConfiguration["MainFile"], luaScriptConfiguration["RootDir"]); } catch (Exception ex) { this.Context.Log(LazynetLogLevel.Error, ex.ToString()); } return(this); }
public LazynetAppServerHandler(LazynetAppContext context) { this.Context = context; }
public LazynetAppServer(LazynetAppContext context) { this.Context = context; this.Client = new LazynetClient(this.Context.Config); }