mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Fixed rank:print()
This commit is contained in:
@@ -218,14 +218,15 @@ function Ranking._rank:print(rtn)
|
||||
else
|
||||
-- using threads to make less lag
|
||||
local thread = Server.new_thread{data={rank=self,rtn=rtn}}
|
||||
thread.on_event('resolve',function(thread)
|
||||
return self.data:get_players(true)
|
||||
thread:on_event('resolve',function(thread)
|
||||
return thread.data.rank:get_players(true)
|
||||
end)
|
||||
thread.on_event('success',function(thread,players)
|
||||
thread:on_event('success',function(thread,players)
|
||||
for _,player in pairs(players) do
|
||||
player_return(rtn,player)
|
||||
player_return(thread.data.rtn,player)
|
||||
end
|
||||
end)
|
||||
thread:queue()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -203,6 +203,12 @@ function Server._thread:create(obj)
|
||||
return obj
|
||||
end
|
||||
|
||||
-- see Server.queue_thread - this just opens it first
|
||||
function Server._thread:queue()
|
||||
self:open()
|
||||
return Server.queue_thread(self)
|
||||
end
|
||||
|
||||
--- Test if the thread has all requied parts
|
||||
-- @usage if thread:valid() then end
|
||||
-- @tparam bolean skip_location_check true to skip the location check
|
||||
@@ -291,7 +297,7 @@ function Server._thread:resolve(...)
|
||||
Server.interface(function(thread,err)
|
||||
local success,err = pcall(thread._success,thread,err)
|
||||
if not success then thread:error(err) end
|
||||
end,true,err)
|
||||
end,true,self,err)
|
||||
_return = true
|
||||
end
|
||||
else
|
||||
|
||||
@@ -491,7 +491,7 @@ end
|
||||
function table.autokey(tbl,str)
|
||||
local _return = {}
|
||||
for key,value in pairs(tbl) do
|
||||
if string.contains(string.lower(str),string.lower(key)) then table.insert(_return,value) end
|
||||
if string.contains(string.lower(key),string.lower(str)) then table.insert(_return,value) end
|
||||
end
|
||||
return _return[1] or false
|
||||
end
|
||||
Reference in New Issue
Block a user