Package net.ME1312.SubData.Server
Class SubDataProtocol
java.lang.Object
net.ME1312.SubData.Server.DataProtocol
net.ME1312.SubData.Server.SubDataProtocol
SubData Protocol Class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAuthService<?>Get the Network Protocol Authorization ServiceintGet SubData's Block SizegetName()Get the Network Protocol NamegetPacket(int id) Grab PacketIn Instance via IDlongGet SubData's Initialization TimerGet the Network Protocol VersionSubData Server Instanceopen(Logger logger, InetAddress address, int port, String cipher) SubData Server InstancevoidregisterCipher(String handle, Cipher cipher) Register a Cipher to SubDatavoidregisterPacket(int id, Class<? extends PacketOut> packet) Register PacketOut to the NetworkvoidregisterPacket(int id, PacketIn packet) Register PacketIn to the NetworkvoidsetAuthService(AuthService<?> service) Set the Network Protocol Authorization Service (may only be called once)voidsetBlockSize(int size) Set SubData's Block SizevoidSet the Network Protocol Name (may only be called once)voidsetTimeout(long time) Set SubData's Initialization TimervoidsetVersion(Version version) Set the Network Protocol Version (may only be called once)voidunregisterCipher(String handle) Unregister a Cipher from SubDatavoidunregisterPacket(Class<? extends PacketOut> packet) Unregister PacketOut to the NetworkvoidunregisterPacket(PacketIn packet) Unregister PacketIn from the NetworkMethods inherited from class net.ME1312.SubData.Server.DataProtocol
getMessage, registerMessage, registerMessage, unregisterMessage, unregisterMessage, unwhitelist, whitelist
-
Field Details
-
MIN_PACKET_ID
public static final int MIN_PACKET_ID- See Also:
-
MAX_PACKET_ID
public static final int MAX_PACKET_ID- See Also:
-
-
Constructor Details
-
SubDataProtocol
public SubDataProtocol()Create a new Protocol
-
-
Method Details
-
open
public SubDataServer open(Consumer<Runnable> scheduler, Logger logger, InetAddress address, int port, String cipher) throws IOException SubData Server Instance- Parameters:
scheduler- Event Schedulerlogger- Network Loggeraddress- Bind Address (or null for all)port- Port Numbercipher- Cipher (or null for none)- Throws:
IOException
-
open
public SubDataServer open(Logger logger, InetAddress address, int port, String cipher) throws IOException SubData Server Instance- Parameters:
logger- Network Loggeraddress- Bind Address (or null for all)port- Port Numbercipher- Cipher (or null for none)- Throws:
IOException
-
setName
Set the Network Protocol Name (may only be called once)- Parameters:
name- Protocol Name
-
getName
Description copied from class:DataProtocolGet the Network Protocol Name- Specified by:
getNamein classDataProtocol- Returns:
- Protocol Name
-
setVersion
Set the Network Protocol Version (may only be called once)- Parameters:
version- Protocol Version
-
getVersion
Description copied from class:DataProtocolGet the Network Protocol Version- Specified by:
getVersionin classDataProtocol- Returns:
- Protocol Version
-
setAuthService
Set the Network Protocol Authorization Service (may only be called once)- Parameters:
service- Protocol Authorization Service
-
getAuthService
Get the Network Protocol Authorization Service- Returns:
- Protocol Authorization Service
-
registerCipher
Register a Cipher to SubData- Parameters:
cipher- Cipher to Addhandle- Handle to Bind
-
unregisterCipher
Unregister a Cipher from SubData- Parameters:
handle- Handle
-
getBlockSize
public int getBlockSize()Get SubData's Block Size- Returns:
- Block Size
-
setBlockSize
public void setBlockSize(int size) Set SubData's Block Size- Parameters:
size- Block Size
-
getTimeout
public long getTimeout()Get SubData's Initialization Timer- Returns:
- Timeout Time
-
setTimeout
public void setTimeout(long time) Set SubData's Initialization Timer- Parameters:
time- Timeout Time
-
registerPacket
Register PacketIn to the Network- Parameters:
id- Packet ID (as an unsigned 16-bit value)packet- PacketIn to register
-
unregisterPacket
Unregister PacketIn from the Network- Parameters:
packet- PacketIn to unregister
-
registerPacket
Register PacketOut to the Network- Parameters:
id- Packet ID (as an unsigned 16-bit value)packet- PacketOut to register
-
unregisterPacket
Unregister PacketOut to the Network- Parameters:
packet- PacketOut to unregister
-
getPacket
Grab PacketIn Instance via ID- Parameters:
id- Packet ID (as an unsigned 16-bit value)- Returns:
- PacketIn
-