Skip to content

Commit

Permalink
feat: golden outfit migration
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Mar 22, 2024
1 parent 0f49b47 commit e8b5bef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local migration = Migration("20241711122214_golden_outfit_to_kv_storage")

local function migrateGoldenOutfit(player)
local goldeOutfitStorageValue = 51015
local value = player:getPlayerStorageValue(goldeOutfitStorageValue)

if value > 0 then
player:kv():set("golden-outfit-quest", value)
player:setPlayerStorageValue(goldeOutfitStorageValue, -1)
end
end

function migration:onExecute()
self:forEachPlayer(migrateGoldenOutfit)
end

migration:register()
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local function updateGoldenOutfitCache()
return
end

goldenOutfitCache = {[1] = {}, [2] = {}, [3] = {}}
goldenOutfitCache = { [1] = {}, [2] = {}, [3] = {} }

local resultId = db.storeQuery("SELECT `key_name`, `timestamp`, `value` FROM `kv_store` WHERE `key_name` = '" .. "golden-outfit-quest" .. "'")

Expand Down Expand Up @@ -34,7 +34,7 @@ function memorial.onUse(player, item, fromPosition, target, toPosition, isHotkey
local msg = NetworkMessage()
msg:addByte(0xB0)

local prices = {500000000, 750000000, 1000000000}
local prices = { 500000000, 750000000, 1000000000 }
for i, price in ipairs(prices) do
msg:addU32(price)
end
Expand Down

0 comments on commit e8b5bef

Please sign in to comment.