Skip to content

Commit

Permalink
Merge branch 'release/1.11' into classic/1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mrogaski committed Mar 29, 2020
2 parents 10416bf + 2f6f971 commit 5f8defe
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 101 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
This project uses [Semantic Versioning](http://semver.org/).

## [1.11.0] -- Unreleased
### Fixed
- Updated debug message call stack parsing for 8.3.

### Removed
- Removed replication of achievements and loot announcements between co-guilds.
The `SendChatMessage` function was made partially protected in 8.2.5, and
events that are not triggered by hardware events cannot use the function.
- Removed unnecessary local co-guild use of the addon communication channel.

### Added
Expand All @@ -18,6 +18,9 @@ This project uses [Semantic Versioning](http://semver.org/).
- Refactored CHAT_MSG_SYSTEM handling to use an abstract factory and added
full unit testing for the polymorphic classes.

### Fixed
- Updated debug message call stack parsing for 8.3.

## [1.10.1] -- 2019-09-24
### Updated
- Updated the TOC for WoW 8.2.5.
Expand Down
11 changes: 1 addition & 10 deletions Channel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ Transmit Methods
-- @param type The message type.
-- Accepted values are:
-- GW_MTYPE_CHAT
-- GW_MTYPE_ACHIEVEMENT
-- GW_MTYPE_BROADCAST
-- GW_MTYPE_NOTICE
-- GW_MTYPE_REQUEST
Expand Down Expand Up @@ -293,10 +292,6 @@ function GwChannel:tl_send(type, message)
local opcode
if type == GW_MTYPE_CHAT then
opcode = 'C'
elseif type == GW_MTYPE_ACHIEVEMENT then
opcode = 'A'
elseif type == GW_MTYPE_LOOT then
opcode = 'L'
elseif type == GW_MTYPE_BROADCAST then
opcode = 'B'
elseif type == GW_MTYPE_NOTICE then
Expand Down Expand Up @@ -466,10 +461,6 @@ function GwChannel:tl_receive(...)
local type = GW_MTYPE_NONE
if opcode == 'C' then
type = GW_MTYPE_CHAT
elseif opcode == 'A' then
type = GW_MTYPE_ACHIEVEMENT
elseif opcode == 'L' then
type = GW_MTYPE_LOOT
elseif opcode == 'B' then
type = GW_MTYPE_BROADCAST
elseif opcode == 'N' then
Expand All @@ -481,7 +472,7 @@ function GwChannel:tl_receive(...)
elseif opcode == 'E' then
type = GW_MTYPE_EXTERNAL
else
gw.Debug(GW_LOG_ERROR, 'unknown segment opcode: %s', opcode)
gw.Debug(GW_LOG_WARNING, 'unknown segment opcode: %s', opcode)
end
return sender, guild_id, type, message
end
Expand Down
10 changes: 0 additions & 10 deletions Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ function gw.handlerGuildChat(type, guild_id, content, arglist)
local sender = arglist[2]
if type == GW_MTYPE_CHAT then
gw.ReplicateMessage('GUILD', content[1], guild_id, arglist)
elseif type == GW_MTYPE_ACHIEVEMENT then
if gw.settings:get('achievements') then
gw.ReplicateMessage('GUILD_ACHIEVEMENT', content[1], guild_id, arglist)
end
elseif type == GW_MTYPE_LOOT then
if gw.settings:get('achievements') then
gw.ReplicateMessage('LOOT', content[1], guild_id, arglist)
end
elseif type == GW_MTYPE_BROADCAST then
local action, target, rank = unpack(content)
if action == 'join' then
Expand Down Expand Up @@ -95,8 +87,6 @@ end
-- Accepted values:
-- 'GUILD'
-- 'OFFICER'
-- 'GUILD_ACHIEVEMENT'
-- 'LOOT'
-- 'SYSTEM'
-- @param message The message to replicate.
-- @param guild_id (optional) Guild ID of the sender.
Expand Down
16 changes: 7 additions & 9 deletions Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,13 @@ GW_CTYPE_ADDON = 2
--
GW_MTYPE_NONE = 0
GW_MTYPE_CHAT = 1
GW_MTYPE_ACHIEVEMENT = 2
GW_MTYPE_LOOT = 3
GW_MTYPE_BROADCAST = 4
GW_MTYPE_CONTROL = 5
GW_MTYPE_REQUEST = 6
GW_MTYPE_RESPONSE = 7
GW_MTYPE_NOTICE = 8
GW_MTYPE_ADDON = 9
GW_MTYPE_EXTERNAL = 10
GW_MTYPE_BROADCAST = 2
GW_MTYPE_CONTROL = 3
GW_MTYPE_REQUEST = 4
GW_MTYPE_RESPONSE = 5
GW_MTYPE_NOTICE = 6
GW_MTYPE_ADDON = 7
GW_MTYPE_EXTERNAL = 8


--
Expand Down
2 changes: 1 addition & 1 deletion GUILD_QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Definitions
-----------

Bridging
> Replication of chat events within one guild into the guild, achievement, and officer chat of another guild.
> Replication of chat events within one guild into the guild and officer chat channels of another guild.
Confederation
> A large WoW guild that is partitioned into smaller guilds to comply with Blizzard's guild size limit.
Expand Down
2 changes: 0 additions & 2 deletions Globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ gw.usage = [[
-- Reload the configuration.
reset
-- Reset communications and reload the configuration.
achievements <on|off>
-- Toggle display of confederation achievements.
roster <on|off>
-- Toggle display of confederation online, offline, join, and leave messages.
rank <on|off>
Expand Down
22 changes: 0 additions & 22 deletions GreenWall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ function GreenWall_OnLoad(self)
self:RegisterEvent('CHAT_MSG_CHANNEL_LEAVE')
self:RegisterEvent('CHAT_MSG_CHANNEL_NOTICE')
self:RegisterEvent('CHAT_MSG_GUILD')
self:RegisterEvent('CHAT_MSG_LOOT')
self:RegisterEvent('CHAT_MSG_OFFICER')
self:RegisterEvent('CHAT_MSG_GUILD_ACHIEVEMENT')
self:RegisterEvent('CHAT_MSG_SYSTEM')
self:RegisterEvent('GUILD_ROSTER_UPDATE')
self:RegisterEvent('PLAYER_ENTERING_WORLD')
Expand Down Expand Up @@ -285,32 +283,12 @@ function GreenWall_OnEvent(self, event, ...)
local message, sender, language, _, _, flags, _, chanNum = select(1, ...)
gw.Debug(GW_LOG_DEBUG, 'event=%s, sender=%s, message=%q', event, sender, message)

elseif event == 'CHAT_MSG_LOOT' then

local message, sender, _, _, _, flags, _, chanNum = select(1, ...)
gw.Debug(GW_LOG_DEBUG, 'event=%s, sender=%s, message=%q', event, sender, message)
item = gw.GetItemString(message)
if item and gw.IsLegendary(item) then
if gw.iCmp(gw.GlobalName(sender), gw.player) then
newmsg = message:gsub('You receive', gw.player .. ' receives') -- Convert to third-person
gw.config.channel.guild:send(GW_MTYPE_LOOT, newmsg)
end
end

elseif event == 'CHAT_MSG_OFFICER' then

-- Messages will be forwarded by the ChatEdit_ParseText hook
local message, sender, language, _, _, flags, _, chanNum = select(1, ...)
gw.Debug(GW_LOG_DEBUG, 'event=%s, sender=%s, message=%q', event, sender, message)

elseif event == 'CHAT_MSG_GUILD_ACHIEVEMENT' then

local message, sender, _, _, _, flags, _, chanNum = select(1, ...)
gw.Debug(GW_LOG_DEBUG, 'event=%s, sender=%s, message=%q', event, sender, message)
if gw.iCmp(gw.GlobalName(sender), gw.player) then
gw.config.channel.guild:send(GW_MTYPE_ACHIEVEMENT, message)
end

elseif event == 'CHAT_MSG_CHANNEL_JOIN' then

local _, player, _, _, _, _, _, number = select(1, ...)
Expand Down
2 changes: 1 addition & 1 deletion GreenWall.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: GreenWall
## Notes: Common communication channel as a replacement for guild chat in guild confederations.
## Author: Mark Rogaski <stigg@aie-guild.org>
## Version: 1.11.0-dev+classic
## Version: 1.11.0-beta+classic
## URL: https://github.com/AIE-Guild/GreenWall
## URL: https://www.curseforge.com/wow/addons/greenwall
## DefaultState: enabled
Expand Down
15 changes: 1 addition & 14 deletions GreenWall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,9 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
<OnLoad>getglobal(self:GetName() .. "Text"):SetText("Show co-guild tags");</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentOptionAchievements" inherits="InterfaceOptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentOptionTag"
relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>getglobal(self:GetName() .. "Text"):SetText("Show co-guild achievement announcements");</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentOptionRoster" inherits="InterfaceOptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentOptionAchievements"
<Anchor point="TOPLEFT" relativeTo="$parentOptionTag"
relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-8"/>
Expand Down
3 changes: 0 additions & 3 deletions Interface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function GreenWallInterfaceFrame_LoadOptions(self, mode)
end
getglobal(self:GetName() .. "OptionMode"):SetChecked(mode == GW_MODE_ACCOUNT)
getglobal(self:GetName() .. "OptionTag"):SetChecked(gw.settings:get('tag', mode))
getglobal(self:GetName() .. "OptionAchievements"):SetChecked(gw.settings:get('achievements', mode))
getglobal(self:GetName() .. "OptionRoster"):SetChecked(gw.settings:get('roster', mode))
getglobal(self:GetName() .. "OptionRank"):SetChecked(gw.settings:get('rank', mode))
getglobal(self:GetName() .. "OptionJoinDelay"):SetValue(gw.settings:get('joindelay', mode))
Expand Down Expand Up @@ -77,8 +76,6 @@ function GreenWallInterfaceFrame_SaveUpdates(self)
local mode = getglobal(self:GetName() .. "OptionMode"):GetChecked() and GW_MODE_ACCOUNT or GW_MODE_CHARACTER
gw.settings:set('mode', mode)
gw.settings:set('tag', getglobal(self:GetName() .. "OptionTag"):GetChecked() and true or false, mode)
gw.settings:set('achievements',
getglobal(self:GetName() .. "OptionAchievements"):GetChecked() and true or false, mode)
gw.settings:set('roster', getglobal(self:GetName() .. "OptionRoster"):GetChecked() and true or false, mode)
gw.settings:set('rank', getglobal(self:GetName() .. "OptionRank"):GetChecked() and true or false, mode)
gw.settings:set('joindelay', getglobal(self:GetName() .. "OptionJoinDelay"):GetValue(), mode)
Expand Down
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ You will be able to set the following options.

Default: on

- __achievements__ - _Show Co-Guild Achievement Announcements_

Show achievements from other co-guilds.

Default: off

- __roster__ - _Show Co-Guild Roster Announcements_

Show guild join and leave messages from other co-guilds.
Expand Down Expand Up @@ -187,12 +181,6 @@ To view the current configuration, you would enter one of the following.

Default: on

- achievements [ on | off ]

Show achievements from other co-guilds.

Default: off

- roster [ on | off ]

Show guild join and leave messages from other co-guilds.
Expand Down Expand Up @@ -269,7 +257,7 @@ to establish communication with other co-guilds in a confederation.

- Bridging

Replication of chat events within one guild into the guild, achievement, and officer chat of another guild.
Replication of chat events within one guild into the guild and officer chat of another guild.

- Confederation

Expand Down
4 changes: 0 additions & 4 deletions Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ function GwSettings:new()
value = true,
desc = "co-guild tagging"
},
achievements = {
value = false,
desc = "co-guild achievement announcements"
},
roster = {
value = true,
desc = "co-guild roster announcements"
Expand Down
9 changes: 0 additions & 9 deletions tests/TestSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function TestSettingsCreate:test_initialize()
lu.assertStrMatches(tab.created, '%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d')
lu.assertStrMatches(tab.updated, '%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d')
lu.assertEquals(tab.tag, true)
lu.assertEquals(tab.achievements, false)
lu.assertEquals(tab.roster, true)
lu.assertEquals(tab.rank, false)
lu.assertEquals(tab.debug, GW_LOG_NONE)
Expand All @@ -96,7 +95,6 @@ function TestSettingsLoad:setUp()
GreenWall = {
created = "2018-01-01 17:28:47",
updated = "2018-01-01 01:04:46",
achievements = true,
roster = false,
}
GreenWallAccount = {
Expand All @@ -123,7 +121,6 @@ end
function TestSettingsLoad:test_character()
local settings = GwSettings:new()
lu.assertEquals(GreenWall.tag, true)
lu.assertEquals(GreenWall.achievements, true)
lu.assertEquals(GreenWall.roster, false)
lu.assertEquals(GreenWall.rank, false)
end
Expand All @@ -149,14 +146,12 @@ function TestSettingsAccess:setUp()
created = "2018-01-01 17:28:47",
updated = "2018-01-01 01:04:46",
tag = true,
achievements = true,
logsize = 1024,
}
GreenWallAccount = {
created = "2018-01-01 17:28:47",
updated = "2018-01-01 01:04:46",
tag = false,
achievements = false,
logsize = 2048,
}
end
Expand All @@ -167,22 +162,18 @@ function TestSettingsAccess:test_get()
lu.assertEquals(settings:get('mode'), GW_MODE_ACCOUNT)

lu.assertEquals(settings:get('tag'), false)
lu.assertEquals(settings:get('achievements'), false)
lu.assertEquals(settings:get('logsize'), 2048)

lu.assertEquals(settings:get('tag',GW_MODE_CHARACTER), true)
lu.assertEquals(settings:get('achievements', GW_MODE_CHARACTER), true)
lu.assertEquals(settings:get('logsize', GW_MODE_CHARACTER), 1024)

settings:set('mode', GW_MODE_CHARACTER)
lu.assertEquals(settings:get('mode'), GW_MODE_CHARACTER)

lu.assertEquals(settings:get('tag'), true)
lu.assertEquals(settings:get('achievements'), true)
lu.assertEquals(settings:get('logsize'), 1024)

lu.assertEquals(settings:get('tag', GW_MODE_ACCOUNT), false)
lu.assertEquals(settings:get('achievements', GW_MODE_ACCOUNT), false)
lu.assertEquals(settings:get('logsize', GW_MODE_ACCOUNT), 2048)
end

Expand Down

0 comments on commit 5f8defe

Please sign in to comment.