| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Net;
- namespace ET
- {
- public class AppStart_Init: AEvent<EventType.AppStart>
- {
- public override async ETTask Run(EventType.AppStart args)
- {
- Game.Scene.AddComponent<ConfigComponent>();
-
- ConfigComponent.GetAllConfigBytes = LoadConfigHelper.LoadAllConfigBytes;
- await ConfigComponent.Instance.LoadAsync();
- StartProcessConfig processConfig = StartProcessConfigCategory.Instance.Get(Game.Options.Process);
-
- 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<NetThreadComponent>();
- Game.Scene.AddComponent<NetInnerComponent, IPEndPoint>(processConfig.InnerIPPort);
-
- var processScenes = StartSceneConfigCategory.Instance.GetByProcess(Game.Options.Process);
- foreach (StartSceneConfig startConfig in processScenes)
- {
- await SceneFactory.Create(Game.Scene, startConfig.SceneId, startConfig.Zone, startConfig.Name, startConfig.Type, startConfig);
- }
- }
- }
- }
|