5 - Guild blacklist and auto kick
What steps will reproduce the problem?
1. Install addon
2. Doesn't warn on blacklisted guild member and doesn't autokick.
Here's patch file to fix it:
Index: BlackList.lua =================================================================== @@ -339,30 +339,48 @@ return; end - if (event == "GUILD_ROSTER_UPDATE" and IsInGuild() ~= nil) then + if (event == "GUILD_ROSTER_UPDATE" and IsInGuild() == 1) then local bootNum = 0; for i = 0, GetNumGuildMembers(), 1 do - local name, rank, rankIndex, level, classLocale, zone, note, officernote, online, status, class = GetGuildRosterInfo(i); + local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(i); -- check for blacklist if (BlackList:GetIndexByName(name) > 0) then local player = BlackList:GetPlayerByIndex(BlackList:GetIndexByName(name)); - -- warn player - if (player["warn"]) then - local alreadywarned = false; - for warnedname, timepassed in pairs(Already_Warned_For["GUILD_ROSTER"]) do - if ((name == warnedname) and (GetTime() < timepassed+10)) then - alreadywarned = true; + -- warn player + if (player["warn"]) then + local alreadywarned = false; + for warnedname, timepassed in pairs(Already_Warned_For["TARGET"]) do + if ((name == warnedname) and (GetTime() < timepassed+10)) then + alreadywarned = true; + end + end + + if (not alreadywarned) then + Already_Warned_For["TARGET"][name]=GetTime(); + BlackList:AddSound(); + BlackList:AddErrorMessage(name .. " is on your Black List (GUILD)", "red", 5); + if(player["reason"] ~= "") then + BlackList:AddMessage(name .. " is on your Black List and in your GUILD, reason for blacklist: " .. player["reason"], "red"); + else + BlackList:AddMessage(name .. " is on your Black List and in your GUILD", "red"); + end + + -- auto kick from guild + if (CanGuildRemove() and BlackList:GetIndexByName(name) > 0) then + GuildUninvite(name); + if player["reason"] ~= "" then + local bannedmsg = name .. " has been banned from the Guild for: " .. player["reason"] .. ". Do not reinvite!"; + SendChatMessage(bannedmsg,"GUILD",nil,index); + else + local bannedmsg = name .. " has been banned from the Guild. Do not reinvite!"; + SendChatMessage(bannedmsg,"GUILD",nil,index); end + if (online ~= nil) then SendChatMessage("You have been banned from the guild for life. Please do not join again!","WHISPER",nil,name); end end - if (not alreadywarned) then - Already_Warned_For["GUILD_ROSTER"][name]=GetTime()+300; - BlackList:AddSound(); - BlackList:UpdateDetails(name, nil, nil, level, class, nil); - BlackList:AddMessage(name .. " is on your Black List and is in your GUILD", "red"); - end end + end end end return;
| User | When | Change |
|---|---|---|
| DjRicko | Mar 08, 2011 at 00:28 UTC | Changed description:[code] Index: BlackList.lua =================================================================== - --- BlackList.lua (revision 46) - +++ BlackList.lua (working copy) @@ -339,30 +339,48 @@ return; end ---------------------------------------- end end return; - [/code] |
| DjRicko | Mar 08, 2011 at 00:27 UTC | Create |
Facts
- Last updated
- Mar 08, 2011
- Reported
- Mar 08, 2011
- Status
- New - Issue has not had initial review yet.
- Type
- Defect - A shortcoming, fault, or imperfection
- Priority
- Medium - Normal priority.
- Votes
- 0