Files
TEngine/Assets/GameScripts/DotNet/Logic/Handler/H_C2G_MessageRequestHandler.cs
ALEXTANG 0c8f3a5f92 [+] TEngineServer
[+] TEngineServer
2023-07-13 17:17:26 +08:00

18 lines
698 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.

#if TENGINE_NET
using TEngine.Core.Network;
using TEngine.Core;
namespace TEngine.Logic;
public class H_C2G_MessageRequestHandler : MessageRPC<H_C2G_MessageRequest,H_G2C_MessageResponse>
{
protected override async FTask Run(Session session, H_C2G_MessageRequest request, H_G2C_MessageResponse response, Action reply)
{
// 这里是接收到客户端发送的消息
Log.Debug($"接收到RPC消息 H_C2G_MessageRequest:{request.ToJson()}");
// response是要给客户端返回的消息、数据结构是在proto文件里定义的
response.Message = "Hello world您现在收到的消息是一个RPC消息";
await FTask.CompletedTask;
}
}
#endif