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 2ef1aec
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 goldenOutfitStorageName = 51015
local value = player:getPlayerStorageValue(goldenOutfitStorageName)

if value > 0 then
player:setPlayerStorageValue(goldenOutfitStorageName, -1)
player:kv():set("golden-outfit-quest", value)
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 2ef1aec

Please sign in to comment.