diff --git a/CodexShare.lua b/CodexShare.lua index 0c2dbf5..37a5342 100644 --- a/CodexShare.lua +++ b/CodexShare.lua @@ -1313,6 +1313,26 @@ function Share.RemoteStats() return senders, records end +-- Diagnose (/fwcodex share): empfangene Datensaetze je Absender und Art (u o q i x t p z g h f), Dev-Status, eigene Datensaetze je Art +function Share.RemoteInfo() + local out = {} + for name, s in pairs(Remote()) do + local by = {} + for _, rec in pairs(s.rec) do by[rec.y or "?"] = (by[rec.y or "?"] or 0) + 1 end + out[#out + 1] = { name = name, dev = IsDevSender(name) and true or false, n = s.n or 0, np = s.np or 0, by = by } + end + return out +end + +function Share.OwnInfo() + local by = {} + for _, e in ipairs(Share.Scan(false) or {}) do + local l = tostring(e.key):sub(1, 1) + by[l] = (by[l] or 0) + 1 + end + return by +end + -- Mitgelieferte Startdaten (nur im Speicher, nie gespeichert und nie gesendet): Schluessel -> Datensatz local builtin = { rec = {}, n = 0 } diff --git a/CodexSync.lua b/CodexSync.lua index da5a67e..023cff9 100644 --- a/CodexSync.lua +++ b/CodexSync.lua @@ -1202,6 +1202,21 @@ function Sync:Debug() FW:Print("Gesendet nach Art: " .. Types(st.txType)) FW:Print("Empfangen nach Art: " .. Types(st.rxType)) FW:Print(string.format("Bekannte Spieler (letzte Stunde): %d", self:HeardCount())) + local function Letters(by) + local o = {} + for _, l in ipairs({ "u", "o", "q", "i", "x", "t", "p", "z", "g", "h", "f" }) do + if by[l] then o[#o + 1] = l .. "=" .. by[l] end + end + return #o > 0 and table.concat(o, " ") or "-" + end + FW:Print("Eigene Datensaetze nach Art: " .. Letters(Share.OwnInfo())) + for _, r in ipairs(Share.RemoteInfo()) do + FW:Print(string.format("Von %s: Dev %s, normal %d, Wege/Punkte %d | %s", tostring(r.name), r.dev and "ja" or "NEIN", r.n, r.np, Letters(r.by))) + end + if Codex.Spots then + FW:Print(string.format("Ortspunkte sichtbar: %d (davon empfangen: %d), Verbindungen empfangen: %d", + Codex.Spots.Count(), #Share.RemoteRecords("h"), #Share.RemoteRecords("g"))) + end end function Sync:Stats() diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index 8cbec38..6ad1ae9 100644 --- a/Freewood-OctoWoW-Codex.toc +++ b/Freewood-OctoWoW-Codex.toc @@ -3,7 +3,7 @@ ## Notes: Learns quests, creatures and drops while you play: who gives and takes a quest, rewards, objectives, drop chances. ## Notes-deDE: Lernt beim Spielen Quests, Kreaturen und Beute: wer eine Quest vergibt und annimmt, Belohnungen, Ziele, Drop-Chancen. ## Author: Lacustat -## Version: 0.1.140 +## Version: 0.1.141 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData