Page 1 of 1
Standard\TeamSpeak plugin throws exception on stopServer()
Posted: 28 Dec 2012, 05:46
by TatharNuar
If I stop my server using my Server Commands plugin, the Standard\TeamSpeak plugin throws an exception. A copy of the function from my plugin is below.
Code: Select all
function stopServerNow($login)
{
$name = $this -> storage -> getPlayerObject($login) -> nickName;
$this -> connection -> chatSendServerMessage("$name \$z($login) is shutting down the server NOW.");
$strippedName = Formatting::stripStyles($name);
$this -> connection -> stopServer();
die("$strippedName ($login) shut down the server.");
}
Re: Standard\TeamSpeak plugin throws exception on stopServer
Posted: 28 Dec 2012, 08:53
by farfa
Can you give us more details about the exception ?
Have you started your server with noautoquit option ?
Re: Standard\TeamSpeak plugin throws exception on stopServer
Posted: 28 Dec 2012, 11:48
by TatharNuar
farfa wrote:Can you give us more details about the exception ?
Have you started your server with noautoquit option ?
I run my testing server on a different computer, so I wouldn't be able to dig up the actual exception. Would it be OK if I just sent you my plugin so you could try it for yourself? It can be reproduced by typing /stopServerNow with both plugins running.
No, I don't know what that option is.
Re: Standard\TeamSpeak plugin throws exception on stopServer
Posted: 28 Dec 2012, 11:54
by farfa
The thing is, if your server is killed. I mean the task does not run anymore (it's the normal situation if you have not start it with the command /noautoquit). ManiaLive crash because the XML-RPC connection is lost.
So, if your server does not run with /noautoquit, it's normal, otherwise, your code sample should be enough to create a fake plugin.
Re: Standard\TeamSpeak plugin throws exception on stopServer
Posted: 29 Dec 2012, 00:36
by TatharNuar
farfa wrote:The thing is, if your server is killed. I mean the task does not run anymore (it's the normal situation if you have not start it with the command /noautoquit). ManiaLive crash because the XML-RPC connection is lost.
So, if your server does not run with /noautoquit, it's normal, otherwise, your code sample should be enough to create a fake plugin.
So, am I doing it right? I couldn't find anything to shut down ManiaLive itself, so I just used PHP's die().