Documentación de Real

RakNet

RakNet.is_enabled

Boolean field on the RakNet table.

Sintaxis

RakNet.is_enabled(): boolean
Alias raknet.is_enabled

Retornos

NombreTipoDescripción
enabledbooleantrue when the RakNet API surface was registered for this session; false otherwise.

Descripción

Boolean field on the RakNet table. It is true only when RakNet support is enabled for the current Real session. When it is false, the RakNet table is still present, but the send, hook, signal, priority, and reliability fields are not registered.

Llamalo sin parametros. La funcion lee el contexto necesario desde el estado actual de runtime.

Devuelve enabled (boolean). Usa la tabla de retornos para separar valores correctos, resultados nil y errores recuperables.

Ejemplo

Check whether the RakNet API surface is available before reading RakNet methods or enum tables.

if not RakNet.is_enabled then
    warn("RakNet is disabled")
    return
end

print(RakNet.is_enabled)