Dedicated Server API Client Communication

Discuss the Dedicated Server Tools developed by Nadeo Live such as ManiaLive, Trust Circles, Dedicated Manager, Competition Manager and Lobbies

Moderator: NADEO

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Dedicated Server API Client Communication

Post by kremsy » 04 May 2014, 17:48

Also two reports from local server, so it's not only on Reading Maplist it seems like:

Code: Select all

[ManiaControl DEBUG]: Fatal Exception: Connection interrupted while reading header Trace: #0 /home/smparagon1/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php(191): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->readMessage()
#1 /home/smparagon1/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php(126): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->flush(true)
#2 /home/smparagon1/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Connection.php(133): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->query('GetStatus', Array)
#3 /home/smparagon1/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Connection.php(4318): Maniaplanet\DedicatedServer\Connection->execute('GetStatus')
#4 /home/smparagon1/ManiaControl/core/Server/Server.php(396): Maniaplanet\DedicatedServer\Connection->getStatus()
#5 /home/smparagon1/ManiaControl/core/ManiaControl.php(403): ManiaControl\Server\Server->waitForStatus(4)
#6 /home/smparagon1/ManiaControl/core/ManiaControl.php(310): ManiaControl\ManiaControl->connect()
#7 /home/smparagon1/ManiaControl/ManiaControl.php(110): ManiaControl\ManiaControl->run()
#8 {main} 	Trace:
#0: ManiaControl\ErrorHandler->errorHandler in File /home/smparagon1/ManiaControl/core/ErrorHandler.php on Line 168
#1: ManiaControl\ErrorHandler->triggerDebugNotice in File /home/smparagon1/ManiaControl/core/ManiaControl.php on Line 409
#2: ManiaControl\ManiaControl->connect in File /home/smparagon1/ManiaControl/core/ManiaControl.php on Line 310
#3: ManiaControl\ManiaControl->run in File /home/smparagon1/ManiaControl/ManiaControl.php on Line 110 		- 	nightly: 2014-04-28 00:10:08 	Linux / 5.4.4-14+deb7u8 	2014-05-02 20:32:13
3017 	[ManiaControl DEBUG]: Fatal Exception: Connection interrupted while writing Trace: #0 /home/smparagon7/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php(125): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->writeMessage(' #1 /home/smparagon7/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Connection.php(133): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->query('GetStatus', Array)
#2 /home/smparagon7/ManiaControl/core/Libs/Maniaplanet/DedicatedServer/Connection.php(4318): Maniaplanet\DedicatedServer\Connection->execute('GetStatus')
#3 /home/smparagon7/ManiaControl/core/Server/Server.php(409): Maniaplanet\DedicatedServer\Connection->getStatus()
#4 /home/smparagon7/ManiaControl/core/ManiaControl.php(405): ManiaControl\Server\Server->waitForStatus(4)
#5 /home/smparagon7/ManiaControl/core/ManiaControl.php(312): ManiaControl\ManiaControl->connect()
#6 /home/smparagon7/ManiaControl/ManiaControl.php(110): ManiaControl\ManiaControl->run()
#7 {main}
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
Jojo_44
Posts: 500
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

Re: Dedicated Server API Client Communication

Post by Jojo_44 » 04 May 2014, 18:57

I´m running out of ideas ;)

Just to clarify this:

The interrupts occur with the original nadeo library and also with the new one from Big_Boo ?

Maybe echoing out the data variable before returning false would help to get some information ?

Jojo
Image
my english sounds very unfriendly but it isn´t ;)

User avatar
The_Big_Boo
Posts: 1041
Joined: 15 Jun 2010, 15:46

Re: Dedicated Server API Client Communication

Post by The_Big_Boo » 04 May 2014, 18:59

kremsy wrote:

Code: Select all

[ManiaControl DEBUG]: Fatal Exception: Connection interrupted while writing
This is something new. But it also means there's something really wrong, which lower the chances that it comes from my library... so, unfortunately, it likely comes from somewhere else.


However, can you apply this patch so we get more information about the socket state

Code: Select all

diff --git a/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php b/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php
index e6deb62..3cc0c44 100644
--- a/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php
+++ b/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php
@@ -218,7 +218,7 @@
 	{
 		$header = $this->read(8);
 		if($header === false)
-			throw new TransportException('Connection interrupted while reading header', TransportException::INTERRUPTED);
+			throw new TransportException('Connection interrupted while reading header '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
 
 		extract(unpack('Vsize/Vhandle', $header));
 		/** @var $size int */
@@ -231,7 +231,7 @@
 
 		$data = $this->read($size);
 		if($data === false)
-			throw new TransportException('Connection interrupted while reading data', TransportException::INTERRUPTED);
+			throw new TransportException('Connection interrupted while reading data '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
 
 		$this->lastNetworkActivity = time();
 		return array($handle, $data);
@@ -245,7 +245,7 @@
 	{
 		$data = pack('V2a*', strlen($xml), ++$this->requestHandle, $xml);
 		if(!$this->write($data))
-			throw new TransportException('Connection interrupted while writing', TransportException::INTERRUPTED);
+			throw new TransportException('Connection interrupted while writing '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
 		$this->lastNetworkActivity = time();
 	}
 


Edit: actually, could you also update the dedicated-api library upto at least this commit (the more recent ones concerning the Connection class "refresh")? Because, I quickly checked and saw the version you're using is way behind mine so it doesn't really help finding issues ^^

Edit 2: by any chance, can your interruptions issues be related in any way to your AsynchronousFileReader? I mean, this report strangely shows the same kind of symptoms (timeout, no data received at all) :? I'm not saying this is the cause but it might be interesting to look into this more closely.
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Dedicated Server API Client Communication

Post by kremsy » 04 May 2014, 21:55

I didnt looked that well maybe the one with writing wasa server restart or something.

We will head to the newest version in the next 1-2 days :).
Will also apply the debug code.

And im sure that the filereader has nothing todo with it, we had the issue already before and yeah same with the old dededicates api. Dunno if it helps or not but it seems that it have todo somehing with the very fast loop of maiacontrol (reading callbacks every ms)
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Dedicated Server API Client Communication

Post by kremsy » 04 May 2014, 22:07

Nevermind the write one you can just see that its due start think its no issue.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Dedicated Server API Client Communication

Post by kremsy » 08 May 2014, 20:43

Got all the new changes now in and also the Debugmessage, lets see what will happen ;).

What I don't really understand in the changes is, why you combined chatSend and chatSendServerMessage.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Dedicated Server API Client Communication

Post by kremsy » 09 May 2014, 13:18

Today I let a profile running over the application to find performance issues, I just found out that in 20sec of our running application, the executeCallbacks takes almost 9 seconds (in only 59 calls or something), but the strange thing is that of that 9 seconds, over 5seconds get lost in the unpack Method, is this method really that inefficient?

http://www.pictures.esc-clan.net/upload/profiler.png

Edit: My fault the times shown in the screenshot are in ms not s.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
The_Big_Boo
Posts: 1041
Joined: 15 Jun 2010, 15:46

Re: Dedicated Server API Client Communication

Post by The_Big_Boo » 09 May 2014, 13:37

kremsy wrote:What I don't really understand in the changes is, why you combined chatSend and chatSendServerMessage.
I actually had in mind that only chatSendServerMessage is necessary because making the server "speaking" like any player is weird (and ugly anyway). But using chatSend is shorter than chatSendServerMessage thus I decided to merge it.
I can still:
- make isServerMessage argument default to true (though it breaks a bit compatibility)
- undeprecate chatSendServerMessage while keeping the current chatSend
- undeprecate chatSendServerMessage and remove the isServerMessage argument in chatSend

However, before choosing any of these choices, what exactly is bothering you with this change?
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Dedicated Server API Client Communication

Post by kremsy » 09 May 2014, 13:41

The_Big_Boo wrote:
kremsy wrote:What I don't really understand in the changes is, why you combined chatSend and chatSendServerMessage.
I actually had in mind that only chatSendServerMessage is necessary because making the server "speaking" like any player is weird (and ugly anyway). But using chatSend is shorter than chatSendServerMessage thus I decided to merge it.
I can still:
- make isServerMessage argument default to true (though it breaks a bit compatibility)
- undeprecate chatSendServerMessage while keeping the current chatSend
- undeprecate chatSendServerMessage and remove the isServerMessage argument in chatSend

However, before choosing any of these choices, what exactly is bothering you with this change?
I mean basically for us its no problem because we handle the chat ourselves anyway and so it's just a one line change. I just think it can get sometimes weired for Plugin-Authors if the Method names are differing from the official DedicatedServer Method names, I think it's okay like you did it now, and we can change it, I just only think its a bit confusing.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Dedicated Server API Client Communication

Post by steeffeen » 09 May 2014, 13:46

kremsy wrote:I just think it can get sometimes weird [...] if the Method names are differing from the official DedicatedServer Method names
this.
imo the dedi-api is an interface to the dedi and not a framework that does additional logic
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks

    Post Reply

    Return to “Dedicated Server Tools”

    Who is online

    Users browsing this forum: No registered users and 1 guest