mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#PLAYERTASK
* Remove client from task, even if only player name is available
This commit is contained in:
parent
07851f449a
commit
d7788a2a2e
@ -21,7 +21,7 @@
|
|||||||
-- ===
|
-- ===
|
||||||
-- @module Ops.PlayerTask
|
-- @module Ops.PlayerTask
|
||||||
-- @image OPS_PlayerTask.jpg
|
-- @image OPS_PlayerTask.jpg
|
||||||
-- @date Last Update Sept 2023
|
-- @date Last Update Oct 2023
|
||||||
|
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -98,7 +98,7 @@ PLAYERTASK = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASK.version="0.1.20"
|
PLAYERTASK.version="0.1.21"
|
||||||
|
|
||||||
--- Generic task condition.
|
--- Generic task condition.
|
||||||
-- @type PLAYERTASK.Condition
|
-- @type PLAYERTASK.Condition
|
||||||
@ -470,10 +470,11 @@ end
|
|||||||
--- [User] Remove a client from this task
|
--- [User] Remove a client from this task
|
||||||
-- @param #PLAYERTASK self
|
-- @param #PLAYERTASK self
|
||||||
-- @param Wrapper.Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
|
-- @param #string Name Name of the client
|
||||||
-- @return #PLAYERTASK self
|
-- @return #PLAYERTASK self
|
||||||
function PLAYERTASK:RemoveClient(Client)
|
function PLAYERTASK:RemoveClient(Client,Name)
|
||||||
self:T(self.lid.."RemoveClient")
|
self:T(self.lid.."RemoveClient")
|
||||||
local name = Client:GetPlayerName()
|
local name = Name or Client:GetPlayerName()
|
||||||
if self.Clients:HasUniqueID(name) then
|
if self.Clients:HasUniqueID(name) then
|
||||||
self.Clients:PullByID(name)
|
self.Clients:PullByID(name)
|
||||||
if self.verbose then
|
if self.verbose then
|
||||||
@ -1551,7 +1552,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASKCONTROLLER.version="0.1.61"
|
PLAYERTASKCONTROLLER.version="0.1.62"
|
||||||
|
|
||||||
--- Create and run a new TASKCONTROLLER instance.
|
--- Create and run a new TASKCONTROLLER instance.
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
@ -2186,6 +2187,10 @@ function PLAYERTASKCONTROLLER:_EventHandler(EventData)
|
|||||||
task:RemoveClient(Client)
|
task:RemoveClient(Client)
|
||||||
--text = "Task aborted!"
|
--text = "Task aborted!"
|
||||||
text = self.gettext:GetEntry("TASKABORT",self.locale)
|
text = self.gettext:GetEntry("TASKABORT",self.locale)
|
||||||
|
else
|
||||||
|
task:RemoveClient(nil,EventData.IniPlayerName)
|
||||||
|
--text = "Task aborted!"
|
||||||
|
text = self.gettext:GetEntry("TASKABORT",self.locale)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--text = "No active task!"
|
--text = "No active task!"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user