Separate names with a comma.
Comments in 'Plugin Development' started by wolfdale, Mar 31, 2015.
Is it possible to check the reason the player left the server? such as timeout or client disconnect?
Yes, The Server Log prints it out.
is it possible for a plugin to check that?
You may want to look at $event->getQuitMessage()
what i am trying to achieve is for a plugin to get if the player quits by client disconnect or by timeout, is that possible?
Why not try dumping getQuitMessage() in your tests and see the values so that you can just check if the values match the ones in your tests?
Im sorry, i dont see any difference?
Then I don't think you can.
But also think about PlayerKickEvent. I don't think it helps, but you can still try.
You could simply read the "server.log" file. It is recorded there.
He is asking about with a plugin...
Uhh well, you could do that using the OB family of functions (like ob_start()), but not sure if it is even present in PocketMine extensions.
AFIK, you can fopen("server.log","w") ... etc... from a plugin.
It is not as real time but it is no different from checking the server.log from another program.
No, that is not good because it will fight for resources with the server.
Better do addAttachment() on MainLogger.