Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
beats-dh authored Jul 4, 2024
2 parents dff3733 + 926a5f3 commit fe158eb
Show file tree
Hide file tree
Showing 258 changed files with 3,376 additions and 2,088 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ QualifierAlignment: Left
ReferenceAlignment: Right
ReflowComments: true
RemoveBracesLLVM: false
SortIncludes: false
SortIncludes: Never
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
Expand All @@ -138,4 +138,4 @@ StatementMacros:
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: true
UseTab: AlignWithSpaces
6 changes: 3 additions & 3 deletions .github/workflows/clang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ jobs:

- name: Run clang format lint
if: ${{ github.ref != 'refs/heads/main' }}
uses: DoozyX/clang-format-lint-action@v0.16.2
uses: DoozyX/clang-format-lint-action@v0.17
with:
source: "src"
exclude: "src/protobuf"
extensions: "cpp,hpp,h"
clangFormatVersion: 16
clangFormatVersion: 17
inplace: true

- name: Run add and commit
if: ${{ github.ref != 'refs/heads/main' }}
uses: EndBug/add-and-commit@v9
uses: EndBug/add-and-commit@v9.1.4
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/mysql-schema-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: MySQL Schema Check
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "schema.sql"
merge_group:
push:
paths:
- "schema.sql"
branches:
- main

jobs:
mysql-schema-check:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: canary
MYSQL_USER: canary
MYSQL_PASSWORD: canary
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
name: Check
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: 📌 MySQL Start & init & show db
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE canary;' -uroot -proot
mysql -e "SHOW DATABASES" -uroot -proot
- name: Import Canary Schema
run: |
mysql -uroot -proot canary < schema.sql
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
# VCPKG
# cmake -DCMAKE_TOOLCHAIN_FILE=/opt/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# Needed libs is in file vcpkg.json
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil bshoshany-thread-pool
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
Expand Down Expand Up @@ -124,4 +124,4 @@ add_subdirectory(src)

if(BUILD_TESTS)
add_subdirectory(tests)
endif()
endif()
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"DEBUG_LOG": "ON",
"ASAN_ENABLED": "OFF",
"BUILD_STATIC_LIBRARY": "OFF",
"SPEED_UP_BUILD_UNITY": "OFF",
"VCPKG_TARGET_TRIPLET": "x64-windows"
}
},
Expand Down
4 changes: 4 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@ partyListMaxDistance = 30
toggleMapCustom = true

-- Market
-- NOTE: marketRefreshPricesInterval (in minutes, minimum is 1 minute)
-- NOTE: set it to 0 for disable, is the time in which the task will run updating the prices of the items that will be sent to the client
marketOfferDuration = 30 * 24 * 60 * 60
marketRefreshPricesInterval = 30
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100
Expand Down Expand Up @@ -508,6 +511,7 @@ bossDefaultTimeToFightAgain = 20 * 60 * 60 -- 20 hours
bossDefaultTimeToDefeat = 20 * 60 -- 20 minutes

-- Monsters
defaultRespawnTime = 60
deSpawnRange = 2
deSpawnRadius = 50

Expand Down
2 changes: 1 addition & 1 deletion data-canary/monster/demons/fury.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ monster.elements = {
{ type = COMBAT_LIFEDRAIN, percent = 0 },
{ type = COMBAT_MANADRAIN, percent = 0 },
{ type = COMBAT_DROWNDAMAGE, percent = 0 },
{ type = COMBAT_ICEDAMAGE, percent = 30 },
{ type = COMBAT_ICEDAMAGE, percent = 5 },
{ type = COMBAT_HOLYDAMAGE, percent = 30 },
{ type = COMBAT_DEATHDAMAGE, percent = -10 },
}
Expand Down
4 changes: 2 additions & 2 deletions data-canary/monster/demons/juggernaut.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ monster.Bestiary = {
The Blood Halls, The Vats, The Hive, The Shadow Nexus, a room deep in Formorgar Mines, Roshamuul Prison, Oramond Dungeon, Grounds of Destruction.",
}

monster.health = 20000
monster.maxHealth = 20000
monster.health = 18000
monster.maxHealth = 18000
monster.race = "blood"
monster.corpse = 6335
monster.speed = 170
Expand Down
28 changes: 0 additions & 28 deletions data-canary/scripts/actions/other/large_sea_shell.lua

This file was deleted.

101 changes: 0 additions & 101 deletions data-canary/scripts/weapons/scripted_weapons.lua

This file was deleted.

9 changes: 9 additions & 0 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3079,6 +3079,15 @@ GlobalStorage = {
DarashiaWest = 60193,
},
},
TheDreamCourts = {
-- Reserved storage from 60194 - 60196
FacelessBane = {
-- Global
StepsOn = 60194,
Deaths = 60195,
ResetSteps = 60196,
},
},
FuryGates = 65000,
Yakchal = 65001,
PitsOfInfernoLevers = 65002,
Expand Down
1 change: 0 additions & 1 deletion data-otservbr-global/lib/others/load.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dofile(DATA_DIRECTORY .. "/lib/others/dawnport.lua")
dofile(DATA_DIRECTORY .. "/lib/others/vip_system.lua")
55 changes: 54 additions & 1 deletion data-otservbr-global/migrations/45.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
logger.info("Updating database to version 46 (feat: vip groups)")

db.query([[
CREATE TABLE IF NOT EXISTS `account_vipgroups` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose vip group entry it is',
`name` varchar(128) NOT NULL,
`customizable` BOOLEAN NOT NULL DEFAULT '1',
CONSTRAINT `account_vipgroups_pk` PRIMARY KEY (`id`, `account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])

db.query([[
CREATE TRIGGER `oncreate_accounts` AFTER INSERT ON `accounts` FOR EACH ROW BEGIN
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Enemies', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Friends', 0);
INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Trading Partner', 0);
END;
]])

db.query([[
CREATE TABLE IF NOT EXISTS `account_vipgrouplist` (
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose viplist entry it is',
`player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry',
`vipgroup_id` int(11) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs',
INDEX `account_id` (`account_id`),
INDEX `player_id` (`player_id`),
INDEX `vipgroup_id` (`vipgroup_id`),
CONSTRAINT `account_vipgrouplist_unique` UNIQUE (`account_id`, `player_id`, `vipgroup_id`),
CONSTRAINT `account_vipgrouplist_player_fk`
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`)
ON DELETE CASCADE,
CONSTRAINT `account_vipgrouplist_vipgroup_fk`
FOREIGN KEY (`vipgroup_id`, `account_id`) REFERENCES `account_vipgroups` (`id`, `account_id`)
ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])

db.query([[
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`)
SELECT 1, id, 'Friends', 0 FROM `accounts`;
]])

db.query([[
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`)
SELECT 2, id, 'Enemies', 0 FROM `accounts`;
]])

db.query([[
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`)
SELECT 3, id, 'Trading Partners', 0 FROM `accounts`;
]])

return true
end
3 changes: 3 additions & 0 deletions data-otservbr-global/migrations/46.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Constrictor")
local monster = {}

monster.description = "a quara constrictor"
monster.experience = 250
monster.experience = 380
monster.outfit = {
lookType = 46,
lookHead = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Hydromancer")
local monster = {}

monster.description = "a quara hydromancer"
monster.experience = 800
monster.experience = 950
monster.outfit = {
lookType = 47,
lookHead = 0,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/quara_mantassin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Mantassin")
local monster = {}

monster.description = "a quara mantassin"
monster.experience = 400
monster.experience = 600
monster.outfit = {
lookType = 72,
lookHead = 0,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/quara_pincher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Pincher")
local monster = {}

monster.description = "a quara pincher"
monster.experience = 1200
monster.experience = 1500
monster.outfit = {
lookType = 77,
lookHead = 0,
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/quara_predator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Predator")
local monster = {}

monster.description = "a quara predator"
monster.experience = 1600
monster.experience = 1850
monster.outfit = {
lookType = 20,
lookHead = 0,
Expand Down
Loading

0 comments on commit fe158eb

Please sign in to comment.