adding at most 50 maps to casualpool from playtime session frontend. also assuring they are not on cooldown
This commit is contained in:
@@ -629,7 +629,6 @@ public void OnTransferComplete(HTTPResponse response, int offset)
|
|||||||
|
|
||||||
int count = maps.Length;
|
int count = maps.Length;
|
||||||
char mapName[PLATFORM_MAX_PATH];
|
char mapName[PLATFORM_MAX_PATH];
|
||||||
int maps_added = 0;
|
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
JSONObject entry = view_as<JSONObject>(maps.Get(i));
|
JSONObject entry = view_as<JSONObject>(maps.Get(i));
|
||||||
@@ -639,18 +638,28 @@ public void OnTransferComplete(HTTPResponse response, int offset)
|
|||||||
}
|
}
|
||||||
entry.GetString("map_name", mapName, sizeof(mapName));
|
entry.GetString("map_name", mapName, sizeof(mapName));
|
||||||
//make sure that the map actually is in the map pool and not admin only or deleted from the server again
|
//make sure that the map actually is in the map pool and not admin only or deleted from the server again
|
||||||
|
//also make sure its not on cooldown right now.
|
||||||
|
if (InternalGetMapCooldownTime(mapName) > GetTime())
|
||||||
|
{
|
||||||
|
delete entry;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (FindStringInArray(tempMaps, mapName) != -1)
|
if (FindStringInArray(tempMaps, mapName) != -1)
|
||||||
{
|
{
|
||||||
PushArrayString(g_hTopImpactMaps, mapName);
|
PushArrayString(g_hTopImpactMaps, mapName);
|
||||||
maps_added++;
|
|
||||||
}
|
}
|
||||||
delete entry;
|
delete entry;
|
||||||
|
|
||||||
|
if (GetArraySize(g_hTopImpactMaps) >= 50)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delete tempMaps;
|
delete tempMaps;
|
||||||
delete root;
|
delete root;
|
||||||
delete maps;
|
delete maps;
|
||||||
|
|
||||||
if (maps_added < 45)
|
if (GetArraySize(g_hTopImpactMaps) < 50)
|
||||||
{
|
{
|
||||||
FillMapsByImpact(offset + 50); //did not get enough maps from the public maplist, set offset to pick the next.
|
FillMapsByImpact(offset + 50); //did not get enough maps from the public maplist, set offset to pick the next.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user