Hello, it’s me again 
I’ve got a problem because early this morning my server crashed due to the luaItemGetUniqueId function.
crashlog: https://pastebin.com/raw/ZdueEn7C
Here are the scripts that contain this function:
I edited fishing and here’s what I have:
And here’s the one from the merchant:
And I’ve got a problem because I can’t figure out why this happened — I’ll add that it’s the first time it’s occurred in a month.
It happened early in the morning — I checked if any player logged in during that time frame, but no one did.
I have a feeling that it just triggered by itself.
Can someone explain to me why this happened?
I’ve got a problem because early this morning my server crashed due to the luaItemGetUniqueId function.
crashlog: https://pastebin.com/raw/ZdueEn7C
Here are the scripts that contain this function:
Code:
data/npc/scripts/handlarz.lua: playerMarket[cid] = { itemId = handItem:ge tId(), itemUid = handItem:getUniqueId() }
data/actions/scripts/other/partyhat.lua: if headSlotItem == nil or item.u id ~= headSlotItem:getUniqueId() then
data/actions/scripts/tools/fishing.lua: if not leftHand or leftHand:getUnique Id() ~= item:getUniqueId() then
data/movements/scripts/tiles.lua: local depotItems = playe r:getDepotLocker(getDepotId(depotItem:getUniqueId()), true):getItemHoldingCount( )
data/movements/scripts/closingdoor.lua: if tileItem and tileItem:getUniq ueId() ~= item.uid and tileItem:getType():isMovable() then
data/lib/compat/compat.lua: return methods.getUniqueId(self)
data/lib/compat/compat.lua: t.uid = thing:getUniqueId()
data/lib/compat/compat.lua: return item:getUniqueId()
data/lib/compat/compat.lua: return item:getUniqueId()
data/lib/compat/compat.lua: return item:getUniqueId()
data/spells/scripts/support/disintegrate rune.lua: i f item:getType():isMovable() and item:getUniqueId() > 65535 and item:getActionId
I edited fishing and here’s what I have:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
-- sprawdzenie czy gracz w obszarze
if not isInFishingArea(player:getPosition()) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Aby lowic ryby, musisz znajdowac sie w poblizu Rybaka.")
return true
end
-- sprawdzenie czy wedka jest w lewej rece
local leftHand = player:getSlotItem(CONST_SLOT_LEFT)
if not leftHand or leftHand:getUniqueId() ~= item:getUniqueId() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Aby lowic ryby, musisz trzymac wedke w lewej rece.")
return true
end
And here’s the one from the merchant:
LUA:
-- dodawanie przedmiotu
if text == "dodaj przedmiot" or text == "dodaj" then
if getPlayerMarketCount(player) >= 5 then
say(cid, "Mozesz miec maksymalnie 5 aktywnych ofert na rynku.")
reset(cid); return true
end
local handItem = player:getSlotItem(CONST_SLOT_AMMO)
if not handItem then
say(cid, "Musisz trzymac przedmiot w slocie na amunicje.")
reset(cid); return true
end
npcHandler.topic[cid] = TOPIC.ADD_CURRENCY
playerMarket[cid] = { itemId = handItem:getId(), itemUid = handItem:getUniqueId() }
-- say(cid, "Chcesz dodac ten przedmiot na aukcje za gp czy za premium points? [gp] [premium points]")
local msgs = {"Aby dodac przedmiot, musisz miec go w slocie na amunicje. Jesli chcesz dodac plecak, pamietaj, ze straci on swoja zawartosc..","Chcesz dodac ten przedmiot na aukcje za gp czy za premium points? [gp] [premium points]"}
npcHandler:doNPCTalkALot(msgs, 5000, cid)
return true
end
if npcHandler.topic[cid] == TOPIC.ADD_CURRENCY then
if text == "gp" or text == "gold" then
playerMarket[cid].currency = "gold"
npcHandler.topic[cid] = TOPIC.ADD_PRICE
say(cid, "Podaj cene w gp.")
return true
elseif text == "premium" or text == "premium points" then
playerMarket[cid].currency = "points"
npcHandler.topic[cid] = TOPIC.ADD_PRICE
say(cid, "Podaj cene w premium points.")
return true
else
say(cid, "Wybierz gp albo premium points. [gp] [premium points]")
return true
end
end
if npcHandler.topic[cid] == TOPIC.ADD_PRICE then
local price = tonumber(text)
if not price or price <= 0 then
say(cid, "Podaj poprawna liczbe wieksza od 0.")
return true
end
local data = playerMarket[cid]
if not data then
say(cid, "Cos poszlo nie tak. Sprobuj ponownie.")
reset(cid); return true
end
data.price = price
npcHandler.topic[cid] = TOPIC.CONFIRM
local handItem = player:getSlotItem(CONST_SLOT_AMMO)
if not handItem then
say(cid, "Nie trzymasz zadnego przedmiotu w slocie na amunicje.")
reset(cid); return true
end
say(cid, "Chcesz dodac " .. handItem:getCount() .."x " .. handItem:getName() .. " za " .. formatCurrency(price) .. " " .. data.currency .. "? [tak] [nie]")
return true
end
if npcHandler.topic[cid] == TOPIC.CONFIRM then
if isNo(text) then
say(cid, "Okej, wroc innym razem..")
reset(cid); return true
elseif isYes(text) then
local data = playerMarket[cid]
if not data then
say(cid, "Cos poszlo nie tak. Sprobuj ponownie.")
reset(cid); return true
end
local handItem = player:getSlotItem(CONST_SLOT_AMMO)
if not handItem or handItem:getId() ~= data.itemId then
say(cid, "Nie trzymasz juz tego samego przedmiotu w slocie na amunicje.")
reset(cid); return true
end
local success, msg = doAddMarketItem(player, handItem, data.price, data.currency)
say(cid, msg)
reset(cid)
return true
else
say(cid, "Odpowiedz tak albo nie. [tak] [nie]")
return true
end
end
return true
end
And I’ve got a problem because I can’t figure out why this happened — I’ll add that it’s the first time it’s occurred in a month.
It happened early in the morning — I checked if any player logged in during that time frame, but no one did.
I have a feeling that it just triggered by itself.
Can someone explain to me why this happened?