diff --git a/.github/workflows/core_build.yml b/.github/workflows/core_build.yml index fe4802e5..45de9b47 100644 --- a/.github/workflows/core_build.yml +++ b/.github/workflows/core_build.yml @@ -50,18 +50,35 @@ jobs: path: 'modules/mod-playerbots' - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: - path: | - /var/cache/apt - /var/lib/apt - key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }} + path: ${{ github.workspace }}/var/ccache + key: ccache:${{ matrix.os }}:${{ matrix.c_compiler }}:${{ github.ref }}:${{ github.sha }} restore-keys: | - ccache:${{ matrix.os }}:${{ github.ref }} + ccache:${{ matrix.os }}:${{ matrix.c_compiler }}:${{ github.ref }} + ccache:${{ matrix.os }}:${{ matrix.c_compiler }} ccache:${{ matrix.os }} - name: Install Requirements - run: sudo apt-get update && sudo apt-get install git cmake make gcc g++ clang libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libboost-all-dev + run: sudo apt-get update && sudo apt-get install ccache git cmake make gcc g++ clang libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libboost-all-dev + + - name: setup ccache + shell: bash + env: + CCACHE_DIR: $GITHUB_WORKSPACE/var/ccache + run: | + cat <> $GITHUB_ENV + CCACHE_DIR=${{ env.CCACHE_DIR }} + CCACHE_MAXSIZE=1000MB + CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime + CCACHE_CPP2=true + CCACHE_COMPRESS=1 + CCACHE_COMPRESSLEVEL=9 + CCACHE_COMPILERCHECK=content + CCACHE_LOGFILE=$CCACHE_DIR/cache.debug + CC=${{ inputs.CC }} + CXX=${{ inputs.CXX }} + EOF - name: Configure CMake run: > @@ -69,6 +86,8 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" + -DCMAKE_C_COMPILER_LAUNCHER="ccache" -S ${{ github.workspace }} - name: Build diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index d6829895..48d33ba2 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -26,14 +26,8 @@ jobs: with: repository: 'liyunfan1223/mod-playerbots' path: 'modules/mod-playerbots' - - name: Cache - uses: actions/cache@v3 - with: - path: C:\ProgramData\chocolatey\cache - key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }} - restore-keys: | - ccache:${{ matrix.os }}:${{ github.ref }} - ccache:${{ matrix.os }} + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.13 - name: Configure OS shell: bash env: diff --git a/src/ChatHelper.cpp b/src/ChatHelper.cpp index a181ac89..630bfca9 100644 --- a/src/ChatHelper.cpp +++ b/src/ChatHelper.cpp @@ -336,11 +336,11 @@ std::string const ChatHelper::FormatItem(ItemTemplate const* proto, uint32 count char color[32]; sprintf(color, "%x", ItemQualityColors[proto->Quality]); - const std::string &name = sObjectMgr->GetItemLocale(proto->ItemId)->Name[sWorld->GetDefaultDbcLocale()]; + // const std::string &name = sObjectMgr->GetItemLocale(proto->ItemId)->Name[sWorld->GetDefaultDbcLocale()]; std::ostringstream out; out << "|c" << color << "|Hitem:" << proto->ItemId - << ":0:0:0:0:0:0:0" << "|h[" << name + << ":0:0:0:0:0:0:0" << "|h[" << proto->Name1 << "]|h|r"; if (count > 1)