Hey Undef & all,
I'm updating a private plugin from xaseco to uaseco, I'm struggling where I can gather the Score for a given player at the end of a round (or at the end of a map, but I suppose it's the same).
Since Score from GetCurrentRanking is not available for the Script.Round it seems.
An other question : still for the same mode, is there a way we could alter LIVE (without restarting uaseco, like the modification would be effective on next map), the parameters in modescript_settings.xml (would like to change rounds_per_map, or couple of other parameters). Atm the only way is to change it in the file and restart uaseco to make it updated, if I'm right.
Thanks in advance.
Script.Round : Fetch Score + Alter live modescript_settings
Re: Script.Round : Fetch Score + Alter live modescript_settings
You do not have to call the methods (like "GetCurrentRanking") from the dedicated server by yourself, all you need UASECO keep that up-to-date for you:
Just use the chat command to reload the changed settings of your config/modescript_settings.xml 
https://www.uaseco.org/development/classes/rankinglist.php#getRankByLogin wrote:$rank is the Class Ranking object.Code: Select all
$login = 'puennt_ennel'; $rank = $aseco->server->rankings->getRankByLogin($login);
Just use the chat command
Code: Select all
/modescript reload

Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: Script.Round : Fetch Score + Alter live modescript_settings
All right, get it, thanks !
Little question, if, in modescript_settings.xml, I disable the display of informations such as <checkpoint_time>, <checkpoint_list>, ...., I don't have performance improvement right ?
Little question, if, in modescript_settings.xml, I disable the display of informations such as <checkpoint_time>, <checkpoint_list>, ...., I don't have performance improvement right ?
Re: Script.Round : Fetch Score + Alter live modescript_settings
No, those widgets are made with ManiaScript and work only locally.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: Script.Round : Fetch Score + Alter live modescript_settings
Ok, in my initial question I ask you how to get the round points for a given player, so your answer was perfect (getRankByLogin, then I have access to it $rank->rounds_points).
But if I have to collect these points for a hundred of players in a loop, is this method still good ? In terms of performance I mean. Or is there a more proper way ? Or I'm worrying for nothing ?
I mean to be sure to keep the server (and controller) stable with a big amount of players, I don't know where I have to be careful.
edit : aka, is there now an equivelance of the GetCurrentRanking in Script.Rounds, where I can get, in one object, the score (round_points) of every players present in the rankings ?
But if I have to collect these points for a hundred of players in a loop, is this method still good ? In terms of performance I mean. Or is there a more proper way ? Or I'm worrying for nothing ?

I mean to be sure to keep the server (and controller) stable with a big amount of players, I don't know where I have to be careful.
edit : aka, is there now an equivelance of the GetCurrentRanking in Script.Rounds, where I can get, in one object, the score (round_points) of every players present in the rankings ?
Re: Script.Round : Fetch Score + Alter live modescript_settings
In this case you should use this:
$data contains this:
See also: https://www.uaseco.org/development/classes/ranking.php
Code: Select all
foreach ($aseco->server->rankings->ranking_list as $login => $data) {
// ...
}
Code: Select all
'rank' => 1,
'login' => 'puennt_ennel',
'nickname' => '$S$W$F90Gιммє$FF0ツ',
'round_points' => 12,
'map_points' => 10,
'match_points' => 8,
'best_race_time' => 3741, // Best race time in milliseconds
'best_race_respawns' => 2, // Number of respawn during best race
'best_race_checkpoints' => array(1740,2475,3122,3741), // Checkpoints times during best race
'best_lap_time' => 0, // Best lap time in milliseconds (only in ModeScript "Laps")
'best_lap_respawns' => 0, // Number of respawn during best lap (only in ModeScript "Laps")
'best_lap_checkpoints' => 0, // Checkpoints times during best lap (only in ModeScript "Laps")
'prev_race_time' => 7411, // Best race time in milliseconds of the previous race
'prev_race_respawns' => 3, // Number of respawn of the previous race
'prev_race_checkpoints' => array(2871,3012,4587,7411), // Checkpoints times of the previous race
'stunts_score' => 50,
'prev_stunts_score' => 125,
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: Script.Round : Fetch Score + Alter live modescript_settings
Great, I made my algo with that, thanks again!
Is the only way to display local records (in a proper widget) is via records_eyepiece ?
Is the only way to display local records (in a proper widget) is via records_eyepiece ?
Re: Script.Round : Fetch Score + Alter live modescript_settings
As I don't know details on what you want to do, it's a bit difficult for me to advice you what's the best way to code. If you want to display a widget like local records from RecordsEyepiece, then it would be better done in ManiaScript (which runs like JavaScript on the client side).
I was playing around - a long time ago - with the LiveRankingWidget in RecordsEyepiece, that could be a good start for you (but be careful, this code isn't finished yet): https://github.com/undeflabs/UASECO/blo ... .php#L7630
I was playing around - a long time ago - with the LiveRankingWidget in RecordsEyepiece, that could be a good start for you (but be careful, this code isn't finished yet): https://github.com/undeflabs/UASECO/blo ... .php#L7630
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: Script.Round : Fetch Score + Alter live modescript_settings
Yeah if I had the level in coding I would have done few things in ManiaScript (and if there was a proper and deep documentation, or I missed something ?).
But for the local records I will finally simply not display them and try to keep ressources light, this is not an essential info in that format.
Beacause, for the rest of the plugin, i'm coding a bit "in the fog" concerning perfomance side. On php side, and controller/server couple. I have no knowledge.
On controller/server side, what should I worry about ?
Sending too many manialinks too often could be an issue (like, on each endRound, I'm sending a manialink to each player, same on beginRound with an empty manialink to clear) ?
We could hit 80,100 players, even more but we'll maybe put a limit if we meet problems.
edit : To give an example, to add these up/down arrows in that manialink, I added a foreach (of 10 max items) with 3 basic if in it, in an already existing foreach (10 max items). Is this significant ? I could give you a view of the code for general advice, but well, I don't want to abuse of your help.

But for the local records I will finally simply not display them and try to keep ressources light, this is not an essential info in that format.
Beacause, for the rest of the plugin, i'm coding a bit "in the fog" concerning perfomance side. On php side, and controller/server couple. I have no knowledge.
On controller/server side, what should I worry about ?
Sending too many manialinks too often could be an issue (like, on each endRound, I'm sending a manialink to each player, same on beginRound with an empty manialink to clear) ?
We could hit 80,100 players, even more but we'll maybe put a limit if we meet problems.
edit : To give an example, to add these up/down arrows in that manialink, I added a foreach (of 10 max items) with 3 basic if in it, in an already existing foreach (10 max items). Is this significant ? I could give you a view of the code for general advice, but well, I don't want to abuse of your help.

Re: Script.Round : Fetch Score + Alter live modescript_settings
No, only something of this exists and that's not really helpful.
If that ManiaLink are build for each player with each different informations on endRound, then you could hit a bottleneck (the dedicated server) real quick. If that Manialink looks for all players the same, then you should send them to all players in one call:Palteza wrote: ↑04 Dec 2019, 14:06 Because, for the rest of the plugin, i'm coding a bit "in the fog" concerning perfomance side. On php side, and controller/server couple. I have no knowledge.
On controller/server side, what should I worry about ?
Sending too many manialinks too often could be an issue (like, on each endRound, I'm sending a manialink to each player, same on beginRound with an empty manialink to clear) ?
We could hit 80,100 players, even more but we'll maybe put a limit if we meet problems.
Code: Select all
$widget = '<manialink id="08154711"><quad posn="0 0 0" sizen="10 2" bgcolor="FFFF"></manialink>';
$logins = false;
$aseco->sendManialink($widget, $logins);
That looks like you could send that Manialink to all players at once, that "removes" the bottleneck.Palteza wrote: ↑04 Dec 2019, 14:06 edit : To give an example, to add these up/down arrows in that manialink, I added a foreach (of 10 max items) with 3 basic if in it, in an already existing foreach (10 max items). Is this significant ? I could give you a view of the code for general advice, but well, I don't want to abuse of your help.
![]()
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Who is online
Users browsing this forum: No registered users and 2 guests