diff --git a/cmake/checks.cmake b/cmake/checks.cmake index 821198427..000d65860 100644 --- a/cmake/checks.cmake +++ b/cmake/checks.cmake @@ -264,16 +264,17 @@ MACRO(CHECK_LIBRARIES) ENDIF(SDL_FOUND) ENDIF(OPTION_SDL2) + IF(OPTION_WEBSERVER) + # CURL + Find_Package(CURL) - # CURL - Find_Package(CURL) - - IF(CURL_FOUND) - SET(HAVE_CURL 1) - MESSAGE(STATUS "Looking for library CURL - found") - ELSE(CURL_FOUND) - MESSAGE(STATUS "Looking for library CURL - NOT found") - ENDIF(CURL_FOUND) + IF(CURL_FOUND) + SET(HAVE_CURL 1) + MESSAGE(STATUS "Looking for library CURL - found") + ELSE(CURL_FOUND) + MESSAGE(STATUS "Looking for library CURL - NOT found") + ENDIF(CURL_FOUND) + ENDIF(OPTION_WEBSERVER) # OSG diff --git a/cmake/customthirdparty.cmake b/cmake/customthirdparty.cmake index 2e10101c8..2de3b4848 100644 --- a/cmake/customthirdparty.cmake +++ b/cmake/customthirdparty.cmake @@ -187,9 +187,11 @@ MACRO(_FIND_3RDPARTY_DEPENDENCIES ROOT_DIR) # JPEG. _FIND_3RDPARTY_DEPENDENCY(JPEG jpeglib.h "" "jpeg_s;jpeg;jpeg-8;jpeg-9" ${ROOT_DIR} "") - - # CURL. - _FIND_3RDPARTY_DEPENDENCY(CURL curl/curl.h "" "libcurl;libcurl_imp" ${ROOT_DIR} "") + + IF(OPTION_WEBSERVER) + # CURL. + _FIND_3RDPARTY_DEPENDENCY(CURL curl/curl.h "" "libcurl;libcurl_imp" ${ROOT_DIR} "") + ENDIF(OPTION_WEBSERVER) # ZLib. _FIND_3RDPARTY_DEPENDENCY(ZLIB zlib.h "" "z;zlib;zlib1" ${ROOT_DIR} "D") @@ -401,8 +403,10 @@ MACRO(SD_INSTALL_CUSTOM_3RDPARTY TARGET_NAME) _FIND_3RDPARTY_DLL("${JPEG_LIBRARY}" "jpeg;jpeg-8;jpeg-9" "lib" _DLL_PATHNAME) LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") - _FIND_3RDPARTY_DLL("${CURL_LIBRARY}" "curl" "lib" _DLL_PATHNAME) - LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + IF(OPTION_WEBSERVER) + _FIND_3RDPARTY_DLL("${CURL_LIBRARY}" "curl" "lib" _DLL_PATHNAME) + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + ENDIF(OPTION_WEBSERVER) # 2) Copy found 3rd party DLL files to the bin folder (for running without installing). #MESSAGE(STATUS "3rdParty dependencies : Will install ${_THIRDPARTY_DLL_PATHNAMES}") diff --git a/cmake/options.cmake b/cmake/options.cmake index 409aefeb2..f5d04e388 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -81,6 +81,8 @@ MACRO(ADD_SD_COMPILE_OPTIONS) SET(OPTION_SDL2 true CACHE BOOL "Build with SDL2 instead of SDL 1.2") SET(OPTION_SDL_JOYSTICK true CACHE BOOL "Use SDL for Joystick instead of PLIB") + SET(OPTION_WEBSERVER false CACHE BOOL "Build with WebServer functionality") + IF(APPLE) # Automatically set OPTION_USE_MACPORTS (at least until someone fixes the regular APPLE build) MESSAGE(STATUS "Automatically set OPTION_USE_MACPORTS (at least until someone fixes the regular APPLE build)") @@ -192,6 +194,10 @@ MACRO(ADD_SD_COMPILE_OPTIONS) ADD_DEFINITIONS(-DSDL_JOYSTICK) ENDIF(OPTION_SDL_JOYSTICK) + IF(OPTION_WEBSERVER) + ADD_DEFINITIONS(-DWEBSERVER) + ENDIF(OPTION_WEBSERVER) + IF(OPTION_USE_MACPORTS) ADD_DEFINITIONS(-DUSE_MACPORTS) ENDIF(OPTION_USE_MACPORTS) diff --git a/cmake/thirdpartydeps.cmake b/cmake/thirdpartydeps.cmake index e6fca66a5..96200e15f 100644 --- a/cmake/thirdpartydeps.cmake +++ b/cmake/thirdpartydeps.cmake @@ -437,30 +437,32 @@ MACRO(ADD_JPEG_LIBRARY TARGET) ENDMACRO(ADD_JPEG_LIBRARY TARGET) -#CURL -MACRO(ADD_CURL_INCLUDEDIR) +IF(OPTION_WEBSERVER) + #CURL + MACRO(ADD_CURL_INCLUDEDIR) - FIND_PACKAGE(CURL) + FIND_PACKAGE(CURL) - IF(CURL_FOUND) - INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) - ELSE(CURL_FOUND) - MESSAGE(FATAL_ERROR "Cannot find CURL header files") - ENDIF(CURL_FOUND) + IF(CURL_FOUND) + INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) + ELSE(CURL_FOUND) + MESSAGE(FATAL_ERROR "Cannot find CURL header files") + ENDIF(CURL_FOUND) -ENDMACRO(ADD_CURL_INCLUDEDIR) + ENDMACRO(ADD_CURL_INCLUDEDIR) -MACRO(ADD_CURL_LIBRARY TARGET) + MACRO(ADD_CURL_LIBRARY TARGET) - FIND_PACKAGE(CURL) + FIND_PACKAGE(CURL) - IF(CURL_FOUND) - TARGET_LINK_LIBRARIES(${TARGET} ${CURL_LIBRARY}) - ELSE(CURL_FOUND) - MESSAGE(FATAL_ERROR "Cannot find CURL libraries") - ENDIF(CURL_FOUND) + IF(CURL_FOUND) + TARGET_LINK_LIBRARIES(${TARGET} ${CURL_LIBRARY}) + ELSE(CURL_FOUND) + MESSAGE(FATAL_ERROR "Cannot find CURL libraries") + ENDIF(CURL_FOUND) -ENDMACRO(ADD_CURL_LIBRARY TARGET) + ENDMACRO(ADD_CURL_LIBRARY TARGET) +ENDIF(OPTION_WEBSERVER) MACRO(ADD_X11_INCLUDEDIR) diff --git a/src/libs/tgf/params.cpp b/src/libs/tgf/params.cpp index 1a0e67d29..e68b13211 100644 --- a/src/libs/tgf/params.cpp +++ b/src/libs/tgf/params.cpp @@ -1681,6 +1681,7 @@ GfParmWriteBuf (void *handle, char *buf, int size) /* Never used in current code return 0; // Success } +#ifdef WEBSERVER /** Write a configuration string. @ingroup conf @param handle Configuration handle @@ -1710,6 +1711,7 @@ GfParmWriteString (void *handle, std::string& str) return 0; // Success } +#endif //WEBSERVER /** Set the dtd path and header if necessary @ingroup conf diff --git a/src/libs/tgf/tgf.h b/src/libs/tgf/tgf.h index fac47afa5..53007e3e6 100644 --- a/src/libs/tgf/tgf.h +++ b/src/libs/tgf/tgf.h @@ -413,8 +413,9 @@ TGF_API int GfParmWriteFile(const char *file, void* handle, const char *name); TGF_API int GfParmWriteFileSDHeader(const char *file, void* handle, const char *name, const char *author, bool trace = true); /* write a parameter file to a supplied buffer */ TGF_API int GfParmWriteBuf(void *handle, char *buf, int size);/* Never used in current codebase: to be removed? */ +#ifdef WEBSERVER TGF_API int GfParmWriteString(void *handle, std::string& str); - +#endif //WEBSERVER TGF_API char *GfParmGetName(void *handle); TGF_API char *GfParmGetFileName(void *handle); diff --git a/src/libs/tgfclient/CMakeLists.txt b/src/libs/tgfclient/CMakeLists.txt index 995cbeb02..cd433202b 100644 --- a/src/libs/tgfclient/CMakeLists.txt +++ b/src/libs/tgfclient/CMakeLists.txt @@ -13,17 +13,31 @@ ADD_JPEG_INCLUDEDIR() ADD_PLIB_INCLUDEDIR() ADD_OPENAL_INCLUDEDIR() ADD_VORBIS_INCLUDEDIR() -ADD_CURL_INCLUDEDIR() +IF(OPTION_WEBSERVER) + ADD_CURL_INCLUDEDIR() +ENDIF(OPTION_WEBSERVER) + +IF(OPTION_WEBSERVER) + SET(_SOURCES control.cpp glfeatures.cpp guibutton.cpp guifont.cpp + guiimage.cpp guimenu.cpp guiscrollbar.cpp guitexture.cpp + tgfclient.cpp gui.cpp guiedit.cpp guihelp.cpp + guilabel.cpp guiobject.cpp guiscrollist.cpp + guicombobox.cpp guicheckbox.cpp guiprogresbar.cpp + guiscreen.cpp guieventloop.cpp guiapplication.cpp + musicplayer.cpp musicplayer.h + glfeatures.h gui.h guiscreen.h guimenu.h tgfclient.h guifont.h + webserver.h webserver.cpp) +ELSE(OPTION_WEBSERVER) + SET(_SOURCES control.cpp glfeatures.cpp guibutton.cpp guifont.cpp + guiimage.cpp guimenu.cpp guiscrollbar.cpp guitexture.cpp + tgfclient.cpp gui.cpp guiedit.cpp guihelp.cpp + guilabel.cpp guiobject.cpp guiscrollist.cpp + guicombobox.cpp guicheckbox.cpp guiprogresbar.cpp + guiscreen.cpp guieventloop.cpp guiapplication.cpp + musicplayer.cpp musicplayer.h + glfeatures.h gui.h guiscreen.h guimenu.h tgfclient.h guifont.h) +ENDIF(OPTION_WEBSERVER) -SET(_SOURCES control.cpp glfeatures.cpp guibutton.cpp guifont.cpp - guiimage.cpp guimenu.cpp guiscrollbar.cpp guitexture.cpp - tgfclient.cpp gui.cpp guiedit.cpp guihelp.cpp - guilabel.cpp guiobject.cpp guiscrollist.cpp - guicombobox.cpp guicheckbox.cpp guiprogresbar.cpp - guiscreen.cpp guieventloop.cpp guiapplication.cpp - musicplayer.cpp musicplayer.h - glfeatures.h gui.h guiscreen.h guimenu.h tgfclient.h guifont.h - webserver.h webserver.cpp) SET(_OTHER_SOURCES guimenutest.xml) SET(_SOURCES ${_SOURCES} @@ -65,7 +79,9 @@ ADD_SDLIB_LIBRARY(tgfclient portability tgf networking) ADD_PNG_LIBRARY(tgfclient) ADD_JPEG_LIBRARY(tgfclient) -ADD_CURL_LIBRARY(tgfclient) +IF(OPTION_WEBSERVER) + ADD_CURL_LIBRARY(tgfclient) +ENDIF(OPTION_WEBSERVER) IF(OPENGL_FOUND) TARGET_LINK_LIBRARIES(tgfclient ${OPENGL_LIBRARY}) diff --git a/src/libs/tgfclient/guieventloop.cpp b/src/libs/tgfclient/guieventloop.cpp index 5870efea9..d3c0bc64e 100644 --- a/src/libs/tgfclient/guieventloop.cpp +++ b/src/libs/tgfclient/guieventloop.cpp @@ -20,10 +20,12 @@ #include "tgfclient.h" +#ifdef WEBSERVER #include "webserver.h" extern NotificationManager notifications; extern TGFCLIENT_API WebServer webServer; +#endif //WEBSERVER @@ -301,8 +303,10 @@ void GfuiEventLoop::postRedisplay(void) void GfuiEventLoop::forceRedisplay() { + #ifdef WEBSERVER webServer.updateAsyncStatus(); - notifications.updateStatus(); + notifications.updateStatus(); + #endif //WEBSERVER if (_pPrivate->cbDisplay) _pPrivate->cbDisplay(); @@ -311,8 +315,10 @@ void GfuiEventLoop::forceRedisplay() void GfuiEventLoop::redisplay() { + #ifdef WEBSERVER //temp _pPrivate->bRedisplay=true; + #endif //WEBSERVER // Refresh display if requested and if any redisplay CB. if (_pPrivate->bRedisplay) diff --git a/src/libs/tgfclient/webserver.cpp b/src/libs/tgfclient/webserver.cpp index ea19fca97..b04093d10 100644 --- a/src/libs/tgfclient/webserver.cpp +++ b/src/libs/tgfclient/webserver.cpp @@ -21,6 +21,7 @@ @author MadBad @version $Id$ */ +#ifdef WEBSERVER #include #include #include @@ -904,5 +905,6 @@ int WebServer::sendRaceEnd (int race_id, int endposition){ //initialize the web server WebServer webServer; +#endif //WEBSERVER diff --git a/src/libs/tgfclient/webserver.h b/src/libs/tgfclient/webserver.h index 99b7b497c..625ac925a 100644 --- a/src/libs/tgfclient/webserver.h +++ b/src/libs/tgfclient/webserver.h @@ -21,6 +21,7 @@ @author MadBad @version $Id$ */ +#ifdef WEBSERVER #include "tgfclient.h" #include #include @@ -124,5 +125,6 @@ class TGFCLIENT_API WebServer { //destructor ~WebServer(); }; +#endif //WEBSERVER diff --git a/src/modules/racing/standardgame/CMakeLists.txt b/src/modules/racing/standardgame/CMakeLists.txt index eb65691cd..bcdc37931 100644 --- a/src/modules/racing/standardgame/CMakeLists.txt +++ b/src/modules/racing/standardgame/CMakeLists.txt @@ -18,7 +18,11 @@ SET(_OTHER_SOURCES ) ADD_INTERFACE_INCLUDEDIR() -ADD_SDLIB_INCLUDEDIR(math portability robottools tgf tgfdata networking tgfclient) +IF(OPTION_WEBSERVER) + ADD_SDLIB_INCLUDEDIR(math portability robottools tgf tgfdata networking tgfclient) +ELSE(OPTION_WEBSERVER) + ADD_SDLIB_INCLUDEDIR(math portability robottools tgf tgfdata networking) +ENDIF(OPTION_WEBSERVER) ADD_PLIB_INCLUDEDIR() diff --git a/src/modules/racing/standardgame/raceinit.cpp b/src/modules/racing/standardgame/raceinit.cpp index 128881842..4981b3556 100644 --- a/src/modules/racing/standardgame/raceinit.cpp +++ b/src/modules/racing/standardgame/raceinit.cpp @@ -27,8 +27,10 @@ #include #include #include +#ifdef WEBSERVER #include #include +#endif //WEBSERVER #ifdef THIRD_PARTY_SQLITE3 #include @@ -42,7 +44,9 @@ #include #include +#ifdef WEBSERVER #include +#endif //WEBSERVER #include #include @@ -58,7 +62,10 @@ #include "raceinit.h" +#ifdef WEBSERVER extern TGFCLIENT_API WebServer webServer; +#endif //WEBSERVER + static const char *aPszSkillLevelNames[] = { ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO }; @@ -958,7 +965,7 @@ ReInitCars(void) } #endif } - + #ifdef WEBSERVER // webServer lap logger. //Find human cars for (int i = 0; i < ReInfo->s->_ncars; i++) { @@ -980,7 +987,7 @@ ReInitCars(void) } } - + #endif //WEBSERVER ReInfo->_rePitRequester = 0; diff --git a/src/modules/racing/standardgame/raceinit.h b/src/modules/racing/standardgame/raceinit.h index bf1613681..318775d9c 100644 --- a/src/modules/racing/standardgame/raceinit.h +++ b/src/modules/racing/standardgame/raceinit.h @@ -58,7 +58,6 @@ extern tModList *ReRacingRobotsModList; struct RmInfo; extern struct RmInfo *ReInfo; - #endif /* _RACEINIT_H_ */ diff --git a/src/modules/racing/standardgame/raceresults.cpp b/src/modules/racing/standardgame/raceresults.cpp index e463bfabb..b7d3e36cd 100644 --- a/src/modules/racing/standardgame/raceresults.cpp +++ b/src/modules/racing/standardgame/raceresults.cpp @@ -30,7 +30,9 @@ #include #include +#ifdef WEBSERVER #include +#endif //WEBSERVER #include "standardgame.h" diff --git a/src/modules/racing/standardgame/racesituation.cpp b/src/modules/racing/standardgame/racesituation.cpp index 40017209f..dddde938b 100644 --- a/src/modules/racing/standardgame/racesituation.cpp +++ b/src/modules/racing/standardgame/racesituation.cpp @@ -38,7 +38,9 @@ #include #include #include +#ifdef WEBSERVER #include +#endif //WEBSERVER #include "standardgame.h" @@ -372,7 +374,8 @@ void ReSituationUpdater::runOneStep(double deltaTimeIncrement) if (replayRecord && pCurrReInfo->s->currentTime >= replayTimestamp) { replaySituation(pCurrReInfo); } - + + #ifdef WEBSERVER // webServer lap logger. extern TGFCLIENT_API WebServer webServer; //Find human cars @@ -421,6 +424,8 @@ void ReSituationUpdater::runOneStep(double deltaTimeIncrement) } } webServer.updateAsyncStatus(); + #endif //WEBSERVER + } int ReSituationUpdater::threadLoop(void* pUpdater) diff --git a/src/modules/userinterface/legacymenu/confscreens/playerconfig.cpp b/src/modules/userinterface/legacymenu/confscreens/playerconfig.cpp index 230a88871..d910bb064 100644 --- a/src/modules/userinterface/legacymenu/confscreens/playerconfig.cpp +++ b/src/modules/userinterface/legacymenu/confscreens/playerconfig.cpp @@ -29,7 +29,9 @@ #include #include #include +#ifdef WEBSERVER #include +#endif //WEBSERVER #include @@ -41,8 +43,10 @@ static const char *PlayerNamePrompt = "-- Enter name --"; static const char *NoPlayer = "-- No one --"; static const char *HumanDriverModuleName = "human"; static const char *DefaultCarName = "sc-lynx-220"; +#ifdef WEBSERVER static const char *DefaultWebserverusername = "username"; static const char *DefaultWebserverpassword = "password"; +#endif //WEBSERVER static const char *SkillLevelString[] = { ROB_VAL_ARCADE, ROB_VAL_SEMI_ROOKIE, ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO }; static const int NbSkillLevels = sizeof(SkillLevelString) / sizeof(SkillLevelString[0]); @@ -68,16 +72,20 @@ static int AutoReverseEditId; static int AutoReverseLeftId; static int AutoReverseRightId; static int AutoReverseLabelId; +#ifdef WEBSERVER static int WebUsernameEditId; static int WebPasswordEditId; +#endif //WEBSERVER /* Struct to define a generic ("internal name / id", "displayable name") pair */ typedef struct tInfo { char *name; char *dispname; + #ifdef WEBSERVER char *webserverusername; char *webserverpassword; + #endif //WEBSERVER } tInfo; @@ -90,9 +98,13 @@ public: const char *defcarname = 0, int racenumber = 0, int skilllevel = 0, float *color = 0, tGearChangeMode gearchangemode = GEAR_MODE_AUTO, int autoreverse = 0, - int nbpitstops = 0, + int nbpitstops = 0 + #ifdef WEBSERVER + , const char *webserverusername = 0, - const char *webserverpassword = 0) + const char *webserverpassword = 0 + #endif //WEBSERVER + ) { _info.name = 0; setName(name); @@ -105,10 +117,12 @@ public: _nbpitstops = nbpitstops; _skilllevel = skilllevel; _autoreverse = autoreverse; + #ifdef WEBSERVER _webserverusername = 0; setWebserverusername(webserverusername); _webserverpassword = 0; setWebserverpassword(webserverpassword); + #endif //WEBSERVER _color[0] = color ? color[0] : 1.0; _color[1] = color ? color[1] : 1.0; _color[2] = color ? color[2] : 0.5; @@ -128,10 +142,12 @@ public: _nbpitstops = src._nbpitstops; _skilllevel = src._skilllevel; _autoreverse = src._autoreverse; + #ifdef WEBSERVER _info.webserverusername = 0; setWebserverusername(src._info.webserverusername); _info.webserverpassword = 0; setWebserverpassword(src._info.webserverpassword); + #endif //WEBSERVER _color[0] = src._color[0]; _color[1] = src._color[1]; _color[2] = src._color[2]; @@ -147,8 +163,10 @@ public: float color(int idx) const { return (idx >= 0 && idx < 4) ? _color[idx] : 0.0; } int skillLevel() const { return _skilllevel; } int autoReverse() const { return _autoreverse; } + #ifdef WEBSERVER const char *webserverusername() const { return _webserverusername; } const char *webserverpassword() const { return _webserverpassword; } + #endif //WEBSERVER void setName(const char *name) { @@ -177,6 +195,8 @@ public: _defcarname = new char[strlen(defcarname)+1]; strcpy(_defcarname, defcarname); // Can't use strdup : free crashes in destructor !? } + + #ifdef WEBSERVER void setWebserverusername(const char *webserverusername) { if (_webserverusername) @@ -195,6 +215,8 @@ public: _webserverpassword = new char[strlen(webserverpassword)+1]; strcpy(_webserverpassword, webserverpassword); // Can't use strdup : free crashes in destructor !? } + #endif //WEBSERVER + void setRaceNumber(int raceNumber) { _racenumber = raceNumber; } void setGearChangeMode(tGearChangeMode gearChangeMode) { _gearchangemode = gearChangeMode; } void setNbPitStops(int nbPitStops) { _nbpitstops = nbPitStops; } @@ -209,10 +231,14 @@ public: delete[] _info.name; if (_defcarname) delete[] _defcarname; + + #ifdef WEBSERVER if (_webserverusername) delete[] _webserverusername; if (_webserverpassword) delete[] _webserverpassword; + #endif //WEBSERVER + } // Gear change mode enum to string conversion @@ -243,8 +269,10 @@ private: float _color[4]; int _skilllevel; int _autoreverse; + #ifdef WEBSERVER char* _webserverusername; char* _webserverpassword; + #endif //WEBSERVER }; @@ -289,12 +317,13 @@ refreshEditVal(void) GfuiLabelSetText(ScrHandle, AutoReverseEditId, ""); GfuiEnable(ScrHandle, AutoReverseEditId, GFUI_DISABLE); + #ifdef WEBSERVER GfuiEditboxSetString(ScrHandle, WebUsernameEditId, ""); GfuiEnable(ScrHandle, WebUsernameEditId, GFUI_DISABLE); GfuiEditboxSetString(ScrHandle, WebPasswordEditId, ""); GfuiEnable(ScrHandle, WebPasswordEditId, GFUI_DISABLE); - + #endif //WEBSERVER } else { @@ -322,6 +351,7 @@ refreshEditVal(void) GfuiLabelSetText(ScrHandle, AutoReverseEditId, Yn[(*CurrPlayer)->autoReverse()]); GfuiEnable(ScrHandle, AutoReverseEditId, GFUI_ENABLE); + #ifdef WEBSERVER snprintf(buf, sizeof(buf), "%s", (*CurrPlayer)->webserverusername()); GfuiEditboxSetString(ScrHandle, WebUsernameEditId, buf); GfuiEnable(ScrHandle, WebUsernameEditId, GFUI_ENABLE); @@ -329,6 +359,7 @@ refreshEditVal(void) snprintf(buf, sizeof(buf), "%s", (*CurrPlayer)->webserverpassword()); GfuiEditboxSetString(ScrHandle, WebPasswordEditId, buf); GfuiEnable(ScrHandle, WebPasswordEditId, GFUI_ENABLE); + #endif //WEBSERVER if ((*CurrPlayer)->gearChangeMode() == GEAR_MODE_AUTO) @@ -432,8 +463,10 @@ PutPlayerSettings(unsigned index) GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_TRANS, player->gearChangeModeString()); GfParmSetNum(PrefHdle, drvSectionPath, HM_ATT_NBPITS, (char*)NULL, (tdble)player->nbPitStops()); GfParmSetStr(PrefHdle, drvSectionPath, HM_ATT_AUTOREVERSE, Yn[player->autoReverse()]); + #ifdef WEBSERVER GfParmSetStr(PrefHdle, drvSectionPath, "WebServerUsername", player->webserverusername()); GfParmSetStr(PrefHdle, drvSectionPath, "WebServerPassword", player->webserverpassword()); + #endif //WEBSERVER /* Allow neutral gear in sequential mode if neutral gear command not defined */ @@ -702,11 +735,14 @@ GenPlayerList(void) PlayersInfo[i]->setAutoReverse(1); } + #ifdef WEBSERVER str = GfParmGetStr(PrefHdle, sstring, "WebServerUsername", 0); PlayersInfo[i]->setWebserverusername(str); str = GfParmGetStr(PrefHdle, sstring, "WebServerPassword", 0); PlayersInfo[i]->setWebserverpassword(str); + #endif //WEBSERVER + } @@ -792,6 +828,7 @@ onChangeName(void * /* dummy */) UpdtScrollList(); } +#ifdef WEBSERVER static void onChangeWebserverusername(void * /* dummy */) { @@ -853,6 +890,7 @@ static void onWebserverLoginTest(void * /* dummy */) GfuiApp().eventLoop().postRedisplay(); } } +#endif //WEBSERVER //#641 New player name should get empty when clicking on it // In the Player Configuration menu, when you create @@ -1056,12 +1094,14 @@ PlayerConfigMenuInit(void *prevMenu) GfuiMenuCreateButtonControl(ScrHandle, param, "ApplyButton", NULL, onSavePlayerList); GfuiMenuCreateButtonControl(ScrHandle, param, "CancelButton", NULL, onQuitPlayerConfig); + #ifdef WEBSERVER /* Web username and password editbox */ WebUsernameEditId = GfuiMenuCreateEditControl(ScrHandle, param, "webusernameedit", NULL, NULL, onChangeWebserverusername); WebPasswordEditId = GfuiMenuCreateEditControl(ScrHandle, param, "webpasswordedit", NULL, NULL, onChangeWebserverpassword); /* Web test button */ GfuiMenuCreateButtonControl(ScrHandle, param, "weblogintest", NULL, onWebserverLoginTest); + #endif //WEBSERVER // Close menu XML descriptor. diff --git a/src/modules/userinterface/legacymenu/racescreens/raceloadingmenu.cpp b/src/modules/userinterface/legacymenu/racescreens/raceloadingmenu.cpp index b96ba8173..d0dca05a3 100644 --- a/src/modules/userinterface/legacymenu/racescreens/raceloadingmenu.cpp +++ b/src/modules/userinterface/legacymenu/racescreens/raceloadingmenu.cpp @@ -115,8 +115,12 @@ RmLoadingScreenStart(const char *title, const char *bgimg) // Display screen. GfuiScreenActivate(HScreen); GfuiDisplay(); + + #ifdef WEBSERVER //force one redisplay GfuiApp().eventLoop().forceRedisplay(); + #endif //WEBSERVER + } void @@ -176,7 +180,9 @@ RmLoadingScreenSetText(const char *text) while (i != CurTextLineIdx); GfuiDisplay(); + #ifdef WEBSERVER //force one redisplay GfuiApp().eventLoop().forceRedisplay(); + #endif //WEBSERVER }