diff --git a/source/LedgerFactory.lua b/source/LedgerFactory.lua index afddd9e..ddaf0c2 100644 --- a/source/LedgerFactory.lua +++ b/source/LedgerFactory.lua @@ -1,6 +1,6 @@ local _, LibEventSourcing = ... -local LedgerFactory, _ = LibStub:NewLibrary("EventSourcing/LedgerFactory", 2) +local LedgerFactory, _ = LibStub:NewLibrary("EventSourcing/LedgerFactory", 3) if not LedgerFactory then return end @@ -71,10 +71,10 @@ LedgerFactory.createLedger = function(table, send, registerReceiveHandler, autho registerMutator = function(metatable, mutatorFunc) stateManager:registerHandler(metatable, mutatorFunc) end, - submitEntry = function(entry) + submitEntry = function(entry, creator) -- not applying timetravel before auth, because from an addon perspective it is the current time. -- check authorization - if not authorizationHandler(entry, UnitName("player")) then + if not authorizationHandler(entry, creator or UnitName("player")) then error("Attempted to submit entries for which you are not authorized") return end diff --git a/source/ListSync.lua b/source/ListSync.lua index 491f4aa..a6a02fd 100644 --- a/source/ListSync.lua +++ b/source/ListSync.lua @@ -2,7 +2,7 @@ Sync lists in lua ]]-- -local ListSync, _ = LibStub:NewLibrary("EventSourcing/ListSync", 2) +local ListSync, _ = LibStub:NewLibrary("EventSourcing/ListSync", 3) if not ListSync then return end @@ -262,10 +262,6 @@ end local function handleMessage(listSync, message, distribution, sender) - if sender == listSync.playerName then - return - end - if not Message.cast(message) then listSync.logger:Warning("Ignoring invalid message from %s", sender) return diff --git a/source/LogEntry.lua b/source/LogEntry.lua index 1be610f..30137c6 100644 --- a/source/LogEntry.lua +++ b/source/LogEntry.lua @@ -1,7 +1,8 @@ -local WoW10 = select(4, GetBuildInfo()) >= 100000 -if WoW10 then return end +local WoW10 = select(4, GetBuildInfo()) >= 100000 +local WoWEra = select(4, GetBuildInfo()) < 30000 +if WoW10 or WoWEra then return end -local LogEntry, _ = LibStub:NewLibrary("EventSourcing/LogEntry", 1) +local LogEntry, _ = LibStub:NewLibrary("EventSourcing/LogEntry", 3) if not LogEntry then return end @@ -130,6 +131,10 @@ function LogEntry:creator() return self[privateCreator] end +function LogEntry:creatorFull() + return self[privateCreator] +end + function LogEntry:counter() return self[privateCounter] end diff --git a/source/LogEntryCrossRealm.lua b/source/LogEntryCrossRealm.lua index 5e79dd4..a338f66 100644 --- a/source/LogEntryCrossRealm.lua +++ b/source/LogEntryCrossRealm.lua @@ -1,7 +1,8 @@ -local WoW10 = select(4, GetBuildInfo()) >= 100000 -if not WoW10 then return end +local WoW10 = select(4, GetBuildInfo()) >= 100000 +local WoWEra = select(4, GetBuildInfo()) < 30000 +if not (WoW10 or WoWEra) then return end -local LogEntry, _ = LibStub:NewLibrary("EventSourcing/LogEntry", 2) +local LogEntry, _ = LibStub:NewLibrary("EventSourcing/LogEntry", 4) if not LogEntry then return end @@ -144,6 +145,10 @@ function LogEntry:realm() return self[privateRealm] end +function LogEntry:creatorFull() + return {self[privateRealm], self[privateCreator]} +end + function LogEntry:counter() return self[privateCounter] end