mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #24 from FlightControl-Master/Add-variable-parameters-to-Alive-function-for-CLIENTS
Add variable parameters to alive function for clients
This commit is contained in:
commit
92bf378a1c
@ -7533,11 +7533,12 @@ end
|
||||
-- @param #CLIENT self
|
||||
-- @param #function CallBack Function.
|
||||
-- @return #CLIENT
|
||||
function CLIENT:Alive( CallBack )
|
||||
function CLIENT:Alive( CallBack, ... )
|
||||
self:F()
|
||||
|
||||
self.ClientAlive2 = false
|
||||
self.ClientCallBack = CallBack
|
||||
self.ClientParameters = arg
|
||||
self.AliveCheckScheduler = routines.scheduleFunction( self._AliveCheckScheduler, { self }, timer.getTime() + 1, 5 )
|
||||
|
||||
return self
|
||||
@ -7592,7 +7593,7 @@ function CLIENT:_AliveCheckScheduler()
|
||||
if self:IsAlive() then
|
||||
if self.ClientAlive2 == false then
|
||||
self:T("Calling Callback function")
|
||||
self.ClientCallBack( self )
|
||||
self.ClientCallBack( self, unpack( self.ClientParameters ) )
|
||||
self.ClientAlive2 = true
|
||||
end
|
||||
else
|
||||
|
||||
@ -91,11 +91,12 @@ end
|
||||
-- @param #CLIENT self
|
||||
-- @param #function CallBack Function.
|
||||
-- @return #CLIENT
|
||||
function CLIENT:Alive( CallBack )
|
||||
function CLIENT:Alive( CallBack, ... )
|
||||
self:F()
|
||||
|
||||
self.ClientAlive2 = false
|
||||
self.ClientCallBack = CallBack
|
||||
self.ClientParameters = arg
|
||||
self.AliveCheckScheduler = routines.scheduleFunction( self._AliveCheckScheduler, { self }, timer.getTime() + 1, 5 )
|
||||
|
||||
return self
|
||||
@ -150,7 +151,7 @@ function CLIENT:_AliveCheckScheduler()
|
||||
if self:IsAlive() then
|
||||
if self.ClientAlive2 == false then
|
||||
self:T("Calling Callback function")
|
||||
self.ClientCallBack( self )
|
||||
self.ClientCallBack( self, unpack( self.ClientParameters ) )
|
||||
self.ClientAlive2 = true
|
||||
end
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user