IdlePixel+ Custom Handling

Library for parsing custom messages.

Bu script direkt olarak kurulamaz. Başka scriptler için bir kütüphanedir ve meta yönergeleri içerir // @require https://update.greasyforks.org/scripts/484046/1307197/IdlePixel%2B%20Custom%20Handling.js

Yazar
Lux-Ferre
Versiyon
1.0.0
Oluşturulma
06.01.2024
Güncellenme
06.01.2024
Size
1,45 KB
Lisans
MIT

Idle-Pixel Custom Handling Framework Plugin

Extension to IP+ that adds static methods for handling custom websocket messages. It is designed to make using customs in the Anwin Custom Standard format easier.

The ACS format is: CUSTOM=recipient:callbackId:plugin:command:payload

Parser

Customs.parseCustom(player, content, callbackId)

Returns a single object of the form:

{
    player: player,
    callbackId: callbackId,
    anwinFormatted: true,
    plugin: plugin,
    command: command, 
    payload: payload
}

Note: If message is not in the ACS format, the returned object will be of the form:

{
    player: player,
    callbackId: callbackId,
    anwinFormatted: false,
    plugin: "unknown",
    command: "unknown", 
    payload: content
}

Sender

Customs.sendBasicCustom(recipient, plugin, command, payload)

This method will create an IP+ custom object and pass it on to IdlePixelPlus.sendCustomMessage()

If the advanced features of IdlePixelPlus.sendCustomMessage() are needed (ie callback functions), that method will have to be called directly instead.

长期地址
遇到问题?请前往 GitHub 提 Issues。