public void Start(string[] args) { int AutoKeyLocalId = -1; for (int i = 0; i < args.Length; ++i) { switch (args[i]) { case "-AutoKeyLocalId": AutoKeyLocalId = int.Parse(args[++i]); break; } } LoadConfig(); var config = global::Zeze.Config.Load(); if (AutoKeyLocalId != -1) { config.AutoKeyLocalId = AutoKeyLocalId; // replace from args } Create(config); ProviderModuleBinds = ProviderModuleBinds.Load(); ProviderModuleBinds.BuildStaticBinds(Modules, Zeze.Config.AutoKeyLocalId, StaticBinds); StartModules(); // 启动模块,装载配置什么的。 Zeze.Start(); // 启动数据库 StartService(); // 启动网络 ServiceManagerAgent = new Zeze.Services.ServiceManager.Agent(config, (agent) => { foreach (var staticBind in StaticBinds) { agent.RegisterService($"{GameServerServiceNamePrefix}{staticBind.Key}", config.AutoKeyLocalId.ToString()); } agent.SubscribeService(GameLinkdServiceName, global::Zeze.Services.ServiceManager.SubscribeInfo.SubscribeTypeSimple); }, (subscribeState) => { Server.ApplyLinksChanged(subscribeState.ServiceInfos); }); Load.StartTimerTask(); }
public Module(XmlElement self) { FullName = self.GetAttribute("name"); ChoiceType = GetChoiceType(self); ProviderModuleBinds.SplitIntoSet(self.GetAttribute("providers"), Providers); }