Author Topic: Blockland Glass - Open Beta  (Read 19509 times)

I made a script called "TCPHooker" that allows add-ons to hook into a TCPObject listening on the server's port. Do you have use for this?


Can you explain how it works?

TCP object that listens on the server's port.

TCPhooker.bindProtocol(%this, %protocol, %callback, %addonName)

    //%protocol
    //Name of the protocol being bound
    //HTTP must be bound through TCPhooker::bindHTTP, since it's not a protocol designed with this mod in mind
    //Only one callback per protocol; most recent registered callback is the one that will be used

    //%callback
    //Callback function when data is received
    //Callback function will receive the protocol identifier (the first line received)

    //%addonName
    //Name of the addon that bound this protocol; should be the name of the addon file without ".zip"
    //Useful for finding out what addon bound itself to a protocol
    //Example: Script_ClearSpam


TCPhooker.bindHTTP(%this, %callback, %addonName)
    //self explanatory


What do the actual protocols look like?


PROTOCOL\tPROTONAME[\tOTHEROPTIONS]
    (format)


PROTOCOL\tSAVE-GET\tMYPASSWORD

PROTOCOL\tSERVERINFO

PROTOCOL\tSAVE-UPLOAD\t[client-id]

bump for this awesome addon