Thread Tools Display Modes
Prev Previous Post   Next Post Next
06/27/18, 06:04 PM   #1
ziggr
 
ziggr's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 27
GuildDemote() loop --> Error 307 Kicked from Server

Even with a 5-second zo_callLater() delay between calls, attempting any automation of guild ranks leads to the dreaded kick from server for message spam, followed by "Error 307 Booted from server" for ten minutes.

Is this API even callable at all? If a 5-second delay still triggers the ban, I'm not about to attempt it again even with 10 seconds between calls. How does the UI itself avoid a ban (because I could certainly manually promote/demote more than 1 player every 5 seconds).

I've got a couple dozen promotions/demotions pending in my 500-member guild, and not about to spend hours doing them manually.

--Z

Lua Code:
  1. function ZZGuildRank.DoSome()
  2.     self = ZZGuildRank
  3.     local i = #self.queue
  4.     assert(0 < i)
  5.     local record_str  = table.remove(self.queue,i)
  6.     local w           = split(record_str, "\t")
  7.     local want_rank   = tonumber(w[1])
  8.     local player_name = w[2]
  9.     self:SetRank(player_name, want_rank, i)
  10.     self:DoSomeLater()
  11. end
  12.  
  13. function ZZGuildRank:DoSomeLater()
  14.     if #self.queue <= 0 then
  15.         d("ZZGuildRank: Done.")
  16.         return
  17.     end
  18.                     -- 500, 1000, even 5000 too fast!
  19.                     -- cause server kick, dreaded
  20.                     -- "Error 307 Booted from Server" 15-minute softban
  21.     zo_callLater(function() ZZGuildRank.DoSome() end, 10 * 1000)
  22. end
  23.  
  24.  
  25. function ZZGuildRank:SetRank(player_name, want_rank, queue_index)
  26.     local member_info = self.guild[player_name]
  27.     if not member_info then
  28.         d("ZZGuildRank: not a member:"..player_name)
  29.         return
  30.     end
  31.     if member_info.curr_rank_index == want_rank then
  32.         d("ZZGuildRank: already rank "..tostring(want_rank).." "..player_name)
  33.         return
  34.     end
  35.  
  36.     local step = 1
  37.     local func = GuildDemote
  38.     if want_rank < member_info.curr_rank_index then
  39.         step = -1
  40.         func = GuildPromote
  41.     end
  42.  
  43.     for rank = member_info.curr_rank_index+step, want_rank, step do
  44.         d(string.format("|ceeeeee%d: rank:%d %s|r",queue_index, rank, player_name))
  45.         func(GUILD_INDEX, player_name)
  46.     end
  47. end

Last edited by ziggr : 06/27/18 at 10:31 PM.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » GuildDemote() loop --> Error 307 Kicked from Server


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off