Interface UserSession

All Superinterfaces:
AttrOptionDynamic
All Known Implementing Classes:
SocketUserSession

public interface UserSession extends AttrOptionDynamic
UserSession
Author:
渔民小镇
See Also:
date:
2023-02-18
  • Method Details

    • isActive

      boolean isActive()
      active
      Returns:
      true active
    • setExternalJoin

      void setExternalJoin(ExternalJoinEnum externalJoin)
    • setUserId

      void setUserId(long userId)
      Sets the ID of the current user (player).
      Parameters:
      userId - userId
    • getUserId

      long getUserId()
      Gets the ID of the current user (player).
      Returns:
      The ID of the current user (player)
    • isVerifyIdentity

      boolean isVerifyIdentity()
      Checks if the identity has been verified.
      Returns:
      true: if logged in
    • getState

      UserSessionState getState()
      UserSessionState of current player
      Returns:
      State
    • getUserChannelId

      long getUserChannelId()
      Gets the UserChannelId of the current user (player).
      Returns:
      UserChannelId
    • employ

      void employ(CommunicationMessage message)
      Adds user info to request. Developers can extend data via HeadMetadata.setAttachmentData(byte[]), which will be forwarded to the logic server.
      Parameters:
      message - message
    • writeAndFlush

      <T> T writeAndFlush(Object message)
      writeAndFlush
      Parameters:
      message - message
      Returns:
      ChannelFuture
    • getIp

      String getIp()
      Get player IP
      Returns:
      player IP
    • setAttachment

      void setAttachment(byte[] attachment)
    • setBindingLogicServerIds

      void setBindingLogicServerIds(int[] bindingLogicServerIds)
    • getBindingLogicServerIds

      int[] getBindingLogicServerIds()
    • ofMessage

      default CommunicationMessage ofMessage(CmdInfo cmdInfo)