Config - nixfanboy/WrathNet GitHub Wiki
The Config
The WrathNet Engine uses the Config class from the WrathUtils Utilities Library. The Client Config object can be obtained using the Client.getClientConfig() static method, and the Server Config object can be obtained using the Server.getServerConfig() static method The format in the Config file is as follows:
key: value
key2: value1,value2
List of Config Options
Following is a list of possible configuration options followed by their default values and a brief description of their function.
Global
CheckForGZIPCompression: false ... Checks all data received if it is compressed in the GZIP format, and decompresses it if detected.
Client
Timeout: 500 ... Sets the time in milliseconds until a connection "times out" after no data received from Server.
TCP
TcpKeepAlive: false ... If true, a packet of empty data will be sent to the Server in order to keep the connection alive if no data is transferred in a long period of time.
TcpNoDelay: true ... If true, TCP sends data as soon as the call is made rather that storing the data in a buffer to be sent with other data.
TcpRecvBufferSize: (system dependent) ... Sets the size, in bytes, of the Socket's receive data buffer.
TcpSendBufferSize: (system dependent) ... Sets the size, in bytes, of the Socket's sent data buffer.
TcpReuseAddress: true ... If true, a restored connection will use the same resolved address as previously.
TcpTrafficClass: (system dependent) ... Changes the priority of the traffic, from 0 to 255. The higher the number, the higher the priority.
TcpOobInline: (system dependent) ... If true, it could pose as a security risk. However, having this enabled allows the system to send and receive data asynchronously, resulting in a large performance boost.
TcpRecvArraySize: 512 ... The size of the array to store received data in for processing. Recommended to be the same size as TcpRecvBufferSize.
TcpConnectingTimeout: 1000 ... The time (in milliseconds) that a Client will attempt to connect to a Server without giving up.
UDP
UdpRecvBufferSize: (system dependent) ... Sets the size, in bytes, of the Socket's receive data buffer.
UdpSendBufferSize: (system dependent) ... Sets the size, in bytes, of the Socket's sent data buffer.
UdpRecvArraySize: 512 ... The size of the array to store received data in for processing. Recommended to be the same size as UdpRecvBufferSize.
UdpBroadcast: (system dependent) ... If true, the connection can be broadcasted across a LAN.
UdpReuseAddress: (system dependent) ... If true, a restored connection will use the same resolved address as previously.
UdpTrafficClass: (system dependent) ... Changes the priority of the traffic, from 0 to 255. The higher the number, the higher the priority.
Server
TCP
TcpBacklog: 0 ... The maximum number of Clients allowed to be queued for a connection simultaneously. If set to 0, there is no limit.
TcpClientRecvBufferSize: 512 ... The size (in bytes) of the array containing the data received from clients. Each client has its own buffer of this size.
UDP
UdpClientRecvBufferSize: 512 ... The size (in bytes) of the array containing the data received from clients. Each client has its own buffer of this size.
Applying the Config
In order to change config options, create a new file in the same folder as the executable .jar file for the program named 'netclient.cfg' for Client configuration, or 'netserver.cfg' for Server configuration. Edit the files according to the format above and save.