-
Notifications
You must be signed in to change notification settings - Fork 170
po: Protocol
The PO protocol (scheme) is enabled in channel chat, and enables additional client-side functionality specified by a developer using anchors (HTML anchor tag: ). The user must click the anchor for the functionality, so it is secure.
To be used, the developer must send an HTML message using server-side sys.sendHtmlAll
, client-side client.printHtml
(and similar functions), or manually through the network protocol (however you want to do it). It must be used inside the href attribute of an a tag (anchor). The syntax is po:method/parameter
po:join/channel
Parameter: channel name
This method makes the player join the supplied channel. Additionally, the client will focus on the channel if the player is already in it.
po:reconnect
This method makes the player reconnect to the server. No parameters are used. Note, there is no solidus at the end!
po:watch/battle
Parameter: battle id
This method makes the player watch the given battle. Note that Spectator Clause is still in effect and scripts can deny access as well.
po:watchplayer/name-or-id
Parameter: player id/player name
This method makes the player watch the given player's battle. Note that Spectator Clause is still in effect and scripts can deny access as well. Although you can both specify id or name, prefer using the player's id, because for numeric names the client will attempt to watch the battle of the player with that id.
po:pm/name-or-id
Parameter: player id/player name
This method makes the player open a PM window for the given player. Although you can both specify id or name, prefer using the player's id, because for numeric names the client will attempt to open a PM window for the player with that id.
po:ignore/name-or-id
Parameter: player id/player name
This method makes the player toggle their ignore status for the given player. Although you can both specify id or name, prefer using the player's id, because for numeric names the client will attempt to toggle the ignore status the player with that id.
po:info/name-or-id
Parameter: player id/player name
This method makes the player open a challenge window for the given player. Although you can both specify id or name, prefer using the player's id, because for numeric names the client will attempt to open a challenge window for the player with that id.
po:send/message
Parameter: message
This method makes the player send a message in the channel the anchor was printed in. The client-side beforeSendMessage
will receive the message and may reject the sending of it. New lines (\n) can be used to send several messages at once.
po:setmsg/message
Parameter: message
This method changes the text inside the player's chat line with the given message.
po:appendmsg/message
Parameter: message
This method adds the given message to the text inside the player's chat line.