Enum Class SystemChannel
- All Implemented Interfaces:
Serializable, Comparable<SystemChannel>, Constable
Predefined system channels for cross-proxy messaging.
These channels are built into Numdrassl and are used for core functionality. Plugins can subscribe to these channels to receive system-level messages.
Usage with @MessageSubscribe
@MessageSubscribe(SystemChannel.HEARTBEAT)
public void onHeartbeat(HeartbeatMessage msg) {
logger.info("Proxy {} is alive", msg.sourceProxyId());
}
@MessageSubscribe(SystemChannel.CHAT)
public void onChat(ChatMessage msg) {
if (msg.isBroadcast()) {
broadcastToAll(msg.message());
}
}
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBroadcast messages to all proxies.Cross-proxy chat messages.Proxy heartbeat and registration.No system channel - use this when subscribing to plugin messages.Player count updates.Plugin-defined custom messages.Player transfer coordination. -
Method Summary
Modifier and TypeMethodDescriptionGet the channel ID.Get the corresponding MessageChannel instance.static SystemChannelReturns the enum constant of this class with the specified name.static SystemChannel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No system channel - use this when subscribing to plugin messages. -
HEARTBEAT
Proxy heartbeat and registration.Message type:
HeartbeatMessage -
PLAYER_COUNT
Player count updates.Message type:
PlayerCountMessage -
CHAT
Cross-proxy chat messages.Message type:
ChatMessage -
TRANSFER
Player transfer coordination.Message type:
TransferMessage -
PLUGIN
Plugin-defined custom messages.Message type:
PluginMessage -
BROADCAST
Broadcast messages to all proxies.Message type:
BroadcastMessage
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getChannelId
Get the channel ID.- Returns:
- the full channel ID (e.g., "numdrassl:heartbeat")
-
toMessageChannel
Get the corresponding MessageChannel instance.For
NONE, this method returnsnull.For all other system channels, this method is guaranteed to return a non-null
MessageChannelbecause system channels are pre-registered inChannelsduring class initialization.- Returns:
- the MessageChannel, or null if this is
NONE
-