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.NativeResourceStructure 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_WAITstate 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;rmtReallocPtrrealloc;rmtFreePtr_free; void * mm_context;rmtInputHandlerPtrinput_handler; void * input_handler_context; rmtPStr logFilename; }
-
-
Field Summary
Fields Modifier and Type Field Description static int_FREE
_MALLOCThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intINPUT_HANDLER
INPUT_HANDLER_CONTEXT
LIMIT_CONNECTIONS_TO_LOCALHOST
LOGFILENAME
MAXNBMESSAGESPERUPDATE
MESSAGEQUEUESIZEINBYTES
MM_CONTEXT
MSSLEEPBETWEENSERVERUPDATES
PORT
REALLOC
REUSE_OPEN_PORTThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description RMTSettings(java.nio.ByteBuffer container)Creates aRMTSettingsinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RMTFree_free()Returns the value of the_freefield.RMTSettings_free(RMTFreeI value)Sets the specified value to the_freefield.RMTMalloc_malloc()Returns the value of the_mallocfield.RMTSettings_malloc(RMTMallocI value)Sets the specified value to the_mallocfield.static RMTSettingscalloc()Returns a newRMTSettingsinstance allocated withmemCalloc.static RMTSettingscallocStack()Returns a newRMTSettingsinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static RMTSettingscallocStack(org.lwjgl.system.MemoryStack stack)Returns a newRMTSettingsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static RMTSettingscreate()Returns a newRMTSettingsinstance allocated withBufferUtils.static RMTSettingscreate(long address)Returns a newRMTSettingsinstance for the specified memory address.static RMTSettingscreateSafe(long address)RMTInputHandlerinput_handler()Returns the value of theinput_handlerfield.RMTSettingsinput_handler(RMTInputHandlerI value)Sets the specified value to theinput_handlerfield.longinput_handler_context()Returns the value of theinput_handler_contextfield.RMTSettingsinput_handler_context(long value)Sets the specified value to theinput_handler_contextfield.intlimit_connections_to_localhost()Returns the value of thelimit_connections_to_localhostfield.RMTSettingslimit_connections_to_localhost(int value)Sets the specified value to thelimit_connections_to_localhostfield.java.nio.ByteBufferlogFilename()Returns aByteBufferview of the null-terminated string pointed to by thelogFilenamefield.RMTSettingslogFilename(java.nio.ByteBuffer value)Sets the address of the specified encoded string to thelogFilenamefield.java.lang.StringlogFilenameString()Decodes the null-terminated string pointed to by thelogFilenamefield.static RMTSettingsmalloc()Returns a newRMTSettingsinstance allocated withmemAlloc.static RMTSettingsmallocStack()Returns a newRMTSettingsinstance allocated on the thread-localMemoryStack.static RMTSettingsmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newRMTSettingsinstance allocated on the specifiedMemoryStack.intmaxNbMessagesPerUpdate()Returns the value of themaxNbMessagesPerUpdatefield.RMTSettingsmaxNbMessagesPerUpdate(int value)Sets the specified value to themaxNbMessagesPerUpdatefield.intmessageQueueSizeInBytes()Returns the value of themessageQueueSizeInBytesfield.RMTSettingsmessageQueueSizeInBytes(int value)Sets the specified value to themessageQueueSizeInBytesfield.longmm_context()Returns the value of themm_contextfield.RMTSettingsmm_context(long value)Sets the specified value to themm_contextfield.intmsSleepBetweenServerUpdates()Returns the value of themsSleepBetweenServerUpdatesfield.RMTSettingsmsSleepBetweenServerUpdates(int value)Sets the specified value to themsSleepBetweenServerUpdatesfield.static RMTFreen_free(long struct)Unsafe version of_free().static voidn_free(long struct, RMTFreeI value)Unsafe version of_free.static RMTMallocn_malloc(long struct)Unsafe version of_malloc().static voidn_malloc(long struct, RMTMallocI value)Unsafe version of_malloc.static RMTInputHandlerninput_handler(long struct)Unsafe version ofinput_handler().static voidninput_handler(long struct, RMTInputHandlerI value)Unsafe version ofinput_handler.static longninput_handler_context(long struct)Unsafe version ofinput_handler_context().static voidninput_handler_context(long struct, long value)Unsafe version ofinput_handler_context.static intnlimit_connections_to_localhost(long struct)Unsafe version oflimit_connections_to_localhost().static voidnlimit_connections_to_localhost(long struct, int value)Unsafe version oflimit_connections_to_localhost.static java.nio.ByteBuffernlogFilename(long struct)Unsafe version oflogFilename().static voidnlogFilename(long struct, java.nio.ByteBuffer value)Unsafe version oflogFilename.static java.lang.StringnlogFilenameString(long struct)Unsafe version oflogFilenameString().static intnmaxNbMessagesPerUpdate(long struct)Unsafe version ofmaxNbMessagesPerUpdate().static voidnmaxNbMessagesPerUpdate(long struct, int value)Unsafe version ofmaxNbMessagesPerUpdate.static intnmessageQueueSizeInBytes(long struct)Unsafe version ofmessageQueueSizeInBytes().static voidnmessageQueueSizeInBytes(long struct, int value)Unsafe version ofmessageQueueSizeInBytes.static longnmm_context(long struct)Unsafe version ofmm_context().static voidnmm_context(long struct, long value)Unsafe version ofmm_context.static intnmsSleepBetweenServerUpdates(long struct)Unsafe version ofmsSleepBetweenServerUpdates().static voidnmsSleepBetweenServerUpdates(long struct, int value)Unsafe version ofmsSleepBetweenServerUpdates.static shortnport(long struct)Unsafe version ofport().static voidnport(long struct, short value)Unsafe version ofport.static RMTReallocnrealloc(long struct)Unsafe version ofrealloc().static voidnrealloc(long struct, RMTReallocI value)Unsafe version ofrealloc.static intnreuse_open_port(long struct)Unsafe version ofreuse_open_port().static voidnreuse_open_port(long struct, int value)Unsafe version ofreuse_open_port.shortport()Returns the value of theportfield.RMTSettingsport(short value)Sets the specified value to theportfield.RMTReallocrealloc()Returns the value of thereallocfield.RMTSettingsrealloc(RMTReallocI value)Sets the specified value to thereallocfield.intreuse_open_port()Returns the value of thereuse_open_portfield.RMTSettingsreuse_open_port(int value)Sets the specified value to thereuse_open_portfield.RMTSettingsset(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.RMTSettingsset(RMTSettings src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(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 aRMTSettingsinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
port
public short port()
Returns the value of theportfield.
-
reuse_open_port
public int reuse_open_port()
Returns the value of thereuse_open_portfield.
-
limit_connections_to_localhost
public int limit_connections_to_localhost()
Returns the value of thelimit_connections_to_localhostfield.
-
msSleepBetweenServerUpdates
public int msSleepBetweenServerUpdates()
Returns the value of themsSleepBetweenServerUpdatesfield.
-
messageQueueSizeInBytes
public int messageQueueSizeInBytes()
Returns the value of themessageQueueSizeInBytesfield.
-
maxNbMessagesPerUpdate
public int maxNbMessagesPerUpdate()
Returns the value of themaxNbMessagesPerUpdatefield.
-
_malloc
public RMTMalloc _malloc()
Returns the value of the_mallocfield.
-
realloc
public RMTRealloc realloc()
Returns the value of thereallocfield.
-
_free
public RMTFree _free()
Returns the value of the_freefield.
-
mm_context
public long mm_context()
Returns the value of themm_contextfield.
-
input_handler
public RMTInputHandler input_handler()
Returns the value of theinput_handlerfield.
-
input_handler_context
public long input_handler_context()
Returns the value of theinput_handler_contextfield.
-
logFilename
public java.nio.ByteBuffer logFilename()
Returns aByteBufferview of the null-terminated string pointed to by thelogFilenamefield.
-
logFilenameString
public java.lang.String logFilenameString()
Decodes the null-terminated string pointed to by thelogFilenamefield.
-
port
public RMTSettings port(short value)
Sets the specified value to theportfield.
-
reuse_open_port
public RMTSettings reuse_open_port(int value)
Sets the specified value to thereuse_open_portfield.
-
limit_connections_to_localhost
public RMTSettings limit_connections_to_localhost(int value)
Sets the specified value to thelimit_connections_to_localhostfield.
-
msSleepBetweenServerUpdates
public RMTSettings msSleepBetweenServerUpdates(int value)
Sets the specified value to themsSleepBetweenServerUpdatesfield.
-
messageQueueSizeInBytes
public RMTSettings messageQueueSizeInBytes(int value)
Sets the specified value to themessageQueueSizeInBytesfield.
-
maxNbMessagesPerUpdate
public RMTSettings maxNbMessagesPerUpdate(int value)
Sets the specified value to themaxNbMessagesPerUpdatefield.
-
_malloc
public RMTSettings _malloc(RMTMallocI value)
Sets the specified value to the_mallocfield.
-
realloc
public RMTSettings realloc(RMTReallocI value)
Sets the specified value to thereallocfield.
-
_free
public RMTSettings _free(RMTFreeI value)
Sets the specified value to the_freefield.
-
mm_context
public RMTSettings mm_context(long value)
Sets the specified value to themm_contextfield.
-
input_handler
public RMTSettings input_handler(RMTInputHandlerI value)
Sets the specified value to theinput_handlerfield.
-
input_handler_context
public RMTSettings input_handler_context(long value)
Sets the specified value to theinput_handler_contextfield.
-
logFilename
public RMTSettings logFilename(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thelogFilenamefield.
-
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 newRMTSettingsinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static RMTSettings calloc()
Returns a newRMTSettingsinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static RMTSettings create()
Returns a newRMTSettingsinstance allocated withBufferUtils.
-
create
public static RMTSettings create(long address)
Returns a newRMTSettingsinstance for the specified memory address.
-
createSafe
@Nullable public static RMTSettings createSafe(long address)
-
mallocStack
public static RMTSettings mallocStack()
Returns a newRMTSettingsinstance allocated on the thread-localMemoryStack.
-
callocStack
public static RMTSettings callocStack()
Returns a newRMTSettingsinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static RMTSettings mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettingsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static RMTSettings callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettingsinstance allocated on the specifiedMemoryStackand 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
-
-