Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ this repo. Humans: also read [`doc/CodingStandard.md`](doc/CodingStandard.md).

**MangosFour** — The Mists of Pandaria World of Warcraft **5.4.8** server (C++, MySQL/MariaDB), client build
**18414**. Compatibility target is **5.4.8 only**; do **not** introduce 6.x/Warlords of Draenor or
later-expansion assumptions.
later-expansion assumptions. The client’s data files are tagged 18273 while the wire protocol is 18414 — see
the `EXPECTED_MANGOSD_CLIENT_BUILD` / `EXPECTED_MANGOSD_WIRE_BUILD` note in `src/game/Server/SharedDefines.h`.

- **Database changes go in the separate `mangosfour/database` repo**, not here — as transactional, idempotent
`Rel##_##_###_*.sql` migrations that chain via `db_version`.
Expand Down
508 changes: 508 additions & 0 deletions MOP-TERRAIN-PORT.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ if(BUILD_MANGOSD)
endif()
endif()

if(BUILD_MANGOSD OR BUILD_TOOLS)
if(BUILD_MANGOSD OR BUILD_TOOLS OR WITH_TESTS)
add_subdirectory(${MANGOS_DEP_DIR}/recastnavigation dep/recastnavigation)
add_subdirectory(${MANGOS_DEP_DIR}/g3dlite dep/g3dlite)
endif()

if(BUILD_TOOLS)
# StormLib backs extractor_mpq, which is configured alongside the parsers the unit
# tests link -- so it follows the same switch rather than BUILD_TOOLS alone.
if(BUILD_TOOLS OR WITH_TESTS)
add_subdirectory(${MANGOS_DEP_DIR}/StormLib dep/StormLib)
endif()
3 changes: 2 additions & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ INPUT = @TOP_SRCDIR@/src/shared/ \
@TOP_SRCDIR@/src/game/BattleGround/ \
@TOP_SRCDIR@/src/game/movement/ \
@TOP_SRCDIR@/src/game/OutdoorPvP/ \
@TOP_SRCDIR@/src/game/vmap/ \
@TOP_SRCDIR@/src/shared/Geometry/ \
@TOP_SRCDIR@/src/shared/terrain/ \
@TOP_SRCDIR@/src/realmd/ \
@TOP_SRCDIR@/src/mangosd/ \
@TOP_SRCDIR@/doc/DocStructure.dox \
Expand Down
291 changes: 24 additions & 267 deletions linux/getmangos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1953,285 +1953,42 @@
exit 1
fi

if [[ $DLGAPP == 'fzf' ]]; then
ACTIONS=$(
{
echo '1 DBC and Maps';
echo '2 Vmaps';
echo '3 Mmaps';
} \
| $DLGAPPFZF --header 'Extractions to perform'
);
else
ACTIONS=$(
$DLGAPP \
--backtitle "MaNGOS Linux Build Configuration" \
--title "Select Tasks" \
--checklist "Please select the extractions to perform" 0 70 3 \
1 "DBC and Maps" On \
2 "Vmaps" On \
3 "Mmaps" On \
3>&2 2>&1 1>&3
)
fi

if [ ! -d "$INSTPATH/bin/tools" ]; then
Log "The client tools have not been built, cannot extract data" 1
exit 1
fi

#TODO What if DBC are not yet generated ??
if [[ $ACTIONS == *1* ]]; then
if [ -d "$GAMEPATH/dbc" ]; then
$DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "DBC and Maps were already generated" \
--yesno "Do you want to generate them again?" 8 60

# Check the user's answer
if [ $? -eq 0 ]; then
Log "Deleting DBC and Maps previously generated." 1
rm -rf "$GAMEPATH/dbc"
rm -rf "$GAMEPATH/maps"

Log "Copying DBC and Maps extractor" 0
rm -f "$GAMEPATH/map-extractor"
cp "$INSTPATH/bin/tools/map-extractor" "$GAMEPATH"

Log "Extracting DBC and Maps" 0
cd "$GAMEPATH"
./map-extractor

if [ $? -eq 0 ]; then
Log "DBC and Maps are extracted" 0
Log "Copying DBC and Maps files to installation directory" 0
cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"
cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/map-extractor"
Log "Changing ownership of the extracted directories"
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
else
Log "There was an issue while extracting DBC and Maps!" 1
rm -rf "$GAMEPATH/map-extractor"
rm -rf "$GAMEPATH/dbc"
rm -rf "$GAMEPATH/maps"
exit 1
fi
else
Log "Copying DBC and Maps files to installation directory" 0
cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"
cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
fi
else
rm -rf "$GAMEPATH/map-extractor"
cp "$INSTPATH/bin/tools/map-extractor" "$GAMEPATH"

Log "Extracting DBC and Maps" 0
cd "$GAMEPATH"
./map-extractor
# ONE tool now. mangos-extractor reads the client once and writes everything the
# server loads -- dbc/, tiles/, gomodels/ and mmaps/ -- so the old "which of the
# three do you want" checklist has nothing left to choose between: the components
# feed each other and the tool bakes them in dependency order.
if [ -d "$INSTPATH/bin/tiles" ]; then
$DLGAPP --backtitle "MaNGOS Linux Build Configuration" \
--title "Client data was already extracted" \
--yesno "Do you want to extract it again?" 8 60

if [ $? -eq 0 ]; then
Log "DBC and Maps are extracted" 0
Log "Copying DBC and Maps files to installation directory" 0
cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"
cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/map-extractor"
Log "Changing ownership of the extracted directories"
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
else
Log "There was an issue while extracting DBC and Maps!" 1
rm -rf "$GAMEPATH/map-extractor"
rm -rf "$GAMEPATH/dbc"
rm -rf "$GAMEPATH/maps"
exit 1
fi
if [ $? -ne 0 ]; then
Log "Keeping the client data already installed" 0
return
fi
fi

if [[ $ACTIONS == *2* ]]; then
if [ -d "$GAMEPATH/vmaps" ]; then
$DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "VMaps were already generated" \
--yesno "Do you want to generate them again?" 8 60

# Check the user's answer
if [ $? -eq 0 ]; then
Log "Deleting VMaps previously generated." 1
rm -rf $GAMEPATH/vmaps
Log "Copying VMaps extractor" 0
rm -f "$GAMEPATH/vmap-extractor"
cp "$INSTPATH/bin/tools/vmap-extractor" "$GAMEPATH"

Log "Extracting VMaps" 0
cd $GAMEPATH
# Make sure there is no previous vmaps generation that cause issue.
rm -rf Buildings
./vmap-extractor

if [ $? -eq 0 ]; then
Log "VMaps are extracted" 0
Log "Copying VMaps files to installation directory" 0
cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/vmap-extractor"
Log "Changing ownership of the extracted directories"
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
else
Log "There was an issue while extracting VMaps!" 1
rm -rf "$GAMEPATH/vmap-extractor"
rm -rf "$GAMEPATH/vmaps"
exit 1
fi
else
Log "Copying VMaps files to installation directory" 0
cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"
fi
else
Log "Copying VMaps extractor" 0
rm -f "$GAMEPATH/vmap-extractor"
cp "$INSTPATH/bin/tools/vmap-extractor" "$GAMEPATH"

Log "Extracting VMaps" 0
cd $GAMEPATH
# Make sure there is no previous vmaps generation that cause issue.
rm -rf Buildings
./vmap-extractor

if [ $? -eq 0 ]; then
Log "VMaps are extracted" 0
Log "Copying VMaps files to installation directory" 0
cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/vmap-extractor"
Log "Changing ownership of the extracted directories"
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
else
Log "There was an issue while extracting VMaps!" 1
rm -rf "$GAMEPATH/vmap-extractor"
rm -rf "$GAMEPATH/vmaps"
exit 1
fi
fi
Log "Deleting the client data previously extracted." 1
rm -rf "$INSTPATH/bin/dbc" "$INSTPATH/bin/tiles"
rm -rf "$INSTPATH/bin/gomodels" "$INSTPATH/bin/mmaps"
fi

if [[ $ACTIONS == *3* ]]; then
if [ ! -d "$GAMEPATH/maps" ]; then
Log "Error: maps files must be created to be able to generate MMaps!" 1
exit 1
fi

if [ -d "$GAMEPATH/mmaps" ]; then
$DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "MMaps were already generated" \
--yesno "Do you want to generate them again?" 8 60

# Check the user's answer
if [ $? -eq 0 ]; then
Log "Deleting MMaps previously generated." 1
rm -rf $GAMEPATH/mmaps

Log "Copying MMaps extractor" 0
rm -f "$GAMEPATH/MoveMapGen.sh"
cp "$INSTPATH/bin/tools/MoveMapGen.sh" "$GAMEPATH"
cp "$INSTPATH/bin/tools/offmesh.txt" "$GAMEPATH"
cp "$INSTPATH/bin/tools/mmap_excluded.txt" "$GAMEPATH"
cp "$INSTPATH/bin/tools/mmap-extractor" "$GAMEPATH"

CPU=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Please provide the number of CPU to be used to generate MMaps (1-4)" \
--inputbox "Default: 1" 8 80 3>&2 2>&1 1>&3)

# User cancelled his choice, set default to 1.
if [ $? -ne 0 ]; then
Log "User selection was cancelled. Max CPU set to 1." 1
CPU=1
fi

if [ -z "$CPU" ]; then
Log "User didn't gave any value. Max CPU set to 1." 1
CPU=1
fi

if [ "$CPU" -lt 1 ] || [ "$CPU" -gt 4 ]; then
Log "User entered invalid value. Max CPU set to 1." 1
CPU=1
fi

Log "Extracting MMaps" 0
cd $GAMEPATH
# Making sure we can execute the script
chmod 700 MoveMapGen.sh
./MoveMapGen.sh $CPU

if [ $? -eq 0 ]; then
Log "MMaps are extracted" 0
Log "Copying MMaps files to installation directory" 0
cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/MoveMapGen.sh"
rm -rf "$GAMEPATH/offmesh.txt"
rm -rf "$GAMEPATH/mmap_excluded.txt"
rm -rf "$GAMEPATH/mmap-extractor"
Log "Changing ownership of the extracted directories"
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
else
Log "There was an issue while extracting MMaps!" 1
rm -rf "$GAMEPATH/MoveMapGen.sh"
rm -rf "$GAMEPATH/mmaps"
rm -rf "$GAMEPATH/offmesh.txt"
rm -rf "$GAMEPATH/mmap_excluded.txt"
rm -rf "$GAMEPATH/mmap-extractor"
exit 1
fi
else
Log "Copying MMaps files to installation directory" 0
cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"
fi
else
Log "Copying MMaps extractor" 0
rm -f "$GAMEPATH/MoveMapGen.sh"
cp "$INSTPATH/bin/tools/MoveMapGen.sh" "$GAMEPATH"
cp "$INSTPATH/bin/tools/offmesh.txt" "$GAMEPATH"
cp "$INSTPATH/bin/tools/mmap_excluded.txt" "$GAMEPATH"
cp "$INSTPATH/bin/tools/mmap-extractor" "$GAMEPATH"
CPU=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Please provide the number of CPU to be used to generate MMaps (1-4)" \
--inputbox "Default: 1" 8 80 3>&2 2>&1 1>&3)

# User cancelled his choice, set default to 1.
if [ $? -ne 0 ]; then
Log "User selection was cancelled. Max CPU set to 1." 1
CPU=1
fi

if [ -z "$CPU" ]; then
Log "User didn't gave any value. Max CPU set to 1." 1
CPU=1
fi

if [ "$CPU" -lt 1 ] || [ "$CPU" -gt 4 ]; then
Log "User entered invalid value. Max CPU set to 1." 1
CPU=1
fi

Log "Extracting MMaps" 0
cd $GAMEPATH
# Making sure we can execute the script
chmod 700 MoveMapGen.sh
./MoveMapGen.sh $CPU
Log "Extracting client data -- this takes a while" 0
"$INSTPATH/bin/tools/mangos-extractor" \
--src "$GAMEPATH/Data" --dest "$INSTPATH/bin" --no-menu

if [ $? -eq 0 ]; then
Log "MMaps are extracted" 0
Log "Copying MMaps files to installation directory" 0
cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/MoveMapGen.sh"
rm -rf "$GAMEPATH/offmesh.txt"
rm -rf "$GAMEPATH/mmap_excluded.txt"
rm -rf "$GAMEPATH/mmap-extractor"
Log "Changing ownership of the extracted directories"
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
else
Log "There was an issue while extracting MMaps!" 1
rm -rf "$GAMEPATH/MoveMapGen.sh"
rm -rf "$GAMEPATH/mmaps"
rm -rf "$GAMEPATH/offmesh.txt"
rm -rf "$GAMEPATH/mmap_excluded.txt"
rm -rf "$GAMEPATH/mmap-extractor"
exit 1
fi
fi
if [ $? -ne 0 ]; then
Log "There was an issue while extracting the client data!" 1
exit 1
fi

Log "Client data extracted" 0
Log "Changing ownership of the extracted directories" 0
chown -R $SERVER_USER:$SERVER_USER "$INSTPATH"
}

# Function to create a Code::Blocks project
Expand Down
15 changes: 13 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# Geometry is header-only and sits below everything else: it knows nothing
# about WoW, so both the server and the offline baker link it.
add_subdirectory(shared/Geometry)
add_subdirectory(shared/terrain)

# Build the mangos shared library
add_subdirectory(shared)

Expand Down Expand Up @@ -47,11 +52,17 @@ if(BUILD_REALMD)
add_subdirectory(realmd)
endif()

# If we want the tools for map/vmap/mmap extraction
if(BUILD_TOOLS)
# The client-data parsers are configured whenever the TESTS need them, not only for
# the tools: mangos_tests links extractor_client and extractor_data and nothing else
# of the baker. The baker executables themselves stay gated on BUILD_TOOLS, inside.
if(BUILD_TOOLS OR WITH_TESTS)
add_subdirectory(tools)
endif()

if(WITH_TESTS)
add_subdirectory(tests)
endif()

if (BUILD_MANGOSD OR BUILD_REALMD)
if(WIN32)
get_filename_component(MYSQL_LIB_DIR ${MySQL_LIBRARIES} DIRECTORY)
Expand Down
1 change: 0 additions & 1 deletion src/game/AuctionHouseBot/AuctionHouseBot.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ struct AuctionHouseBotStatusInfoPerType
typedef AuctionHouseBotStatusInfoPerType AuctionHouseBotStatusInfo[MAX_AUCTION_HOUSE_TYPE];

/**
<<<<<<< HEAD
* @brief This class handle both Selling and Buying method
* (holder of AuctionBotBuyer and AuctionBotSeller objects)
* (Taken from comments in source)
Expand Down
Loading
Loading