Package org.lwjgl.util.remotery
Class RMTSettings
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.remotery.RMTSettings
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class RMTSettings extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure to fill in to modify Remotery default settings.Member documentation
port
– which port to listen for incoming connections onreuse_open_port
– when this server exits it can leave the port open inTIME_WAIT
state for a while. This forces subsequent server bind attempts to fail when restarting. If you find restarts fail repeatedly with bind attempts, set this to true to forcibly reuse the open port.limit_connections_to_localhost
– Only allow connections on localhost?For dev builds you may want to access your game from other devices but if you distribute a game to your players with Remotery active, probably best to limit connections to localhost.
msSleepBetweenServerUpdates
– how long to sleep between server updates, hopefully trying to give a little CPU back to other threadsmessageQueueSizeInBytes
– size of the internal message queues Remotery uses. Will be rounded to page granularity of 64k.maxNbMessagesPerUpdate
– if the user continuously pushes to the message queue, the server network code won't get a chance to update unless there's an upper-limit on how many messages can be consumed per loop_malloc
– callback pointer for memory allocationrealloc
– callback pointer for memory allocation_free
– callback pointer for memory allocationmm_context
– memory allocation context pointerinput_handler
– callback pointer for receiving input from the Remotery consoleinput_handler_context
– context pointer that gets sent to Remotery console callback function
Layout
struct rmtSettings { rmtU16 port; rmtBool reuse_open_port; rmtBool limit_connections_to_localhost; rmtU32 msSleepBetweenServerUpdates; rmtU32 messageQueueSizeInBytes; rmtU32 maxNbMessagesPerUpdate;
rmtMallocPtr
_malloc;rmtReallocPtr
realloc;rmtFreePtr
_free; void * mm_context;rmtInputHandlerPtr
input_handler; void * input_handler_context; rmtPStr logFilename; }
-
-
Field Summary
Fields Modifier and Type Field Description static int
_FREE
_MALLOCThe struct member offsets.static int
ALIGNOF
The struct alignment in bytes.static int
INPUT_HANDLER
INPUT_HANDLER_CONTEXT
LIMIT_CONNECTIONS_TO_LOCALHOST
LOGFILENAME
MAXNBMESSAGESPERUPDATE
MESSAGEQUEUESIZEINBYTES
MM_CONTEXT
MSSLEEPBETWEENSERVERUPDATES
PORT
REALLOC
REUSE_OPEN_PORTThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description RMTSettings(java.nio.ByteBuffer container)
Creates aRMTSettings
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RMTFree
_free()
Returns the value of the_free
field.RMTSettings
_free(RMTFreeI value)
Sets the specified value to the_free
field.RMTMalloc
_malloc()
Returns the value of the_malloc
field.RMTSettings
_malloc(RMTMallocI value)
Sets the specified value to the_malloc
field.static RMTSettings
calloc()
Returns a newRMTSettings
instance allocated withmemCalloc
.static RMTSettings
callocStack()
Returns a newRMTSettings
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static RMTSettings
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettings
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static RMTSettings
create()
Returns a newRMTSettings
instance allocated withBufferUtils
.static RMTSettings
create(long address)
Returns a newRMTSettings
instance for the specified memory address.static RMTSettings
createSafe(long address)
RMTInputHandler
input_handler()
Returns the value of theinput_handler
field.RMTSettings
input_handler(RMTInputHandlerI value)
Sets the specified value to theinput_handler
field.long
input_handler_context()
Returns the value of theinput_handler_context
field.RMTSettings
input_handler_context(long value)
Sets the specified value to theinput_handler_context
field.int
limit_connections_to_localhost()
Returns the value of thelimit_connections_to_localhost
field.RMTSettings
limit_connections_to_localhost(int value)
Sets the specified value to thelimit_connections_to_localhost
field.java.nio.ByteBuffer
logFilename()
Returns aByteBuffer
view of the null-terminated string pointed to by thelogFilename
field.RMTSettings
logFilename(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thelogFilename
field.java.lang.String
logFilenameString()
Decodes the null-terminated string pointed to by thelogFilename
field.static RMTSettings
malloc()
Returns a newRMTSettings
instance allocated withmemAlloc
.static RMTSettings
mallocStack()
Returns a newRMTSettings
instance allocated on the thread-localMemoryStack
.static RMTSettings
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettings
instance allocated on the specifiedMemoryStack
.int
maxNbMessagesPerUpdate()
Returns the value of themaxNbMessagesPerUpdate
field.RMTSettings
maxNbMessagesPerUpdate(int value)
Sets the specified value to themaxNbMessagesPerUpdate
field.int
messageQueueSizeInBytes()
Returns the value of themessageQueueSizeInBytes
field.RMTSettings
messageQueueSizeInBytes(int value)
Sets the specified value to themessageQueueSizeInBytes
field.long
mm_context()
Returns the value of themm_context
field.RMTSettings
mm_context(long value)
Sets the specified value to themm_context
field.int
msSleepBetweenServerUpdates()
Returns the value of themsSleepBetweenServerUpdates
field.RMTSettings
msSleepBetweenServerUpdates(int value)
Sets the specified value to themsSleepBetweenServerUpdates
field.static RMTFree
n_free(long struct)
Unsafe version of_free()
.static void
n_free(long struct, RMTFreeI value)
Unsafe version of_free
.static RMTMalloc
n_malloc(long struct)
Unsafe version of_malloc()
.static void
n_malloc(long struct, RMTMallocI value)
Unsafe version of_malloc
.static RMTInputHandler
ninput_handler(long struct)
Unsafe version ofinput_handler()
.static void
ninput_handler(long struct, RMTInputHandlerI value)
Unsafe version ofinput_handler
.static long
ninput_handler_context(long struct)
Unsafe version ofinput_handler_context()
.static void
ninput_handler_context(long struct, long value)
Unsafe version ofinput_handler_context
.static int
nlimit_connections_to_localhost(long struct)
Unsafe version oflimit_connections_to_localhost()
.static void
nlimit_connections_to_localhost(long struct, int value)
Unsafe version oflimit_connections_to_localhost
.static java.nio.ByteBuffer
nlogFilename(long struct)
Unsafe version oflogFilename()
.static void
nlogFilename(long struct, java.nio.ByteBuffer value)
Unsafe version oflogFilename
.static java.lang.String
nlogFilenameString(long struct)
Unsafe version oflogFilenameString()
.static int
nmaxNbMessagesPerUpdate(long struct)
Unsafe version ofmaxNbMessagesPerUpdate()
.static void
nmaxNbMessagesPerUpdate(long struct, int value)
Unsafe version ofmaxNbMessagesPerUpdate
.static int
nmessageQueueSizeInBytes(long struct)
Unsafe version ofmessageQueueSizeInBytes()
.static void
nmessageQueueSizeInBytes(long struct, int value)
Unsafe version ofmessageQueueSizeInBytes
.static long
nmm_context(long struct)
Unsafe version ofmm_context()
.static void
nmm_context(long struct, long value)
Unsafe version ofmm_context
.static int
nmsSleepBetweenServerUpdates(long struct)
Unsafe version ofmsSleepBetweenServerUpdates()
.static void
nmsSleepBetweenServerUpdates(long struct, int value)
Unsafe version ofmsSleepBetweenServerUpdates
.static short
nport(long struct)
Unsafe version ofport()
.static void
nport(long struct, short value)
Unsafe version ofport
.static RMTRealloc
nrealloc(long struct)
Unsafe version ofrealloc()
.static void
nrealloc(long struct, RMTReallocI value)
Unsafe version ofrealloc
.static int
nreuse_open_port(long struct)
Unsafe version ofreuse_open_port()
.static void
nreuse_open_port(long struct, int value)
Unsafe version ofreuse_open_port
.short
port()
Returns the value of theport
field.RMTSettings
port(short value)
Sets the specified value to theport
field.RMTRealloc
realloc()
Returns the value of therealloc
field.RMTSettings
realloc(RMTReallocI value)
Sets the specified value to therealloc
field.int
reuse_open_port()
Returns the value of thereuse_open_port
field.RMTSettings
reuse_open_port(int value)
Sets the specified value to thereuse_open_port
field.RMTSettings
set(short port, int reuse_open_port, int limit_connections_to_localhost, int msSleepBetweenServerUpdates, int messageQueueSizeInBytes, int maxNbMessagesPerUpdate, RMTMallocI _malloc, RMTReallocI realloc, RMTFreeI _free, long mm_context, RMTInputHandlerI input_handler, long input_handler_context, java.nio.ByteBuffer logFilename)
Initializes this struct with the specified values.RMTSettings
set(RMTSettings src)
Copies the specified struct data to this struct.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Field Detail
-
SIZEOF
The struct size in bytes.
-
ALIGNOF
The struct alignment in bytes.
-
PORT, REUSE_OPEN_PORT, LIMIT_CONNECTIONS_TO_LOCALHOST, MSSLEEPBETWEENSERVERUPDATES, MESSAGEQUEUESIZEINBYTES, MAXNBMESSAGESPERUPDATE, _MALLOC, REALLOC, _FREE, MM_CONTEXT, INPUT_HANDLER, INPUT_HANDLER_CONTEXT, LOGFILENAME
The struct member offsets.
-
-
Constructor Detail
-
RMTSettings
public RMTSettings(java.nio.ByteBuffer container)
Creates aRMTSettings
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
port
public short port()
Returns the value of theport
field.
-
reuse_open_port
public int reuse_open_port()
Returns the value of thereuse_open_port
field.
-
limit_connections_to_localhost
public int limit_connections_to_localhost()
Returns the value of thelimit_connections_to_localhost
field.
-
msSleepBetweenServerUpdates
public int msSleepBetweenServerUpdates()
Returns the value of themsSleepBetweenServerUpdates
field.
-
messageQueueSizeInBytes
public int messageQueueSizeInBytes()
Returns the value of themessageQueueSizeInBytes
field.
-
maxNbMessagesPerUpdate
public int maxNbMessagesPerUpdate()
Returns the value of themaxNbMessagesPerUpdate
field.
-
_malloc
public RMTMalloc _malloc()
Returns the value of the_malloc
field.
-
realloc
public RMTRealloc realloc()
Returns the value of therealloc
field.
-
_free
public RMTFree _free()
Returns the value of the_free
field.
-
mm_context
public long mm_context()
Returns the value of themm_context
field.
-
input_handler
public RMTInputHandler input_handler()
Returns the value of theinput_handler
field.
-
input_handler_context
public long input_handler_context()
Returns the value of theinput_handler_context
field.
-
logFilename
public java.nio.ByteBuffer logFilename()
Returns aByteBuffer
view of the null-terminated string pointed to by thelogFilename
field.
-
logFilenameString
public java.lang.String logFilenameString()
Decodes the null-terminated string pointed to by thelogFilename
field.
-
port
public RMTSettings port(short value)
Sets the specified value to theport
field.
-
reuse_open_port
public RMTSettings reuse_open_port(int value)
Sets the specified value to thereuse_open_port
field.
-
limit_connections_to_localhost
public RMTSettings limit_connections_to_localhost(int value)
Sets the specified value to thelimit_connections_to_localhost
field.
-
msSleepBetweenServerUpdates
public RMTSettings msSleepBetweenServerUpdates(int value)
Sets the specified value to themsSleepBetweenServerUpdates
field.
-
messageQueueSizeInBytes
public RMTSettings messageQueueSizeInBytes(int value)
Sets the specified value to themessageQueueSizeInBytes
field.
-
maxNbMessagesPerUpdate
public RMTSettings maxNbMessagesPerUpdate(int value)
Sets the specified value to themaxNbMessagesPerUpdate
field.
-
_malloc
public RMTSettings _malloc(RMTMallocI value)
Sets the specified value to the_malloc
field.
-
realloc
public RMTSettings realloc(RMTReallocI value)
Sets the specified value to therealloc
field.
-
_free
public RMTSettings _free(RMTFreeI value)
Sets the specified value to the_free
field.
-
mm_context
public RMTSettings mm_context(long value)
Sets the specified value to themm_context
field.
-
input_handler
public RMTSettings input_handler(RMTInputHandlerI value)
Sets the specified value to theinput_handler
field.
-
input_handler_context
public RMTSettings input_handler_context(long value)
Sets the specified value to theinput_handler_context
field.
-
logFilename
public RMTSettings logFilename(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thelogFilename
field.
-
set
public RMTSettings set(short port, int reuse_open_port, int limit_connections_to_localhost, int msSleepBetweenServerUpdates, int messageQueueSizeInBytes, int maxNbMessagesPerUpdate, RMTMallocI _malloc, RMTReallocI realloc, RMTFreeI _free, long mm_context, RMTInputHandlerI input_handler, long input_handler_context, java.nio.ByteBuffer logFilename)
Initializes this struct with the specified values.
-
set
public RMTSettings set(RMTSettings src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static RMTSettings malloc()
Returns a newRMTSettings
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static RMTSettings calloc()
Returns a newRMTSettings
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static RMTSettings create()
Returns a newRMTSettings
instance allocated withBufferUtils
.
-
create
public static RMTSettings create(long address)
Returns a newRMTSettings
instance for the specified memory address.
-
createSafe
@Nullable public static RMTSettings createSafe(long address)
-
mallocStack
public static RMTSettings mallocStack()
Returns a newRMTSettings
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static RMTSettings callocStack()
Returns a newRMTSettings
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static RMTSettings mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettings
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static RMTSettings callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettings
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
nport
public static short nport(long struct)
Unsafe version ofport()
.
-
nreuse_open_port
public static int nreuse_open_port(long struct)
Unsafe version ofreuse_open_port()
.
-
nlimit_connections_to_localhost
public static int nlimit_connections_to_localhost(long struct)
Unsafe version oflimit_connections_to_localhost()
.
-
nmsSleepBetweenServerUpdates
public static int nmsSleepBetweenServerUpdates(long struct)
Unsafe version ofmsSleepBetweenServerUpdates()
.
-
nmessageQueueSizeInBytes
public static int nmessageQueueSizeInBytes(long struct)
Unsafe version ofmessageQueueSizeInBytes()
.
-
nmaxNbMessagesPerUpdate
public static int nmaxNbMessagesPerUpdate(long struct)
Unsafe version ofmaxNbMessagesPerUpdate()
.
-
nrealloc
public static RMTRealloc nrealloc(long struct)
Unsafe version ofrealloc()
.
-
nmm_context
public static long nmm_context(long struct)
Unsafe version ofmm_context()
.
-
ninput_handler
public static RMTInputHandler ninput_handler(long struct)
Unsafe version ofinput_handler()
.
-
ninput_handler_context
public static long ninput_handler_context(long struct)
Unsafe version ofinput_handler_context()
.
-
nlogFilename
public static java.nio.ByteBuffer nlogFilename(long struct)
Unsafe version oflogFilename()
.
-
nlogFilenameString
public static java.lang.String nlogFilenameString(long struct)
Unsafe version oflogFilenameString()
.
-
nport
public static void nport(long struct, short value)
Unsafe version ofport
.
-
nreuse_open_port
public static void nreuse_open_port(long struct, int value)
Unsafe version ofreuse_open_port
.
-
nlimit_connections_to_localhost
public static void nlimit_connections_to_localhost(long struct, int value)
Unsafe version oflimit_connections_to_localhost
.
-
nmsSleepBetweenServerUpdates
public static void nmsSleepBetweenServerUpdates(long struct, int value)
Unsafe version ofmsSleepBetweenServerUpdates
.
-
nmessageQueueSizeInBytes
public static void nmessageQueueSizeInBytes(long struct, int value)
Unsafe version ofmessageQueueSizeInBytes
.
-
nmaxNbMessagesPerUpdate
public static void nmaxNbMessagesPerUpdate(long struct, int value)
Unsafe version ofmaxNbMessagesPerUpdate
.
-
n_malloc
public static void n_malloc(long struct, RMTMallocI value)
Unsafe version of_malloc
.
-
nrealloc
public static void nrealloc(long struct, RMTReallocI value)
Unsafe version ofrealloc
.
-
nmm_context
public static void nmm_context(long struct, long value)
Unsafe version ofmm_context
.
-
ninput_handler
public static void ninput_handler(long struct, RMTInputHandlerI value)
Unsafe version ofinput_handler
.
-
ninput_handler_context
public static void ninput_handler_context(long struct, long value)
Unsafe version ofinput_handler_context
.
-
nlogFilename
public static void nlogFilename(long struct, java.nio.ByteBuffer value)
Unsafe version oflogFilename
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-