完成离线消息发送和上线获取离线消息
This commit is contained in:
22
Hotfix/Chat/Handler/Inner/G2Chat_EnterRequestHandler.cs
Normal file
22
Hotfix/Chat/Handler/Inner/G2Chat_EnterRequestHandler.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
using NB.Game;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class G2Chat_EnterRequestHandler : RouteRPC<Scene, G2Chat_EnterRequest, Chat2G_EnterResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, G2Chat_EnterRequest request, Chat2G_EnterResponse response,
|
||||
Action reply)
|
||||
{
|
||||
var roleId = request.Role.RoleId;
|
||||
Log.Debug($"收到 G2Chat_EnterRequestHandler {roleId}");
|
||||
|
||||
// 在缓存中检查该账号是否存在
|
||||
var chatUnitManageComponent = scene.GetComponent<ChatUnitManageComponent>();
|
||||
var account = await chatUnitManageComponent.Online(scene, request.Role, request.GateRouteId);
|
||||
|
||||
response.RoleRouteId = account.RuntimeId;
|
||||
}
|
||||
}
|
||||
16
Hotfix/Chat/Handler/Inner/G2Chat_ExitRequestHandler.cs
Normal file
16
Hotfix/Chat/Handler/Inner/G2Chat_ExitRequestHandler.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class G2Chat_ExitRequestHandler : RouteRPC<Scene, G2Chat_ExitRequest, Chat2G_ExitResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, G2Chat_ExitRequest request, Chat2G_ExitResponse response,
|
||||
Action reply)
|
||||
{
|
||||
// 在缓存中检查该账号是否存在
|
||||
var chatUnitManageComponent = scene.GetComponent<ChatUnitManageComponent>();
|
||||
await chatUnitManageComponent.Offline(scene, request.AccountId, request.GateRouteId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user