Class CommunicationKit

java.lang.Object
com.iohao.net.framework.communication.CommunicationKit

public final class CommunicationKit extends Object
Utility class providing static access to the global communication infrastructure.

Holds the singleton CommunicationAggregation and Communication instances, and offers convenience methods for common cross-server operations such as forced user offline and user existence checks.

Since:
25.1
Author:
渔民小镇
date:
2025-09-28
  • Constructor Details

    • CommunicationKit

      public CommunicationKit()
  • Method Details

    • setCommunicationAggregation

      public void setCommunicationAggregation(CommunicationAggregation communicationAggregation)
      Set the global communication aggregation and initialize the communication instance.
      Parameters:
      communicationAggregation - the aggregation implementation to use
    • forcedOffline

      public void forcedOffline(long userId)
      Force a user offline by broadcasting a forced-offline request to all external servers.
      Parameters:
      userId - the ID of the user to disconnect
    • existUser

      public boolean existUser(long userId)
      Check whether a user is currently connected to any external server.
      Parameters:
      userId - the ID of the user to check
      Returns:
      true if the user exists on at least one external server