RakNet

RakNet.is_enabled

Boolean field on the RakNet table.

문법

RakNet.is_enabled(): boolean
별칭 raknet.is_enabled

반환값

이름타입설명
enabledbooleantrue when the RakNet API surface was registered for this session; false otherwise.

설명

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.

파라미터 없이 호출합니다. 함수는 현재 runtime 상태에서 필요한 context를 읽습니다.

enabled (boolean)을 반환합니다. 반환 표를 사용해 성공 값, nil 결과, 복구 가능한 오류를 구분하세요.

예제

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)