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

@ -95,7 +95,7 @@ class BotRelease(object):
self.project = 'yapb' self.project = 'yapb'
self.version = sys.argv[1] self.version = sys.argv[1]
self.artifacts = 'artifacts' self.artifacts = 'artifacts'
self.graphs = 'yapb-gcdn.akamaized.net' self.graphs = 'yapb.jeefo.net'
self.win32exe = 'https://github.com/yapb/setup/releases/latest/download/botsetup.exe' self.win32exe = 'https://github.com/yapb/setup/releases/latest/download/botsetup.exe'
meson_src_root_env = 'MESON_SOURCE_ROOT' meson_src_root_env = 'MESON_SOURCE_ROOT'

View file

@ -1611,7 +1611,7 @@ bool BotGraph::loadGraphData () {
int mapSize = getBspSize (); int mapSize = getBspSize ();
if (mapSize != exten.mapSize) { if (mapSize != exten.mapSize) {
msg ("Warning: Graph data is probably not for this map. Please check bots behaviour."); msg ("Warning: Graph data is probably not for this map. Please check bots behavior.");
} }
} }
cv_debug_goal.set (kInvalidNodeIndex); cv_debug_goal.set (kInvalidNodeIndex);

View file

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