新增相关协议
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
using NB.Game;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class G2S_EnterRequestHandler : RouteRPC<Scene, G2S_EnterRequest, S2G_EnterResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, G2S_EnterRequest request, S2G_EnterResponse response,
|
||||
Action reply)
|
||||
{
|
||||
var roleId = request.Role.RoleId;
|
||||
Log.Debug($"收到 G2S_EnterRequestHandler {roleId}");
|
||||
|
||||
// 在缓存中检查该账号是否存在
|
||||
var chatUnitManageComponent = scene.GetComponent<SocialUnitManageComponent>();
|
||||
var account = await chatUnitManageComponent.Online(scene, request.Role, request.GateRouteId);
|
||||
|
||||
response.RoleRouteId = account.RuntimeId;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class G2S_ExitRequestHandler : RouteRPC<Scene, G2S_ExitRequest, S2G_ExitResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, G2S_ExitRequest request, S2G_ExitResponse response,
|
||||
Action reply)
|
||||
{
|
||||
// 在缓存中检查该账号是否存在
|
||||
var chatUnitManageComponent = scene.GetComponent<SocialUnitManageComponent>();
|
||||
await chatUnitManageComponent.Offline(scene, request.AccountId, request.GateRouteId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user