AddressableRPC<TEntity, TRouteRequest, TRouteResponse> 类
泛型可寻址RPC路由基类,实现了 IRouteMessageHandler 接口,用于处理特定实体和可寻址RPC路由请求类型的路由。
继承成员
命名空间: Fantasy.Network.Interface
程序集: Fantasy.Net.dll
语法
public abstract class AddressableRPC<TEntity, TRouteRequest, TRouteResponse> : IRouteMessageHandler where TEntity : Entity where TRouteRequest : IAddressableRouteRequest where TRouteResponse : IAddressableRouteResponse, new()
类型参数
名称 | 描述 |
---|---|
TEntity | 实体类型。 |
TRouteRequest | 可寻址RPC路由请求类型。 |
TRouteResponse | 可寻址RPC路由响应类型。 |
方法
| 编辑本文 查看源代码Handle(Session, Entity, uint, object)
处理可寻址RPC路由请求。
声明
public FTask Handle(Session session, Entity entity, uint rpcId, object routeMessage)
参数
类型 | 名称 | 描述 |
---|---|---|
Session | session | 会话。 |
Entity | entity | 实体。 |
uint | rpcId | RPC标识。 |
object | routeMessage | 可寻址RPC路由请求。 |
返回
类型 | 描述 |
---|---|
FTask |
Run(TEntity, TRouteRequest, TRouteResponse, Action)
运行处理可寻址RPC路由请求。
声明
protected abstract FTask Run(TEntity entity, TRouteRequest request, TRouteResponse response, Action reply)
参数
类型 | 名称 | 描述 |
---|---|---|
TEntity | entity | 实体。 |
TRouteRequest | request | 可寻址RPC路由请求。 |
TRouteResponse | response | 可寻址RPC路由响应。 |
Action | reply | 回复操作。 |
返回
类型 | 描述 |
---|---|
FTask |
Type()
获取消息类型。
声明
public Type Type()
返回
类型 | 描述 |
---|---|
Type | 消息类型。 |