mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
PLAYERTASK - debugging
This commit is contained in:
parent
d060c7535a
commit
c74a14fcb0
@ -28,7 +28,7 @@
|
|||||||
-- @field #number PlayerTaskNr (Globally unique) Number of the task.
|
-- @field #number PlayerTaskNr (Globally unique) Number of the task.
|
||||||
-- @field Ops.Auftrag#AUFTRAG.Type Type The type of the task
|
-- @field Ops.Auftrag#AUFTRAG.Type Type The type of the task
|
||||||
-- @field Ops.Target#TARGET Target The target for this Task
|
-- @field Ops.Target#TARGET Target The target for this Task
|
||||||
-- @field Utilities.FiFo#FIFO Clients Table of Wrapper.Client#CLIENT planes executing this task
|
-- @field Utilities.FiFo#FIFO Clients FiFo of Wrapper.Client#CLIENT planes executing this task
|
||||||
-- @field #boolean Repeat
|
-- @field #boolean Repeat
|
||||||
-- @field #number repeats
|
-- @field #number repeats
|
||||||
-- @field #number RepeatNo
|
-- @field #number RepeatNo
|
||||||
@ -67,7 +67,7 @@ PLAYERTASK = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASK.version="0.0.5"
|
PLAYERTASK.version="0.0.6"
|
||||||
|
|
||||||
--- Generic task condition.
|
--- Generic task condition.
|
||||||
-- @type PLAYERTASK.Condition
|
-- @type PLAYERTASK.Condition
|
||||||
@ -170,7 +170,7 @@ end
|
|||||||
-- @return #PLAYERTASK self
|
-- @return #PLAYERTASK self
|
||||||
function PLAYERTASK:AddClient(Client)
|
function PLAYERTASK:AddClient(Client)
|
||||||
self:I(self.lid.."AddClient")
|
self:I(self.lid.."AddClient")
|
||||||
local name = Client:GetName()
|
local name = Client:GetPlayerName()
|
||||||
if not self.Clients:HasUniqueID(name) then
|
if not self.Clients:HasUniqueID(name) then
|
||||||
self.Clients:Push(Client,name)
|
self.Clients:Push(Client,name)
|
||||||
self:__ClientAdded(-2,Client)
|
self:__ClientAdded(-2,Client)
|
||||||
@ -184,7 +184,7 @@ end
|
|||||||
-- @return #PLAYERTASK self
|
-- @return #PLAYERTASK self
|
||||||
function PLAYERTASK:RemoveClient(Client)
|
function PLAYERTASK:RemoveClient(Client)
|
||||||
self:I(self.lid.."RemoveClient")
|
self:I(self.lid.."RemoveClient")
|
||||||
local name = Client:GetName()
|
local name = Client:GetPlayerName()
|
||||||
if self.Clients:HasUniqueID(name) then
|
if self.Clients:HasUniqueID(name) then
|
||||||
self.Clients:PullByID(name)
|
self.Clients:PullByID(name)
|
||||||
self:__ClientRemoved(-2,Client)
|
self:__ClientRemoved(-2,Client)
|
||||||
@ -201,7 +201,6 @@ end
|
|||||||
-- @return #PLAYERTASK self
|
-- @return #PLAYERTASK self
|
||||||
function PLAYERTASK:ClientAbort(Client)
|
function PLAYERTASK:ClientAbort(Client)
|
||||||
self:I(self.lid.."ClientAbort")
|
self:I(self.lid.."ClientAbort")
|
||||||
local name = Client:GetName()
|
|
||||||
if Client and Client:IsAlive() then
|
if Client and Client:IsAlive() then
|
||||||
self:RemoveClient(Client)
|
self:RemoveClient(Client)
|
||||||
self:__ClientAborted(-1,Client)
|
self:__ClientAborted(-1,Client)
|
||||||
@ -580,7 +579,7 @@ PLAYERTASKCONTROLLER.Type = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASKCONTROLLER.version="0.0.3"
|
PLAYERTASKCONTROLLER.version="0.0.4"
|
||||||
|
|
||||||
--- Constructor
|
--- Constructor
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
@ -718,12 +717,14 @@ function PLAYERTASKCONTROLLER:_CheckTaskQueue()
|
|||||||
local data = _entry.data -- Ops.PlayerTask#PLAYERTASK
|
local data = _entry.data -- Ops.PlayerTask#PLAYERTASK
|
||||||
self:I("Looking at Task: "..data.PlayerTaskNr.." Type: "..data.Type.." State: "..data:GetState())
|
self:I("Looking at Task: "..data.PlayerTaskNr.." Type: "..data.Type.." State: "..data:GetState())
|
||||||
if data:GetState() == "Done" or data:GetState() == "Stopped" then
|
if data:GetState() == "Done" or data:GetState() == "Stopped" then
|
||||||
local task = self.TaskQueue:PullByID(_id) -- Ops.PlayerTask#PLAYERTASK
|
local task = self.TaskQueue:ReadByID(_id) -- Ops.PlayerTask#PLAYERTASK
|
||||||
-- TODO: Remove clients from the task
|
-- TODO: Remove clients from the task
|
||||||
local clientsattask = task.Clients:GetIDStackSorted()
|
local clientsattask = task.Clients:GetIDStackSorted()
|
||||||
for _,_id in pairs(clientsattask) do
|
for _,_id in pairs(clientsattask) do
|
||||||
|
self:I("*****Removing player " .. _id)
|
||||||
self.TasksPerPlayer:PullByID(_id)
|
self.TasksPerPlayer:PullByID(_id)
|
||||||
end
|
end
|
||||||
|
local task = self.TaskQueue:PullByID(_id) -- Ops.PlayerTask#PLAYERTASK
|
||||||
task = nil
|
task = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -995,6 +996,7 @@ function PLAYERTASKCONTROLLER:_BuildMenus()
|
|||||||
_task.TaskMenu = taskentry
|
_task.TaskMenu = taskentry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
join:Refresh()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user