mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
General Addidions to help fix a known desync
This commit is contained in:
@@ -44,7 +44,7 @@ Event.register(-1,function(event)
|
||||
if not data.high_rank or not data.low_rank
|
||||
or not data.low then self.reopen = false return end
|
||||
-- idk but this stoped working for no appent reason so i added more checks for nil values
|
||||
if Ranking.get_rank(player) and Ranking.get_rank(player).power <= Ranking.get_rank(data.low_rank).power then return end
|
||||
if Ranking.get_rank(player).power <= Ranking.get_rank(data.low_rank).power then return end
|
||||
for _,message in pairs(data.low) do
|
||||
player_return({'chat-bot.message',message},nil,player)
|
||||
end
|
||||
|
||||
@@ -16,7 +16,8 @@ local function _polls(reset)
|
||||
return global.addons.polls
|
||||
end
|
||||
|
||||
local function _poll_end(uuid)
|
||||
local function _poll_end(self)
|
||||
local uuid = self.data.poll_uuid
|
||||
local poll = _polls().active[uuid]
|
||||
if not poll then return end
|
||||
local highest = {nil,-1}
|
||||
@@ -48,10 +49,8 @@ local function _poll_data(question,answers)
|
||||
Server.new_thread{
|
||||
data={poll_uuid=poll.uuid},
|
||||
timeout=poll_time_out*60
|
||||
}:on_event('timeout',function(self)
|
||||
local uuid = self.data.poll_uuid
|
||||
_poll_end(uuid)
|
||||
end):open()
|
||||
}:on_event('timeout',_poll_end):open()
|
||||
-- this time out is knowen to cause desyncs and so i have moved it to a hard coded function
|
||||
_polls().active[poll.uuid]=poll
|
||||
return poll.uuid
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user