Skip to content

Commit

Permalink
Renamed a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Nov 2, 2022
1 parent de92b91 commit e34a277
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions Server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,10 @@ function LootReserve.Server:Load()
if versionSave < "2022-10-30" then
if self.CurrentSession and self.CurrentSession.Members then
for member, memberData in pairs(self.CurrentSession.Members) do
if not memberData.RollBonuses then
memberData.RollBonuses = { };
if not memberData.RollBonus then
memberData.RollBonus = { };
for _, id in ipairs(memberData.ReservedItems) do
memberData.RollBonuses[id] = 0;
memberData.RollBonus[id] = 0;
end
end
end
Expand Down Expand Up @@ -1682,7 +1682,7 @@ function LootReserve.Server:StartSession()
ReservesLeft = self.CurrentSession.Settings.MaxReservesPerPlayer,
ReservesDelta = 0,
ReservedItems = { ItemID, ItemID, ... },
RollBonuses = { [ItemID] = 0, [ItemID] = 10, ... },
RollBonus = { [ItemID] = 0, [ItemID] = 10, ... },
Locked = nil,
OptedOut = nil,
},
Expand Down Expand Up @@ -1733,7 +1733,7 @@ function LootReserve.Server:StartSession()
ReservesLeft = self.CurrentSession.Settings.MaxReservesPerPlayer,
ReservesDelta = 0,
ReservedItems = { },
RollBonuses = { },
RollBonus = { },
Locked = nil,
OptedOut = nil,
};
Expand All @@ -1749,11 +1749,11 @@ function LootReserve.Server:StartSession()
ReservesLeft = self.CurrentSession.Settings.MaxReservesPerPlayer,
ReservesDelta = 0,
ReservedItems = { },
RollBonuses = { },
RollBonus = { },
Locked = nil,
OptedOut = nil,
};
member.RollBonuses = importedMember.RollBonuses;
member.RollBonus = importedMember.RollBonus;
self.CurrentSession.Members[player] = member;
for _, itemID in ipairs(importedMember.ReservedItems) do
itemID = LootReserve.Data:GetToken(itemID) or itemID;
Expand Down Expand Up @@ -3084,7 +3084,7 @@ function LootReserve.Server:PrepareRequestRoll()
if not rollSubmitted then
self.RequestedRoll.Players[player][i] = tonumber(roll);
if not self.RequestedRoll.Custom and self.CurrentSession and self.CurrentSession.Members and self.CurrentSession.Members[player] then
self.RequestedRoll.Players[player][i] = self.RequestedRoll.Players[player][i] + self.CurrentSession.Members[player].RollBonuses[self.RequestedRoll.Item:GetID()];
self.RequestedRoll.Players[player][i] = self.RequestedRoll.Players[player][i] + self.CurrentSession.Members[player].RollBonus[self.RequestedRoll.Item:GetID()];
end
rollSubmitted = true;
else
Expand Down
24 changes: 12 additions & 12 deletions Windows/ServerImportWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ function LootReserve.Server.Import:InputOptionsUpdated()
break;
end
end
elseif header:find("delta") or header:find("reservebonus") then
self.Columns[i] = "Delta"
elseif header:find("delta") or header:find("reserves?%s*bonus") or header:find("bonus%s*reserves?") or header:find("extra%s*reserves?") then
self.Columns[i] = "Extra Reserves"
elseif header:find("class") then
self.Columns[i] = "Class";
elseif header:find("rollbonus") then
self.Columns[i] = "RollBonus";
elseif header:find("roll%s*bonus") then
self.Columns[i] = "Roll Bonus";
end
end
end
Expand Down Expand Up @@ -335,11 +335,11 @@ function LootReserve.Server.Import:SessionSettingsUpdated()
return "Only one column can be marked as \"Count\"";
end
end
if column == "Delta" and row[i] then
if column == "Extra Reserves" and row[i] then
if not row.Delta then
row.Delta = ParseNumber(row[i]);
else
return "Only one column can be marked as \"Delta\"";
return "Only one column can be marked as \"Extra Reserves\"";
end
end
if column == "Class" and row[i] then
Expand All @@ -349,11 +349,11 @@ function LootReserve.Server.Import:SessionSettingsUpdated()
return "Only one column can be marked as \"Class\"";
end
end
if column == "RollBonus" and row[i] then
if column == "Roll Bonus" and row[i] then
if not row.Bonus then
row.Bonus = ParseNumber(row[i]);
else
return "Only one column can be marked as \"RollBonus\"";
return "Only one column can be marked as \"Roll Bonus\"";
end
end
end
Expand Down Expand Up @@ -426,7 +426,7 @@ function LootReserve.Server.Import:SessionSettingsUpdated()
{
NameMatchResult = nameMatchResult,
ReservedItems = { },
RollBonuses = { },
RollBonus = { },
InvalidReasons = { },
ReservesDelta = nil,
Class = nil,
Expand All @@ -438,7 +438,7 @@ function LootReserve.Server.Import:SessionSettingsUpdated()
end
for i = 1, (row.Count or 1) * itemCount * playerCount do
table.insert(member.ReservedItems, itemID);
member.RollBonuses[itemID] = row.Bonus or 0;
member.RollBonus[itemID] = row.Bonus or 0;
itemReserveCount[itemID] = (itemReserveCount[itemID] or 0) + 1;
itemReserveCountByPlayer[player] = itemReserveCountByPlayer[player] or { };
itemReserveCountByPlayer[player][itemID] = (itemReserveCountByPlayer[player][itemID] or 0) + 1;
Expand Down Expand Up @@ -580,7 +580,7 @@ function LootReserve.Server.Import:Import()
ReservesLeft = nil,
ReservesDelta = 0,
ReservedItems = { },
RollBonuses = member.RollBonuses,
RollBonus = member.RollBonus,
Locked = nil,
OptedOut = nil,
};
Expand All @@ -593,7 +593,7 @@ function LootReserve.Server.Import:Import()
ReservesLeft = nil,
ReservesDelta = 0,
ReservedItems = { },
RollBonuses = member.RollBonuses,
RollBonus = member.RollBonus,
Locked = nil,
OptedOut = nil,
};
Expand Down
4 changes: 2 additions & 2 deletions Windows/ServerImportWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
<Frame name="LootReserveServerImportOptionColumnTemplate" virtual="true" inherits="LootReserveServerImportOptionTemplate" parentArray="Columns">
<KeyValues>
<KeyValue key="field" type="string" value="Columns" />
<KeyValue key="values" type="string" value="|cFF808080Unused|r=Unused$Player$Item$Count$Delta$Class$RollBonus" />
<KeyValue key="width" type="number" value="65" />
<KeyValue key="values" type="string" value="|cFF808080Unused|r=Unused$Player$Item$Count$Class$Extra Reserves$Roll Bonus" />
<KeyValue key="width" type="number" value="75" />
<KeyValue key="justify" type="string" value="LEFT" />
</KeyValues>
<Size y="32" />
Expand Down

0 comments on commit e34a277

Please sign in to comment.