Skip to content

Commit

Permalink
Merge pull request #28 from vmangos/devcopy2
Browse files Browse the repository at this point in the history
Repack 22
  • Loading branch information
ratkosrb authored Jun 23, 2023
2 parents 4ba5d4f + 1c2eac1 commit 9e1bd08
Show file tree
Hide file tree
Showing 659 changed files with 187,095 additions and 19,082 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/db_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
pull_request:
paths:
- '**.sql'
- '.github/workflows/**.yml'
- '.github/workflows/db_check.yml'
env:
REPO_DIR : ${{github.workspace}}
WORLD_DB : "world_full_14_june_2021"
jobs:
build:
runs-on: ubuntu-18.04 # 18.04 has mysql5.7 and latest(20.04) has mysql8
runs-on: ubuntu-latest # 18.04 has mysql5.7 and latest(20.04) has mysql8

# ... some other config ...

Expand All @@ -23,7 +23,7 @@ jobs:
- name: Start docker mysql
run: |
sudo docker pull mysql
sudo docker run --name mysqldb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.6
sudo docker run --name mysqldb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.6 --max_allowed_packet=128M
sudo docker start mysqldb
Expand Down
36 changes: 32 additions & 4 deletions .github/workflows/db_dump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
push:
paths:
- '**.sql'
- '.github/workflows/**.yml'
- '.github/workflows/db_dump.yml'

env:
REPO_DIR : ${{github.workspace}}
WORLD_DB : "world_full_14_june_2021"
jobs:
build:
runs-on: ubuntu-18.04 # 18.04 has mysql5.7 and latest(20.04) has mysql8
runs-on: ubuntu-latest # 18.04 has mysql5.7 and latest(20.04) has mysql8

# ... some other config ...

Expand All @@ -24,7 +24,7 @@ jobs:
- name: Start docker mysql
run: |
sudo docker pull mysql
sudo docker run --name mysqldb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.6
sudo docker run --name mysqldb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.6 --max_allowed_packet=128M
sudo docker start mysqldb
Expand Down Expand Up @@ -76,6 +76,21 @@ jobs:
# cp ${{github.workspace}}/sql/migrations/logs_db_updates.sql ${{github.workspace}}/dbexport/db_dump/update_check_only_do_not_import/logs_db_updates.sql
# cp ${{github.workspace}}/sql/migrations/characters_db_updates.sql ${{github.workspace}}/dbexport/db_dump/update_check_only_do_not_import/characters_db_updates.sql
- name: Install SQLite dependencies
run: |
sudo apt install sqlite3 mawk -y
git clone https://github.com/dumblob/mysql2sqlite
chmod +x ${{github.workspace}}/mysql2sqlite/mysql2sqlite
- name: Create SQLite databases
run: |
mkdir ${{github.workspace}}/dbexport/sqlite_dump || true
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/mangos.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/mangos.sqlite
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/logon.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/logon.sqlite
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/logs.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/logs.sqlite
${{github.workspace}}/mysql2sqlite/mysql2sqlite ${{github.workspace}}/dbexport/db_dump/characters.sql | sqlite3 ${{github.workspace}}/dbexport/sqlite_dump/characters.sqlite
- name: Create New tables
run: |
docker exec mysqldb sh -c 'exec mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS realmd2 DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"'
Expand All @@ -98,19 +113,32 @@ jobs:
run: |
cd ${{github.workspace}}/dbexport
7z a -tzip db-${{steps.vars.outputs.sha_short}}.zip db_dump
7z a -tzip db-sqlite-${{steps.vars.outputs.sha_short}}.zip sqlite_dump
- name: Archive this artefact
- name: Archive SQL artifact
uses: actions/upload-artifact@v2
with:
name: snapshot-db-dump
path: "${{github.workspace}}/dbexport/db-${{steps.vars.outputs.sha_short}}.zip"

- name: Archive SQLite artifact
uses: actions/upload-artifact@v2
with:
name: snapshot-db-sqlite-dump
path: "${{github.workspace}}/dbexport/db-sqlite-${{steps.vars.outputs.sha_short}}.zip"

- name: Download artifact snapshot-db-dump
uses: actions/download-artifact@v1
with:
name: snapshot-db-dump
path: all_snapshots

- name: Download artifact snapshot-db-sqlite-dump
uses: actions/download-artifact@v1
with:
name: snapshot-db-sqlite-dump
path: all_snapshots

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- '.github/ISSUE_TEMPLATE/**'
- '.github/ISSUE_TEMPLATE.md'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/workflows/db_check.yml'
- '.github/workflows/db_dump.yml'
- 'sql/**'
- '.drone.yml'
- 'README.md'
Expand Down Expand Up @@ -81,8 +83,9 @@ jobs:
copy ${{github.workspace}}/ACE_wrappers/lib/ACE.dll ${{github.workspace}}/bin/Release/ACE.dll
copy c:/mysql/lib/libmysql.dll ${{github.workspace}}/bin/Release/libmysql.dll
copy "c:/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
copy "c:/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy "c:/Program Files/OpenSSL/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
copy "c:/Program Files/OpenSSL/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy ${{github.workspace}}/dep/windows/lib/x64_release/libeay32.dll ${{github.workspace}}/bin/Release/libeay32.dll
7z a -tzip ${{env.ARCHIVE_FILENAME}} Release
- name: Archive this artefact
Expand Down Expand Up @@ -123,8 +126,9 @@ jobs:
copy ${{github.workspace}}/ACE_wrappers/lib/ACE.dll ${{github.workspace}}/bin/Release/ACE.dll
copy c:/mysql/lib/libmysql.dll ${{github.workspace}}/bin/Release/libmysql.dll
copy "c:/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
copy "c:/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy "c:/Program Files/OpenSSL/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
copy "c:/Program Files/OpenSSL/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy ${{github.workspace}}/dep/windows/lib/x64_release/libeay32.dll ${{github.workspace}}/bin/Release/libeay32.dll
7z a -tzip ${{env.ARCHIVE_FILENAME}} Release
- name: Archive this artefact
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/vmangos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- '.github/ISSUE_TEMPLATE/**'
- '.github/ISSUE_TEMPLATE.md'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/workflows/db_check.yml'
- '.github/workflows/db_dump.yml'
- 'sql/**'
- '.drone.yml'
- 'README.md'
Expand All @@ -24,6 +26,8 @@ on:
- '.github/ISSUE_TEMPLATE/**'
- '.github/ISSUE_TEMPLATE.md'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/workflows/db_check.yml'
- '.github/workflows/db_dump.yml'
- 'sql/**'
- '.drone.yml'
- 'README.md'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
*.opendb
*.exp
*.res
CMakeSettings.json
/out/

# CLion files
cmake-build-debug
cmake-build-release

#
# Top-level generic files
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

project(MaNGOS)

# CMake policies
cmake_minimum_required(VERSION 3.1...3.20)

project(MaNGOS)

# Allow -DACE_ROOT, -DTBB_ROOT, etc.
if(${CMAKE_VERSION} VERSION_GREATER "3.11")
cmake_policy(SET CMP0074 NEW)
Expand Down Expand Up @@ -148,7 +148,7 @@ if(WIN32)
set(LIBS_DIR ${CMAKE_INSTALL_PREFIX})
else()
set(BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc)
set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc CACHE PATH "Set custom configuration directory")
set(LIBS_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()

Expand Down
14 changes: 12 additions & 2 deletions cmake/FindOpenSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES )

find_path(OPENSSL_INCLUDE_DIR
NAMES
ssl.h
openssl/ssl.h
PATHS
/usr/include
/usr/include/openssl
/usr/local/include
/usr/local/include/openssl
/usr/local/openssl/include
/usr/local/opt/[email protected]/include
/usr/local/opt/openssl
/opt/homebrew/opt/[email protected]/include
/opt/homebrew/opt/openssl/include
${TMP_OPENSSL_INCLUDE_DIR}
DOC
"Specify the directory containing openssl.h."
"Specify the directory containing ssl.h."
)

find_library(OPENSSL_LIBRARIES
Expand All @@ -63,7 +66,10 @@ else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES )
/usr/local/lib
/usr/local/lib/ssl
/usr/local/ssl/lib
/usr/local/opt/[email protected]/lib
/usr/local/opt/openssl/lib
/opt/homebrew/opt/[email protected]/lib
/opt/homebrew/opt/openssl/lib
${TMP_OPENSSL_LIBRARIES}
DOC "Specify the OpenSSL library here."
)
Expand All @@ -89,6 +95,10 @@ else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES )
/usr/local/lib
/usr/local/lib/ssl
/usr/local/ssl/lib
/usr/local/opt/[email protected]/lib
/usr/local/opt/openssl/lib
/opt/homebrew/opt/[email protected]/lib
/opt/homebrew/opt/openssl/lib
${TMP_OPENSSL_LIBRARIES}
DOC "if more libraries are necessary to link in a OpenSSL client, specify them here."
)
Expand Down
94 changes: 1 addition & 93 deletions contrib/extractor/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ typedef struct

map_id* map_ids;
uint16* areas;
uint16* LiqType;
char output_path[128] = ".";
char input_path[128] = ".";
uint32 maxAreaId = 0;
Expand Down Expand Up @@ -232,27 +231,6 @@ void ReadAreaTableDBC()
printf("Done! (%u areas loaded)\n", uint32(area_count));
}

void ReadLiquidTypeTableDBC()
{
printf("Read LiquidType.dbc file...");
DBCFile dbc("DBFilesClient\\LiquidType.dbc");
if (!dbc.open())
{
printf("Fatal error: Invalid LiquidType.dbc file format!\n");
exit(1);
}

size_t LiqType_count = dbc.getRecordCount();
size_t LiqType_maxid = dbc.getMaxId();
LiqType = new uint16[LiqType_maxid + 1];
memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16));

for (uint32 x = 0; x < LiqType_count; ++x)
LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);

printf("Done! (%u LiqTypes loaded)\n", uint32(LiqType_count));
}

//
// Adt file convertor function and data
//
Expand Down Expand Up @@ -537,7 +515,7 @@ bool ConvertADT(char* filename, char* filename2, int cell_y, int cell_x)
map.heightMapSize += sizeof(V9) + sizeof(V8);
}

// Get from MCLQ chunk (old)
// Get from MCLQ chunk (vanilla and tbc)
for (int i = 0; i < ADT_CELLS_PER_GRID; i++)
{
for (int j = 0; j < ADT_CELLS_PER_GRID; j++)
Expand Down Expand Up @@ -599,75 +577,6 @@ bool ConvertADT(char* filename, char* filename2, int cell_y, int cell_x)
}
}

// Get liquid map for grid (in WOTLK used MH2O chunk)
adt_MH2O* h2o = adt.a_grid->getMH2O();
if (h2o)
{
for (int i = 0; i < ADT_CELLS_PER_GRID; i++)
{
for (int j = 0; j < ADT_CELLS_PER_GRID; j++)
{
adt_liquid_header* h = h2o->getLiquidData(i, j);
if (!h)
continue;

int count = 0;
uint64 show = h2o->getLiquidShowMap(h);
for (int y = 0; y < h->height; y++)
{
int cy = i * ADT_CELL_SIZE + y + h->yOffset;
for (int x = 0; x < h->width; x++)
{
int cx = j * ADT_CELL_SIZE + x + h->xOffset;
if (show & 1)
{
liquid_show[cy][cx] = true;
++count;
}
show >>= 1;
}
}

liquid_entry[i][j] = h->liquidType;
switch (LiqType[h->liquidType])
{
case LIQUID_TYPE_WATER: liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; break;
case LIQUID_TYPE_OCEAN: liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; break;
case LIQUID_TYPE_MAGMA: liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; break;
case LIQUID_TYPE_SLIME: liquid_flags[i][j] |= MAP_LIQUID_TYPE_SLIME; break;
default:
printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, filename, i, j);
break;
}
// Dark water detect
if (LiqType[h->liquidType] == LIQUID_TYPE_OCEAN)
{
uint8* lm = h2o->getLiquidLightMap(h);
if (!lm)
liquid_flags[i][j] |= MAP_LIQUID_TYPE_DEEP_WATER;
}

if (!count && liquid_flags[i][j])
printf("Wrong liquid detect in MH2O chunk");

float* height = h2o->getLiquidHeightMap(h);
int pos = 0;
for (int y = 0; y <= h->height; y++)
{
int cy = i * ADT_CELL_SIZE + y + h->yOffset;
for (int x = 0; x <= h->width; x++)
{
int cx = j * ADT_CELL_SIZE + x + h->xOffset;
if (height)
liquid_height[cy][cx] = height[pos];
else
liquid_height[cy][cx] = h->heightLevel1;
pos++;
}
}
}
}
}
//============================================
// Pack liquid data
//============================================
Expand Down Expand Up @@ -848,7 +757,6 @@ void ExtractMapsFromMpq()
uint32 map_count = ReadMapDBC();

ReadAreaTableDBC();
ReadLiquidTypeTableDBC();

std::string path = output_path;
path += "/maps/";
Expand Down
14 changes: 0 additions & 14 deletions contrib/mmap/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"0": {
"3328": {
"quick": 1,
"_Info": "fixes terrain beneath a barricade at the bulwark"
},
"3147": {
"maxSimplificationError": 1.0,
"detailSampleDist": 0.5,
Expand All @@ -12,15 +8,5 @@
"3050": {
"_Info": "TODO:westbrook garrison"
}
},
"1": {
"3541": {
"quick": 1,
"_Info": "fixes terrain beneath a bridge allowing galak messenger to path correctly"
},
"4045": {
"quick": 1,
"_Info": "fixes terrain beneath a tent so wastewander bandit is no longer stuck"
}
}
}
Loading

0 comments on commit 9e1bd08

Please sign in to comment.