Skip to content

Commit

Permalink
Merge branch 'development' into 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
zz committed Oct 6, 2023
2 parents 7653cf0 + 071c3b1 commit 309411b
Show file tree
Hide file tree
Showing 465 changed files with 65,531 additions and 7,419 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/db_dump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,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 @@ -111,19 +126,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
14 changes: 7 additions & 7 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
rm oneapi-tbb-$TBB_VERSION-win.zip
mv oneapi-tbb-$TBB_VERSION tbb
#openssl
choco install -y openssl --version=1.1.1.500
#choco install -y openssl --version=1.1.1.500
#git bash shell
shell: bash

Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
copy ${{github.workspace}}/tbb/redist/intel64/vc14/tbbmalloc_proxy_debug.dll ${{github.workspace}}/bin/Release/tbbmalloc_proxy_debug.dll
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/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/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 ${{github.workspace}}/dep/windows/lib/x64_release/libeay32.dll ${{github.workspace}}/bin/Release/libeay32.dll
7z a -tzip ${{env.ARCHIVE_FILENAME}} Release
Expand Down Expand Up @@ -130,9 +130,9 @@ jobs:
copy ${{github.workspace}}/tbb/redist/intel64/vc14/tbbmalloc_proxy_debug.dll ${{github.workspace}}/bin/Release/tbbmalloc_proxy_debug.dll
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/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/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 ${{github.workspace}}/dep/windows/lib/x64_release/libeay32.dll ${{github.workspace}}/bin/Release/libeay32.dll
7z a -tzip ${{env.ARCHIVE_FILENAME}} Release
Expand Down
18 changes: 0 additions & 18 deletions contrib/mmap/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"0": {
"3652": {
"quick": 1,
"_Info": "fixes terrain beneath a bridge at deadwind pass"
},
"3328": {
"quick": 1,
"_Info": "fixes terrain beneath a barricade at the bulwark"
},
"3147": {
"maxSimplificationError": 1.0,
"detailSampleDist": 0.5,
Expand All @@ -16,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"
}
}
}
91 changes: 46 additions & 45 deletions contrib/mmap/src/MapBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <list>
#include <fstream>
#include "MMapCommon.h"
#include "MapBuilder.h"
Expand Down Expand Up @@ -120,33 +119,31 @@ bool IsModelArea(int area)
}

void filterLedgeSpans(const int walkableHeight, const int walkableClimbTransition, const int walkableClimbTerrain,
rcHeightfield& solid)
rcHeightfield& heightfield)
{
const int w = solid.width;
const int h = solid.height;
const int w = heightfield.width;
const int h = heightfield.height;
const int MAX_HEIGHT = 0xffff;
std::list<rcSpan*> nullSpans;
std::list<rcSpan*> steepSlopes;

for (int y = 0; y < h; ++y)
{
for (int x = 0; x < w; ++x)
{
for (rcSpan* s = solid.spans[x + y*w]; s; s = s->next)
for (rcSpan* span = heightfield.spans[x + y*w]; span; span = span->next)
{
// Skip non walkable spans.
if (s->area == RC_NULL_AREA)
if (span->area == RC_NULL_AREA)
continue;

const int bot = (int)(s->smax);
const int top = s->next ? (int)(s->next->smin) : MAX_HEIGHT;
const int bot = (int)(span->smax);
const int top = span->next ? (int)(span->next->smin) : MAX_HEIGHT;

// Find neighbours minimum height.
int minh = MAX_HEIGHT;
int minNeighborHeight = MAX_HEIGHT;

// Min and max height of accessible neighbours.
int asmin = s->smax;
int asmax = s->smax;
int accessibleNeighborMinHeight = span->smax;
int accessibleNeighborMaxHeight = span->smax;
bool hasAllNbTerrain = true;
bool hasAllNbModel = true;

Expand All @@ -157,35 +154,36 @@ void filterLedgeSpans(const int walkableHeight, const int walkableClimbTransitio
// Skip neighbours which are out of bounds.
if (dx < 0 || dy < 0 || dx >= w || dy >= h)
{
//minh = rcMin(minh, -walkableClimbTerrain - bot);
//TODO: Figure out why this is commented out.
//minNeighborHeight = rcMin(minNeighborHeight , -walkableClimbTerrain - bot);
continue;
}

// From minus infinity to the first span.
rcSpan* ns = solid.spans[dx + dy*w];
rcSpan* neighborSpan = heightfield.spans[dx + dy*w];
int nbot = -walkableClimbTerrain;
int ntop = ns ? (int)ns->smin : MAX_HEIGHT;
int ntop = neighborSpan ? (int)neighborSpan->smin : MAX_HEIGHT;
// Skip neighbour if the gap between the spans is too small.
if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight)
minh = rcMin(minh, nbot - bot);
minNeighborHeight = rcMin(minNeighborHeight, nbot - bot);

// Rest of the spans.
for (ns = solid.spans[dx + dy*w]; ns; ns = ns->next)
for (neighborSpan = heightfield.spans[dx + dy*w]; neighborSpan; neighborSpan = neighborSpan->next)
{
if (ns->area == RC_NULL_AREA)
if (neighborSpan->area == RC_NULL_AREA)
continue;
nbot = (int)ns->smax;
ntop = ns->next ? (int)ns->next->smin : MAX_HEIGHT;
nbot = (int)neighborSpan->smax;
ntop = neighborSpan->next ? (int)neighborSpan->next->smin : MAX_HEIGHT;
// Skip neightbour if the gap between the spans is too small.
if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight)
{
minh = rcMin(minh, nbot - bot);
minNeighborHeight = rcMin(minNeighborHeight, nbot - bot);
// Find min/max accessible neighbour height.
if (rcAbs(nbot - bot) <= walkableClimbTerrain)
{
if (nbot < asmin) asmin = nbot;
if (nbot > asmax) asmax = nbot;
if (!IsModelArea(ns->area))
if (nbot < accessibleNeighborMinHeight) accessibleNeighborMinHeight = nbot;
if (nbot > accessibleNeighborMaxHeight) accessibleNeighborMaxHeight = nbot;
if (!IsModelArea(neighborSpan->area))
hasAllNbModel = false;
else
hasAllNbTerrain = false;
Expand All @@ -196,31 +194,27 @@ void filterLedgeSpans(const int walkableHeight, const int walkableClimbTransitio

// The current span is close to a ledge if the drop to any
// neighbour span is less than the walkableClimb.
bool modelToTerrainTransition = (IsModelArea(s->area) && !hasAllNbModel) || (!IsModelArea(s->area) && !hasAllNbTerrain);
bool modelToTerrainTransition = (IsModelArea(span->area) && !hasAllNbModel) || (!IsModelArea(span->area) && !hasAllNbTerrain);
int currentMaxClimb = walkableClimbTerrain;
// Model -> Terrain or Terrain -> Model
if (modelToTerrainTransition)
currentMaxClimb = walkableClimbTransition;
if (minh < -currentMaxClimb)
nullSpans.push_front(s);
if (minNeighborHeight < -currentMaxClimb)
span->area = RC_NULL_AREA;


// If the difference between all neighbours is too large,
// we are at steep slope, mark the span as it
else if ((asmax - asmin) > currentMaxClimb)
else if ((accessibleNeighborMaxHeight - accessibleNeighborMinHeight) > currentMaxClimb)
{
if (modelToTerrainTransition)
nullSpans.push_front(s);
span->area = RC_NULL_AREA;
else
steepSlopes.push_front(s);
span->area = AREA_STEEP_SLOPE;
}
}
}
}
for (std::list<rcSpan*>::iterator it = nullSpans.begin(); it != nullSpans.end(); ++it)
(*it)->area = RC_NULL_AREA;
for (std::list<rcSpan*>::iterator it = steepSlopes.begin(); it != steepSlopes.end(); ++it)
(*it)->area = AREA_STEEP_SLOPE;
}

void from_json(const json& j, rcConfig& config)
Expand Down Expand Up @@ -373,8 +367,7 @@ namespace MMAP

float bmin[3] = { 0, 0, 0 };
float bmax[3] = { 0, 0, 0 };
float lmin[3] = { 0, 0, 0 };
float lmax[3] = { 0, 0, 0 };

MeshData meshData;

// make sure we process maps which don't have tiles
Expand All @@ -389,6 +382,9 @@ namespace MMAP
// get the coord bounds of the model data
if (meshData.solidVerts.size() && meshData.liquidVerts.size())
{
float lmin[3] = { 0, 0, 0 };
float lmax[3] = { 0, 0, 0 };

rcCalcBounds(meshData.solidVerts.getCArray(), meshData.solidVerts.size() / 3, bmin, bmax);
rcCalcBounds(meshData.liquidVerts.getCArray(), meshData.liquidVerts.size() / 3, lmin, lmax);
rcVmin(bmin, lmin);
Expand All @@ -397,7 +393,7 @@ namespace MMAP
else if (meshData.solidVerts.size())
rcCalcBounds(meshData.solidVerts.getCArray(), meshData.solidVerts.size() / 3, bmin, bmax);
else
rcCalcBounds(meshData.liquidVerts.getCArray(), meshData.liquidVerts.size() / 3, lmin, lmax);
rcCalcBounds(meshData.liquidVerts.getCArray(), meshData.liquidVerts.size() / 3, bmin, bmax);

// convert coord bounds to grid bounds
maxX = 32 - bmin[0] / GRID_SIZE;
Expand Down Expand Up @@ -680,10 +676,15 @@ namespace MMAP
Tile liquidsTile;

// Calculate the per tile bounding box.
tileCfg.bmin[0] = config.bmin[0] + float(x * config.tileSize - config.borderSize) * config.cs;
tileCfg.bmin[2] = config.bmin[2] + float(y * config.tileSize - config.borderSize) * config.cs;
tileCfg.bmax[0] = config.bmin[0] + float((x + 1) * config.tileSize + config.borderSize) * config.cs;
tileCfg.bmax[2] = config.bmin[2] + float((y + 1) * config.tileSize + config.borderSize) * config.cs;
tileCfg.bmin[0] = config.bmin[0] + x * float(config.tileSize * config.cs);
tileCfg.bmin[2] = config.bmin[2] + y * float(config.tileSize * config.cs);
tileCfg.bmax[0] = config.bmin[0] + (x + 1) * float(config.tileSize * config.cs);
tileCfg.bmax[2] = config.bmin[2] + (y + 1) * float(config.tileSize * config.cs);

tileCfg.bmin[0] -= tileCfg.borderSize * tileCfg.cs;
tileCfg.bmin[2] -= tileCfg.borderSize * tileCfg.cs;
tileCfg.bmax[0] += tileCfg.borderSize * tileCfg.cs;
tileCfg.bmax[2] += tileCfg.borderSize * tileCfg.cs;

// NOSTALRIUS - MMAPS TILE GENERATION
/// 1. Alloc heightfield for walkable areas
Expand Down Expand Up @@ -711,7 +712,7 @@ namespace MMAP
// - We are on a model (WMO...)
// - Also we want to remove under-terrain triangles
unsigned char* areas = new unsigned char[tTriCount];
memset(areas, 0, tTriCount * sizeof(unsigned char));
memset(areas, AREA_NONE, tTriCount * sizeof(unsigned char));
float norm[3];
const float playerClimbLimit = cosf(52.0f/180.0f*RC_PI);
const float maxClimbLimitTerrain = cosf(75.0f/180.0f*RC_PI);
Expand Down Expand Up @@ -756,7 +757,7 @@ namespace MMAP

if (m_terrainBuilder->IsUnderMap(&verts[0]) && m_terrainBuilder->IsUnderMap(&verts[3]) && m_terrainBuilder->IsUnderMap(&verts[6]))
{
areas[i] = 0;
areas[i] = AREA_NONE;
continue;
}
}
Expand Down Expand Up @@ -1275,7 +1276,7 @@ namespace MMAP
return;
}
unsigned char* m_triareas = new unsigned char[tTriCount];
memset(m_triareas, 0, tTriCount*sizeof(unsigned char));
memset(m_triareas, AREA_NONE, tTriCount*sizeof(unsigned char));
rcMarkWalkableTriangles(m_rcContext, config.walkableSlopeAngle, tVerts, tVertCount, tTris, tTriCount, m_triareas);
rcRasterizeTriangles(m_rcContext, tVerts, tVertCount, tTris, m_triareas, tTriCount, *tile.solid, config.walkableClimb);
rcFilterLowHangingWalkableObstacles(m_rcContext, config.walkableClimb, *tile.solid);
Expand Down
13 changes: 9 additions & 4 deletions contrib/mmap/src/TerrainBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,7 @@ namespace MMAP
/// Check every map vertice
// x, y * -1
Vector3 up(0, 0, 1);
up.x *= -1.0f;
up.y *= -1.0f;
up = up * rotation.inverse() / scale;

for (vector<GroupModel>::iterator it = groupModels.begin(); it != groupModels.end(); ++it)
for (int t = 0; t < mapVertsCount / 3; ++t)
{
Expand All @@ -767,7 +765,14 @@ namespace MMAP
float outDist = -1.0f;
float inDist = -1.0f;
if (it->IsUnderObject(v, up, isM2, &outDist, &inDist)) // inDist < outDist
terrainInsideModelsVerts[t] = inDist;
{
// If terrain is under wmo, mark terrain as unwalkable
// If there are less than 1.5y between terrain and m2 then mark the terrain as unwalkable
if (!isM2 || inDist < 1.5f)
{
terrainInsideModelsVerts[t] = inDist;
}
}
}
}
/// Correct triangles partially under models
Expand Down
3 changes: 3 additions & 0 deletions dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,9 @@ dtStatus dtNavMeshQuery::getPortalPoints(dtPolyRef from, const dtPoly* fromPoly,
}
return DT_FAILURE | DT_INVALID_PARAM;
}

if (fromPoly->vertCount == 0)
return DT_FAILURE | DT_INVALID_PARAM;

// Find portal vertices.
const int v0 = fromPoly->verts[link->edge];
Expand Down
Loading

0 comments on commit 309411b

Please sign in to comment.