Fantasy
搜索结果

    显示/隐藏目录

    Session 类

    网络会话的基类,用于管理网络通信。

    继承
    object
    Entity
    Session
    ProcessSession
    实现
    IEntity
    IPool
    ISupportedMultiEntity
    IDisposable
    继承成员
    Entity.Id
    Entity.RunTimeId
    Entity.IsDisposed
    Entity.Scene
    Entity.Parent
    Entity.Type
    Entity.GetParent<T>()
    Entity.Create<T>(Scene, bool, bool)
    Entity.Create<T>(Scene, long, bool, bool)
    Entity.AddComponent<T>(bool)
    Entity.AddComponent<T>(long, bool)
    Entity.AddComponent(Entity)
    Entity.AddComponent<T>(T)
    Entity.GetComponent<T>()
    Entity.GetComponent(Type)
    Entity.GetComponent<T>(long)
    Entity.GetOrAddComponent<T>(bool)
    Entity.RemoveComponent<T>(bool)
    Entity.RemoveComponent<T>(long, bool)
    Entity.RemoveComponent(Entity, bool)
    Entity.RemoveComponent<T>(T, bool)
    Entity.Deserialize(Scene, bool)
    Entity.ForEachSingleCollection
    Entity.ForEachTransfer
    Entity.ForEachMultiEntity
    Entity.ForEachEntity
    Entity.IsPool()
    Entity.SetIsPool(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    命名空间: Fantasy.Network
    程序集: Fantasy.Net.dll
    语法
    public class Session : Entity, IEntity, IPool, ISupportedMultiEntity, IDisposable

    字段

    | 编辑本文 查看源代码

    RequestCallback

    声明
    public readonly Dictionary<long, FTask<IResponse>> RequestCallback
    字段值
    类型 描述
    Dictionary<long, FTask<IResponse>>

    属性

    | 编辑本文 查看源代码

    Channel

    关联的网络连接通道

    声明
    public INetworkChannel Channel { get; }
    属性值
    类型 描述
    INetworkChannel
    | 编辑本文 查看源代码

    RemoteEndPoint

    当前Session的终结点信息

    声明
    public IPEndPoint RemoteEndPoint { get; }
    属性值
    类型 描述
    IPEndPoint

    方法

    | 编辑本文 查看源代码

    Call(IRequest, long)

    发送一个RPC消息

    声明
    public virtual FTask<IResponse> Call(IRequest request, long routeId = 0)
    参数
    类型 名称 描述
    IRequest request

    请求消息的实例

    long routeId

    routeId

    返回
    类型 描述
    FTask<IResponse>
    | 编辑本文 查看源代码

    Call(IRouteRequest, long)

    发送一个RPC消息

    声明
    public virtual FTask<IResponse> Call(IRouteRequest request, long routeId = 0)
    参数
    类型 名称 描述
    IRouteRequest request

    请求Route消息的实例

    long routeId

    routeId

    返回
    类型 描述
    FTask<IResponse>
    | 编辑本文 查看源代码

    Dispose()

    销毁一个Session,当执行了这个方法会自动断开网络的连接。

    声明
    public override void Dispose()
    重写
    Entity.Dispose()
    | 编辑本文 查看源代码

    Send(IMessage, uint, long)

    发送一个消息

    声明
    public virtual void Send(IMessage message, uint rpcId = 0, long routeId = 0)
    参数
    类型 名称 描述
    IMessage message

    消息的实例

    uint rpcId

    如果是RPC消息需要传递一个RPCId

    long routeId

    routeId

    | 编辑本文 查看源代码

    Send(IRouteMessage, uint, long)

    发送一个消息

    声明
    public virtual void Send(IRouteMessage routeMessage, uint rpcId = 0, long routeId = 0)
    参数
    类型 名称 描述
    IRouteMessage routeMessage

    消息的实例,不同的是这个是发送Route消息使用的

    uint rpcId

    如果是RPC消息需要传递一个RPCId

    long routeId

    routeId

    | 编辑本文 查看源代码

    Send(ProcessPackInfo, uint, long)

    发送一个消息,框架内部使用建议不要用这个方法。

    声明
    public virtual void Send(ProcessPackInfo packInfo, uint rpcId = 0, long routeId = 0)
    参数
    类型 名称 描述
    ProcessPackInfo packInfo

    一个ProcessPackInfo消息包

    uint rpcId

    如果是RPC消息需要传递一个RPCId

    long routeId

    routeId

    | 编辑本文 查看源代码

    Send(MemoryStreamBuffer, uint, long)

    发送一个消息

    声明
    public virtual void Send(MemoryStreamBuffer memoryStream, uint rpcId = 0, long routeId = 0)
    参数
    类型 名称 描述
    MemoryStreamBuffer memoryStream

    需要发送的MemoryStreamBuffer

    uint rpcId

    如果是RPC消息需要传递一个RPCId

    long routeId

    routeId

    | 编辑本文 查看源代码

    Send(uint, long, Type, APackInfo)

    发送一个消息,框架内部使用建议不要用这个方法。

    声明
    public virtual void Send(uint rpcId, long routeId, Type messageType, APackInfo packInfo)
    参数
    类型 名称 描述
    uint rpcId

    如果是RPC消息需要传递一个RPCId

    long routeId

    routeId

    Type messageType

    消息的类型

    APackInfo packInfo

    packInfo消息包

    事件

    | 编辑本文 查看源代码

    OnDispose

    Session的Dispose委托

    声明
    public event Action OnDispose
    事件类型
    类型 描述
    Action

    实现

    IEntity
    IPool
    ISupportedMultiEntity
    IDisposable

    扩展方法

    JsonHelper.ToJson<T>(T)
    • 编辑本文
    • 查看源代码
    本文内容
    Back to top Generated by DocFX