mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Codex.git
synced 2026-10-30 12:50:52 +00:00
0.1.140: Eigentuemer je Server, Namensschluessel ohne Nachnamen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
ef7d631fe7
commit
55c0415450
+6
-6
@@ -4,9 +4,9 @@
|
||||
-- Charaktere kommen, werden von anderen Spielern uebernommen. Der Absender einer Addon-Nachricht wird vom
|
||||
-- Spiel gesetzt und kann nicht gefaelscht werden.
|
||||
--
|
||||
-- Eintrag zum Beispiel: "Lacustat-Everlook",
|
||||
-- (genau so geschrieben, wie der Charakter im Spiel heisst. Charaktere haben Vor- und Nachnamen: "Aroki Steel".
|
||||
-- Ein Bindestrich gilt nur als Realm-Trenner, wenn dahinter ClassicBetaPvP2 steht.)
|
||||
-- Eintrag zum Beispiel: "Lacustat-NZoth",
|
||||
-- (Name-Realm, Realm ohne Apostroph und Leerzeichen: NZoth, CThun, YShaarj. Ohne Realm gilt der eigene Realm.
|
||||
-- Auf OctoWoW haben Charaktere nur einen Namen.)
|
||||
--
|
||||
-- Ist die Liste leer, gibt es niemanden mit DEV-Rechten: Namen koennen dann nicht bearbeitet werden.
|
||||
|
||||
@@ -16,9 +16,9 @@ if not NS then
|
||||
end
|
||||
|
||||
NS.Owners = {
|
||||
"Fwfreewood",
|
||||
"Freewood",
|
||||
"Fwaroki",
|
||||
"Fwaroki-NZoth", -- PvE
|
||||
"Freewood-CThun", -- Hardcore
|
||||
"Fwfreewood-YShaarj", -- PvP
|
||||
}
|
||||
|
||||
-- Fest eingetragene Moderatoren (duerfen Namen aendern, Datensaetze markieren, Verbindungen und Ortspunkte weitergeben).
|
||||
|
||||
+10
-19
@@ -46,7 +46,7 @@ end
|
||||
local function RealmPart(name)
|
||||
local r = type(name) == "string" and name:match("%-(.+)$")
|
||||
if r then
|
||||
r = r:gsub("[%s%-]", ""):lower()
|
||||
r = r:gsub("[%s%-']", ""):lower()
|
||||
if r ~= "" then return r end
|
||||
end
|
||||
return nil
|
||||
@@ -54,7 +54,7 @@ end
|
||||
|
||||
local function OwnRealm()
|
||||
local r = (GetNormalizedRealmName and GetNormalizedRealmName()) or (GetRealmName and GetRealmName()) or ""
|
||||
return (tostring(r):gsub("[%s%-]", ""):lower())
|
||||
return (tostring(r):gsub("[%s%-']", ""):lower())
|
||||
end
|
||||
|
||||
-- Der eigene Realm hat im Spiel mehrere Schreibweisen (z.B. GetNormalizedRealmName = "ClassicBetaPvP2",
|
||||
@@ -68,7 +68,7 @@ local function IsOwnRealmVariant(r)
|
||||
if ok then variants[#variants + 1] = ur end
|
||||
end
|
||||
for _, v in ipairs(variants) do
|
||||
if type(v) == "string" and v:gsub("[%s%-]", ""):lower() == r then return true end
|
||||
if type(v) == "string" and v:gsub("[%s%-']", ""):lower() == r then return true end
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -82,32 +82,23 @@ function Trust.Key(name)
|
||||
return core .. "-" .. realm
|
||||
end
|
||||
|
||||
-- Eintrag aus einer Liste oder von Hand getippt ("Speedtest-Timerun", "Aroki Steel", "Yuto-ClassicBetaPvP2").
|
||||
-- In Forever haben Charaktere Vor- und Nachnamen ("Aroki Steel"); ein Bindestrich gilt nur dann als Realm-Trenner,
|
||||
-- wenn dahinter der eigene Realm steht. Sonst ist es der Nachname (Bindestrich = Leerzeichen).
|
||||
-- Eintrag aus einer Liste oder von Hand getippt: "Name" (gilt fuer den eigenen Realm) oder "Name-Realm"
|
||||
-- (z.B. "Fwaroki-NZoth"). Auf OctoWoW gibt es nur einen Namen, keinen Nachnamen: ein Bindestrich trennt den Realm ab.
|
||||
function Trust.EntryKey(name)
|
||||
if type(name) ~= "string" then return nil end
|
||||
local clean = name:gsub("\194\160", " "):gsub("^%s+", ""):gsub("%s+$", "")
|
||||
local base, realm = clean:match("^(.*)%-([^%-]+)$")
|
||||
if base and realm:gsub("[%s%-]", ""):lower() == OwnRealm() then
|
||||
return Trust.Key(clean)
|
||||
end
|
||||
return Trust.Key((clean:gsub("%-", " ")))
|
||||
return Trust.Key(clean)
|
||||
end
|
||||
|
||||
-- Eigener voller Name. UnitFullName liefert in Forever Vorname und Nachname ("Aroki", "Steel"); die anderen
|
||||
-- sehen uns als "Aroki Steel-ClassicBetaPvP2". Weicht der zweite Teil vom eigenen Realm ab, ist es der Nachname.
|
||||
-- Eigener voller Name (OctoWoW: nur ein Name; der zweite Rueckgabewert von UnitFullName ist der Realm, kein Nachname)
|
||||
function Trust.SelfKey()
|
||||
local name, second
|
||||
local name
|
||||
if UnitFullName then
|
||||
local ok, n, r = pcall(UnitFullName, "player")
|
||||
if ok then name, second = n, r end
|
||||
local ok, n = pcall(UnitFullName, "player")
|
||||
if ok then name = n end
|
||||
end
|
||||
if not name and UnitName then name = (UnitName("player")) end
|
||||
if not name then return nil end
|
||||
if second and second ~= "" and second:gsub("[%s%-]", ""):lower() ~= OwnRealm() then
|
||||
name = name .. " " .. second
|
||||
end
|
||||
return Trust.Key(name)
|
||||
end
|
||||
|
||||
|
||||
@@ -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.139
|
||||
## Version: 0.1.140
|
||||
## Dependencies: Freewood-OctoWoW-Core
|
||||
## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData
|
||||
|
||||
|
||||
Reference in New Issue
Block a user