For XmlRpc methods :
Ability to set/get a value to a/from player manialink :
1. SetNetVarForLogin(string, string,
|int,| object, bool) where the first parameter would be Login, second would be the Variable name, the third the value to apply, and the fourth mean if the value need to be forced.
The int parameter would be the ID of the manialink ( look after this chapter )
This will only work if the variable is present in the principal manialink shown.
example :
Code: Select all
SetNetVarForLogin("guerro", "MyVariable", 13, true);
And in the manialink of the player :
Code: Select all
main() {
declare MyVariable for LocalUser = 0;
while(true) {
yield;
log(MyVariable);
}
}
MyVariable will log 13 and not 0.
If the fourth param is False, then :
example :
Code: Select all
main() {
declare MyVariable for LocalUser = 0;
while(true) {
yield;
foreach (Event in PendingEvents) {
if (Event.Type == CMlScript::XmlRpc::OnApplyVar) {
if (Event.XmlRpc.Name == MyVariable.Name) {
PassOn(Event);
// or
Discard(Event);
}
}
}
}
}
GetNerVar would be the same.
2. Ability to set multiple manialinks.
Why? It's simple, if you got a lot of manialinks to be displayed, you'll need to send a lot of informations, because only one "manialink" will be send, so, we need to display a manialink or more manialinks to a player with a specific ID for the manialink.
example :
Actual :
Code: Select all
<manialink version="2">
// Manialink 1
</manialink>
<manialink version="2">
// Manialink 2
</manialink>
<manialink version="2">
// Manialink 3
</manialink>
</etc....>
And then send it to the players... and repeat when you need to refresh a SPECIFIC part of a manialink
Replacement :
SendDisplayManialink|ToLogin|(string, string, int, int, bool)
First parameter : Login or uID;
Second : Manialink to be shown.
Third : The ID of this manialink.
<etc....>
example :
Code: Select all
toReturn1 = ""<manialink version="2">
// Manialink 1
</manialink>"";
SendDisplayManialinkToLogin("guerro", toReturn1, 1, 0, false);
<some codes between...>
toReturn2 = ""<manialink version="2">
// Manialink 2
</manialink>"";
SendDisplayManialinkToLogin("guerro", toReturn2, 2, 0, false);
<some codes between...>
toReturn3 = ""<manialink version="2">
// Manialink 3
</manialink>"";
SendDisplayManialinkToLogin("guerro", toReturn3, 3, 0, false);
Also RemoveDisplayManialinkToLogin("guerro", ID_ofTheManialink);
My english is not perfect, but I hope you understood ^^
Hype, hype for Maniaplanet 4
