| 1199 | } |
| 1200 | |
| 1201 | static void FormatMapDownloadFilename(const char *pName, const std::optional<SHA256_DIGEST> &Sha256, int Crc, bool Temp, char *pBuffer, int BufferSize) |
| 1202 | { |
| 1203 | char aSuffix[32]; |
| 1204 | if(Temp) |
| 1205 | { |
| 1206 | IStorage::FormatTmpPath(aSuffix, sizeof(aSuffix), ""); |
| 1207 | } |
| 1208 | else |
| 1209 | { |
| 1210 | str_copy(aSuffix, ".map"); |
| 1211 | } |
| 1212 | |
| 1213 | if(Sha256.has_value()) |
| 1214 | { |
| 1215 | char aSha256[SHA256_MAXSTRSIZE]; |
| 1216 | sha256_str(Sha256.value(), aSha256, sizeof(aSha256)); |
| 1217 | str_format(pBuffer, BufferSize, "downloadedmaps/%s_%s%s", pName, aSha256, aSuffix); |
| 1218 | } |
| 1219 | else |
| 1220 | { |
| 1221 | str_format(pBuffer, BufferSize, "downloadedmaps/%s_%08x%s", pName, Crc, aSuffix); |
| 1222 | } |
| 1223 | } |
| 1224 | |
| 1225 | const char *CClient::LoadMapSearch(const char *pMapName, const std::optional<SHA256_DIGEST> &WantedSha256, int WantedCrc) |
| 1226 | { |
no test coverage detected