Class SocketUserSession

java.lang.Object
com.iohao.net.external.core.netty.session.SocketUserSession
All Implemented Interfaces:
AttrOptionDynamic, UserSession

public final class SocketUserSession extends Object
Socket UserSession
Author:
渔民小镇
date:
2023-02-18
  • Method Details

    • isActive

      public boolean isActive()
      Description copied from interface: UserSession
      active
      Specified by:
      isActive in interface UserSession
      Returns:
      true active
    • writeAndFlush

      public io.netty.channel.ChannelFuture writeAndFlush(Object message)
      Description copied from interface: UserSession
      writeAndFlush
      Parameters:
      message - message
      Returns:
      ChannelFuture
    • getIp

      public String getIp()
      Description copied from interface: UserSession
      Get player IP
      Returns:
      player IP
    • employ

      public void employ(CommunicationMessage message)
      Description copied from interface: UserSession
      Adds user info to request. Developers can extend data via HeadMetadata.setAttachmentData(byte[]), which will be forwarded to the logic server.
      Specified by:
      employ in interface UserSession
      Parameters:
      message - message
    • setUserId

      public void setUserId(long userId)
      Description copied from interface: UserSession
      Sets the ID of the current user (player).
      Specified by:
      setUserId in interface UserSession
      Parameters:
      userId - userId
    • setBindingLogicServerIds

      public void setBindingLogicServerIds(int[] bindingLogicServerIds)
      Specified by:
      setBindingLogicServerIds in interface UserSession
    • isVerifyIdentity

      public boolean isVerifyIdentity()
      Description copied from interface: UserSession
      Checks if the identity has been verified.
      Specified by:
      isVerifyIdentity in interface UserSession
      Returns:
      true: if logged in
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object