Skip to main content

Export Functions (Server-side)

ส่งออกฟังก์ชันเพื่อให้สามารถเรียกใช้จากทรัพยากรอื่นได้ทางฝั่ง Server

executeCommand

เรียกใช้งาน คำสั่งต่างๆ ของทรัพยากรนี้

exports.azael_playpass:executeCommand(subCommandKey, args)

Arguments

  • subCommandKey: string
  • args: table<{ [index]: any }> | nil
    • ข้อมูลที่คำสั่งต้องการ

Returns

  • success: boolean
    • สถานะการใช้งานคำสั่ง
  • response: table<{ [key]: any }>
    • ข้อมูลตอบกลับของคำสั่ง
รายละเอียดข้อมูลตอบกลับของคำสั่ง
Success

ข้อมูลตอบกลับเมื่อใช้คำสั่งสำเร็จ คุณสามารถดูรายละเอียดได้ที่ respHandler

Failed

ข้อมูลตอบกลับเมื่อใช้คำสั่งล้มเหลว

FieldTypeDescription
typestringประเภทของข้อผิดพลาด
messagestringข้อความของข้อผิดพลาด

Subcommand List

KeyLabel
getUserรับข้อมูลผู้ใช้
addUserเพิ่มข้อมูลผู้ใช้
deleteUserลบข้อมูลผู้ใช้
getBanInfoรับข้อมูลแบนผู้ใช้
banUserแบนผู้ใช้ (ชั่วคราว/ถาวร)
unbanUserยกเลิกแบนผู้ใช้
setUserRoleกำหนดบทบาทผู้ใช้
reactivateUserยกเลิกระงับผู้ใช้ (ไม่เล่นนานเกินกำหนด)
setNewIdentifierกำหนดตัวระบุใหม่ให้ผู้ใช้
resetBindIdentifierรีเซ็ตตัวระบุที่ผูกไว้ของผู้ใช้
resetHwidsรีเซ็ต HWIDs ผู้ใช้
getPointsรับข้อมูลคิวพอยท์ผู้ใช้
addPointsเพิ่มคิวพอยท์ผู้ใช้
setPermanentPointsกำหนดคิวพ้อยท์ถาวรผู้ใช้
deleteTemporaryPointsลบคิวพ้อยท์ชั่วคราวผู้ใช้
purgePointsลบคิวพ้อยท์ทั้งหมดของผู้ใช้
getAirtimeรับแอร์ไทม์คงเหลือผู้ใช้
setAirtimeกำหนดแอร์ไทม์ผู้ใช้
addAirtimeเพิ่มแอร์ไทม์ผู้ใช้
removeAirtimeลบแอร์ไทม์ผู้ใช้
getQueueInfoรับข้อมูลระบบคิว

getUser

รับข้อมูลผู้ใช้งาน

exports.azael_playpass:getUser(identifier)

Arguments

Returns

addUser

เพิ่มข้อมูลผู้ใช้

exports.azael_playpass:addUser(identifier, boundId|nil)

Arguments

Returns

deleteUser

ลบข้อมูลผู้ใช้

exports.azael_playpass:deleteUser(identifier)

Arguments

Returns

getBanInfo

รับข้อมูลแบนผู้ใช้

exports.azael_playpass:getBanInfo(identifier|banRefId)

Arguments

  • identifier | banRefId: string

Returns

banUser

แบนผู้ใช้ ชั่วคราว หรือ ถาวร

exports.azael_playpass:banUser(identifier, numDays|0=permanent, reason)

Arguments

  • identifier: string
  • numDays: integer
    • จำนวนวันที่ต้องการแบนผู้ใช้ หรือระบุ 0 เพื่อแบนผู้ใช้ถาวร
  • reason: string
    • เหตุผลที่แบนผู้ใช้

Returns

unbanUser

ยกเลิกแบนผู้ใช้

exports.azael_playpass:unbanUser(identifier)

Arguments

Returns

setUserRole

กำหนดบทบาทผู้ใช้

exports.azael_playpass:setUserRole(identifier, roleId)

Arguments

Returns

reactivateUser

ยกเลิกสถานะการถูกระงับของผู้ใช้ จากสาเหตุไม่เข้าร่วมเซิร์ฟเวอร์นานเกินที่กำหนดใน inactivePlayers

exports.azael_playpass:reactivateUser(identifier)

Arguments

Returns

setNewIdentifier

กำหนดตัวระบุใหม่ให้ผู้ใช้

exports.azael_playpass:setNewIdentifier(identifier, newIdentifier)

Arguments

Returns

resetBindIdentifier

รีเซ็ตตัวระบุที่ผูกไว้ของผู้ใช้

exports.azael_playpass:resetBindIdentifier(identifier)

Arguments

Returns

resetHwids

รีเซ็ต HWIDs ของผู้ใช้

exports.azael_playpass:resetHwids(identifier)

Arguments

Returns

getPoints

รับข้อมูลคิวพอยท์ผู้ใช้

exports.azael_playpass:getPoints(identifier)

Arguments

Returns

addPoints

เพิ่มคิวพอยท์ผู้ใช้

exports.azael_playpass:addPoints(identifier, numPoints, expirationDays|nil)

Arguments

  • identifier: string
  • numPoints: integer
    • จำนวนคิวพ้อยท์ที่ต้องการเพิ่มให้ผู้ใช้
  • expirationDays: integer | nil
    • จำนวนวันที่คิวพ้อยท์จะหมดอายุ หรือ ไม่ระบุหากเป็นคิวพ้อยท์แบบถาวร (ไม่มีวันหมดอายุ)

Returns

setPermanentPoints

กำหนดคิวพ้อยท์ถาวรผู้ใช้

exports.azael_playpass:setPermanentPoints(identifier, numPoints)

Arguments

  • identifier: string
  • numPoints: integer
    • จำนวนคิวพ้อยท์ที่ต้องการกำหนดให้ผู้ใช้

Returns

deleteTemporaryPoints

ลบคิวพ้อยท์ชั่วคราวของผู้ใช้ (คิวพ้อยท์แบบมีวันหมดอายุ)

exports.azael_playpass:deleteTemporaryPoints(identifier, numIndex)

Arguments

Returns

purgePoints

ลบคิวพ้อยท์ทั้งหมดของผู้ใช้

exports.azael_playpass:purgePoints(identifier)

Arguments

Returns

getAirtime

รับแอร์ไทม์คงเหลือผู้ใช้

exports.azael_playpass:getAirtime(identifier)

Arguments

Returns

setAirtime

กำหนดแอร์ไทม์ผู้ใช้

exports.azael_playpass:setAirtime(identifier, numSeconds)

Arguments

  • identifier: string
  • numSeconds: integer
    • จำนวนแอร์ไทม์ที่ต้องการกำหนดให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
      • 3600 วินาที = 1 ชั่วโมง
      • 86400 วินาที = 1 วัน
      • 604800 วินาที = 7 วัน
      • 18144000 วินาที = 30 วัน

Returns

addAirtime

เพิ่มแอร์ไทม์ผู้ใช้

exports.azael_playpass:addAirtime(identifier, numSeconds)

Arguments

  • identifier: string
  • numSeconds: integer
    • จำนวนแอร์ไทม์ที่ต้องการเพิ่มให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
      • 3600 วินาที = 1 ชั่วโมง
      • 86400 วินาที = 1 วัน
      • 604800 วินาที = 7 วัน
      • 18144000 วินาที = 30 วัน

Returns

removeAirtime

ลบแอร์ไทม์ผู้ใช้

exports.azael_playpass:removeAirtime(identifier, numSeconds)

Arguments

  • identifier: string
  • numSeconds: integer
    • จำนวนแอร์ไทม์ที่ต้องการเพิ่มให้ผู้ใช้ โดยมีหน่วยเป็น วินาที
      • 3600 วินาที = 1 ชั่วโมง
      • 86400 วินาที = 1 วัน
      • 604800 วินาที = 7 วัน
      • 18144000 วินาที = 30 วัน

Returns

getQueueInfo

รับข้อมูลระบบคิวรอเข้าร่วมเซิร์ฟเวอร์

exports.azael_playpass:getQueueInfo()

Returns

hasInactiveRecord

ผู้ใช้เคยถูกระงับจากสาเหตุไม่เข้าร่วมเซิร์ฟเวอร์นานเกินที่กำหนดใน inactivePlayers หรือไม่?

exports.azael_playpass:hasInactiveRecord(identifier)

Arguments

Returns

  • wasInactive: boolean
    • สถานะเคยถูกระงับ
  • rejoinData: table<{ timestamp: integer, secondsAgo: integer }> | nil
    • ข้อมูลการเข้าร่วมเซิร์ฟเวอร์หลังถูกยกเลิกสถานะจาก reactivateUser หรือใช้คำสั่ง ยกเลิกระงับผู้ใช้ (ไม่เล่นนานเกินกำหนด)
      • timestamp: integer
        • เวลาที่เข้าร่วมกับเซิร์ฟเวอร์หรือถูกยกเลิกสถานะครั้งล่าสุด (Unix time)
      • secondsAgo: integer
        • เข้าร่วมกับเซิร์ฟเวอร์หรือถูกยกเลิกสถานะมาแล้วกี่วินาที