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