Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Jan 2, 2025
1 parent 21f0a50 commit 37bbf4d
Show file tree
Hide file tree
Showing 144 changed files with 5,635 additions and 738 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ endif()
# *****************************************************************************
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)

# Configure build options for compatibility with commodity CPUs
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -mtune=generic -mno-avx -mno-sse4")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64 -mtune=generic -mno-avx -mno-sse4")
endif()

# *****************************************************************************
# Include cmake tools
# *****************************************************************************
Expand Down
4 changes: 3 additions & 1 deletion config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,11 @@ Setting this to false may pose risks; if a house is abandoned and contains a lar
]]
-- Periods: daily/weekly/monthly/yearly/never
-- Base: sqm,rent,sqm+rent
toggleCyclopediaHouseAuction = true
daysToCloseBid = 7
housePriceRentMultiplier = 0.0
housePriceEachSQM = 1000
houseRentPeriod = "never"
houseRentPeriod = "weekly"
houseRentRate = 1.0
houseOwnedByAccount = false
houseBuyLevel = 100
Expand Down
6 changes: 6 additions & 0 deletions data-otxserver/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ Storage = {
NoblemanSecondAddon = 41308,
FormorgarMinesHoistSkeleton = 41309,
FormorgarMinesHoistChest = 41310,
PickAmount = 41311,
},
},
U8_1 = { -- update 8.1 - Reserved Storages 41351 - 41650
Expand Down Expand Up @@ -2766,6 +2767,11 @@ Storage = {
},
},
},
U13_20 = { -- update 13.20 - Reserved Storages 47952 - 47970
RottenBlood = {
AccessDoor = 47952,
},
},
},
-- Reserved storage from 63951 - 63999
ThaisExhibition = {
Expand Down
14 changes: 0 additions & 14 deletions data-otxserver/migrations/0.lua

This file was deleted.

35 changes: 11 additions & 24 deletions data-otxserver/migrations/1.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
function onUpdateDatabase()
logger.info("Updating database to version 2 (hireling)")

db.query([[
CREATE TABLE IF NOT EXISTS `player_hirelings` (
`id` INT NOT NULL PRIMARY KEY auto_increment,
`player_id` INT NOT NULL,
`name` varchar(255),
`active` tinyint unsigned NOT NULL DEFAULT '0',
`sex` tinyint unsigned NOT NULL DEFAULT '0',
`posx` int(11) NOT NULL DEFAULT '0',
`posy` int(11) NOT NULL DEFAULT '0',
`posz` int(11) NOT NULL DEFAULT '0',
`lookbody` int(11) NOT NULL DEFAULT '0',
`lookfeet` int(11) NOT NULL DEFAULT '0',
`lookhead` int(11) NOT NULL DEFAULT '0',
`looklegs` int(11) NOT NULL DEFAULT '0',
`looktype` int(11) NOT NULL DEFAULT '136',
FOREIGN KEY(`player_id`) REFERENCES `players`(`id`)
ON DELETE CASCADE
)
]])

return true
logger.info("Updating database to version 1 (sample players)")
-- Rook Sample
db.query("UPDATE `players` SET `level` = 2, `vocation` = 0, `health` = 155, `healthmax` = 155, `experience` = 100, `soul` = 100, `lookbody` = 113, `lookfeet` = 115, `lookhead` = 95, `looklegs` = 39, `looktype` = 129, `mana` = 60, `manamax` = 60, `town_id` = 1, `cap` = 410 WHERE `id` = 1;")
-- Sorcerer Sample
db.query("UPDATE `players` SET `level` = 8, `vocation` = 1, `health` = 185, `healthmax` = 185, `experience` = 4200, `soul` = 100, `lookbody` = 113, `lookfeet` = 115, `lookhead` = 95, `looklegs` = 39, `looktype` = 129, `mana` = 90, `manamax` = 90, `town_id` = 8, `cap` = 470 WHERE `id` = 2;")
-- Druid Sample
db.query("UPDATE `players` SET `level` = 8, `vocation` = 2, `health` = 185, `healthmax` = 185, `experience` = 4200, `soul` = 100, `lookbody` = 113, `lookfeet` = 115, `lookhead` = 95, `looklegs` = 39, `looktype` = 129, `mana` = 90, `manamax` = 90, `town_id` = 8, `cap` = 470 WHERE `id` = 3;")
-- Paladin Sample
db.query("UPDATE `players` SET `level` = 8, `vocation` = 3, `health` = 185, `healthmax` = 185, `experience` = 4200, `soul` = 100, `lookbody` = 113, `lookfeet` = 115, `lookhead` = 95, `looklegs` = 39, `looktype` = 129, `mana` = 90, `manamax` = 90, `town_id` = 8, `cap` = 470 WHERE `id` = 4;")
-- Knight Sample
db.query("UPDATE `players` SET `level` = 8, `vocation` = 4, `health` = 185, `healthmax` = 185, `experience` = 4200, `soul` = 100, `lookbody` = 113, `lookfeet` = 115, `lookhead` = 95, `looklegs` = 39, `looktype` = 129, `mana` = 90, `manamax` = 90, `town_id` = 8, `cap` = 470 WHERE `id` = 5;")
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/10.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 11 (Guilds Balance)")
logger.info("Updating database to version 10 (Guilds Balance)")
db.query("ALTER TABLE `guilds` ADD `balance` bigint(20) UNSIGNED NOT NULL DEFAULT '0';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/11.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 12 (Player get daily reward)")
logger.info("Updating database to version 11 (Player get daily reward)")
db.query("ALTER TABLE `players` ADD `isreward` tinyint(1) NOT NULL DEFAULT 1")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/12.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
function onUpdateDatabase()
logger.info("Updating database to version 13 (Boosted Creature Outfit)")
logger.info("Updating database to version 12 (Boosted Creature Outfit)")
db.query("ALTER TABLE boosted_creature ADD `looktype` int(11) NOT NULL DEFAULT 136;")
db.query("ALTER TABLE boosted_creature ADD `lookfeet` int(11) NOT NULL DEFAULT 0;")
db.query("ALTER TABLE boosted_creature ADD `looklegs` int(11) NOT NULL DEFAULT 0;")
db.query("ALTER TABLE boosted_creature ADD `lookhead` int(11) NOT NULL DEFAULT 0;")
db.query("ALTER TABLE boosted_creature ADD `lookbody` int(11) NOT NULL DEFAULT 0;")
db.query("ALTER TABLE boosted_creature ADD `lookaddons` int(11) NOT NULL DEFAULT 0;")
db.query("ALTER TABLE boosted_creature ADD `lookmount` int(11) DEFAULT 0;")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/13.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 14 (Fixed mana spent)")
logger.info("Updating database to version 13 (Fixed mana spent)")
db.query("ALTER TABLE `players` CHANGE `manaspent` `manaspent` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/14.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 15 (Magic Shield Spell)")
logger.info("Updating database to version 14 (Magic Shield Spell)")
db.query("ALTER TABLE `players` ADD `manashield` SMALLINT UNSIGNED NOT NULL DEFAULT '0' AFTER `skill_manaleech_amount`")
db.query("ALTER TABLE `players` ADD `max_manashield` SMALLINT UNSIGNED NOT NULL DEFAULT '0' AFTER `manashield`")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/15.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
function onUpdateDatabase()
logger.info("Updating database to version 16 (Rook sample and GOD player values)")
logger.info("Updating database to version 15 (Rook sample and GOD player values)")
-- Rook Sample
db.query("UPDATE `players` SET `maglevel` = 2, `manaspent` = 5936, `skill_club` = 12, `skill_club_tries` = 155, `skill_sword` = 12, `skill_sword_tries` = 155, `skill_axe` = 12, `skill_axe_tries` = 155, `skill_dist` = 12, `skill_dist_tries` = 93 WHERE `id` = 1;")
-- GOD
db.query("UPDATE `players` SET `health` = 155, `healthmax` = 155, `experience` = 100, `looktype` = 75, `town_id` = 8 WHERE `id` = 6;")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/16.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
print("Updating database to version 17 (Tutorial support)")
print("Updating database to version 16 (Tutorial support)")
db.query("ALTER TABLE `players` ADD `istutorial` SMALLINT(1) NOT NULL DEFAULT '0'")
return true -- true = There are others migrations file | false = this is the last migration file
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/17.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 18 (Fix guild creation myaac)")
logger.info("Updating database to version 17 (Fix guild creation myaac)")
db.query("ALTER TABLE `guilds` ADD `level` int(11) NOT NULL DEFAULT 1")
db.query("ALTER TABLE `guilds` ADD `points` int(11) NOT NULL DEFAULT 0")
return true
end
4 changes: 1 addition & 3 deletions data-otxserver/migrations/18.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 19 (Prey system rework + Task hunting system)")
logger.info("Updating database to version 18 (Prey system rework + Task hunting system)")
db.query([[
ALTER TABLE `players`
DROP `prey_stamina_1`,
Expand Down Expand Up @@ -48,6 +48,4 @@ function onUpdateDatabase()
`monster_list` BLOB NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])

return true
end
4 changes: 1 addition & 3 deletions data-otxserver/migrations/19.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
function onUpdateDatabase()
logger.info("Updating database to version 20 (Gamestore accepting Tournament Coins)")
logger.info("Updating database to version 19 (Gamestore accepting Tournament Coins)")

db.query("ALTER TABLE `accounts` ADD `tournament_coins` int(11) NOT NULL DEFAULT 0 AFTER `coins`")
db.query("ALTER TABLE `store_history` ADD `coin_type` tinyint(1) NOT NULL DEFAULT 0 AFTER `description`")
db.query("ALTER TABLE `store_history` DROP COLUMN `coins`") -- Not in use anywhere.

return true
end
4 changes: 1 addition & 3 deletions data-otxserver/migrations/2.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 3 (account refactor)")
logger.info("Updating database to version 2 (account refactor)")

db.query([[
LOCK TABLES
Expand Down Expand Up @@ -109,6 +109,4 @@ function onUpdateDatabase()
ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])

return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/20.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 21 (Fix market price size)")
logger.info("Updating database to version 20 (Fix market price size)")
db.query("ALTER TABLE `market_history` CHANGE `price` `price` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';")
db.query("ALTER TABLE `market_offers` CHANGE `price` `price` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/21.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
function onUpdateDatabase()
logger.info("Updating database to version 22 (forge and tier system)")
logger.info("Updating database to version 21 (forge and tier system)")
db.query("ALTER TABLE `market_offers` ADD `tier` tinyint UNSIGNED NOT NULL DEFAULT '0';")
db.query("ALTER TABLE `market_history` ADD `tier` tinyint UNSIGNED NOT NULL DEFAULT '0';")
db.query("ALTER TABLE `players` ADD `forge_dusts` bigint(21) NOT NULL DEFAULT '0';")
db.query("ALTER TABLE `players` ADD `forge_dust_level` bigint(21) UNSIGNED NOT NULL DEFAULT '100';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/22.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
function onUpdateDatabase()
logger.info("Updating database to version 23 (fix offline training skill size)")
logger.info("Updating database to version 22 (fix offline training skill size)")
db.query([[
ALTER TABLE `players`
MODIFY offlinetraining_skill tinyint(2) NOT NULL DEFAULT '-1';
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/23.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 24 (forge history)")
logger.info("Updating database to version 23 (forge history)")
db.query([[
CREATE TABLE IF NOT EXISTS `forge_history` (
`id` int NOT NULL AUTO_INCREMENT,
Expand All @@ -16,5 +16,4 @@ function onUpdateDatabase()
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/24.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 25 (random mount outfit window)")
logger.info("Updating database to version 24 (random mount outfit window)")
db.query("ALTER TABLE `players` ADD `randomize_mount` SMALLINT(1) NOT NULL DEFAULT '0'")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/25.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 26 (reward bag fix)")
logger.info("Updating database to version 25 (reward bag fix)")
db.query("UPDATE player_rewards SET pid = 0 WHERE itemtype = 19202;")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/26.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 27 (towns)")
logger.info("Updating database to version 26 (towns)")

db.query([[
CREATE TABLE IF NOT EXISTS `towns` (
Expand All @@ -11,5 +11,4 @@ function onUpdateDatabase()
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`))
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/27.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 28 (bosstiary system)")
logger.info("Updating database to version 27 (bosstiary system)")
db.query("ALTER TABLE `players` ADD `boss_points` int NOT NULL DEFAULT '0';")
db.query([[
CREATE TABLE IF NOT EXISTS `boosted_boss` (
Expand All @@ -23,5 +23,4 @@ function onUpdateDatabase()
`bossIdSlotTwo` int NOT NULL DEFAULT 0,
`removeTimes` int NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/28.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 29 (transfer coins)")
logger.info("Updating database to version 28 (transfer coins)")
db.query("ALTER TABLE `accounts` ADD `coins_transferable` int unsigned NOT NULL DEFAULT '0';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/29.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 30 (looktypeEx)")
logger.info("Updating database to version 29 (looktypeEx)")
db.query("ALTER TABLE `boosted_boss` ADD `looktypeEx` int unsigned NOT NULL DEFAULT '0';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/3.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
function onUpdateDatabase()
logger.info("Updating database to version 4 (prey tick)")
logger.info("Updating database to version 3 (prey tick)")

db.query([[
ALTER TABLE `prey_slots`
ADD `tick` smallint(3) NOT NULL DEFAULT '0';
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/30.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
function onUpdateDatabase()
logger.info("Updating database to version 31 (loyalty)")
logger.info("Updating database to version 30 (loyalty)")
db.query([[
ALTER TABLE `accounts` ADD COLUMN `premdays_purchased` int(11) NOT NULL DEFAULT 0;
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/31.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 32 (account_sessions)")
logger.info("Updating database to version 31 (account_sessions)")
db.query([[
CREATE TABLE IF NOT EXISTS `account_sessions` (
`id` VARCHAR(191) NOT NULL,
Expand All @@ -13,5 +13,4 @@ function onUpdateDatabase()
db.query([[
ALTER TABLE `accounts` MODIFY `password` TEXT NOT NULL;
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/32.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 33 (wheel of destiny)")
logger.info("Updating database to version 32 (wheel of destiny)")
db.query([[
CREATE TABLE IF NOT EXISTS `player_wheeldata` (
`player_id` int(11) NOT NULL,
Expand All @@ -10,5 +10,4 @@ function onUpdateDatabase()
ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/33.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 34 (add primary keys)")
logger.info("Updating database to version 33 (add primary keys)")
db.query([[
ALTER TABLE `player_prey`
ADD PRIMARY KEY (`player_id`, `slot`);
Expand All @@ -24,5 +24,4 @@ function onUpdateDatabase()
ALTER TABLE `player_wheeldata`
ADD PRIMARY KEY (`player_id`);
]])
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/34.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 35 (bosstiary tracker)")
logger.info("Updating database to version 34 (bosstiary tracker)")
db.query("ALTER TABLE `player_bosstiary` ADD `tracker` blob NOT NULL;")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/35.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function onUpdateDatabase()
logger.info("Updating database to version 36 (fix account premdays and lastday)")
logger.info("Updating database to version 35 (fix account premdays and lastday)")

local resultQuery = db.storeQuery("SELECT `id`, `premdays`, `lastday` FROM `accounts` WHERE (`premdays` > 0 OR `lastday` > 0) AND `lastday` <= " .. os.time())
if resultQuery ~= false then
Expand All @@ -12,7 +12,6 @@ function onUpdateDatabase()
until not Result.next(resultQuery)
Result.free(resultQuery)
end
return true
end

function getNewValue(premDays, lastDay)
Expand Down
3 changes: 1 addition & 2 deletions data-otxserver/migrations/36.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 37 (add coin_type to accounts)")
logger.info("Updating database to version 36 (add coin_type to accounts)")
db.query("ALTER TABLE `coins_transactions` ADD `coin_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '1';")
return true
end
3 changes: 1 addition & 2 deletions data-otxserver/migrations/37.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function onUpdateDatabase()
logger.info("Updating database to version 38 (add pronoun to players)")
logger.info("Updating database to version 37 (add pronoun to players)")
db.query("ALTER TABLE `players` ADD `pronoun` int(11) NOT NULL DEFAULT '0';")
return true
end
Loading

0 comments on commit 37bbf4d

Please sign in to comment.