RakNet

RakNet.is_enabled

Boolean field on the RakNet table.

ไวยากรณ์

RakNet.is_enabled(): boolean
Aliases raknet.is_enabled

Returns

ชื่อชนิดคำอธิบาย
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.

เรียกโดยไม่ต้องมี parameter ฟังก์ชันอ่าน context ที่ต้องใช้จาก runtime state ปัจจุบัน

ส่งคืน enabled (boolean) ใช้ตาราง returns เพื่อแยกค่าที่สำเร็จ ผลลัพธ์ nil และ error ที่จัดการต่อได้

ตัวอย่าง

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)