Index: head/games/openttd/Makefile =================================================================== --- head/games/openttd/Makefile (revision 530263) +++ head/games/openttd/Makefile (revision 530264) @@ -1,143 +1,144 @@ # Created by: Alexey Dokuchaev # $FreeBSD$ PORTNAME= openttd -DISTVERSION= 1.9.3 -PORTREVISION= 1 +DISTVERSION= 1.10.0 CATEGORIES= games MASTER_SITES= https://proxy.binaries.openttd.org/openttd-releases/${DISTVERSION}/ DISTNAME= ${PORTNAME}-${DISTVERSION}-source MAINTAINER= danfe@FreeBSD.org COMMENT= Open source clone of Microprose Transport Tycoon Deluxe LICENSE= GPLv2 LIB_DEPENDS= libpng.so:graphics/png \ liblzo2.so:archivers/lzo2 USES= cpe gmake pkgconfig tar:xz HAS_CONFIGURE= yes CONFIGURE_ENV= STRIP="${STRIP_CMD} ${STRIP}" -CONFIGURE_ARGS= --prefix-dir="${PREFIX}" --data-dir="${DATADIR_REL}" \ - --without-libtimidity +CONFIGURE_ARGS= --prefix-dir="${PREFIX}" --data-dir="${DATADIR_REL}" MAKE_ARGS= VERBOSE=1 WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} CXXFLAGS= # Set to empty as OpenTTD treats it as an addition to CFLAGS SUB_FILES= pkg-message -PORTDOCS= HOWTO_compile_lang_files.txt README.md admin_network.txt \ +PORTDOCS= README.md admin_network.md compiling_lang_files.md \ + debugging_desyncs.md desync.md directory_structure.md \ changelog.txt elrail.svg elrail_tile.png elrail_track.png \ known-bugs.txt landscape.html landscape_externals.html \ - landscape_grid.html multiplayer.txt obg_format.txt \ + landscape_grid.html logging_and_performance_metrics.md \ + multiplayer.md obg_format.txt \ obm_format.txt obs_format.txt ottd-colourtext-palette.png \ tileh.png DESKTOP_ENTRIES="OpenTTD" "${COMMENT}" "${PORTNAME}" "${PORTNAME}" \ "Game;Simulation;StrategyGame;" false OPTIONS_DEFINE= DOCS .if defined(WITH_MIDI_PLAYER) CONFIGURE_ARGS+= --with-midi="${WITH_MIDI_PLAYER}" .endif .if defined(WITH_MIDI_PLAYER_ARGS) CONFIGURE_ARGS+= --with-midi-arg="${WITH_MIDI_PLAYER_ARGS}" .endif .if defined(WITH_FLUIDSYNTH) LIB_DEPENDS+= libfluidsynth.so:audio/fluidsynth .else CONFIGURE_ARGS+= --without-fluidsynth .endif .if defined(WITH_DEDICATED_SERVER_ONLY) CONFIGURE_ARGS+= --enable-dedicated # Aid it to find lzo2 headers; client build gets it via sdl-config CFLAGS+= -I${LOCALBASE}/include USE_RC_SUBR= ${PORTNAME} .else +CONFIGURE_ARGS+= --with-sdl=sdl1 USES+= compiler:c++11-lib gnome sdl USE_CXXSTD= gnu++11 CXXFLAGS+= -DU_USING_ICU_NAMESPACE=1 LIB_DEPENDS+= libfreetype.so:print/freetype2 \ libicui18n.so:devel/icu \ libicu-le-hb.so:devel/icu-le-hb \ libiculx.so:devel/icu-lx \ libfontconfig.so:x11-fonts/fontconfig USE_SDL= sdl INSTALLS_ICONS= yes .endif .if defined(WITH_OPEN_GAME_FILES) RUN_DEPENDS+= ${LOCALBASE}/share/${PORTNAME}/baseset/opengfx/opengfx.obg:games/opengfx \ ${LOCALBASE}/share/${PORTNAME}/baseset/openmsx/openmsx.obm:games/openmsx \ ${LOCALBASE}/share/${PORTNAME}/baseset/opensfx/opensfx.obs:games/opensfx .endif .if defined(WITH_SAVE_PASSWORDS) EXTRA_PATCHES= ${FILESDIR}/extra-patch-save-passwords .endif .include pre-everything:: .if !defined(WITH_MIDI_PLAYER) @${ECHO_MSG} "Define WITH_MIDI_PLAYER=/path/to/player to build with external MIDI player" .endif .if !defined(WITH_MIDI_PLAYER_ARGS) @${ECHO_MSG} "Define WITH_MIDI_PLAYER_ARGS=arguments for external MIDI player" .endif .if !defined(WITH_FLUIDSYNTH) @${ECHO_MSG} "Define WITH_FLUIDSYNTH to enable new Fluidsynth music driver" .endif .if !defined(WITH_DEDICATED_SERVER_ONLY) @${ECHO_MSG} "Define WITH_DEDICATED_SERVER_ONLY to build CLI-based dedicated server" .endif .if !defined(WITH_OPEN_GAME_FILES) @${ECHO_MSG} "Define WITH_OPEN_GAME_FILES to install with libre graphics, music, and sounds" .endif .if !defined(WITH_SAVE_PASSWORDS) @${ECHO_MSG} "Define WITH_SAVE_PASSWORDS to save passwords between server restarts" .endif post-extract: @${MV} ${WRKSRC}/README.md ${WRKSRC}/changelog.txt \ ${WRKSRC}/known-bugs.txt ${WRKSRC}/docs post-patch: @${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},' ${WRKSRC}/config.lib @${REINPLACE_CMD} -e 's,OSX,${OPSYS:tu},' ${WRKSRC}/Makefile.grf.in do-install: ${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin @${MKDIR} ${STAGEDIR}${DATADIR}/ai ${STAGEDIR}${DATADIR}/baseset \ ${STAGEDIR}${DATADIR}/game ${STAGEDIR}${DATADIR}/lang \ ${STAGEDIR}${DATADIR}/scripts ${INSTALL_DATA} ${WRKSRC}/bin/ai/*.nut ${STAGEDIR}${DATADIR}/ai ${INSTALL_DATA} ${WRKSRC}/bin/baseset/* ${STAGEDIR}${DATADIR}/baseset ${INSTALL_DATA} ${WRKSRC}/bin/game/* ${STAGEDIR}${DATADIR}/game ${INSTALL_DATA} ${WRKSRC}/bin/lang/* ${STAGEDIR}${DATADIR}/lang ${INSTALL_DATA} ${WRKSRC}/bin/scripts/* ${STAGEDIR}${DATADIR}/scripts ${INSTALL_MAN} ${WRKSRC}/docs/${PORTNAME}.6 \ ${STAGEDIR}${MANPREFIX}/man/man6 .if !defined(WITH_DEDICATED_SERVER_ONLY) ${INSTALL_DATA} ${WRKSRC}/media/openttd.32.xpm \ ${STAGEDIR}${PREFIX}/share/pixmaps . for n in 16 32 48 64 128 256 @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps ${INSTALL_DATA} ${WRKSRC}/media/openttd.${n}.png \ ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps/openttd.png . endfor .else @${REINPLACE_CMD} -E '/icons|pixmaps/d' ${TMPPLIST} .endif post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/docs/,} ${STAGEDIR}${DOCSDIR} .include Index: head/games/openttd/distinfo =================================================================== --- head/games/openttd/distinfo (revision 530263) +++ head/games/openttd/distinfo (revision 530264) @@ -1,3 +1,3 @@ -TIMESTAMP = 1568662216 -SHA256 (openttd-1.9.3-source.tar.xz) = 1988e17f5b6f4b8f423c849ef1c579c21f678722ae4440f87b27a5fea6385846 -SIZE (openttd-1.9.3-source.tar.xz) = 6659508 +TIMESTAMP = 1585730612 +SHA256 (openttd-1.10.0-source.tar.xz) = 1ba21aac9a1de98b23f80fee952b4b9c5e2d3cc4ac187f5203730826b3f0e253 +SIZE (openttd-1.10.0-source.tar.xz) = 6801228 Index: head/games/openttd/files/extra-patch-save-passwords =================================================================== --- head/games/openttd/files/extra-patch-save-passwords (revision 530263) +++ head/games/openttd/files/extra-patch-save-passwords (revision 530264) @@ -1,137 +1,137 @@ --- src/network/network_func.h 2014-10-21 21:36:31.000000000 +0300 +++ src/network/network_func.h 2014-11-09 21:37:49.000000000 +0200 @@ -74,7 +74,8 @@ bool NetworkServerStart(); void NetworkServerNewCompany(const Company *company, NetworkClientInfo *ci); bool NetworkServerChangeClientName(ClientID client_id, const char *new_name); - +void NetworkSavePassword(); +void NetworkLoadPassword(); void NetworkServerDoMove(ClientID client_id, CompanyID company_id); void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const char *string); --- src/network/network_server.cpp 2014-10-21 21:36:31.000000000 +0300 +++ src/network/network_server.cpp 2014-11-09 21:37:49.000000000 +0200 @@ -32,7 +32,7 @@ #include "../core/pool_func.hpp" - #include "../core/random_func.hpp" - #include "../rev.h" + #include + #include - +#include "../fileio_func.h" #include "../safeguards.h" @@ -500,6 +500,7 @@ /* Reset 'lag' counters */ this->last_frame = this->last_frame_server = _frame_counter; + DEBUG( net, 1, "requesting GAME password" ); Packet *p = new Packet(PACKET_SERVER_NEED_GAME_PASSWORD); this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; @@ -1684,6 +1685,9 @@ IConsolePrintF(CC_DEFAULT, "Auto-removed protection from company #%d", c->index + 1); _network_company_states[c->index].months_empty = 0; NetworkServerUpdateCompanyPassworded(c->index, false); + if (_settings_client.network.save_password) { + NetworkSavePassword( ); + } } /* Is the company empty for autoclean_novehicles-months, and has no vehicles? */ if (_settings_client.network.autoclean_novehicles != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_novehicles && vehicles_in_company[c->index] == 0) { @@ -1782,6 +1786,9 @@ strecpy(_network_company_states[company_id].password, password, lastof(_network_company_states[company_id].password)); NetworkServerUpdateCompanyPassworded(company_id, !StrEmpty(_network_company_states[company_id].password)); + if (_settings_client.network.save_password) { + NetworkSavePassword( ); + } } /** @@ -2206,4 +2213,47 @@ } } +void NetworkSavePassword( ) +{ + static FILE *file_pointer; + char password_file_name[80]; + + seprintf( password_file_name, lastof(password_file_name), "%u.pwd", _settings_game.game_creation.generation_seed ); + DEBUG( net, 0, "Saving companies password to %s", password_file_name ); + file_pointer = FioFOpenFile( password_file_name, "wb", SAVE_DIR ); + + if (file_pointer != NULL) { + for( CompanyID l_company = (CompanyID)0; l_company < MAX_COMPANIES; l_company++ ) { + if (NetworkCompanyIsPassworded(l_company)) { + fwrite( _network_company_states[l_company].password, strlen(_network_company_states[l_company].password), 1, file_pointer); + } + fwrite( "\n", 1, 1, file_pointer ); + } + fclose(file_pointer); + } +} + +void NetworkLoadPassword( ) +{ + static FILE *file_pointer; + char password[NETWORK_PASSWORD_LENGTH]; + char password_file_name[80]; + + seprintf( password_file_name, lastof(password_file_name), "%u.pwd", _settings_game.game_creation.generation_seed ); + file_pointer = FioFOpenFile( password_file_name, "rb", SAVE_DIR ); + if (file_pointer != NULL) { + DEBUG( net, 0, "Loading password from %s", password_file_name ); + for( CompanyID l_company = (CompanyID)0; l_company < MAX_COMPANIES; l_company++ ) { + fgets( password, sizeof( password), file_pointer); + if (strlen(password)>1) { + fseek( file_pointer, 1L, SEEK_CUR ); + strecpy(_network_company_states[l_company].password, password, lastof(_network_company_states[l_company].password)); + NetworkServerUpdateCompanyPassworded(l_company, !StrEmpty(_network_company_states[l_company].password)); + } + } + } else { + DEBUG( net, 0, "Password file %s not found", password_file_name ); + } +} + #endif /* ENABLE_NETWORK */ --- src/openttd.cpp 2014-10-21 21:36:36.000000000 +0300 +++ src/openttd.cpp 2014-11-09 21:40:39.000000000 +0200 @@ -1111,6 +1111,10 @@ #ifdef ENABLE_NETWORK if (_network_server) { seprintf(_network_game_info.map_name, lastof(_network_game_info.map_name), "%s (Loaded game)", _file_to_saveload.title); + // Try to load password + if ( _settings_client.network.save_password ) { + NetworkLoadPassword( ); + } } #endif /* ENABLE_NETWORK */ } --- src/settings_type.h 2014-10-21 21:36:35.000000000 +0300 +++ src/settings_type.h 2014-11-09 21:37:49.000000000 +0200 @@ -266,6 +266,7 @@ char last_host[NETWORK_HOSTNAME_LENGTH]; ///< IP address of the last joined server uint16 last_port; ///< port of the last joined server bool no_http_content_downloads; ///< do not do content downloads over HTTP + bool save_password; ///< If password file is used - #else /* ENABLE_NETWORK */ - #endif }; + + /** Settings related to the creation of games. */ --- src/table/settings.ini 2014-10-21 21:36:21.000000000 +0300 +++ src/table/settings.ini 2014-11-09 21:37:49.000000000 +0200 @@ -3915,6 +3915,12 @@ def = false cat = SC_EXPERT +[SDTC_BOOL] +ifdef = ENABLE_NETWORK +var = network.save_password +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = false + ; Since the network code (CmdChangeSetting and friends) use the index in this array to decide ; which setting the server is talking about all conditional compilation of this array must be at the ; end. This isn't really the best solution, the settings the server can tell the client about should Index: head/games/openttd/files/patch-config.lib =================================================================== --- head/games/openttd/files/patch-config.lib (revision 530263) +++ head/games/openttd/files/patch-config.lib (revision 530264) @@ -1,82 +1,82 @@ --- config.lib.orig 2016-04-01 18:33:55 UTC +++ config.lib @@ -816,15 +816,15 @@ check_params() { pre_detect_with_lzma=$with_lzma detect_lzma - if [ "$with_lzma" = "0" ] || [ -z "$lzma_config" ]; then + if [ "$with_lzma" = "0" ] || [ -z "$lzma" ]; then log 1 "WARNING: lzma was not detected or disabled" log 1 "WARNING: OpenTTD doesn't require lzma, but it does mean that many features" log 1 "WARNING: (like loading most savegames/scenarios and joining most servers)" log 1 "WARNING: will be disabled." if [ "$pre_detect_with_lzma" = "0" ]; then log 1 "WARNING: We strongly suggest you to install liblzma." - log 1 "configure: error: no liblzma detected" else + log 1 "configure: error: no liblzma detected" log 1 " If you want to compile without lzma use --without-lzma as parameter" exit fi @@ -1468,7 +1468,6 @@ make_cflags_and_ldflags() { # -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible) CFLAGS="-fomit-frame-pointer $CFLAGS" fi - CFLAGS="-O2 $CFLAGS" else OBJS_SUBDIR="debug" @@ -1675,16 +1674,14 @@ make_cflags_and_ldflags() { fi fi - if [ -n "$lzma_config" ]; then -- CFLAGS="$CFLAGS -DWITH_LZMA" +- CFLAGS="$CFLAGS -DWITH_LIBLZMA" - CFLAGS="$CFLAGS `$lzma_config --cflags | tr '\n\r' ' '`" - - if [ "$enable_static" != "0" ]; then + if [ "$with_lzma" != "0" ]; then + if [ "$enable_static" != "0" ] && [ "$os" != "OSX" ]; then CFLAGS="$CFLAGS -DLZMA_API_STATIC" - LIBS="$LIBS `$lzma_config --libs --static | tr '\n\r' ' '`" + LIBS="$LIBS $lzma" else - LIBS="$LIBS `$lzma_config --libs | tr '\n\r' ' '`" + LIBS="$LIBS -llzma" fi -+ CFLAGS="$CFLAGS -DWITH_LZMA" ++ CFLAGS="$CFLAGS -DWITH_LIBLZMA" fi if [ "$with_lzo2" != "0" ]; then @@ -2692,6 +2689,10 @@ detect_lzo2() { detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h" } +detect_lzma() { + detect_library "$with_lzma" "lzma" "liblzma.a" "" "lzma.h" +} + - detect_libtimidity() { - detect_pkg_config "$with_libtimidity" "libtimidity" "libtimidity_config" "0.1" "1" + detect_fluidsynth() { + detect_library "$with_fluidsynth" "fluidsynth" "" "" "fluidsynth.h" } @@ -2756,10 +2757,6 @@ detect_pkg_config() { log 1 "checking $2... found" } -detect_lzma() { - detect_pkg_config "$with_lzma" "liblzma" "lzma_config" "5.0" -} - detect_xdg_basedir() { detect_pkg_config "$with_xdg_basedir" "libxdg-basedir" "xdg_basedir_config" "1.2" } @@ -3523,8 +3520,7 @@ showhelp() { echo " --with-sdl[=\"pkg-config sdl\"] enables SDL video driver support" echo " --with-zlib[=\"pkg-config zlib\"]" echo " enables zlib support" - echo " --with-liblzma[=\"pkg-config liblzma\"]" - echo " enables liblzma support" + echo " --with-liblzma[=liblzma.a] enables liblzma support" echo " --with-liblzo2[=liblzo2.a] enables liblzo2 support" echo " --with-png[=\"pkg-config libpng\"]" echo " enables libpng support" Index: head/games/openttd/pkg-plist =================================================================== --- head/games/openttd/pkg-plist (revision 530263) +++ head/games/openttd/pkg-plist (revision 530264) @@ -1,106 +1,108 @@ bin/openttd man/man6/openttd.6.gz %%DATADIR%%/ai/compat_0.7.nut %%DATADIR%%/ai/compat_1.0.nut %%DATADIR%%/ai/compat_1.1.nut %%DATADIR%%/ai/compat_1.2.nut %%DATADIR%%/ai/compat_1.3.nut %%DATADIR%%/ai/compat_1.4.nut %%DATADIR%%/ai/compat_1.5.nut %%DATADIR%%/ai/compat_1.6.nut %%DATADIR%%/ai/compat_1.7.nut %%DATADIR%%/ai/compat_1.8.nut %%DATADIR%%/ai/compat_1.9.nut +%%DATADIR%%/ai/compat_1.10.nut %%DATADIR%%/baseset/no_music.obm %%DATADIR%%/baseset/no_sound.obs %%DATADIR%%/baseset/openttd.grf %%DATADIR%%/baseset/opntitle.dat %%DATADIR%%/baseset/orig_dos.obg %%DATADIR%%/baseset/orig_dos.obm %%DATADIR%%/baseset/orig_dos.obs %%DATADIR%%/baseset/orig_dos_de.obg %%DATADIR%%/baseset/orig_extra.grf %%DATADIR%%/baseset/orig_tto.obm %%DATADIR%%/baseset/orig_win.obg %%DATADIR%%/baseset/orig_win.obm %%DATADIR%%/baseset/orig_win.obs %%DATADIR%%/game/compat_1.2.nut %%DATADIR%%/game/compat_1.3.nut %%DATADIR%%/game/compat_1.4.nut %%DATADIR%%/game/compat_1.5.nut %%DATADIR%%/game/compat_1.6.nut %%DATADIR%%/game/compat_1.7.nut %%DATADIR%%/game/compat_1.8.nut %%DATADIR%%/game/compat_1.9.nut +%%DATADIR%%/game/compat_1.10.nut %%DATADIR%%/lang/afrikaans.lng %%DATADIR%%/lang/arabic_egypt.lng %%DATADIR%%/lang/basque.lng %%DATADIR%%/lang/belarusian.lng %%DATADIR%%/lang/brazilian_portuguese.lng %%DATADIR%%/lang/bulgarian.lng %%DATADIR%%/lang/catalan.lng %%DATADIR%%/lang/croatian.lng %%DATADIR%%/lang/czech.lng %%DATADIR%%/lang/danish.lng %%DATADIR%%/lang/dutch.lng %%DATADIR%%/lang/english.lng %%DATADIR%%/lang/english_AU.lng %%DATADIR%%/lang/english_US.lng %%DATADIR%%/lang/esperanto.lng %%DATADIR%%/lang/estonian.lng %%DATADIR%%/lang/faroese.lng %%DATADIR%%/lang/finnish.lng %%DATADIR%%/lang/french.lng %%DATADIR%%/lang/gaelic.lng %%DATADIR%%/lang/galician.lng %%DATADIR%%/lang/german.lng %%DATADIR%%/lang/greek.lng %%DATADIR%%/lang/hebrew.lng %%DATADIR%%/lang/hungarian.lng %%DATADIR%%/lang/icelandic.lng %%DATADIR%%/lang/indonesian.lng %%DATADIR%%/lang/irish.lng %%DATADIR%%/lang/italian.lng %%DATADIR%%/lang/japanese.lng %%DATADIR%%/lang/korean.lng %%DATADIR%%/lang/latin.lng %%DATADIR%%/lang/latvian.lng %%DATADIR%%/lang/lithuanian.lng %%DATADIR%%/lang/luxembourgish.lng %%DATADIR%%/lang/malay.lng %%DATADIR%%/lang/norwegian_bokmal.lng %%DATADIR%%/lang/norwegian_nynorsk.lng %%DATADIR%%/lang/polish.lng %%DATADIR%%/lang/portuguese.lng %%DATADIR%%/lang/romanian.lng %%DATADIR%%/lang/russian.lng %%DATADIR%%/lang/serbian.lng %%DATADIR%%/lang/simplified_chinese.lng %%DATADIR%%/lang/slovak.lng %%DATADIR%%/lang/slovenian.lng %%DATADIR%%/lang/spanish.lng %%DATADIR%%/lang/spanish_MX.lng %%DATADIR%%/lang/swedish.lng %%DATADIR%%/lang/tamil.lng %%DATADIR%%/lang/thai.lng %%DATADIR%%/lang/traditional_chinese.lng %%DATADIR%%/lang/turkish.lng %%DATADIR%%/lang/ukrainian.lng %%DATADIR%%/lang/vietnamese.lng %%DATADIR%%/lang/welsh.lng %%DATADIR%%/scripts/autoexec.scr.example %%DATADIR%%/scripts/game_start.scr.example %%DATADIR%%/scripts/on_client.scr.example %%DATADIR%%/scripts/on_dedicated.scr.example %%DATADIR%%/scripts/on_server.scr.example %%DATADIR%%/scripts/on_server_connect.scr.example %%DATADIR%%/scripts/pre_dedicated.scr.example %%DATADIR%%/scripts/pre_server.scr.example %%DATADIR%%/scripts/readme.txt share/icons/hicolor/16x16/apps/openttd.png share/icons/hicolor/32x32/apps/openttd.png share/icons/hicolor/48x48/apps/openttd.png share/icons/hicolor/64x64/apps/openttd.png share/icons/hicolor/128x128/apps/openttd.png share/icons/hicolor/256x256/apps/openttd.png share/pixmaps/openttd.32.xpm