| Prev | Next |
POT contains special class to work with OTServ informational protocols. It is named OTS_ServerInfo. It associates it's instance to server connection and provides methods to retrive status information.
OTS_ServerInfo class contains status() method which sends 'info' packet to OTS and handles results. It returns object of class OTS_InfoRespond which provides access methods for all OTServ respond info. It will return false if server is offline. Here is a simple example of this method usage:
In case you would want to use this method for some non-SVN server which contains custom fields in respond packet you can still use it. OTS_InfoRespond class is child of DOMDocument class and doesn't overwrite it's interface neither behaviour in any way. Returned object is standard DOM document so you can work with it in standard DOM-way.
Many people don't know that OTServ actualy provides two information protocol and use only XML-based one. Second one was for a long time redundant so it was ommited in POT. But lastly it was extended and provides very powerful features. In the end it provides all features that XML-based protocol.
It is possible (eventualy) to retrive list of online players using binary protocol. You can do that using OTS_ServerInfo::players():
As you can see it is also possible to simply check state of single character. It doesn't require huge list, just responds single byte that represents player status.
| Prev | Up | Next |
| Additional routines | Additional routines | POT in depth |