Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Mar 2, 2024
1 parent 0571146 commit a32f47c
Show file tree
Hide file tree
Showing 406 changed files with 2,241 additions and 25,212 deletions.
18 changes: 11 additions & 7 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ tibiadromeConcoctionTickType = "online" -- "online" | "experience"
onlyPremiumAccount = false

-- Customs
-- NOTE: weatherRain = true, activates weather raining effects
-- NOTE: thunderEffect = true, activates thunder effects
-- NOTE: allConsoleLog = true, show all message logs
-- NOTE: stashMoving = true, stow an container inside your stash
-- NOTE: depotChest, the non-stackable items will be moved to the selected depot chest(I - XVIII).
-- NOTE: autoBank = true, the dropped coins from monsters will be automatically deposited to your bank account.
Expand All @@ -239,9 +236,8 @@ onlyPremiumAccount = false
-- NOTE: teleportPlayerToVocationRoom will enable oressa to teleport player to his/her room vocation
-- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward
-- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt
weatherRain = false
thunderEffect = false
allConsoleLog = false
-- NOTE: enablePlayerPutItemInAmmoSlot = true, will enable players to put any items on ammo slot, more used in custom shopping system
-- NOTE: startStreakLevel will make a reward streak level for new players who never logged in
stashMoving = false
depotChest = 4
autoLoot = false
Expand All @@ -257,6 +253,8 @@ toggleReceiveReward = false
randomMonsterSpawn = false
lootPouchMaxLimit = 2000
storeInboxMaxLimit = 2000
enablePlayerPutItemInAmmoSlot = false
startStreakLevel = 0

-- Teleport summon
-- Set to true will never remove the summon
Expand All @@ -281,9 +279,11 @@ maxAllowedOnADummy = 1

-- Save interval per time
-- NOTE: toggleSaveInterval: true = enable the save interval, false = disable the save interval
-- NOTE: toggleSaveAsync = true, will enable save async (experimental), not recommended for use in production
-- NOTE: saveIntervalType: "minute", "second" or "hour"
-- NOTE: toggleSaveIntervalCleanMap: true = enable the clean map, false = disable the clean map
-- NOTE: saveIntervalTime: time based on what was set in "saveIntervalType"
toggleSaveAsync = false
toggleSaveInterval = true
saveIntervalType = "minute"
toggleSaveIntervalCleanMap = true
Expand Down Expand Up @@ -419,11 +419,15 @@ multiplierSpeedOnFist = 5
maxSpeedOnFist = 500
disableLegacyRaids = false
disableMonsterArmor = false
combatChainDelay = 50
minElementalResistance = -200
maxElementalResistance = 200
maxDamageReflection = 200

-- Chain system
toggleChainSystem = true
combatChainDelay = 50
combatChainTargets = 5

-- Global server Save
-- NOTE: globalServerSaveNotifyDuration in minutes
globalServerSaveNotifyMessage = true
Expand Down
13 changes: 5 additions & 8 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `server_config` (
CONSTRAINT `server_config_pk` PRIMARY KEY (`config`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '43'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0');
INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '44'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0');

-- Table structure `accounts`
CREATE TABLE IF NOT EXISTS `accounts` (
Expand Down Expand Up @@ -312,9 +312,12 @@ CREATE TABLE IF NOT EXISTS `guild_wars` (
`guild2` int(11) NOT NULL DEFAULT '0',
`name1` varchar(255) NOT NULL,
`name2` varchar(255) NOT NULL,
`status` tinyint(2) NOT NULL DEFAULT '0',
`status` tinyint(2) UNSIGNED NOT NULL DEFAULT '0',
`started` bigint(15) NOT NULL DEFAULT '0',
`ended` bigint(15) NOT NULL DEFAULT '0',
`frags_limit` smallint(4) UNSIGNED NOT NULL DEFAULT '0',
`payment` bigint(13) UNSIGNED NOT NULL DEFAULT '0',
`duration_days` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
INDEX `guild1` (`guild1`),
INDEX `guild2` (`guild2`),
CONSTRAINT `guild_wars_pk` PRIMARY KEY (`id`)
Expand Down Expand Up @@ -640,12 +643,6 @@ CREATE TABLE IF NOT EXISTS `player_kills` (
`unavenged` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Table structure `player_misc`
CREATE TABLE IF NOT EXISTS `player_misc` (
`player_id` int(11) NOT NULL,
`info` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Table structure `player_namelocks`
CREATE TABLE IF NOT EXISTS `player_namelocks` (
`player_id` int(11) NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/account/account.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_info.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
6 changes: 2 additions & 4 deletions src/account/account_repository_db.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand All @@ -20,9 +20,7 @@
#include "account/account_info.hpp"

AccountRepositoryDB::AccountRepositoryDB() :
coinTypeToColumn({ { enumToValue(CoinType::Normal), "coins" },
{ enumToValue(CoinType::Tournament), "tournament_coins" },
{ enumToValue(CoinType::Transferable), "coins_transferable" } }) { }
coinTypeToColumn({ { enumToValue(CoinType::Normal), "coins" }, { enumToValue(CoinType::Tournament), "tournament_coins" }, { enumToValue(CoinType::Transferable), "coins_transferable" } }) { }

bool AccountRepositoryDB::loadByID(const uint32_t &id, AccountInfo &acc) {
auto query = fmt::format("SELECT `id`, `type`, `premdays`, `lastday`, `creation`, `premdays_purchased`, 0 AS `expires` FROM `accounts` WHERE `id` = {}", id);
Expand Down
2 changes: 1 addition & 1 deletion src/account/account_repository_db.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
24 changes: 13 additions & 11 deletions src/canary_server.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down Expand Up @@ -342,8 +342,17 @@ void CanaryServer::loadModules() {
}

auto coreFolder = g_configManager().getString(CORE_DIRECTORY, __FUNCTION__);
// Load items dependencies
// Load appearances.dat first
modulesLoadHelper((g_game().loadAppearanceProtobuf(coreFolder + "/items/appearances.dat") == ERROR_NONE), "appearances.dat");

// Load XML folder dependencies (order matters)
modulesLoadHelper(g_vocations().loadFromXml(), "XML/vocations.xml");
modulesLoadHelper(g_eventsScheduler().loadScheduleEventFromXml(), "XML/events.xml");
modulesLoadHelper(Outfits::getInstance().loadFromXml(), "XML/outfits.xml");
modulesLoadHelper(Familiars::getInstance().loadFromXml(), "XML/familiars.xml");
modulesLoadHelper(g_imbuements().loadFromXml(), "XML/imbuements.xml");
modulesLoadHelper(g_storages().loadFromXML(), "XML/storages.xml");

modulesLoadHelper(Item::items.loadFromXml(), "items.xml");

const auto datapackFolder = g_configManager().getString(DATA_DIRECTORY, __FUNCTION__);
Expand All @@ -352,17 +361,10 @@ void CanaryServer::loadModules() {
modulesLoadHelper((g_luaEnvironment().loadFile(coreFolder + "/core.lua", "core.lua") == 0), "core.lua");
modulesLoadHelper(g_scripts().loadScripts(coreFolder + "/scripts/lib", true, false), coreFolder + "/scripts/libs");
modulesLoadHelper(g_scripts().loadScripts(coreFolder + "/scripts", false, false), coreFolder + "/scripts");
modulesLoadHelper((g_npcs().load(true, false)), "npclib");

// Second XML scripts
modulesLoadHelper(g_vocations().loadFromXml(), "XML/vocations.xml");
modulesLoadHelper(g_eventsScheduler().loadScheduleEventFromXml(), "XML/events.xml");
modulesLoadHelper(Outfits::getInstance().loadFromXml(), "XML/outfits.xml");
modulesLoadHelper(Familiars::getInstance().loadFromXml(), "XML/familiars.xml");
modulesLoadHelper(g_imbuements().loadFromXml(), "XML/imbuements.xml");
modulesLoadHelper(g_storages().loadFromXML(), "XML/storages.xml");
modulesLoadHelper(g_modules().loadFromXml(), "modules/modules.xml");
modulesLoadHelper(g_events().loadFromXml(), "events/events.xml");
modulesLoadHelper((g_npcs().load(true, false)), "npclib");
modulesLoadHelper(g_modules().loadFromXml(), "modules/modules.xml");

logger.debug("Loading datapack scripts on folder: {}/", datapackName);
// Load scripts
Expand Down
2 changes: 1 addition & 1 deletion src/canary_server.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Canary - A free and open-source MMORPG server emulator
* Copyright (©) 2019-2022 OpenTibiaBR <opentibiabr@outlook.com>
* Copyright (©) 2019-2024 OpenTibiaBR <opentibiabr@outlook.com>
* Repository: https://github.com/opentibiabr/canary
* License: https://github.com/opentibiabr/canary/blob/main/LICENSE
* Contributors: https://github.com/opentibiabr/canary/graphs/contributors
Expand Down
Loading

0 comments on commit a32f47c

Please sign in to comment.