Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new commands to website database #21

Open
wants to merge 43 commits into
base: ike3-bots
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4cb4f45
Add Playerbots module
celguar Nov 13, 2020
154ff68
BG Fixes
celguar May 23, 2021
f1bf0d2
Crashfixes
celguar Jun 22, 2021
8568884
Custom stuff
celguar Mar 14, 2021
57f7909
Transmog script (Thx Ace)
celguar Aug 21, 2022
72c08ee
Collector's Edition rewards
celguar Aug 21, 2022
4fcae60
Learn my level command
celguar Sep 3, 2022
68d10ef
Bods mods
celguar Nov 25, 2022
8e7f425
Accurate Diff
celguar Nov 25, 2022
01bc404
-Command fix: Add .pmon command to server window.
mostlikely4r Oct 4, 2022
6d5fa38
-Crash fix: Stops bots from logging in multiple times.
mostlikely4r Sep 30, 2022
5d89148
-Mapgen fix: Fix memory leak during map generation.
mostlikely4r Oct 19, 2022
6794422
-Performance: Lower the amount of packets/work being done for bot pla…
mostlikely4r Oct 10, 2022
c49604a
-Disabled some packets/work for bots.
mostlikely4r Oct 11, 2022
802f8f0
-Performance improvement: Do not trigger map updates near bots.
mostlikely4r Oct 19, 2022
7005532
-detail: Only apply realPlayerCheeck if playerbots are enabled.
mostlikely4r Oct 19, 2022
0477eb0
-Revert not loading social for bots until further notice
mostlikely4r Nov 13, 2022
cb74b94
Fix connect to bot session
mostlikely4r Nov 11, 2022
9c9e301
Save zones with real players
celguar Nov 26, 2022
c63656e
Do not logout bots
celguar Nov 26, 2022
b944883
accurate diff
celguar Nov 26, 2022
6ca1702
Fix learn my level command
celguar Dec 26, 2022
27f2eee
Fix learn command giving high lvl talents
celguar Dec 26, 2022
0699b27
-Visibiltiy fix: Fix getting default visibility
celguar Jan 24, 2023
4331eb0
-Bot command: handle guild chat commands
celguar Jan 24, 2023
d32326e
-Internal: Linux compilation fixes.
mostlikely4r Feb 1, 2023
96983b5
-Fly fix: Allow bots to use follow pathfinding while flying.
mostlikely4r Jan 31, 2023
5b2c04a
-Add yell/say support
mostlikely4r Feb 14, 2023
17eb318
-Addon filter support
mostlikely4r Feb 14, 2023
4031b0f
-Removed addon language filtering (moved to bot code)
mostlikely4r Feb 14, 2023
f9fd609
-Fix to make lower actually lower.
mostlikely4r Mar 15, 2023
d349587
Fix client crash
celguar Mar 18, 2023
5532589
Fix bots visibility
celguar Mar 18, 2023
c0610e2
Fix recastDemo tool
celguar Mar 12, 2023
3e7b933
add chat command to start recast app
celguar Mar 19, 2023
c8feff5
Update Bots
celguar Mar 19, 2023
43bb955
Update Bots
celguar Mar 20, 2023
d7ee29a
-Follow fix: Bots no longer match speed while following without boost.
mostlikely4r Mar 22, 2023
bedd9e8
Update Bots
celguar Mar 23, 2023
3d2d37a
Fix compilation
davidonete Mar 23, 2023
bc0b6ef
Fix immune bot spell config
davidonete Mar 23, 2023
9461e84
Added new commands to website database
kadeshar Mar 28, 2023
600b63c
Reverted db version change
kadeshar Mar 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/modules/Bots"]
path = src/modules/Bots
url = https://github.com/celguar/mangosbot-bots.git
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,21 @@ if(NOT BUILD_GAME_SERVER AND BUILD_PLAYERBOT)
message(STATUS "BUILD_PLAYERBOT forced to OFF due to BUILD_GAME_SERVER is not set")
endif()

if(NOT BUILD_GAME_SERVER AND BUILD_IKE3_BOTS)
set(BUILD_IKE3_BOTS OFF)
message(STATUS "BUILD_PLAYERBOTS forced to OFF due to BUILD_GAME_SERVER is not set")
endif()

if(BUILD_IKE3_BOTS)
set(BUILD_PLAYERBOT OFF)
message(STATUS "CMaNGOS bots DISABLED because Ike3 bots enabled")
endif()

if(BUILD_PLAYERBOT)
set(BUILD_IKE3_BOTS OFF)
message(STATUS "Ike3 bots DISABLED because CMaNGOS bots enabled")
endif()

if(PCH)
if(${CMAKE_VERSION} VERSION_LESS "3.16")
message("PCH is not supported by your CMake version")
Expand Down
2 changes: 2 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option(BUILD_LOGIN_SERVER "Build login server" ON)
option(BUILD_EXTRACTORS "Build map/dbc/vmap/mmap extractors" OFF)
option(BUILD_SCRIPTDEV "Build ScriptDev. (OFF Speedup build)" ON)
option(BUILD_PLAYERBOT "Build Playerbot mod" OFF)
option(BUILD_IKE3_BOTS "Build ike3 Playerbots" OFF)
option(BUILD_AHBOT "Build Auction House Bot mod" OFF)
option(BUILD_METRICS "Build Metrics, generate data for Grafana" OFF)
option(BUILD_RECASTDEMOMOD "Build map/vmap/mmap viewer" OFF)
Expand Down Expand Up @@ -34,6 +35,7 @@ message(STATUS
BUILD_EXTRACTORS Build map/dbc/vmap/mmap extractor
BUILD_SCRIPTDEV Build scriptdev. (Disable it to speedup build in dev mode by not including scripts)
BUILD_PLAYERBOT Build Playerbot mod
BUILD_IKE3_BOTS Build Ike3 Playerbot mod
BUILD_AHBOT Build Auction House Bot mod
BUILD_METRICS Build Metrics, generate data for Grafana
BUILD_RECASTDEMOMOD Build map/vmap/mmap viewer
Expand Down
6 changes: 6 additions & 0 deletions cmake/showoptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ else()
message(STATUS "Build Playerbot : No (default)")
endif()

if(BUILD_IKE3_BOTS)
message(STATUS "Build ike3 Playerbots : Yes")
else()
message(STATUS "Build ike3 Playerbots : No (default)")
endif()

if(BUILD_EXTRACTORS)
message(STATUS "Build extractors : Yes")
else()
Expand Down
41 changes: 38 additions & 3 deletions contrib/mmap/src/MapBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,36 @@

using namespace VMAP;

void rcModAlmostUnwalkableTriangles(rcContext* ctx, const float walkableSlopeAngle,
const float* verts, int /*nv*/,
const int* tris, int nt,
unsigned char* areas)
{
rcIgnoreUnused(ctx);

const float walkableThr = cosf(walkableSlopeAngle / 180.0f * RC_PI);

float norm[3];

for (int i = 0; i < nt; ++i)
{
if (areas[i] & RC_WALKABLE_AREA)
{
const int* tri = &tris[i * 3];

float e0[3], e1[3];
rcVsub(e0, &verts[tri[1] * 3], &verts[tri[0] * 3]);
rcVsub(e1, &verts[tri[2] * 3], &verts[tri[0] * 3]);
rcVcross(norm, e0, e1);
rcVnormalize(norm);

// Check if the face is walkable.
if (norm[1] <= walkableThr)
areas[i] = NAV_AREA_GROUND_STEEP; //Slopes between 50 and 60. Walkable for mobs, unwalkable for players.
}
}
}

void from_json(const json& j, rcConfig& config)
{
config.tileSize = MMAP::VERTEX_PER_TILE;
Expand Down Expand Up @@ -1147,8 +1177,13 @@ namespace MMAP
}

// mark all walkable tiles, both liquids and solids
rcClearUnwalkableTriangles(m_rcContext, tileCfg.walkableSlopeAngle, tVerts, tVertCount, tTris, tTriCount, tTriFlags);
rcRasterizeTriangles(m_rcContext, tVerts, tVertCount, tTris, tTriFlags, tTriCount, *tile.solid, tileCfg.walkableClimb);

unsigned char* triFlags = new unsigned char[tTriCount];
memset(triFlags, NAV_AREA_GROUND, tTriCount * sizeof(unsigned char));
rcClearUnwalkableTriangles(m_rcContext, tileCfg.walkableSlopeAngle, tVerts, tVertCount, tTris, tTriCount, triFlags);
rcModAlmostUnwalkableTriangles(m_rcContext, 50.0f, tVerts, tVertCount, tTris, tTriCount, triFlags);
rcRasterizeTriangles(m_rcContext, tVerts, tVertCount, tTris, triFlags, tTriCount, *tile.solid, tileCfg.walkableClimb);
delete[] triFlags;

rcFilterLowHangingWalkableObstacles(m_rcContext, tileCfg.walkableClimb, *tile.solid);
rcFilterLedgeSpans(m_rcContext, tileCfg.walkableHeight, tileCfg.walkableClimb, *tile.solid);
Expand Down Expand Up @@ -1371,7 +1406,7 @@ namespace MMAP
{"minRegionArea", 30},
{"walkableClimb", 4},
{"walkableHeight", 3},
{"walkableRadius", 2},
{"walkableRadius", 1},
{"walkableSlopeAngle", 60.0f},
{"liquidFlagMergeThreshold", 0.0f},
};
Expand Down
11 changes: 6 additions & 5 deletions contrib/recastdemomod/Include/RecastDemoSharedDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ enum SamplePolyAreas
SAMPLE_POLYAREA_DOOR,
SAMPLE_POLYAREA_GRASS,
SAMPLE_POLYAREA_JUMP,
SAMPLE_POLYAREA_SLOPE,
};
enum SamplePolyFlags
{
SAMPLE_POLYFLAGS_WALK = 0x01, // Ability to walk (ground, grass, road)
SAMPLE_POLYFLAGS_SWIM = 0x02, // Ability to swim (water).
SAMPLE_POLYFLAGS_DOOR = 0x04, // Ability to move through doors.
SAMPLE_POLYFLAGS_JUMP = 0x08, // Ability to jump.
SAMPLE_POLYFLAGS_DISABLED = 0x10, // Disabled polygon
SAMPLE_POLYFLAGS_ALL = 0xffff // All abilities.
SAMPLE_POLYFLAGS_SLOPES = 0x02, // Ability to swim (water).
SAMPLE_POLYFLAGS_SWIM = 0x04, // Ability to move through doors.
SAMPLE_POLYFLAGS_MAGMA_SLIME = 0x08, // Ability to jump.
SAMPLE_POLYFLAGS_DISABLED = 0x20, // Disabled polygon
SAMPLE_POLYFLAGS_ALL = 0xffff // All abilities.
};

enum SamplePartitionType
Expand Down
9 changes: 8 additions & 1 deletion contrib/recastdemomod/Include/SampleInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@ class BuildContext : public rcContext
std::string m_mMapsFolder;
std::string m_vMapsFolder;

unsigned int mapID;
unsigned int tileX;
unsigned int tileY;

public:
BuildContext(const char* dataDir);
BuildContext(const char* dataDir, unsigned int mapId, unsigned int tileX, unsigned int tileY);
virtual ~BuildContext();

const char* getMapFolder() { return m_mapsFolder.c_str(); }
const char* getMMapFolder() { return m_mMapsFolder.c_str(); }
const char* getVMapFolder() { return m_vMapsFolder.c_str(); }
const char* getDataDir() { return m_dataDir; }
unsigned int getMapId() { return mapID; }
unsigned int getTileX() { return tileX; }
unsigned int getTileY() { return tileY; }

/// Dumps the log to stdout.
void dumpLog(const char* format, ...);
Expand Down
49 changes: 48 additions & 1 deletion contrib/recastdemomod/Source/CMaNGOS_Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,58 @@ void CMaNGOS_Map::Init()
ScanFoldersForMaps();
if (m_mapID < 0)
return;

if (m_ctx->getMapId() != m_mapID && m_ctx->getTileX() && m_ctx->getTileY())
m_mapID = m_ctx->getMapId();

scanFoldersForTiles();
m_MapInfos = new MapInfos();
m_MapInfos->Init(m_mapID, m_ctx);
m_navMesh = m_MapInfos->GetNavMesh();
m_navQuery = m_MapInfos->GetNavMeshQuery();

if (m_ctx->getTileX() && m_ctx->getTileY())
{
if (LoadTileData(m_ctx->getTileX(), m_ctx->getTileY()))
{
//m_showLevel = SHOW_LEVEL_NONE;
}
// if first chosen tile, add neighbor
if (!m_MapInfos->IsEmpty())
{
unsigned int x, y;
x = m_ctx->getTileX();
y = m_ctx->getTileY();
m_NeighborTiles.clear();
if (x != y || x != 64)
{
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
uint32 tx = x - 1 + i;
uint32 ty = y - 1 + j;

// skip current already loaded tile
if (tx == x && ty == y)
continue;

// add only available tile
uint32 pxy = VMAP::StaticMapTree::packTileID(tx, ty);
if (m_TilesFound.find(pxy) != m_TilesFound.end())
m_NeighborTiles.insert(pxy);
}
}
}
}

if (m_MapInfos->IsEmpty())
m_TileButtonStr = "Click to choose a tile";
else if (!m_NeighborTiles.empty())
m_TileButtonStr = "Add neighbor tile";
else
m_TileButtonStr = "No neighbor tile to add";
}
}

void CMaNGOS_Map::ClearAllGeoms()
Expand Down Expand Up @@ -299,7 +346,7 @@ void CMaNGOS_Map::resetCommonSettings()
m_agentHeight = m_bigBaseUnit ? 3.0f : 6.0f;
m_agentRadius = m_bigBaseUnit ? 1.0f : 2.0f;
m_agentMaxClimb = m_bigBaseUnit ? 2.0f : 4.0f;
m_agentMaxSlope = 50.0f;
m_agentMaxSlope = 60.0f;
m_regionMinSize = 60;
m_regionMergeSize = 50;
m_partitionType = SAMPLE_PARTITION_WATERSHED;
Expand Down
13 changes: 4 additions & 9 deletions contrib/recastdemomod/Source/MMapData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,22 +497,17 @@ void MMapData::BuildNavMeshOfTile(unsigned int tx, unsigned int ty, MeshObjects
// Update poly flags from areas.
for (int i = 0; i < m_pmesh->npolys; ++i)
{
if (m_pmesh->areas[i] == RC_WALKABLE_AREA)
m_pmesh->areas[i] = SAMPLE_POLYAREA_GROUND;

if (m_pmesh->areas[i] == SAMPLE_POLYAREA_GROUND ||
m_pmesh->areas[i] == SAMPLE_POLYAREA_GRASS ||
m_pmesh->areas[i] == SAMPLE_POLYAREA_ROAD)
if (m_pmesh->areas[i] == 11)
{
m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK;
}
else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_WATER)
else if (m_pmesh->areas[i] == 9 || m_pmesh->areas[i] == 8)
{
m_pmesh->flags[i] = SAMPLE_POLYFLAGS_SWIM;
}
else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_DOOR)
else if (m_pmesh->areas[i] == 10)
{
m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK | SAMPLE_POLYFLAGS_DOOR;
m_pmesh->flags[i] = SAMPLE_POLYFLAGS_SLOPES;
}
}

Expand Down
19 changes: 5 additions & 14 deletions contrib/recastdemomod/Source/NavMeshTesterTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ void NavMeshTesterTool::init(CMaNGOS_Map* sample)
m_filter.setAreaCost(SAMPLE_POLYAREA_DOOR, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_GRASS, 2.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_JUMP, 1.5f);
m_filter.setAreaCost(SAMPLE_POLYAREA_SLOPE, 5.0f);
}

m_neighbourhoodRadius = sample->getAgentRadius() * 20.0f;
Expand Down Expand Up @@ -424,14 +425,9 @@ void NavMeshTesterTool::handleMenu()
m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_SWIM);
recalc();
}
if (imguiCheck("Door", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_DOOR) != 0))
if (imguiCheck("Slopes", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_SLOPES) != 0))
{
m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_DOOR);
recalc();
}
if (imguiCheck("Jump", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_JUMP) != 0))
{
m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_JUMP);
m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_SLOPES);
recalc();
}
imguiUnindent();
Expand All @@ -450,14 +446,9 @@ void NavMeshTesterTool::handleMenu()
m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_SWIM);
recalc();
}
if (imguiCheck("Door", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_DOOR) != 0))
{
m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_DOOR);
recalc();
}
if (imguiCheck("Jump", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_JUMP) != 0))
if (imguiCheck("Slopes", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_SLOPES) != 0))
{
m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_JUMP);
m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_SLOPES);
recalc();
}
imguiUnindent();
Expand Down
5 changes: 4 additions & 1 deletion contrib/recastdemomod/Source/SampleInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@

////////////////////////////////////////////////////////////////////////////////////////////////////

BuildContext::BuildContext(const char* dataDir) :
BuildContext::BuildContext(const char* dataDir, unsigned int mapid, unsigned int tilex, unsigned int tiley) :
m_messageCount(0),
m_textPoolSize(0)
{
m_dataDir = dataDir;
mapID = mapid;
tileX = tilex;
tileY = tiley;
m_mapsFolder = dataDir;
m_vMapsFolder = dataDir;
m_mMapsFolder = dataDir;
Expand Down
43 changes: 42 additions & 1 deletion contrib/recastdemomod/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "RecastDebugDraw.h"
#include "Filelist.h"
#include <filesystem>
#include <sstream>

//#include "Sample_SoloMesh.h"
//#include "Sample_TileMesh.h"
Expand Down Expand Up @@ -71,6 +72,39 @@ bool handleArgs(int argc, char** argv, char*& dataDir)
return true;
}

uint32 check_int_input(const char* arg)
{
std::istringstream ss(arg);
unsigned int x;
if (!(ss >> x))
return 0; // std::cerr << "Invalid number: " << arg << '\n';
else if (!ss.eof())
return 0; // std::cerr << "Trailing characters after number: " << arg << '\n';
return x;
}

bool handleArgs(int argc, char** argv, char* argName, uint32& result)
{
uint32 param = 0;

for (int i = 1; i < argc; ++i)
{
if (strcmp(argv[i], argName) == 0)
{
param = check_int_input(argv[++i]);
if (!param)
{
printUsage();
return false;
}

result = param;
}
}

return true;
}

int main(int argc, char** argv)
{
// Init SDL
Expand All @@ -81,10 +115,17 @@ int main(int argc, char** argv)
}

char* dataDir = nullptr;
uint32 mapId = 0;
uint32 tileX = 0;
uint32 tileY = 0;

if (!handleArgs(argc, argv, dataDir))
return -1;

handleArgs(argc, argv, "-map", mapId);
handleArgs(argc, argv, "-tilex", tileX);
handleArgs(argc, argv, "-tiley", tileY);

// Center window
char env[] = "SDL_VIDEO_CENTERED=1";
putenv(env);
Expand Down Expand Up @@ -164,7 +205,7 @@ int main(int argc, char** argv)

//InputGeom* geom = 0;
CMaNGOS_Map* sample = new CMaNGOS_Map();
BuildContext ctx(dataDir);
BuildContext ctx(dataDir, mapId, tileX, tileY);
sample->setContext(&ctx);
sample->Init();
if (sample->GetMapId() < 0)
Expand Down
Loading