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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAuthService<?>
Get the Network Protocol Authorization Serviceint
Get SubData's Block SizegetName()
Get the Network Protocol NamegetPacket
(int id) Grab PacketIn Instance via IDlong
Get SubData's Initialization TimerGet the Network Protocol VersionSubData Server Instanceopen
(Logger logger, InetAddress address, int port, String cipher) SubData Server Instancevoid
registerCipher
(String handle, Cipher cipher) Register a Cipher to SubDatavoid
registerPacket
(int id, Class<? extends PacketOut> packet) Register PacketOut to the Networkvoid
registerPacket
(int id, PacketIn packet) Register PacketIn to the Networkvoid
setAuthService
(AuthService<?> service) Set the Network Protocol Authorization Service (may only be called once)void
setBlockSize
(int size) Set SubData's Block Sizevoid
Set the Network Protocol Name (may only be called once)void
setTimeout
(long time) Set SubData's Initialization Timervoid
setVersion
(Version version) Set the Network Protocol Version (may only be called once)void
unregisterCipher
(String handle) Unregister a Cipher from SubDatavoid
unregisterPacket
(Class<? extends PacketOut> packet) Unregister PacketOut to the Networkvoid
unregisterPacket
(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:DataProtocol
Get the Network Protocol Name- Specified by:
getName
in classDataProtocol
- Returns:
- Protocol Name
-
setVersion
Set the Network Protocol Version (may only be called once)- Parameters:
version
- Protocol Version
-
getVersion
Description copied from class:DataProtocol
Get the Network Protocol Version- Specified by:
getVersion
in 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
-