Needs a check for people asking to leave a specific layer or joining a specific layer
CKozanecki opened this issue ยท 5 comments
When people are asking "Looking for layer XX" or "Looking for layer off XX" types of messages are not processed correctly because someone will be looking for an interaction with that specific layer and we invite even if not on that layer (or worse, when they are asking to leave that layer)
I looked at the code, and I think that something like this could work starting around
Line 66 in 4cae711
if addonTable.NWB ~= nil then
local message = ({ strsplit(" ", msg) })
for _, v in pairs(message) do
if tonumber(v) == addonTable.NWB.currentLayer then
if string.find(string.lower(msg), "%f[%a]off%f[%A]") then
-- asking off the layer you are on, ignore
AutoLayer:DebugPrint("Wants off layer " .. v)
AutoLayer:DebugPrint("Currently on layer " .. addonTable.NWB.currentLayer)
AutoLayer:DebugPrint("Ignoring")
return
end
else
-- asking for specific layer we are not on, ignore
AutoLayer:DebugPrint("Wants specific layer " .. v)
AutoLayer:DebugPrint("Currently on layer " .. addonTable.NWB.currentLayer)
AutoLayer:DebugPrint("Ignoring")
return
end
end
end
When I "LFL 3", nothing happens.
The rest of the server says "looking to get off layer 2" or "looking for any layer except 3" or "looking for layer 7".
If you don't see any issue with auto layering when people are asking off the layer you are on, I guess I'll fork and fix my own version.
i see that most requests dont get flagged as such but i dont have the time to add that without causing too many false positives.
feel free to fork it and make a puill request, ill happily accept contributions