• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Error with updateKeysStorage OTX

endziu2222

Active Member
Joined
Nov 2, 2010
Messages
167
Solutions
1
Reaction score
44
I have been trying to fix this and nothing helped.


1694174130996.png

Lua:
function updateKeysStorage(tablename)
    -- It updates old storage keys from quests for all players
    local newUpdate = tablename[0].latest
    local oldUpdate = getGlobalStorage(GlobalStorage.KeysUpdate)
    if newUpdate <= oldUpdate then
        return true
    end

    logger.info("Updating quest keys storages...")
    if oldUpdate < 1 then
        oldUpdate = 1
    end
    for u = oldUpdate, newUpdate do
        for i = 1, #tablename[u] do
            db.query("UPDATE `player_storage` SET `key` = '" .. tablename[u][i].new .. "' WHERE `key` = '" .. tablename[u][i].old .. "';")
        end
    end
    setGlobalStorage(GlobalStorage.KeysUpdate, newUpdate)
    logger.info("Storage Keys Updated")
end

Lua:
    -- Update old quest storage keys
    updateKeysStorage(QuestKeysUpdate)


Don't really know what to do anymore with this, I could delete these 2 codes but this will not solve my problem with not having rewards in chests on the map. Anybody can help?
 
Solution
The only one I could find it was inside startup/tables/storage_keys_update is this the one?

Lua:
QuestKeysUpdate = {
    [0] = {latest = 4}, -- Increase +1 every time this below table suffer a modification
    -- Add a new table to the bottow of this array with the following number versioning.
    --[[
    [1] = { -- New table version, allows the updated servers apply the changes to the only new revised quest.
        -- Example of new quest revised to be migrated
        {old = 10001, new = 80001}, -- Example
        {old = 10002, new = 80002}, -- Example
        {old = 10003, new = 80003}, -- Example
        {old = 10004, new = 80004}, -- Example
        {old = 10005, new = 80005}, -- Example
    },
]]--
}
set
[0] = {latest...
I have been trying to fix this and nothing helped.


View attachment 78230

Lua:
function updateKeysStorage(tablename)
    -- It updates old storage keys from quests for all players
    local newUpdate = tablename[0].latest
    local oldUpdate = getGlobalStorage(GlobalStorage.KeysUpdate)
    if newUpdate <= oldUpdate then
        return true
    end

    logger.info("Updating quest keys storages...")
    if oldUpdate < 1 then
        oldUpdate = 1
    end
    for u = oldUpdate, newUpdate do
        for i = 1, #tablename[u] do
            db.query("UPDATE `player_storage` SET `key` = '" .. tablename[u][i].new .. "' WHERE `key` = '" .. tablename[u][i].old .. "';")
        end
    end
    setGlobalStorage(GlobalStorage.KeysUpdate, newUpdate)
    logger.info("Storage Keys Updated")
end

Lua:
    -- Update old quest storage keys
    updateKeysStorage(QuestKeysUpdate)


Don't really know what to do anymore with this, I could delete these 2 codes but this will not solve my problem with not having rewards in chests on the map. Anybody can help?
show the QuestKeysUpdate table
 
show the QuestKeysUpdate table
The only one I could find it was inside startup/tables/storage_keys_update is this the one?

Lua:
QuestKeysUpdate = {
    [0] = {latest = 4}, -- Increase +1 every time this below table suffer a modification
    -- Add a new table to the bottow of this array with the following number versioning.
    --[[
    [1] = { -- New table version, allows the updated servers apply the changes to the only new revised quest.
        -- Example of new quest revised to be migrated
        {old = 10001, new = 80001}, -- Example
        {old = 10002, new = 80002}, -- Example
        {old = 10003, new = 80003}, -- Example
        {old = 10004, new = 80004}, -- Example
        {old = 10005, new = 80005}, -- Example
    },
]]--
}
 
The only one I could find it was inside startup/tables/storage_keys_update is this the one?

Lua:
QuestKeysUpdate = {
    [0] = {latest = 4}, -- Increase +1 every time this below table suffer a modification
    -- Add a new table to the bottow of this array with the following number versioning.
    --[[
    [1] = { -- New table version, allows the updated servers apply the changes to the only new revised quest.
        -- Example of new quest revised to be migrated
        {old = 10001, new = 80001}, -- Example
        {old = 10002, new = 80002}, -- Example
        {old = 10003, new = 80003}, -- Example
        {old = 10004, new = 80004}, -- Example
        {old = 10005, new = 80005}, -- Example
    },
]]--
}
set
[0] = {latest = 4},
to
[0] = {latest = -1},
 
Solution
set
[0] = {latest = 4},
to
[0] = {latest = -1},
Thanks it worked. By any chance you may know how to add new quest reward with canary 13.20? Every time I try to add any reward in for example annihilator it does not work. Anyway thanks for help.
 
Thanks it worked. By any chance you may know how to add new quest reward with canary 13.20? Every time I try to add any reward in for example annihilator it does not work. Anyway thanks for help.
all i can say is: in tfs it's set on map editor.
 
Back
Top