2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
using System.Collections.Generic;
|
2021-04-08 20:09:59 +08:00
|
|
|
using System.Net;
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
{
|
|
|
|
public class AppStartEvent: AEvent<EventType.AppStart>
|
|
|
|
{
|
|
|
|
|
|
|
|
public override async ETTask Run(EventType.AppStart a)
|
|
|
|
{
|
|
|
|
ConfigComponent configComponent = Game.Scene.AddComponent<ConfigComponent>();
|
|
|
|
Options options = Game.Options;
|
|
|
|
Log.Info($"当前进程:{options.Process}");
|
|
|
|
StartProcessConfig processConfig = StartProcessConfigCategory.Instance.Get(options.Process);
|
|
|
|
|
|
|
|
StartZoneConfig startZoneConfig = StartZoneConfigCategory.Instance.Get(options.Process);
|
|
|
|
Game.Scene.AddComponent<DBComponent, string, string>(startZoneConfig.DBConnection, startZoneConfig.DBName);
|
|
|
|
|
|
|
|
Game.Scene.AddComponent<TimerComponent>();
|
|
|
|
Game.Scene.AddComponent<OpcodeTypeComponent>();
|
|
|
|
Game.Scene.AddComponent<MessageDispatcherComponent>();
|
|
|
|
|
|
|
|
|
|
|
|
Game.Scene.AddComponent<CoroutineLockComponent>();
|
|
|
|
// 发送普通actor消息
|
|
|
|
Game.Scene.AddComponent<ActorMessageSenderComponent>();
|
|
|
|
// 发送location actor消息
|
|
|
|
Game.Scene.AddComponent<ActorLocationSenderComponent>();
|
|
|
|
// 访问location server的组件
|
|
|
|
Game.Scene.AddComponent<LocationProxyComponent>();
|
|
|
|
Game.Scene.AddComponent<ActorMessageDispatcherComponent>();
|
|
|
|
// 数值订阅组件
|
|
|
|
Game.Scene.AddComponent<NumericWatcherComponent>();
|
|
|
|
// 控制台组件
|
|
|
|
Game.Scene.AddComponent<ConsoleComponent>();
|
|
|
|
|
|
|
|
Game.Scene.AddComponent<NetThreadComponent>();
|
|
|
|
Game.Scene.AddComponent<NetInnerComponent, IPEndPoint>(processConfig.InnerAddress);
|
|
|
|
|
|
|
|
//!自定义组件
|
|
|
|
Game.Scene.AddComponent<AppConfig>();
|
|
|
|
Game.Scene.AddComponent<Notice>();
|
|
|
|
Game.Scene.AddComponent<MainStoryAIComponent>();
|
2021-04-15 00:12:07 +08:00
|
|
|
Game.Scene.AddComponent<TestComponent>();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
List<StartSceneConfig> processScenes = StartSceneConfigCategory.Instance.GetByProcess(Game.Options.Process);
|
2021-04-08 20:09:59 +08:00
|
|
|
foreach (StartSceneConfig startConfig in processScenes)
|
|
|
|
{
|
|
|
|
Scene scene = await SceneFactory.Create(Game.Scene, startConfig.SceneId, startConfig.Zone, startConfig.Name, startConfig.Type, startConfig);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|