Skip to content

Retail support alignment with newest lib version #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/LedgerFactory.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions source/ListSync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions source/LogEntry.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions source/LogEntryCrossRealm.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down