Compare commits

..

No commits in common. "81f062d54c226846d0cacb020b943a63e6a81267" and "36ee7fc531b74809b04edff0c5e95a5b268a64d8" have entirely different histories.

View File

@ -51,7 +51,6 @@
#Const C_MlId_LiveAltitude "ClimbTheMap_Altidude"
#Const C_Callback_UpdatePBs "Trackmania.ClimbTheMap.UpdatePBs"
#Const C_Callback_RequestPB "Trackmania.ClimbTheMap.RequestPB"
#Const C_Method_SetPlayersPB "Trackmania.ClimbTheMap.SetPlayersPB"
#Const C_Method_SetWR "Trackmania.ClimbTheMap.SetWR"
@ -72,7 +71,7 @@ StateMgr::Load();
XmlRpc::RegisterCallback(C_Callback_UpdatePBs, """
* Name: {{{C_Callback_UpdatePBs}}}
* Type: CallbackArray
* Description: List of the new PB
* Description:
* Data:
- Version >=2.0.0:
```
@ -84,23 +83,11 @@ XmlRpc::RegisterCallback(C_Callback_UpdatePBs, """
]
```
""");
XmlRpc::RegisterCallback(C_Callback_RequestPB, """
* Name: {{{C_Callback_RequestPB}}}
* Type: CallbackArray
* Description: Request PB to be sure that the Player is initialized by the ManiaScript
* Data:
- Version >=2.0.0:
```
[
"Vvjdn4WBRE6irR6Oie7RpA"
]
```
""");
XmlRpc::RegisterMethod(C_Method_SetPlayersPB, """
* Name: {{{C_Method_SetPlayersPB}}}
* Type: TriggerModeScriptEventArray
* Description: List of the new PB
* Description: Request the current properties of the AFK libraries.
* Data:
- Version >=3.5.0:
```
@ -115,7 +102,7 @@ XmlRpc::RegisterMethod(C_Method_SetPlayersPB, """
XmlRpc::RegisterMethod(C_Method_SetWR, """
* Name: {{{C_Method_SetWR}}}
* Type: TriggerModeScriptEventArray
* Description: WR
* Description: Request the current properties of the AFK libraries.
* Data:
- Version >=3.5.0:
```
@ -131,7 +118,6 @@ XmlRpc::RegisterMethod(C_Method_SetWR, """
***
StateMgr::Unload();
XmlRpc::UnregisterCallback(C_Callback_UpdatePBs);
XmlRpc::UnregisterCallback(C_Callback_RequestPB);
XmlRpc::UnregisterMethod(C_Method_SetPlayersPB);
XmlRpc::UnregisterMethod(C_Method_SetWR);
***
@ -180,7 +166,6 @@ foreach (Event in PendingEvents) {
case CSmModeEvent::EType::OnPlayerAdded: {
StateMgr::InitializePlayer(Event.Player);
CarRank::InitializePlayer(Event.Player);
XmlRpc::SendCallback(C_Callback_RequestPB, [Event.Player.User.Login]);
}
}
}
@ -205,22 +190,19 @@ foreach (Event in XmlRpc.PendingEvents) {
declare netwrite Integer Net_ClimbTheMap_AltitudePerName_Update for Teams[0];
Net_ClimbTheMap_AltitudePerName_Update += 1;
} else if (Event.ParamArray1 == C_Method_SetWR) {
if (Event.ParamArray2.count < 3) continue;
if (Event.ParamArray2.count < 2) continue;
declare netwrite Int2 Net_ClimbTheMap_AltitudeOfWaypoints for Teams[0];
declare Integer Altitude = ML::Min(TL::ToInteger(Event.ParamArray2[1]), Net_ClimbTheMap_AltitudeOfWaypoints.Y);
declare Integer Time = TL::ToInteger(Event.ParamArray2[2]);
declare netwrite Integer Net_ClimbTheMap_TimeOfWR for Teams[0];
declare netwrite Integer Net_ClimbTheMap_AltitudeOfWR for Teams[0];
if ((Time > 0 && Net_ClimbTheMap_TimeOfWR <= 0 || Net_ClimbTheMap_TimeOfWR > Time) ||
(Time <= 0 && Net_ClimbTheMap_AltitudeOfWR < Altitude)) {
Net_ClimbTheMap_TimeOfWR = Time;
if (Net_ClimbTheMap_AltitudeOfWR < Altitude) {
Net_ClimbTheMap_AltitudeOfWR = Altitude;
declare netwrite Text Net_ClimbTheMap_NamefWR for Teams[0];
Net_ClimbTheMap_NamefWR = Event.ParamArray2[0];
declare netwrite Integer Net_ClimbTheMap_AltitudePerName_Update for Teams[0];
Net_ClimbTheMap_AltitudePerName_Update += 1;
}
}
}
}
@ -258,8 +240,8 @@ declare Integer Map_NextUpdate;
declare Integer[Text] Map_XmlRpc_AltitudePerLogin_Queue;
declare Integer Map_XmlRpc_Queue_NextUpdate;
declare netwrite Integer Net_ClimbTheMap_TimeOfWR for Teams[0];
declare netwrite Integer Net_ClimbTheMap_AltitudeOfWR for Teams[0];
declare netwrite Text Net_ClimbTheMap_NamefWR for Teams[0];
declare netwrite Integer[Text] Net_ClimbTheMap_AltitudePerName for Teams[0];
@ -294,7 +276,6 @@ if (Start == Null && Finishes.count == 0) {
Net_ClimbTheMap_UpdateFrequency = S_AltitudeUpdateFrequency;
Net_ClimbTheMap_TimeOfWR = 0;
Net_ClimbTheMap_AltitudeOfWR = 0;
Net_ClimbTheMap_NamefWR = "";
Net_ClimbTheMap_AltitudePerName = [];
@ -333,15 +314,6 @@ foreach (Event in RacePendingEvents) {
Scores::UpdatePlayerBestRaceIfBetter(Event.Player);
Scores::UpdatePlayerBestLapIfBetter(Event.Player);
Scores::UpdatePlayerPrevRace(Event.Player);
declare Integer Time = Event.Player.RaceWaypointTimes[Event.Player.RaceWaypointTimes.count - 1];
if (Net_ClimbTheMap_TimeOfWR <= 0 || Net_ClimbTheMap_TimeOfWR > Time) {
Net_ClimbTheMap_TimeOfWR = Time;
declare netwrite Int2 Net_ClimbTheMap_AltitudeOfWaypoints for Teams[0];
Net_ClimbTheMap_AltitudeOfWR = Net_ClimbTheMap_AltitudeOfWaypoints.Y;
Net_ClimbTheMap_NamefWR = Event.Player.User.Name;
}
}
CarRank::ThrottleUpdate(CarRank::C_SortCriteria_BestRace);
}
@ -359,7 +331,7 @@ if (Now > Map_NextUpdate) {
declare Integer Altitude = ML::FloorInteger(Player.Position.Y);
if (Net_ClimbTheMap_TimeOfWR <= 0 && Net_ClimbTheMap_AltitudeOfWR < Altitude) {
if (Net_ClimbTheMap_AltitudeOfWR < Altitude) {
declare netwrite Int2 Net_ClimbTheMap_AltitudeOfWaypoints for Teams[0];
Net_ClimbTheMap_AltitudeOfWR = ML::Min(Altitude, Net_ClimbTheMap_AltitudeOfWaypoints.Y);
Net_ClimbTheMap_NamefWR = Player.User.Name;
@ -433,7 +405,6 @@ Race::StopSkipOutroAll();
ModeUtils::PlaySound(CUIConfig::EUISound::EndRound, 0);
UIModules_BigMessage::SetMessage("Changing Map");
MB_Sleep(5000);
***
***Match_AfterPodiumSequence***
@ -480,7 +451,6 @@ Void SetMl() {
<frameinstance modelid="framemodel-dot" pos="0 120"/>
</frame>
</frame>
<quad id="quad-invisiblebutton" pos="-10 10" size="45 140" scriptevents="1"/>
<frame pos="2 -120">
<frameinstance id="frame-marker-wr" modelid="framemodel-marker" z-index="-1" hidden="1"/>
<frameinstance id="frame-marker-pb" modelid="framemodel-marker" z-index="-2" hidden="1"/>
@ -661,13 +631,6 @@ main() {
I += 1;
}
}
foreach (Event in PendingEvents) {
if (Event.Type == CMlScriptEvent::Type::MouseClick && Event.ControlId == "quad-invisiblebutton") {
TriggerPageAction("Trackmania.ClimbTheMap.ShowAltitudeRecords");
}
}
Last_PageWasVisible = True;
} else {
Last_PageWasVisible = False;