diff --git a/.github/workflows/controller.yml b/.github/workflows/controller.yml index 96dbfcf206..7e73f429c6 100644 --- a/.github/workflows/controller.yml +++ b/.github/workflows/controller.yml @@ -51,3 +51,11 @@ jobs: needs: build if: ${{ !failure() && !cancelled() }} uses: ./.github/workflows/mysql.yml + macos_latest: + needs: build + if: ${{ !failure() && !cancelled() }} + uses: ./.github/workflows/macos_latest.yml + macos_m1: + needs: build + if: ${{ !failure() && !cancelled() }} + uses: ./.github/workflows/macos_m1.yml diff --git a/.github/workflows/macos_latest.yml b/.github/workflows/macos_latest.yml new file mode 100644 index 0000000000..02e2a86734 --- /dev/null +++ b/.github/workflows/macos_latest.yml @@ -0,0 +1,81 @@ +name: macos_latest + +on: workflow_call + +env: + MYSQL_DATABASE: 'ragnarok' + MYSQL_USER: 'ragnarok' + MYSQL_PASSWORD: 'ragnarok' + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MACOS_COMMON_PACKAGES: make zlib pcre mysql mysql-client mysql-connector-c + SQLHOST: 'localhost' + +jobs: + build: + runs-on: macos-latest + timeout-minutes: 60 + strategy: + matrix: + CC: [clang] + RENEWAL: ["", "--disable-renewal"] + CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"] + HTTPLIB: ["", "--with-http_parser=llhttp"] + SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] + PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + exclude: + - PACKET_VERSION: "--enable-packetver=20130724" + CLIENT_TYPE: "--enable-packetver-zero" + + # github.head_ref will stop previous runs in the same PR (if in a PR) + # github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop) + concurrency: + group: macos-x64-${{ github.head_ref || github.run_id }}_${{ matrix.CC }}_${{ matrix.RENEWAL }}_${{ matrix.CLIENT_TYPE }}_${{ matrix.HTTPLIB }}_${{ matrix.SANITIZER }}_${{ matrix.PACKET_VERSION}} + cancel-in-progress: true + + env: + CC: ${{ matrix.CC }} + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} + PACKET_VERSION: ${{ matrix.PACKET_VERSION }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: info + run: | + uname -a + + - name: prepare the build environment + run: | + echo "CPPFLAGS=-I$(brew --prefix)/include" >> $GITHUB_ENV + echo "LDFLAGS=-L$(brew --prefix)/lib" >> $GITHUB_ENV + + - name: install packages + run: | + brew update || true + ./tools/ci/retry.sh brew install $MACOS_COMMON_PACKAGES + + - name: setup mysql server + run: | + brew services start mysql + ./tools/ci/retry.sh mysqladmin ping --silent + ./tools/ci/travis.sh createdb $MYSQL_DATABASE root + ./tools/ci/travis.sh adduser $MYSQL_DATABASE $MYSQL_USER $MYSQL_PASSWORD root '' $SQLHOST + ./tools/ci/travis.sh importdb $MYSQL_DATABASE root + + - name: get plugins + run: | + ./tools/ci/travis.sh getplugins || true + + - name: build + run: | + ./tools/ci/travis.sh build $CONFIGURE_FLAGS --with-mysql=$(brew --prefix mysql)/bin/mysql_config + + - name: test + run: | + ./tools/ci/travis.sh test ragnarok ragnarok ragnarok $SQLHOST + + - name: extra test + if: env.PACKET_VERSION != '--enable-packetver=20130724' + run: | + ./tools/ci/travis.sh extratest diff --git a/.github/workflows/macos_m1.yml b/.github/workflows/macos_m1.yml new file mode 100644 index 0000000000..f4dbfa2945 --- /dev/null +++ b/.github/workflows/macos_m1.yml @@ -0,0 +1,81 @@ +name: macos_m1 + +on: workflow_call + +env: + MYSQL_DATABASE: 'ragnarok' + MYSQL_USER: 'ragnarok' + MYSQL_PASSWORD: 'ragnarok' + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MACOS_COMMON_PACKAGES: make zlib pcre mysql mysql-client mysql-connector-c + SQLHOST: 'localhost' + +jobs: + build: + runs-on: macos-14 + timeout-minutes: 60 + strategy: + matrix: + CC: [clang] + RENEWAL: ["", "--disable-renewal"] + CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"] + HTTPLIB: ["", "--with-http_parser=llhttp"] + SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] + PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + exclude: + - PACKET_VERSION: "--enable-packetver=20130724" + CLIENT_TYPE: "--enable-packetver-zero" + + # github.head_ref will stop previous runs in the same PR (if in a PR) + # github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop) + concurrency: + group: macos-arm-${{ github.head_ref || github.run_id }}_${{ matrix.CC }}_${{ matrix.RENEWAL }}_${{ matrix.CLIENT_TYPE }}_${{ matrix.HTTPLIB }}_${{ matrix.SANITIZER }}_${{ matrix.PACKET_VERSION}} + cancel-in-progress: true + + env: + CC: ${{ matrix.CC }} + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} + PACKET_VERSION: ${{ matrix.PACKET_VERSION }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: info + run: | + uname -a + + - name: prepare the build environment + run: | + echo "CPPFLAGS=-I$(brew --prefix)/include" >> $GITHUB_ENV + echo "LDFLAGS=-L$(brew --prefix)/lib" >> $GITHUB_ENV + + - name: install packages + run: | + brew update || true + ./tools/ci/retry.sh brew install $MACOS_COMMON_PACKAGES + + - name: setup mysql server + run: | + brew services start mysql + ./tools/ci/retry.sh mysqladmin ping --silent + ./tools/ci/travis.sh createdb $MYSQL_DATABASE root + ./tools/ci/travis.sh adduser $MYSQL_DATABASE $MYSQL_USER $MYSQL_PASSWORD root '' $SQLHOST + ./tools/ci/travis.sh importdb $MYSQL_DATABASE root + + - name: get plugins + run: | + ./tools/ci/travis.sh getplugins || true + + - name: build + run: | + ./tools/ci/travis.sh build $CONFIGURE_FLAGS --with-mysql=$(brew --prefix mysql)/bin/mysql_config + + - name: test + run: | + ./tools/ci/travis.sh test ragnarok ragnarok ragnarok $SQLHOST + + - name: extra test + if: env.PACKET_VERSION != '--enable-packetver=20130724' + run: | + ./tools/ci/travis.sh extratest diff --git a/CHANGELOG.md b/CHANGELOG.md index 086faf202f..7845a6ee88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,32 @@ If you are reading this in a text editor, simply ignore this section ### Removed --> +## [v2024.02] `February 2024` + +### Added + +- Added GitHub Actions CI builds on macOS (Intel and ARM). (#3281) + +### Changed + +- Renamed the arguments of the `aMalloc()`, `aCalloc()`, `aStrndup()`, `aRealloc()`, `aReallocz()` macros to make it harder to accidentally swap their order. (#3280) + +### Fixed + +- Fixed `expandinventory()` not allowing to return to the initial minimum inventory size. (#3270) +- Fixed a race condition allowing for a call to `clif->pLoadEndAck()` before the client's loadendack is received. (#3277) +- Fixed a memory leak of emblem data when guilds are unloaded or disbanded. (#3278) +- Fixed several instances of swapped arguments in `aCalloc()` calls, causing warnings in gcc-14. (#3280) +- Fixed a regression causing AutoSpell not to replace the selected skill when the new skill has lower level than the previous one. (#3282) + +### Deprecated + +### Removed + +### Other + +- Updated copyright headers for year 2024. + ## [v2023.12] `December 2023` ### Added @@ -2991,6 +3017,7 @@ Note: everything included in this release is part of PR #3198 which consists of - New versioning scheme and project changelogs/release notes (#1853) [Unreleased]: https://github.com/HerculesWS/Hercules/compare/stable...master +[v2024.02]: https://github.com/HerculesWS/Hercules/compare/v2023.12...v2024.02 [v2023.12]: https://github.com/HerculesWS/Hercules/compare/v2023.11...v2023.12 [v2023.11]: https://github.com/HerculesWS/Hercules/compare/v2023.10...v2023.11 [v2023.10]: https://github.com/HerculesWS/Hercules/compare/v2023.08...v2023.10 diff --git a/configure b/configure index 67bbd3e4dc..86dc664358 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac a16c389a2. +# From configure.ac ce12b6b8f. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71. # @@ -1396,38 +1396,39 @@ Optional Features: --enable-packetver-ad Sets or unsets the PACKETVER_AD define - see src/common/mmo.h (currently disabled by default) --enable-epoll use epoll(4) on Linux - --enable-debug[=ARG] Compiles extra debug code. (yes by default) + --enable-debug[=ARG] Compiles extra debug code. (yes by default) (available options: yes, no, gdb) --enable-libbacktrace[=ARG] - Compiles with libbacktrace. (no by default - + Compiles with libbacktrace. (no by default - experimental) --enable-buildbot[=ARG] (available options: yes, no) - --enable-rdtsc Uses rdtsc as timing source (disabled by default) - Enable it when you've timing issues. (For example: - in conjunction with XEN or Other Virtualization - mechanisms) Note: Please ensure that you've disabled - dynamic CPU-Frequencys, such as power saving - options. (On most modern Dedicated Servers cpufreq - is preconfigured, see your distribution's manual how - to disable it). Furthermore, If your CPU has - built-in CPU-Frequency scaling features (such as - Intel's SpeedStep(R)), do not enable this option. - Recent CPUs (Intel Core or newer) guarantee a fixed - increment rate for their TSC, so it should be safe - to use, but please doublecheck the documentation of - both your CPU and OS before enabling this option. + --enable-rdtsc Uses rdtsc as timing source (disabled by default) + Enable it when you've timing issues. (For + example: in conjunction with XEN or Other + Virtualization mechanisms) Note: Please ensure + that you've disabled dynamic CPU-Frequencys, such as + power saving options. (On most modern Dedicated + Servers cpufreq is preconfigured, see your + distribution's manual how to disable it). + Furthermore, If your CPU has built-in CPU-Frequency + scaling features (such as Intel's SpeedStep(R)), do + not enable this option. Recent CPUs (Intel Core or + newer) guarantee a fixed increment rate for their + TSC, so it should be safe to use, but please + doublecheck the documentation of both your CPU and + OS before enabling this option. --enable-profiler=ARG Profilers: no, gprof (disabled by default) - --disable-64bit Enforce 32bit output on x86_64 systems. - --enable-lto Enables or Disables Linktime Code Optimization (LTO - is disabled by default) - --enable-static Enables or Disables Statick Linking (STATIC is + --disable-64bit Enforce 32bit output on x86_64 systems. + --enable-lto Enables or Disables Linktime Code Optimization + (LTO is disabled by default) + --enable-static Enables or Disables Statick Linking (STATIC is disabled by default) - --enable-sanitize[=ARG] Enables sanitizer. (disabled by default) (available - options: yes, no, full) - --enable-Werror Enables -Werror in the compiler flags. (disabled by - default) - --disable-renewal Disable Ragnarok Renewal support (override settings - in src/config/renewal.h) + --enable-sanitize[=ARG] Enables sanitizer. (disabled by default) + (available options: yes, no, full) + --enable-Werror Enables -Werror in the compiler flags. (disabled + by default) + --disable-renewal Disable Ragnarok Renewal support (override + settings in src/config/renewal.h) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2540,6 +2541,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_config_files="$ac_config_files Makefile src/common/Makefile" ac_config_files="$ac_config_files 3rdparty/mt19937ar/Makefile 3rdparty/libconfig/Makefile 3rdparty/libbacktrace/Makefile 3rdparty/libbacktrace/backtrace-supported.h" @@ -5681,6 +5683,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : pointers_fit_in_ints="yes" +else $as_nop + + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$pointers_fit_in_ints" = "no" ; then @@ -5700,6 +5705,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : pointers_fit_in_ints="yes (with -m32)" +else $as_nop + + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -10488,6 +10496,103 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +case $host_os in +Darwin*) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-deprecated-declarations" >&5 +printf %s "checking whether $CC supports -Wno-deprecated-declarations... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-deprecated-declarations" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wdeprecated-declarations" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-deprecated-declarations" + # Optionally, run a test + if test "x" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-deprecated-declarations" >&5 +printf %s "checking whether $CC can actually use -Wno-deprecated-declarations... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wdeprecated-declarations" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +printf "%s\n" "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" + +else $as_nop + + CFLAGS="$OLD_CFLAGS -Werror -Wno-deprecated-declarations" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-deprecated-declarations" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + + ;; +esac + # Certain versions of gcc make -Wshadow completely useless by making it flood # you with unnecessary warnings # Let's check if we can really use it @@ -12608,9 +12713,17 @@ then : CFLAGS="$CFLAGS -DHAVE_EXECINFO" +else $as_nop + + + fi +else $as_nop + + + fi done diff --git a/configure.ac b/configure.ac index 03f9c468cd..c67777e959 100644 --- a/configure.ac +++ b/configure.ac @@ -20,9 +20,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -AC_INIT(Hercules) +AC_INIT +AC_CONFIG_SRCDIR([Hercules]) AC_REVISION([m4_esyscmd_s([type git >/dev/null 2>&1 && git describe --always 2>/dev/null || echo '(unknown version)'])]) -AC_PREREQ([2.69]) +AC_PREREQ([2.71]) AC_CONFIG_SRCDIR([src/common/cbasetypes.h]) AC_CONFIG_FILES([Makefile src/common/Makefile]) AC_CONFIG_FILES([3rdparty/mt19937ar/Makefile 3rdparty/libconfig/Makefile 3rdparty/libbacktrace/Makefile 3rdparty/libbacktrace/backtrace-supported.h]) @@ -34,10 +35,10 @@ AC_CONFIG_FILES([src/test/Makefile]) AC_CONFIG_FILES([tools/HPMHookGen/Makefile]) AC_CONFIG_FILES([tools/doxygen/Makefile]) -dnl AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.60 or newer. Fall back to AC_GNU_SOURCE otherwise. +dnl AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.60 or newer. Fall back to AC_USE_SYSTEM_EXTENSIONS otherwise. m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_USE_SYSTEM_EXTENSIONS], - [AC_GNU_SOURCE] + [AC_USE_SYSTEM_EXTENSIONS] ) AC_MSG_CHECKING([host OS]) @@ -144,10 +145,8 @@ AC_ARG_ENABLE( # AC_ARG_ENABLE( [old-cashshop-preview-patch], - AC_HELP_STRING( - [--enable-old-cashshop-preview-patch], - [Enable Nemo patch ExtendOldCashShopPreview.] - ), + AS_HELP_STRING([--enable-old-cashshop-preview-patch],[Enable Nemo patch ExtendOldCashShopPreview. + ]), [enable_old_cashshop_preview_patch=1], [enable_old_cashshop_preview_patch=0] ) @@ -672,10 +671,8 @@ AC_ARG_WITH( # Select http parser AC_ARG_WITH( [http_parser], - AC_HELP_STRING( - [--with-http_parser=ARG], - [select http parser. Allowed values: http-parser, llhttp)] - ), + AS_HELP_STRING([--with-http_parser=ARG],[select http parser. Allowed values: http-parser, llhttp) + ]), [ case $withval in http-parser* ) @@ -1247,6 +1244,12 @@ AC_CHECK_COMPILER_WNOFLAG(deprecated-non-prototype) # issue in clang-15 in libconfig AC_CHECK_COMPILER_WNOFLAG(unused-but-set-variable) +case $host_os in +Darwin*) + AC_CHECK_COMPILER_WNOFLAG(deprecated-declarations) + ;; +esac + # Certain versions of gcc make -Wshadow completely useless by making it flood # you with unnecessary warnings # Let's check if we can really use it diff --git a/doc/constants_pre-re.md b/doc/constants_pre-re.md index b123d2f504..33de13f3c5 100644 --- a/doc/constants_pre-re.md +++ b/doc/constants_pre-re.md @@ -4874,7 +4874,7 @@ ### Server defines - `PACKETVER`: 20190530 -- `HERCULES_VERSION`: 202312000 +- `HERCULES_VERSION`: 202402000 - `MAX_LEVEL`: 175 - `MAX_STORAGE`: 600 - `MAX_GUILD_STORAGE`: 500 diff --git a/doc/constants_re.md b/doc/constants_re.md index 7d6955a918..851b01a782 100644 --- a/doc/constants_re.md +++ b/doc/constants_re.md @@ -4874,7 +4874,7 @@ ### Server defines - `PACKETVER`: 20190530 -- `HERCULES_VERSION`: 202312000 +- `HERCULES_VERSION`: 202402000 - `MAX_LEVEL`: 175 - `MAX_STORAGE`: 600 - `MAX_GUILD_STORAGE`: 500 diff --git a/src/common/memmgr.h b/src/common/memmgr.h index a732b5f114..91a94a516c 100644 --- a/src/common/memmgr.h +++ b/src/common/memmgr.h @@ -42,13 +42,13 @@ // Enable memory manager logging by default #define LOG_MEMMGR -#define aMalloc(n) (malloc_proxy((n), ALC_MARK)) -#define aCalloc(m, n) (calloc_proxy((m), (n),ALC_MARK)) -#define aFree(p) (free_proxy((p), ALC_MARK)) -#define aStrdup(p) (strdup_proxy((p),ALC_MARK)) -#define aStrndup(p,n) (strndup_proxy((p),(n),ALC_MARK)) -#define aRealloc(p,n) (iMalloc->realloc((p),(n),ALC_MARK)) -#define aReallocz(p,n) (iMalloc->reallocz((p),(n),ALC_MARK)) +#define aMalloc(size) (malloc_proxy((size), ALC_MARK)) +#define aCalloc(num, size) (calloc_proxy((num), (size), ALC_MARK)) +#define aFree(p) (free_proxy((p), ALC_MARK)) +#define aStrdup(p) (strdup_proxy((p), ALC_MARK)) +#define aStrndup(p, size) (strndup_proxy((p), (size), ALC_MARK)) +#define aRealloc(p, size) (iMalloc->realloc((p), (size), ALC_MARK)) +#define aReallocz(p, size) (iMalloc->reallocz((p), (size), ALC_MARK)) /////////////// Buffer Creation ///////////////// // Full credit for this goes to Shinomori [Ajarn] diff --git a/src/config/core.h b/src/config/core.h index 9f29999212..07d339046d 100644 --- a/src/config/core.h +++ b/src/config/core.h @@ -22,7 +22,7 @@ #define CONFIG_CORE_H /// Hercules version. From tag vYYYY.MM(+PPP) -> YYYYMMPPP -#define HERCULES_VERSION 202312000 +#define HERCULES_VERSION 202402000 /// Max number of items on @autolootid list #define AUTOLOOTITEM_SIZE 10 diff --git a/src/map/instance.c b/src/map/instance.c index 83cf7f2c0f..d76f57e033 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -670,7 +670,7 @@ static void instance_check_idle(int instance_id) timer->delete(instance->list[instance_id].idle_timer, instance->destroy_timer); instance->list[instance_id].idle_timer = INVALID_TIMER; instance->list[instance_id].idle_timeout = 0; - + // Notify instance users normal instance expiration clif->instance(instance_id, INSTANCE_WND_INFO_PROGRESS_TIME, 0); } else if (instance->list[instance_id].idle_timer == INVALID_TIMER && idle) { @@ -678,7 +678,7 @@ static void instance_check_idle(int instance_id) int64 destroy_tick = timer->gettick() + instance->list[instance_id].idle_timeoutval * 1000; instance->list[instance_id].idle_timeout = now + instance->list[instance_id].idle_timeoutval; instance->list[instance_id].idle_timer = timer->add(destroy_tick, instance->destroy_timer, instance_id, 0); - + // Notify instance users it will be destroyed if no user join it again in "X" time clif->instance(instance_id, INSTANCE_WND_INFO_IDLE_TIME, 0); } diff --git a/src/map/map.c b/src/map/map.c index 16fbaf3d5e..d181fe5632 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -4585,7 +4585,7 @@ static bool inter_config_read_database_names(const char *filename, const struct /** * Looks up configuration "name" which is expect to have a final value of int, but may be specified by a string constant. - * + * * If the config is a string, it will be looked up using script->get_constant function to find the actual integer value. * * @param[in] setting The setting to read. @@ -4616,7 +4616,7 @@ static bool map_setting_lookup_const(const struct config_setting_t *setting, con /** * Looks up configuration "name" which is expect to have a final value of int, * but may be specified by a string constant or an array of bitflag constants. - * + * * If the config is a string, it will be looked up using script->get_constant function to find the actual integer value. * If the config is an array, each value will be read and added to the final bitmask. * diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index 24c30f38b4..60e7113284 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -118,7 +118,7 @@ static struct pcrematch_set *lookup_pcreset(struct npc_data *nd, int setid) nullpo_retr(NULL, nd); npcParse = nd->chatdb; if (npcParse == NULL) - nd->chatdb = npcParse = (struct npc_parse *)aCalloc(1, sizeof(struct npc_parse)); + nd->chatdb = npcParse = (struct npc_parse *) aCalloc(1, sizeof(struct npc_parse)); pcreset = npcParse->active; @@ -137,7 +137,7 @@ static struct pcrematch_set *lookup_pcreset(struct npc_data *nd, int setid) } if (pcreset == NULL) { - pcreset = (struct pcrematch_set *)aCalloc(1, sizeof(struct pcrematch_set)); + pcreset = (struct pcrematch_set *) aCalloc(1, sizeof(struct pcrematch_set)); pcreset->next = npcParse->inactive; if (pcreset->next != NULL) pcreset->next->prev = pcreset; @@ -284,7 +284,7 @@ static struct pcrematch_entry *create_pcrematch_entry(struct pcrematch_set *set) struct pcrematch_entry *last; nullpo_retr(NULL, set); - e = (struct pcrematch_entry *)aCalloc(1, sizeof(struct pcrematch_entry)); + e = (struct pcrematch_entry *) aCalloc(1, sizeof(struct pcrematch_entry)); last = set->head; // Normally we would have just stuck it at the end of the list but diff --git a/src/map/script.c b/src/map/script.c index c4b16bbef4..d2c911614c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7214,7 +7214,7 @@ static BUILDIN(callsub) return false; } - ref = (struct reg_db *)aCalloc(1, sizeof(struct reg_db)); + ref = (struct reg_db *) aCalloc(1, sizeof(struct reg_db)); ref[0].vars = st->stack->scope.vars; if (!st->stack->scope.arrays) st->stack->scope.arrays = idb_alloc(DB_OPT_BASE); // TODO: Can this happen? when? @@ -7312,7 +7312,7 @@ static BUILDIN(return) // npc variable if( !data->ref ) { // npc variable without a reference set, link to current script - data->ref = (struct reg_db *)aCalloc(1, sizeof(struct reg_db)); + data->ref = (struct reg_db *) aCalloc(1, sizeof(struct reg_db)); script->add_pending_ref(st, data->ref); data->ref->vars = st->script->local.vars; if( !st->script->local.arrays ) diff --git a/src/map/skill.c b/src/map/skill.c index afcc78c532..94ddcdeda2 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -17926,7 +17926,7 @@ static int skill_autospell_spell_selected(struct map_session_data *sd, uint16 sk if (max_lv > skill_lv) max_lv = skill_lv; - sc_start4(&sd->bl, &sd->bl, SC_AUTOSPELL, 100, skill_lv, skill_id, max_lv, 0, + sc_start4(&sd->bl, &sd->bl, SC_AUTOSPELL, 100, autospell_lv, skill_id, max_lv, 0, skill->get_time(SA_AUTOSPELL, skill_lv), SA_AUTOSPELL); return 0; } diff --git a/tools/ci/travis.sh b/tools/ci/travis.sh index 2876b1d820..82f8321cda 100755 --- a/tools/ci/travis.sh +++ b/tools/ci/travis.sh @@ -160,10 +160,12 @@ case "$MODE" in mysql $DBUSER_ARG $DBPASS_ARG $DBHOST_ARG --execute="CREATE USER '$NEWUSER'@'$DBHOST' IDENTIFIED BY '$NEWPASS';" || true mysql $DBUSER_ARG $DBPASS_ARG $DBHOST_ARG --execute="GRANT SELECT,INSERT,UPDATE,DELETE ON $DBNAME.* TO '$NEWUSER'@'$DBHOST';" || true mysql $DBUSER_ARG $DBPASS_ARG $DBHOST_ARG --execute="ALTER USER '$NEWUSER'@'$DBHOST' IDENTIFIED BY '$NEWPASS';" || true - mysql --defaults-file=/etc/mysql/debian.cnf $DBPASS_ARG $DBHOST_ARG --execute="CREATE USER '$NEWUSER'@'$DBHOST' IDENTIFIED BY '$NEWPASS';" || true - mysql --defaults-file=/etc/mysql/debian.cnf $DBPASS_ARG $DBHOST_ARG --execute="GRANT SELECT,INSERT,UPDATE,DELETE ON $DBNAME.* TO '$NEWUSER'@'$DBHOST';" || true - mysql --defaults-file=/etc/mysql/debian.cnf $DBPASS_ARG $DBHOST_ARG --execute="ALTER USER '$NEWUSER'@'$DBHOST' IDENTIFIED BY '$NEWPASS';" || true + if [[ -n "$(uname -a | grep -i linux)" ]]; then + mysql --defaults-file=/etc/mysql/debian.cnf $DBPASS_ARG $DBHOST_ARG --execute="CREATE USER '$NEWUSER'@'$DBHOST' IDENTIFIED BY '$NEWPASS';" || true + mysql --defaults-file=/etc/mysql/debian.cnf $DBPASS_ARG $DBHOST_ARG --execute="GRANT SELECT,INSERT,UPDATE,DELETE ON $DBNAME.* TO '$NEWUSER'@'$DBHOST';" || true + mysql --defaults-file=/etc/mysql/debian.cnf $DBPASS_ARG $DBHOST_ARG --execute="ALTER USER '$NEWUSER'@'$DBHOST' IDENTIFIED BY '$NEWPASS';" || true + fi ;; build) if [[ -z "${SKIP_VALIDATE_INTERFACES}" ]]; then