Enhanced TNet Protocol (For Developers)

First, to identify a client as being a Blocktrix client,

the server must initiate the handshake so to speak by sending the following to a logged in user:

lvl 0 0\xFF

(Where \xFF is the standard TNet protocol line delimiter)

This in turn forces the BTrix client to respond with:

clientinfo Blocktrix <version info>\xFF

There are some things you may send to BTrix0.13+ clients (after identifying them as such with the lvl protocol). These are as follows: (the queries and the replies all end with the standard TNet delimiter)

ping <argument>

- This will have the client return "pong <argument>" back to the server. Useful for determining latency, or if the client is even alive. (eg. ping 1108944693 will have the client return pong 1108944693)

options <option list>

- This will tell the client what options you wish for the client to obey.

- Options include:

- nomacros : User will NOT be able to drop pieces in far left/right columns with

a single keystroke (at least, not without the use of an external program)

- rotatepreview : User will be able to rotate the next preview piece

- dualpreview : User will see two piece preview display

- delay=<value> : The specified value (in ms) will be used as the time delay between pieces

- botppm=<value> : The specified value will be used as the max. ppm the bot mode for the client will be able to go (0 = disable bot mode <default>)

- samepieces=<seed> : The specified seed will be used for generating random pieces/specials/etc..

- piecedrop : Will force client to send "pd <UserNum>" to server whenever a piece has been dropped (0.14+)

- piecehold : User will be able to use the hold piece feature, to hold the current falling piece

eg. options nomacros dualpreview delay=0 samepieces=5

Note: Changes with options are NOT accumulative, so you will need to send the entire settings you wish for the client to have each time you send out "options". Sending options with no arguments will reset the client to default settings.

Also, server developers may take advantage of the new specials that btrix offers, when sending their newgame string, the same way the occurancy for the other specials are specified, except using letters for the extended specials (as all single digit numbers are taken already by the existing specials): 'a' for zebra attack, 'b' for left gravity, and 'c' for piece change. (They will be sent as 'z','l','p' for field changes, so, developers will also need to adjust their field checks accordingly).

See Also:

TetriNET Protocol