From d5762a506985abfe90d04150d4952f94c644f8a2 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 6 Mar 2009 19:33:45 +0000 Subject: (svn r15632) -Feature: allow downloading scenarios and heightmaps via bananas. --- src/network/network_content.cpp | 8 ++++++++ src/network/network_content_gui.cpp | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'src/network') diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 83740c81c..3a558c7d5 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -22,6 +22,7 @@ extern bool TarListAddFile(const char *filename); extern bool HasGraphicsSet(const ContentInfo *ci, bool md5sum); +extern bool HasScenario(const ContentInfo *ci, bool md5sum); ClientNetworkContentSocketHandler _network_content_client; /** Wrapper function for the HasProc */ @@ -86,6 +87,11 @@ DEF_CONTENT_RECEIVE_COMMAND(Client, PACKET_CONTENT_SERVER_INFO) proc = AI::HasAI; break; break; + case CONTENT_TYPE_SCENARIO: + case CONTENT_TYPE_HEIGHTMAP: + proc = HasScenario; + break; + default: break; } @@ -143,6 +149,8 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentType type) { if (type == CONTENT_TYPE_END) { this->RequestContentList(CONTENT_TYPE_BASE_GRAPHICS); + this->RequestContentList(CONTENT_TYPE_SCENARIO); + this->RequestContentList(CONTENT_TYPE_HEIGHTMAP); this->RequestContentList(CONTENT_TYPE_AI); this->RequestContentList(CONTENT_TYPE_NEWGRF); this->RequestContentList(CONTENT_TYPE_AI_LIBRARY); diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index a2be8557d..2c2f9eac6 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -98,6 +98,13 @@ public: InvalidateWindowData(WC_NETWORK_WINDOW, 0, 2); break; + case CONTENT_TYPE_SCENARIO: + case CONTENT_TYPE_HEIGHTMAP: + InvalidateWindowClasses(WC_SAVELOAD); + extern void ScanScenarios(); + ScanScenarios(); + break; + default: break; } -- cgit v1.2.3-70-g09d2