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;
|
||||
char mapName[PLATFORM_MAX_PATH];
|
||||
int maps_added = 0;
|
||||
for (int i = 0; i < count; 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));
|
||||
//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)
|
||||
{
|
||||
PushArrayString(g_hTopImpactMaps, mapName);
|
||||
maps_added++;
|
||||
}
|
||||
delete entry;
|
||||
|
||||
if (GetArraySize(g_hTopImpactMaps) >= 50)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
delete tempMaps;
|
||||
delete root;
|
||||
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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user