| 673 | } |
| 674 | |
| 675 | void TexturePack_CheckPending(void) { |
| 676 | struct HttpRequest item; |
| 677 | if (!Http_GetResult(TexturePack_ReqID, &item)) return; |
| 678 | |
| 679 | if (item.success) { |
| 680 | ApplyDownloaded(&item); |
| 681 | } else if (item.result) { |
| 682 | Http_LogError("trying to download texture pack", &item); |
| 683 | } else if (item.statusCode == 200 || item.statusCode == 304) { |
| 684 | /* Empty responses is okay for these status codes, so don't log an error */ |
| 685 | } else if (item.statusCode == 404) { |
| 686 | Chat_AddRaw("&c404 Not Found error when trying to download texture pack"); |
| 687 | Chat_AddRaw(" &cThe texture pack URL may be incorrect or no longer exist"); |
| 688 | } else if (item.statusCode == 401 || item.statusCode == 403) { |
| 689 | Chat_Add1("&c%i Not Authorised error when trying to download texture pack", &item.statusCode); |
| 690 | Chat_AddRaw(" &cThe texture pack URL may not be publicly shared"); |
| 691 | } else { |
| 692 | Chat_Add1("&c%i error when trying to download texture pack", &item.statusCode); |
| 693 | } |
| 694 | HttpRequest_Free(&item); |
| 695 | } |
| 696 | |
| 697 | /* Asynchronously downloads the given texture pack */ |
| 698 | static void DownloadAsync(const cc_string* url) { |
no test coverage detected