[network]Define the master/auth/motd/autoupdate servers’ URLs in
config.sh
diff --git a/source/OpenWolf-Engine b/source/OpenWolf-Engine
index 0f6466d..daf6c09 160000
--- a/source/OpenWolf-Engine
+++ b/source/OpenWolf-Engine
@@ -1 +1 @@
-Subproject commit 0f6466d840bad503c970fd8a7914fc3b6c432dcc
+Subproject commit daf6c092b18c8e2f4c6b0094c9ceb38257784ed1
diff --git a/source/game-logic/CMakeLists.txt b/source/game-logic/CMakeLists.txt
index fe33cbe..53a87b0 100644
--- a/source/game-logic/CMakeLists.txt
+++ b/source/game-logic/CMakeLists.txt
@@ -15,6 +15,10 @@ include( CMakeDependentOption )
set( GAME_APP_NAME "" CACHE STRING "The Application name")
set( GAME_APP_VERSION "" CACHE STRING "The Application version")
set( GAME_APP_STAGE "" CACHE STRING "The Application stage")
+set( URL_MASTER_SERVER "" CACHE STRING "The URL for the Master Server")
+set( URL_MOTD_SERVER "" CACHE STRING "The URL for the MOTD Server")
+set( URL_AUTHORIZE_SERVER "" CACHE STRING "The URL for the Authorize Server")
+set( URL_AUTOUPDATE_SERVER "" CACHE STRING "The URL for the Autoupdate Server")
if("${GAME_APP_NAME}" STREQUAL "")
message(FATAL_ERROR "Please set GAME_APP_NAME first")
@@ -28,6 +32,22 @@ if("${GAME_APP_STAGE}" STREQUAL "")
message(FATAL_ERROR "Please set GAME_APP_STAGE first")
endif()
+if("${URL_MASTER_SERVER}" STREQUAL "")
+ message(FATAL_ERROR "Please set URL_MASTER_SERVER first")
+endif()
+
+if("${URL_MOTD_SERVER}" STREQUAL "")
+ message(FATAL_ERROR "Please set URL_MOTD_SERVER first")
+endif()
+
+if("${URL_AUTHORIZE_SERVER}" STREQUAL "")
+ message(FATAL_ERROR "Please set URL_AUTHORIZE_SERVER first")
+endif()
+
+if("${URL_AUTOUPDATE_SERVER}" STREQUAL "")
+ message(FATAL_ERROR "Please set URL_AUTOUPDATE_SERVER first")
+endif()
+
project(${GAME_APP_NAME} C CXX)
# This line has to appear before 'PROJECT' in order to be able to disable incremental linking
diff --git a/source/game-logic/cmake/appConfig.hpp.in b/source/game-logic/cmake/appConfig.hpp.in
index 2065021..8c85465 100644
--- a/source/game-logic/cmake/appConfig.hpp.in
+++ b/source/game-logic/cmake/appConfig.hpp.in
@@ -87,4 +87,20 @@
#define CONFIG_NAME "owconfig.cfg"
#endif //!CONFIG_NAME
+#ifndef MASTER_SERVER_NAME
+#define MASTER_SERVER_NAME "@URL_MASTER_SERVER@"
+#endif //!MASTER_SERVER_NAME
+
+#ifndef MOTD_SERVER_NAME
+#define MOTD_SERVER_NAME "@URL_MOTD_SERVER@"
+#endif //!MOTD_SERVER_NAME
+
+#ifndef AUTHORIZE_SERVER_NAME
+#define AUTHORIZE_SERVER_NAME "@URL_AUTHORIZE_SERVER@"
+#endif //!AUTHORIZE_SERVER_NAME
+
+#ifndef AUTOUPDATE_SERVER_NAME
+#define AUTOUPDATE_SERVER_NAME "@URL_AUTOUPDATE_SERVER@"
+#endif //!AUTOUPDATE_SERVER_NAME
+
#endif //!__APPCONFIG_H__
diff --git a/sp-tools.sh b/sp-tools.sh
index 347352f..e3dbd12 100755
--- a/sp-tools.sh
+++ b/sp-tools.sh
@@ -78,6 +78,11 @@ Set_Config_To_Defaults() {
printf "GAME_APP_VERSION=\"0.0.1\"\n" >> $SCRIPTPATH/config.sh
printf "GAME_APP_STAGE=\"alpha\"\n\n" >> $SCRIPTPATH/config.sh
+ printf "URL_MASTER_SERVER=\"master.grangerhub.org\"\n" >> $SCRIPTPATH/config.sh
+ printf "URL_MOTD_SERVER=\"motd.grangerhub.org\"\n" >> $SCRIPTPATH/config.sh
+ printf "URL_AUTHORIZE_SERVER=\"auth.grangerhub.org\"\n" >> $SCRIPTPATH/config.sh
+ printf "URL_AUTOUPDATE_SERVER=\"update.grangerhub.org\"\n\n" >> $SCRIPTPATH/config.sh
+
printf "FS_GAME=\"$BASEGAME\"\n\n" >> $SCRIPTPATH/config.sh
printf "DOWNLOAD_URL=\"http://dl.lonestellar.site.nfoservers.com/\"\n\n" >> $SCRIPTPATH/config.sh
@@ -112,6 +117,11 @@ Cache_Config_File() {
printf "CACHED_GAME_APP_VERSION=\"$GAME_APP_VERSION\"\n" >> $SCRIPTPATH/.cache-config.sh
printf "CACHED_GAME_APP_STAGE=\"$GAME_APP_STAGE\"\n\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_MASTER_SERVER=\"$URL_MASTER_SERVER\"\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_MOTD_SERVER=\"$URL_MOTD_SERVER\"\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_AUTHORIZE_SERVER=\"$URL_AUTHORIZE_SERVER\"\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_AUTOUPDATE_SERVER=\"$URL_AUTOUPDATE_SERVER\"\n\n" >> $SCRIPTPATH/.cache-config.sh
+
printf "CACHED_FS_GAME=\"$FS_GAME\"\n\n" >> $SCRIPTPATH/.cache-config.sh
printf "CACHED_DOWNLOAD_URL=\"$DOWNLOAD_URL\"\n\n" >> $SCRIPTPATH/.cache-config.sh
@@ -170,6 +180,11 @@ Save_Cached_Variables() {
printf "CACHED_GAME_APP_VERSION=\"$CACHED_GAME_APP_VERSION\"\n" >> $SCRIPTPATH/.cache-config.sh
printf "CACHED_GAME_APP_STAGE=\"$CACHED_GAME_APP_STAGE\"\n\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_MASTER_SERVER=\"$CACHED_URL_MASTER_SERVER\"\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_MOTD_SERVER=\"$CACHED_URL_MOTD_SERVER\"\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_AUTHORIZE_SERVER=\"$CACHED_URL_AUTHORIZE_SERVER\"\n" >> $SCRIPTPATH/.cache-config.sh
+ printf "CACHED_URL_AUTOUPDATE_SERVER=\"$CACHED_URL_AUTOUPDATE_SERVER\"\n\n" >> $SCRIPTPATH/.cache-config.sh
+
printf "CACHED_FS_GAME=\"$CACHED_FS_GAME\"\n\n" >> $SCRIPTPATH/.cache-config.sh
printf "CACHED_DOWNLOAD_URL=\"$CACHED_DOWNLOAD_URL\"\n\n" >> $SCRIPTPATH/.cache-config.sh
@@ -418,6 +433,10 @@ Configure_cmake_game_logic() {
cmake -DGAME_APP_NAME="$GAME_APP_NAME" \
-DGAME_APP_VERSION="$GAME_APP_VERSION" \
-DGAME_APP_STAGE="$GAME_APP_STAGE" \
+ -DURL_MASTER_SERVER="$URL_MASTER_SERVER" \
+ -DURL_MOTD_SERVER="$URL_MOTD_SERVER" \
+ -DURL_AUTHORIZE_SERVER="$URL_AUTHORIZE_SERVER" \
+ -DURL_AUTOUPDATE_SERVER="$URL_AUTOUPDATE_SERVER" \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" .
cd $CURRENTPATH
}
@@ -436,6 +455,10 @@ Configure_cmake_engine() {
cmake -DGAME_APP_NAME="$GAME_APP_NAME" \
-DGAME_APP_VERSION="$GAME_APP_VERSION" \
-DGAME_APP_STAGE="$GAME_APP_STAGE" \
+ -DURL_MASTER_SERVER="$URL_MASTER_SERVER" \
+ -DURL_MOTD_SERVER="$URL_MOTD_SERVER" \
+ -DURL_AUTHORIZE_SERVER="$URL_AUTHORIZE_SERVER" \
+ -DURL_AUTOUPDATE_SERVER="$URL_AUTOUPDATE_SERVER" \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
-DBUILD_CLIENT="$BUILD_CLIENT" \
-DBUILD_SERVER="$BUILD_SERVER" \
@@ -588,6 +611,26 @@ Build_game_logic() {
RECONFIGURE=1
fi
+ if [ ! "$URL_MASTER_SERVER" = "$CACHED_URL_MASTER_SERVER" ]; then
+ CACHED_URL_MASTER_SERVER="$URL_MASTER_SERVER"
+ RECONFIGURE=1
+ fi
+
+ if [ ! "$URL_MOTD_SERVER" = "$CACHED_URL_MOTD_SERVER" ]; then
+ CACHED_URL_MOTD_SERVER="$URL_MOTD_SERVER"
+ RECONFIGURE=1
+ fi
+
+ if [ ! "$URL_AUTHORIZE_SERVER" = "$CACHED_URL_AUTHORIZE_SERVER" ]; then
+ CACHED_URL_AUTHORIZE_SERVER="$URL_AUTHORIZE_SERVER"
+ RECONFIGURE=1
+ fi
+
+ if [ ! "$URL_AUTOUPDATE_SERVER" = "$CACHED_URL_AUTOUPDATE_SERVER" ]; then
+ CACHED_URL_AUTOUPDATE_SERVER="$URL_AUTOUPDATE_SERVER"
+ RECONFIGURE=1
+ fi
+
if [ ! "$CMAKE_BUILD_TYPE" = "$CACHED_CMAKE_BUILD_TYPE" ]; then
CACHED_CMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE"
RECONFIGURE=1
@@ -643,6 +686,26 @@ Build_engine() {
RECONFIGURE=1
fi
+ if [ ! "$URL_MASTER_SERVER" = "$CACHED_URL_MASTER_SERVER" ]; then
+ CACHED_URL_MASTER_SERVER="$URL_MASTER_SERVER"
+ RECONFIGURE=1
+ fi
+
+ if [ ! "$URL_MOTD_SERVER" = "$CACHED_URL_MOTD_SERVER" ]; then
+ CACHED_URL_MOTD_SERVER="$URL_MOTD_SERVER"
+ RECONFIGURE=1
+ fi
+
+ if [ ! "$URL_AUTHORIZE_SERVER" = "$CACHED_URL_AUTHORIZE_SERVER" ]; then
+ CACHED_URL_AUTHORIZE_SERVER="$URL_AUTHORIZE_SERVER"
+ RECONFIGURE=1
+ fi
+
+ if [ ! "$URL_AUTOUPDATE_SERVER" = "$CACHED_URL_AUTOUPDATE_SERVER" ]; then
+ CACHED_URL_AUTOUPDATE_SERVER="$URL_AUTOUPDATE_SERVER"
+ RECONFIGURE=1
+ fi
+
if [ ! "$CMAKE_BUILD_TYPE" = "$CACHED_CMAKE_BUILD_TYPE" ]; then
CACHED_CMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE"
RECONFIGURE=1
GitHub
sha: e8f92603