Class PluginMessageListener
java.lang.Object
de.themoep.resourcepacksplugin.core.SubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer>
de.themoep.resourcepacksplugin.velocity.listeners.PluginMessageListener
public class PluginMessageListener
extends SubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer>
-
Field Summary
Fields inherited from class de.themoep.resourcepacksplugin.core.SubChannelHandler
MESSAGING_CHANNEL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Get the type that we are sending messages toprotected String
loadKey()
Load the key from the storagevoid
onServerSwitch
(com.velocitypowered.api.event.player.ServerPostConnectEvent event) void
pluginMessageReceived
(com.velocitypowered.api.event.connection.PluginMessageEvent event) protected void
Save the key used for authenticating communicationprotected void
sendPluginMessage
(com.velocitypowered.api.proxy.server.RegisteredServer target, byte[] data) Methods inherited from class de.themoep.resourcepacksplugin.core.SubChannelHandler
acceptsNewKey, generateKey, handleMessage, readPack, registerSubChannel, reload, sendKey, sendMessage, setKey, trustsSender, writePack
-
Constructor Details
-
PluginMessageListener
-
-
Method Details
-
pluginMessageReceived
public void pluginMessageReceived(com.velocitypowered.api.event.connection.PluginMessageEvent event) -
onServerSwitch
public void onServerSwitch(com.velocitypowered.api.event.player.ServerPostConnectEvent event) -
sendPluginMessage
protected void sendPluginMessage(com.velocitypowered.api.proxy.server.RegisteredServer target, byte[] data) - Specified by:
sendPluginMessage
in classSubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer>
-
saveKey
Description copied from class:SubChannelHandler
Save the key used for authenticating communication- Specified by:
saveKey
in classSubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer>
- Parameters:
key
- The key to set
-
loadKey
Description copied from class:SubChannelHandler
Load the key from the storage- Specified by:
loadKey
in classSubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer>
- Returns:
- The key (or null if none is stored)
-
getTargetType
Description copied from class:SubChannelHandler
Get the type that we are sending messages to- Specified by:
getTargetType
in classSubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer>
- Returns:
- The type
-