Page 3 of 3

Re: Script.Round : Fetch Score + Alter live modescript_settings

Posted: 21 Jan 2020, 11:35
by undef.de
Miss wrote:
20 Jan 2020, 22:33
Well, Uaseco in itself is pretty slow.
Well... is it? Hmmm... strange.

Re: Script.Round : Fetch Score + Alter live modescript_settings

Posted: 21 Jan 2020, 18:00
by hackie
undef.de wrote:
21 Jan 2020, 11:35
Miss wrote:
20 Jan 2020, 22:33
Well, Uaseco in itself is pretty slow.
Well... is it? Hmmm... strange.

:o Strange indeed. :roflol:

Re: Script.Round : Fetch Score + Alter live modescript_settings

Posted: 21 Jan 2020, 18:22
by Palteza
Miss wrote:
20 Jan 2020, 22:33
Well, Uaseco in itself is pretty slow. But another thing is, if you're sending a manialink to every player at the same time, that might take some time. (Definitely not 3 seconds though..)

It might be faster to display such a text clientside using Maniascript instead of sending the entire manialink.
Doesn't explain why this little manialink takes 4 seconds to show up, when this one (or other of this kind) always comes instantly :

Code: Select all

	$xml  = '<manialink id="3121120001">';
	$xml .= '<frame posn="-160 63 0">';
	$xml .= '<label posn="13 9 2" sizen="60 4" scale ="0.5" valign="center" halign="left" style="TextRaceMessageBig" substyle="" text="Teams Rankings"/>';
	$xml .= '<quad posn="0 4.5 2" sizen="58 1" style="Icons128x32_1" substyle="SlideBar"/>';

	$i = 0;
	$posap = 1;
	foreach($za_teampts as $logt => $pts) {
		if (isset($aseco->server->players->player_list[$logt])) $nickt = $aseco->server->players->player_list[$logt]->nickname;
		else $nickt = $logt;
		
		// algo évolution des positions des teams entre les 2 rounds (pour générer la flèche verte ou rouge)
		$posav = 1;
		foreach ($za_teamcompar as $teamav => $ptsav) {
			if ($teamav === $logt) {
				$diff = $posap - $posav;
				if ($diff > 0) {
					$substyle = "DownWrong";
				} elseif ($diff < 0) {
					$substyle = "UpGood";
				} else {
					$substyle = "";
				}
				break;
			}
			$posav++;
		}
		$posap++;
		//////////////////////////////////////////////////////////////////////////////////////////////////////

		$posv = -$i * 5.5;
		$xml .= '<label posn="1 '.($posv).' 1" sizen="4 0.6" scale="0.55" valign="center" halign="left" text="('.$za_teamnbjou[$logt].')"/>';
		$xml .= '<label posn="6.5 '.($posv-0.16).' 1" sizen="5 1" scale="0.65" valign="center" halign="center" style="TextTitle3" substyle="" text="'.($i + 1).'."/>';
		$xml .= '<label posn="9 '.($posv).' 1" sizen="40 1" scale="0.8" valign="center" halign="left" style="TextTitle3" substyle="" text="'.$nickt.'"/>';
		$xml .= '<label posn="49.5 '.($posv-0.12).' 1" sizen="56 0.6" scale="0.68" valign="center" halign="center" style="TextTitle3" substyle="" text="'.$pts.' Pts"/>';
		$xml .= '<quad posn="56.6 '.($posv-0.14).' 1" sizen="7 7" scale="0.57" valign="center" halign="left" style="Copilot" substyle="'.$substyle.'"/>';
	
		$i++;
		$substyle = "";
	}

	$xml .= '<quad posn="0 '.($posv * 1.087).' 2" sizen="58 1" style="Icons128x32_1" substyle="SlideBar"/>';
	$xml .= '</frame>';
	$xml .= '</manialink>';

Well now I'm reporting this, I see that I use, for the one causing problem : $aseco->client->query("SendDisplayManialinkPage", $xml, 10000, false)
And for the one in this post : $aseco->sendManialink($xml, false, 0, false);

Any significative difference between the 2 methods ?

Re: Script.Round : Fetch Score + Alter live modescript_settings

Posted: 21 Jan 2020, 21:35
by undef.de
Palteza wrote:
21 Jan 2020, 18:22
Well now I'm reporting this, I see that I use, for the one causing problem : $aseco->client->query("SendDisplayManialinkPage", $xml, 10000, false)
And for the one in this post : $aseco->sendManialink($xml, false, 0, false);

Any significative difference between the 2 methods ?
$aseco->sendManialink() uses also $aseco->client->query("SendDisplayManialinkPage", $xml, $timeout, $hideclick) to send the manialink to all players, so that couldn't be the problem. But it's better to use $aseco->sendManialink() instead of the methods directly, because the methods could be changed.

If you want, you could PM me your plugin and I'll take a deeper look into the whole code.