graph: always use lowercase map name when downloading graph

package: use default graph endpoint instead of cdn
This commit is contained in:
jeefo 2023-07-27 01:44:32 +03:00
commit 8f688b1bc7
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
3 changed files with 6 additions and 3 deletions

View file

@ -43,10 +43,13 @@ template <typename U> bool BotStorage::load (SmallArray <U> &data, ExtenHeader *
if (!graph.canDownload ()) {
return false;
}
String lowercaseMapName = game.getMapName ();
lowercaseMapName = lowercaseMapName.lowercase ();
auto downloadAddress = cv_graph_url.str ();
auto toDownload = buildPath (storageToBotFile (type.option), false);
auto fromDownload = strings.format ("http://%s/graph/%s.graph", downloadAddress, game.getMapName ());
auto fromDownload = strings.format ("http://%s/graph/%s.graph", downloadAddress, lowercaseMapName);
// try to download
if (http.downloadFile (fromDownload, toDownload)) {