Page 6 of 7
Re: ManiaLive 3.1.0
Posted: 03 May 2014, 20:46
by oliverde8
The_Big_Boo wrote:oliverde8 wrote:Edit : we never used to have this problem before MP3 and we had nearly a 100 players a few times.
That's actually because my version of dedicated-api library has a feature the old one hadn't: if you use multicall but there's only a single request pending, it sends the request directly (without multicall encapsulation) thus any fault sent back by the server generate an exception. With the multicall encapsulation, exceptions aren't created (because the answer is an array which may contains faults instead of a fault) but it doesn't mean everything was fine.
Anyway, I'll look into it but if you can give me an easy repro, that would really help me ^^
Edit: btw, when a player disconnects, the GuiHandler is already doing the Window::Erase($login) so you don't need it

Thanks a lot,

so we had a hidden problem XD. well reproducing the error has been a problem. The only way I could do it was with changing the code.
At the begining of the onPreLoop I added a call to PlayerConnect of Gui Handler and a plugin with a static instance to ask it to create a window on Null. When I do this the onPreloop starts with a player that doesn't exist and the effect is the same, the window isn't shown for me also, I am not sure if this is exactly what happense in reality but is what I came the closest to reproduce something.
I also replaced on our las version the final loop with :
Code: Select all
// Final loop to send manialinks
$failed = false; //Did it work
$multiCall = true; //If problem we will need to disable it
do{
$nextIsModal = false;
foreach($stackByPlayer as $login => $data)
{
Manialinks::load();
foreach($data as $toDraw)
{
if($nextIsModal) // this element can't be anything else than a window
{
$this->drawModal($toDraw);
$nextIsModal = false;
}
else if($toDraw === self::NEXT_IS_MODAL) // special delimiter for modals
$nextIsModal = true;
else if(is_string($toDraw)) // a window's id alone means it has to be hidden
$this->drawHidden($toDraw);
else if(is_array($toDraw)) // custom ui's special case
{
array_shift($toDraw)->save();
foreach($toDraw as $customUI)
$customUI->hasBeenSaved();
}
else // else it can only be a window to show
{
$this->drawWindow($toDraw);
}
}
try{
$this->connection->sendDisplayManialinkPage(((string) $login), Manialinks::getXml(), 0, false, $multiCall);
}catch(\Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException $ex){
\ManiaLive\Utilities\Console::println("[ManiaLive]Attempt to send Manialink to $login failed. Login unknown");
\ManiaLive\Utilities\Logger::info("[ManiaLive]Attempt to send Manialink to $login failed. Login unknown");
}
}
try{
if($multiCall){
$this->connection->executeMulticall();
}
$failed = false;
}catch(\Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException $ex){
\ManiaLive\Utilities\Console::println("[ManiaLive]Attempt to send Manialink to a login failed. Login unknown");
\ManiaLive\Utilities\Logger::info("[ManiaLive]Attempt to send Manialink to a login failed. Login unknown");
$multiCall = false;
$failed = true;
}
}while($failed);
but I don't think it is the way to go and I was short of simple ideas that don't result in making loops on stuff that throws exceptions XD
Re: ManiaLive 3.1.0
Posted: 03 May 2014, 21:22
by The_Big_Boo
oliverde8 wrote:At the begining of the onPreLoop I added a call to PlayerConnect of Gui Handler and a plugin with a static instance to ask it to create a window on Null. When I do this the onPreloop starts with a player that doesn't exist and the effect is the same, the window isn't shown for me also, I am not sure if this is exactly what happense in reality but is what I came the closest to reproduce something.
I don't have any issue even with adding this kind of code (except one because of calling onPlayerConnect each loop ^^)
I'm using this simple window:
Code: Select all
class Test extends Window
{
function onConstruct()
{
$ui = new Elements\Xml('<quad sizen="40 40" bgcolor="f00"/>');
$this->addComponent($ui);
}
}
And I made different tests at the begin of onPreLoop():
Code: Select all
$this->onPlayerConnect('whatever', false);
$w = Test::Create();
$w->show();
-----
$w->show('whatever');
-----
$w->show();
$w->hide('whatever');
Everytime it works without any exception and I'm seeing the window as expected. I also try a raw call to sendDisplayManialinkPage() and even if some of the given logins failed, the others are seeing the window.
Are you sure you have the right lines 329 and 330 in GuiHandler (with the recent patch adding the array_intersect)? Because that's the only reason I can think of at the moment

Re: ManiaLive 3.1.0
Posted: 03 May 2014, 21:28
by oliverde8
hmm I will recheck tomorrow I was pretty sure I had them :S when did 't I had worse problems XD
Re: ManiaLive 3.1.0
Posted: 04 May 2014, 09:15
by oliverde8
So I have retried this morning with your manialive-lib,
If I do this
Code: Select all
$w = Test::Create();
$w->show();
if(!$this->connected)
$this->onPlayerConnect('whatever', false);
I have login unknown error but the manialink is sent fine, I can't reproduce it again

Re: ManiaLive 3.1.0
Posted: 04 May 2014, 09:39
by The_Big_Boo
Actually you shouldn't even get the login unknown exception
Can you please try to do the following around the multicall and send me the info log file?
Code: Select all
try
{
$this->connection->executeMulticall();
}
catch(\Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException $e)
{
\ManiaLive\Utilities\Logger::info($playersOnServer);
\ManiaLive\Utilities\Logger::info($playersHidingGui);
\ManiaLive\Utilities\Logger::info($playersShowingGui);
\ManiaLive\Utilities\Logger::info($showing);
\ManiaLive\Utilities\Logger::info($hiding);
}
Re: ManiaLive 3.1.0
Posted: 04 May 2014, 10:03
by oliverde8
Since I merged everything I can't reproduce it :S just tried on the older version and there is an error. So probably did an error while merging something before/
So I suppose we can say fixed, thanks a lot

and sorry

Re: ManiaLive 3.1.0
Posted: 03 Apr 2016, 11:58
by oliverde8
Hi,
We are still having some issues with the Gui Handler, Basically we have a LoginUnknown errors and probably some size issues with our Manialinks.
Login issues
What is happening is onBeginMap we display nearly all the widgets. And there is a ton of them with a lot of Maniascript. So when onPreLoop Manialive tries to display the widgets quite some time has passed and some users for whom we have created widgets has disconnected. Therfore the
Code: Select all
$playersOnServer = array_merge(Storage::keys(Storage::getInstance()->players), Storage::keys(Storage::getInstance()->spectators));
is not correct anymore at one point. because when we actually start doing the sendDisplayManialinkPage that user might not be there anymore. So we have a UnknownPlayerException
This I believe we have fixed by detecting the error during the multi execution & repeating the execution for each login indiviually. I know performance wise this is baaaaad
Sizeissues
The second error was to big xml, as we have all the records stored in the local records widget the widget is quite big. And when sending all of them in one xml it was to big for the dedicated server. We have worked out some grouping and fixed that as well.
But we still have missing widgets. The issue happens only when there are many players on the server. And I can't reproduce it on my servers with fake players.
So we are desperate with reaby because we are not sure we understand from where comes the issue. Even on the servers where it does happen it only does time to time.
Here is our version of the Gui Handler :
https://github.com/eXpansionPluginPack/ ... andler.php
Thanks,
Re: ManiaLive 3.1.0
Posted: 03 Apr 2016, 12:49
by w1lla
Seems to me the player when disconnected is never erased from manialive.
See:
https://github.com/eXpansionPluginPack/ ... e.php#L186
Re: ManiaLive 3.1.0
Posted: 03 Apr 2016, 12:57
by oliverde8
No they are :
https://github.com/eXpansionPluginPack/ ... e.php#L135
The issue with players only happens when the server slow down to much.
Re: ManiaLive 3.1.0
Posted: 03 Apr 2016, 13:10
by w1lla
Just wondering then why the GBXRemote limit values have changed, as it seems to me that the value of GBX/Dedicated was changed for some reasons.
Edit: It was with the first release of the dedicated 400Ko x nb players.
Source:
viewtopic.php?f=261&t=8599&start=30#p88019
increased the XmlRpc maximum packet size To 1Mo to support the now bigger maps. (but note that while it's convienient to shove the maps though this communication channel, it's not really optimal... And that very big maps with many ghosts and such, still won't fit.)