Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
conan513 committed Oct 23, 2024
2 parents 6f66728 + 2e37c1f commit a6c027b
Show file tree
Hide file tree
Showing 92 changed files with 7,382 additions and 668 deletions.
12 changes: 7 additions & 5 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

## Build Status

[![nopch-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core-build-nopch.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core-build-nopch.yml)
[![core-modules-build](https://github.com/azerothcore/azerothcore-wotlk/workflows/core-modules-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/azerothcore-wotlk/actions?query=workflow%3Acore-modules-build+branch%3Amaster+event%3Apush)
[![windows-build](https://github.com/azerothcore/azerothcore-wotlk/workflows/windows-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/azerothcore-wotlk/actions?query=workflow%3Awindows-build+branch%3Amaster+event%3Apush)
[![macos-build](https://github.com/azerothcore/azerothcore-wotlk/workflows/macos-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/azerothcore-wotlk/actions?query=workflow%3Amacos-build+branch%3Amaster+event%3Apush)
[![docker-build](https://github.com/azerothcore/azerothcore-wotlk/workflows/docker-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/azerothcore-wotlk/actions?query=workflow%3Adocker-build+branch%3Amaster+event%3Apush)
[![nopch-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core-build-nopch.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core-build-nopch.yml?query=branch%3Amaster)
[![pch-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core-build-pch.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core-build-pch.yml?query=branch%3Amaster)
[![core-modules-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core_modules_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/core_modules_build.yml?query=branch%3Amaster)
[![windows-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/windows_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/windows_build.yml?query=branch%3Amaster)
[![macos-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/macos_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/macos_build.yml?query=branch%3Amaster)
[![docker-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/docker_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/docker_build.yml?query=branch%3Amaster)
[![tools-build](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/tools_build.yml/badge.svg?branch=master)](https://github.com/azerothcore/azerothcore-wotlk/actions/workflows/tools_build.yml?query=branch%3Amaster)

## Introduction

Expand Down
103 changes: 43 additions & 60 deletions apps/ci/ci-pending-sql.sh
Original file line number Diff line number Diff line change
@@ -1,77 +1,60 @@
#!/usr/bin/env bash

set -euo pipefail

CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

source "$CURRENT_PATH/../bash_shared/includes.sh"

UPDATES_PATH="$AC_PATH_ROOT/data/sql/updates/"

COMMIT_HASH=
UPDATES_PATH="$AC_PATH_ROOT/data/sql/updates"

function import() {
db=$1
folder="db_"$db
pendingPath="$AC_PATH_ROOT/data/sql/updates/pending_$folder"
updPath="$UPDATES_PATH/$folder"
archivedPath="$AC_PATH_ROOT/data/sql/archive/$folder/6.x"

latestUpd=$(ls -1 $updPath/ | tail -n 1)

if [ -z $latestUpd ]; then
latestUpd=$(ls -1 $archivedPath/ | tail -n 1)
echo "> Last update file for db $db is missing! Using archived file" $latestUpd
# get_next_index "data/sql/updates/db_world/2024_10_14_22.sql"
# => 23
# get_next_index ""
# => 00
function get_next_index() {
if [[ -n "$1" ]]; then
PREV_COUNT="$(basename "$1" | cut -f4 -d_ | cut -f1 -d\.)"
printf '%02d' "$((PREV_COUNT + 1))"
else
echo "00"
fi
}

dateToday=$(date +%Y_%m_%d)
counter=0
# lists all SQL files in the appropriate data/sql/updates/db_$1, and then moves them to a standard format, ordered by date and how many imports have happened that day. The name should be in this format:
#
# /path/to/data/sql/updates/db_NAME/YYYY_MM_DD_INDEX.sql
#
# Where INDEX is a number with a minimum with a minimum width (0-padded) of 2
#
# for example, "data/sql/updates/db_world/2024_10_01_03.sql" translates to "the third update in the world database from October 01, 2024"

dateLast=$latestUpd
tmp=${dateLast#*_*_*_}
oldCnt=${tmp%.sql}
oldDate=${dateLast%_$tmp}
TODAY="$(date +%Y_%m_%d)"
function import() {
PENDING_PATH="$AC_PATH_ROOT/data/sql/updates/pending_db_$1"
UPDATES_DIR="$UPDATES_PATH/db_$1"

if [ "$oldDate" = "$dateToday" ]; then
((counter=10#$oldCnt+1)) # 10 # is needed to explictly add to a base 10 number
fi;
# Get the most recent SQL file applied to this database. Used for the header comment
LATEST_UPDATE="$(find "$UPDATES_DIR" -iname "*.sql" | sort -h | tail -n 1)"
# Get latest SQL file applied to this database, today. This could be empty.
LATEST_UPDATE_TODAY="$(find "$UPDATES_DIR" -iname "$TODAY*.sql" | sort -h | tail -n 1)"

for entry in "$pendingPath"/*.sql
for entry in "$PENDING_PATH"/*.sql
do
if [[ -e $entry ]]; then
oldVer=$oldDate"_"$oldCnt

cnt=$(printf -v counter "%02d" $counter ; echo $counter)

newVer=$dateToday"_"$cnt

newFile="$updPath/"$dateToday"_"$cnt".sql"

oldFile=$(basename "$entry")
prefix=${oldFile%_*.sql}
suffix=${oldFile#rev_}
rev=${suffix%.sql}

isRev=0
if [[ $prefix = "rev" && $rev =~ ^-?[0-9]+$ ]]; then
isRev=1
fi

echo "-- DB update $oldVer -> $newVer" > "$newFile";

cat $entry >> "$newFile";

currentHash="$(git log --diff-filter=A "$entry" | grep "^commit " | sed -e 's/commit //')"

if [[ "$COMMIT_HASH" != *"$currentHash"* ]]
then
COMMIT_HASH="$COMMIT_HASH $currentHash"
fi

rm $entry;

oldDate=$dateToday
oldCnt=$cnt

((counter+=1))
if [[ -f "$entry" ]]; then
INDEX="$(get_next_index "$LATEST_UPDATE_TODAY")"
OUTPUT_FILE="${UPDATES_DIR}/${TODAY}_${INDEX}.sql"

# ensure a note is added as a header comment
echo "-- DB update $(basename "$LATEST_UPDATE" .sql) -> $(basename "$OUTPUT_FILE" .sql)" > "$OUTPUT_FILE"
# fill in the SQL contents under that
cat "$entry" >> "$OUTPUT_FILE"
# remove the unneeded file
rm -f "$entry"
# set the newest file to the file we just moved
LATEST_UPDATE_TODAY="$OUTPUT_FILE"
LATEST_UPDATE="$OUTPUT_FILE"
fi
done

Expand Down
5 changes: 5 additions & 0 deletions data/sql/updates/db_world/2024_10_10_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- DB update 2024_10_09_00 -> 2024_10_10_00
DELETE FROM `creature_template_model` WHERE `CreatureID` = 23369;
INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES
(23369, 0, 1126, 1, 0, 51831),
(23369, 1, 16946, 1, 1, 51831);
48 changes: 48 additions & 0 deletions data/sql/updates/db_world/2024_10_11_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-- DB update 2024_10_10_00 -> 2024_10_11_00
--
DROP TABLE IF EXISTS `vehicle_seat_addon`;
CREATE TABLE `vehicle_seat_addon` (
`SeatEntry` INT(4) UNSIGNED NOT NULL COMMENT 'VehicleSeatEntry.dbc identifier',
`SeatOrientation` FLOAT(6) DEFAULT 0 COMMENT 'Seat Orientation override value',
`ExitParamX` FLOAT(10) DEFAULT 0,
`ExitParamY` FLOAT(10) DEFAULT 0,
`ExitParamZ` FLOAT(10) DEFAULT 0,
`ExitParamO` FLOAT(10) DEFAULT 0,
`ExitParamValue` TINYINT(1) DEFAULT 0,
PRIMARY KEY (`SeatEntry`)
);

DELETE FROM `vehicle_seat_addon` WHERE `SeatEntry` IN (2726, 2727, 2728, 2729, 2730, 1472, 1473, 1474, 1475, 1476, 2764, 2765, 2767, 2768, 6446, 6447, 7326, 7327, 7328, 7329, 861, 862, 1682, 2097, 2172, 2178, 2179, 2180, 3690, 3691, 3692, 3129, 2772, 2771);
INSERT INTO `vehicle_seat_addon` (`SeatEntry`, `SeatOrientation`, `ExitParamX`, `ExitParamY`, `ExitParamZ`, `ExitParamO`, `ExitParamValue`) VALUES
(2764, 0.0, -2.0, 2.0, 0.0, 0.0, 1), -- 312 Traveler's Tundra Mammoth
(2765, 0.0, -2.0, -2.0, 0.0, 0.0, 1), -- 312
(2767, 0.0, -2.0, 2.0, 0.0, 0.0, 1), -- 313 Traveler's Tundra Mammoth
(2768, 0.0, -2.0, -2.0, 0.0, 0.0, 1),-- 313
(6446, 0.0, -1.0, 4.0, 3.0, 0.0, 1), -- 548 Stormwind Love Boat
(6447, 0.0, 1.0, 4.0, 3.0, 0.0, 1), -- 548
(7326, 0.0, -1.0, 4.0, 3.0, 0.0, 1), -- 615 Darnassus Love Boat
(7327, 0.0, 1.0, 4.0, 3.0, 0.0, 1), -- 615
(7328, 0.0, -1.0, 4.0, 3.0, 0.0, 1), -- 616 Undercity Love Boat
(7329, 0.0, 1.0, 4.0, 3.0, 0.0, 1), -- 616
(861, 0.0, -2.0, 2.0, 0.0, 0.0, 1), -- 51 Ducal's Horse
(862, 0.0, -2.0, 3.0, 0.0, 0.0, 1), -- 51
-- cmangos exclusive
(1682, 0.0, 6708.17, 5130.74, -19.388, 4.83608, 2), -- 118 Zeptek the Destroyer
(2097, 0.0, 12.0, 0.0, 4.0, 0.0, 1), -- 191 Gal'darah
(2172, 0.0, 40.0, 0.0, 0.0, 0.0, 1), -- 205 Gymer
(2178, 0.0, -3.3, 5.0, 0.0, 3.1326, 1), -- 209 Drakkari Rhino
(2179, 0.0, -5.9, -4.9, 0.0, 3.1326, 1), -- 209
(2180, 0.0, -7.9, 0.02, 0.0, 3.1326, 1), -- 209
-- acore exclusive
(3690, 0.0, 1776.0, -24.0, 448.75, 0.0, 2), -- 380 Kologarn right arm
(3691, 0.0, 1776.0, -24.0, 448.75, 0.0, 2), -- 380
(3692, 0.0, 1776.0, -24.0, 448.75, 0.0, 2), -- 380
(3129, 0.0, 0.0, -2.0, 0.0, 0.0, 1), -- 349 AT Mounts, dismount to the right
(2772, 0.0, -2.0, 2.0, 0.0, 0.0, 1), -- 315 Grand Ice Mammoth, Grand Black War Mammoth
(2771, 0.0, -2.0, -2.0, 0.0, 0.0, 1), -- 315
-- Helmsman's coords are different on acore
(1472, 0.0, 2802.18, 7054.91, -0.6, 4.67, 2), -- 91 The Helmsman's Ship
(1473, 0.0, 2802.18, 7054.91, -0.6, 4.67, 2), -- 91
(1474, 0.0, 2802.18, 7054.91, -0.6, 4.67, 2), -- 91
(1475, 0.0, 2802.18, 7054.91, -0.6, 4.67, 2), -- 91
(1476, 0.0, 2802.18, 7054.91, -0.6, 4.67, 2);
3 changes: 3 additions & 0 deletions data/sql/updates/db_world/2024_10_11_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- DB update 2024_10_11_00 -> 2024_10_11_01
--
UPDATE `smart_scripts` SET `target_type`=12, `target_param1`=1 WHERE `entryorguid`=1436800 AND `source_type`=9 AND `id` IN (2, 4);
Loading

0 comments on commit a6c027b

Please sign in to comment.