水电费
This commit is contained in:
38
Hotfix/OnSceneCreate_Init.cs
Normal file
38
Hotfix/OnSceneCreate_Init.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Authentication;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Authentication;
|
||||
using Fantasy.Event;
|
||||
using Fantasy.Gate;
|
||||
|
||||
namespace System;
|
||||
|
||||
public class OnSceneCreate_Init : AsyncEventSystem<OnCreateScene>
|
||||
{
|
||||
protected override async FTask Handler(OnCreateScene self)
|
||||
{
|
||||
var scene = self.Scene;
|
||||
|
||||
switch (scene.SceneType)
|
||||
{
|
||||
case SceneType.Authentication:
|
||||
{
|
||||
// 用于鉴权服务器注册和登录相关逻辑的组件
|
||||
scene.AddComponent<AuthenticationComponent>().UpdatePosition();
|
||||
// 用于颁发ToKen证书相关的逻辑。
|
||||
scene.AddComponent<AuthenticationJwtComponent>();
|
||||
break;
|
||||
}
|
||||
case SceneType.Gate:
|
||||
{
|
||||
// 用于验证JWT是否合法的组件
|
||||
scene.AddComponent<GateJWTComponent>();
|
||||
// 用于管理GameAccount的组件
|
||||
scene.AddComponent<GameAccountManageComponent>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user