[1.6.5] Officer note parsing
lelzj opened this issue · 2 comments
Ok so I uncovered two apparent issues in the greenwall addon for 6.2.
- The parsing of get_gm_officer_note() in Config.lua is matching incorrectly. I tested this with https://regex101.com/
The matching should be: local cname, cpass = string.match(note, 'GWa:?([a-zA-Z0-9_]):([a-zA-Z0-9]_)') - get_gm_officer_note() isn’t assigning data correctly according to the http://wowwiki.wikia.com/API_GetGuildRosterInfo page. Equally important is the fact that it’s returning note instead of officernote.
It should be name, rank, _, _, _, _, _, officernote = GetGuildRosterInfo(i); followed by return officernote;
I've read your suggestions and it appears that the existing code is correct.
The regex101.com tool doesn't validate Lua patterns. I would argue that this is for the best since Lua patterns don't support alternation and shouldn't be considered regular expressions.
The Lua [%w_]
character class will match all alphanumeric characters and the underscore. We also have to include the Kleene stars so we can have channel names and password longer than one character and an optional colon after the GW for pre-1.3 compatibility.
I don't see an issue with the return values from GetGuildRosterInfo we're using in the current code, either. We're interested in the rank index rather than the rank name so we use the return values # 1, 3, and 8.
name, _, rank, _, _, _, _, note = GetGuildRosterInfo(i);