Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mrogaski committed Aug 2, 2014
2 parents 4bd53ba + 1eed32e commit 58aafd5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Guild chat bridging for WildStar.
Distribution
------------

This WildStar addon is currently available on GitHub.
This WildStar addon source, feature requests, and bug reporting is hosted on [GitHub](https://github.com/AIE-Guild/WsGreenWall).

[https://github.com/AIE-Guild/WsGreenWall](https://github.com/AIE-Guild/WsGreenWall)
The latest version can also be found on [Curse Gaming](http://www.curse.com/ws-addons/wildstar/222578-wsgreenwall).


Glossary
Expand Down
33 changes: 28 additions & 5 deletions WsGreenWall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ require "os"
local Salsa20 = nil
local SHA256 = nil
local Base64 = nil


------------------------------------------------------------------------------
-- WsGreenWall Module Definition
Expand Down Expand Up @@ -459,18 +460,40 @@ function WsGreenWall:TransmogrifyMessage(tMessage, f)
for k, v in pairs(clone) do
if k == "arMessageSegments" then
local t = {}
for i, segment in ipairs(v) do
t[i] = segment.strText
for i, tSegment in ipairs(v) do
t[i] = tSegment.strText
end
t = f(t)
for i, segment in ipairs(v) do
segment.strText = t[i]
for i, tSegment in ipairs(v) do
tSegment.strText = t[i]
end
end
end
return clone
end

function WsGreenWall:FlattenMessage(tMessage)
local clone = DeepCopy(tMessage)
for k, v in pairs(clone) do
if k == "arMessageSegments" then
local t = {}
for i, tSegment in ipairs(v) do
if tSegment.uItem then
tSegment.strText = String_GetWeaselString(Apollo.GetString("CRB_Brackets"), tSegment.uItem:GetName())
tSegment.uItem = nil
elseif tSegment.uQuest then
tSegment.strText = String_GetWeaselString(Apollo.GetString("CRB_Brackets"), tSegment.uQuest:GetTitle())
tSegment.uQuest = nil
elseif tSegment.uArchiveArticle then
tSegment.strText = String_GetWeaselString(Apollo.GetString("CRB_Brackets"), tSegment.uArchiveArticle:GetTitle())
tSegment.uArchiveArticle = nil
end
end
end
end
return clone
end

local function MapElem(t, f)
local z = {}
for i, v in ipairs(t) do
Expand Down Expand Up @@ -535,7 +558,7 @@ function WsGreenWall:EncryptMessage(tMessage, key, nonce)
return MapElem(Salsa20.encrypt_table(key, nonce, t, 8), Base64.encode)
end
self:Debug("encrypting with key=%s, nonce=%s", Str2Hex(key), Str2Hex(nonce))
return self:TransmogrifyMessage(tMessage, f)
return self:TransmogrifyMessage(self:FlattenMessage(tMessage), f)
end

function WsGreenWall:DecryptMessage(tMessage, key, nonce)
Expand Down
2 changes: 1 addition & 1 deletion toc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.
-->
<?xml version="1.0" encoding="UTF-8"?>
<Addon Author="Mark Rogaski" APIVersion="9" Name="WsGreenWall" Version="1.0.1" Description="Guild chat bridging for WildStar.">
<Addon Author="Mark Rogaski" APIVersion="9" Name="WsGreenWall" Version="1.0.2" Description="Guild chat bridging for WildStar.">
<Script Name="WsGreenWall.lua"/>
<Form Name="WsGreenWall.xml"/>
<Script Name="Libs\Base64.lua"/>
Expand Down

0 comments on commit 58aafd5

Please sign in to comment.