summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:56:59 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:56:59 +0000
commit963802e9a7cb67f51cb7e6ffe9d33a02cfe93821 (patch)
treed8b2d5c1c2d90c7cb1a02403cea942ab52c2e501 /src/network
parent83f2785f54de1c31267c5586464c97fb39f95b5a (diff)
downloadopenttd-963802e9a7cb67f51cb7e6ffe9d33a02cfe93821.tar.xz
(svn r23612) -Add: allow importing libraries in the same way as AI does, only with GS prefix (and in game/library)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/tcp_content.h1
-rw-r--r--src/network/network_content.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/network/core/tcp_content.h b/src/network/core/tcp_content.h
index dc56f1ad9..12996a02d 100644
--- a/src/network/core/tcp_content.h
+++ b/src/network/core/tcp_content.h
@@ -33,6 +33,7 @@ enum ContentType {
CONTENT_TYPE_BASE_SOUNDS = 7, ///< The content consists of base sounds
CONTENT_TYPE_BASE_MUSIC = 8, ///< The content consists of base music
CONTENT_TYPE_GAME = 9, ///< The content consists of a game script
+ CONTENT_TYPE_GAME_LIBRARY = 10, ///< The content consists of a GS library
CONTENT_TYPE_END, ///< Helper to mark the end of the types
};
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index 28700b69c..fe0921b5e 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -14,6 +14,7 @@
#include "../stdafx.h"
#include "../rev.h"
#include "../ai/ai.hpp"
+#include "../game/game.hpp"
#include "../window_func.h"
#include "../error.h"
#include "../base_media_base.h"
@@ -104,6 +105,14 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p)
proc = AI::HasAILibrary; break;
break;
+ case CONTENT_TYPE_GAME:
+ proc = Game::HasGame; break;
+ break;
+
+ case CONTENT_TYPE_GAME_LIBRARY:
+ proc = Game::HasGameLibrary; break;
+ break;
+
case CONTENT_TYPE_SCENARIO:
case CONTENT_TYPE_HEIGHTMAP:
proc = HasScenario;
@@ -183,6 +192,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentType type)
this->RequestContentList(CONTENT_TYPE_AI);
this->RequestContentList(CONTENT_TYPE_AI_LIBRARY);
this->RequestContentList(CONTENT_TYPE_GAME);
+ this->RequestContentList(CONTENT_TYPE_GAME_LIBRARY);
this->RequestContentList(CONTENT_TYPE_NEWGRF);
return;
}
@@ -386,6 +396,7 @@ static char *GetFullFilename(const ContentInfo *ci, bool compressed)
case CONTENT_TYPE_SCENARIO: dir = SCENARIO_DIR; break;
case CONTENT_TYPE_HEIGHTMAP: dir = HEIGHTMAP_DIR; break;
case CONTENT_TYPE_GAME: dir = GAME_DIR; break;
+ case CONTENT_TYPE_GAME_LIBRARY: dir = GAME_LIBRARY_DIR; break;
}
static char buf[MAX_PATH];
@@ -552,6 +563,10 @@ void ClientNetworkContentSocketHandler::AfterDownload()
sd = GAME_DIR;
break;
+ case CONTENT_TYPE_GAME_LIBRARY:
+ sd = GAME_LIBRARY_DIR;
+ break;
+
case CONTENT_TYPE_BASE_GRAPHICS:
case CONTENT_TYPE_BASE_SOUNDS:
case CONTENT_TYPE_BASE_MUSIC: