Add support for sending plugin messages over the wire
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.velocitypowered.api.proxy;
|
||||
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSink;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
|
||||
import com.velocitypowered.api.server.ServerInfo;
|
||||
import com.velocitypowered.api.util.MessagePosition;
|
||||
@@ -13,7 +14,7 @@ import java.util.UUID;
|
||||
/**
|
||||
* Represents a player who is connected to the proxy.
|
||||
*/
|
||||
public interface Player extends CommandSource, InboundConnection, ChannelMessageSource {
|
||||
public interface Player extends CommandSource, InboundConnection, ChannelMessageSource, ChannelMessageSink {
|
||||
/**
|
||||
* Returns the player's current username.
|
||||
* @return the username
|
||||
|
@@ -1,12 +1,13 @@
|
||||
package com.velocitypowered.api.proxy;
|
||||
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSink;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
|
||||
import com.velocitypowered.api.server.ServerInfo;
|
||||
|
||||
/**
|
||||
* Represents a connection to a backend server from the proxy for a client.
|
||||
*/
|
||||
public interface ServerConnection extends ChannelMessageSource {
|
||||
public interface ServerConnection extends ChannelMessageSource, ChannelMessageSink {
|
||||
ServerInfo getServerInfo();
|
||||
|
||||
Player getPlayer();
|
||||
|
@@ -0,0 +1,5 @@
|
||||
package com.velocitypowered.api.proxy.messages;
|
||||
|
||||
public interface ChannelMessageSink {
|
||||
void sendPluginMessage(ChannelIdentifier identifier, byte[] data);
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
package com.velocitypowered.api.proxy.messages;
|
||||
|
||||
public interface MessageHandler {
|
||||
ForwardStatus handle(ChannelMessageSource source, ChannelSide side, byte[] data);
|
||||
ForwardStatus handle(ChannelMessageSource source, ChannelSide side, ChannelIdentifier identifier, byte[] data);
|
||||
|
||||
enum ForwardStatus {
|
||||
FORWARD,
|
||||
|
Reference in New Issue
Block a user