Eintoo/GameServer/Server/Hotfix/OnCreateScene_InitEvent.cs

32 lines
970 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Fantasy;
using Fantasy.Async;
using Fantasy.Event;
public class OnCreateScene_InitEvent : AsyncEventSystem<OnCreateScene>
{
protected override async FTask Handler(OnCreateScene self)
{
var scene = self.Scene;
switch (scene.SceneType)
{
case SceneType.Authentication:
scene.AddComponent<AuthenticationComponent>();
scene.AddComponent<AuthenticationJWTComponent>();
Log.Debug("初始化鉴权服务器组件");
break;
case SceneType.Gate:
scene.AddComponent<GateComponent>();
scene.AddComponent<GateJWTComponent>();
Log.Debug("初始网关Gate服务器组件");
break;
case SceneType.Chat:
scene.AddComponent<ChatManagementComponent>();
break;
}
await FTask.CompletedTask;
}
}