Merge branch 'FC/AirbasePolice'

# Conflicts:
#	Moose Development/Moose/Functional/ATC_Ground.lua
#	docs/Documentation/AirbasePolice.html
This commit is contained in:
FlightControl_Master
2017-10-26 11:16:04 +02:00
8 changed files with 275 additions and 203 deletions

View File

@@ -1,4 +1,4 @@
--- **Functional** -- The AIRBASEPOLICE classes monitor airbase traffic and regulate speed while taxiing. --- **Functional** -- The ATC_GROUND classes monitor airbase traffic and regulate speed while taxiing.
-- --
-- === -- ===
-- --
@@ -7,34 +7,34 @@
-- --
-- === -- ===
-- --
-- @module AirbasePolice -- @module ATC_Ground
--- @type AIRBASEPOLICE_BASE --- @type ATC_GROUND
-- @field Core.Set#SET_CLIENT SetClient -- @field Core.Set#SET_CLIENT SetClient
-- @extends Core.Base#BASE -- @extends Core.Base#BASE
--- Base class for AIRBASEPOLICE implementations. --- Base class for ATC_GROUND implementations.
-- @field #AIRBASEPOLICE_BASE -- @field #ATC_GROUND
AIRBASEPOLICE_BASE = { ATC_GROUND = {
ClassName = "AIRBASEPOLICE_BASE", ClassName = "ATC_GROUND",
SetClient = nil, SetClient = nil,
Airbases = nil, Airbases = nil,
AirbaseNames = nil, AirbaseNames = nil,
} }
--- @type AIRBASEPOLICE_BASE.AirbaseNames --- @type ATC_GROUND.AirbaseNames
-- @list <#string> -- @list <#string>
--- Creates a new AIRBASEPOLICE_BASE object. --- Creates a new ATC_GROUND object.
-- @param #AIRBASEPOLICE_BASE self -- @param #ATC_GROUND self
-- @param Airbases A table of Airbase Names. -- @param Airbases A table of Airbase Names.
-- @return #AIRBASEPOLICE_BASE self -- @return #ATC_GROUND self
function AIRBASEPOLICE_BASE:New( Airbases, AirbaseList ) function ATC_GROUND:New( Airbases, AirbaseList )
-- Inherits from BASE -- Inherits from BASE
local self = BASE:Inherit( self, BASE:New() ) -- #AIRBASEPOLICE_BASE local self = BASE:Inherit( self, BASE:New() ) -- #ATC_GROUND
self:E( { self.ClassName, Airbases } ) self:E( { self.ClassName, Airbases } )
self.Airbases = Airbases self.Airbases = Airbases
@@ -88,10 +88,10 @@ end
--- Smoke the airbases runways. --- Smoke the airbases runways.
-- @param #AIRBASEPOLICE_BASE self -- @param #ATC_GROUND self
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The color of the smoke around the runways. -- @param Utilities.Utils#SMOKECOLOR SmokeColor The color of the smoke around the runways.
-- @return #AIRBASEPOLICE_BASE self -- @return #ATC_GROUND self
function AIRBASEPOLICE_BASE:SmokeRunways( SmokeColor ) function ATC_GROUND:SmokeRunways( SmokeColor )
for AirbaseID, Airbase in pairs( self.Airbases ) do for AirbaseID, Airbase in pairs( self.Airbases ) do
for PointsRunwayID, PointsRunway in pairs( Airbase.PointsRunways ) do for PointsRunwayID, PointsRunway in pairs( Airbase.PointsRunways ) do
@@ -102,27 +102,27 @@ end
--- Set the maximum speed in Kmph until the player gets kicked. --- Set the maximum speed in Kmph until the player gets kicked.
-- @param #AIRBASEPOLICE_BASE self -- @param #ATC_GROUND self
-- @param #number KickSpeed Set the maximum speed in Kmph until the player gets kicked. -- @param #number KickSpeed Set the maximum speed in Kmph until the player gets kicked.
-- @return #AIRBASEPOLICE_BASE self -- @return #ATC_GROUND self
function AIRBASEPOLICE_BASE:SetKickSpeedKmph( KickSpeed ) function ATC_GROUND:SetKickSpeedKmph( KickSpeed )
self.KickSpeed = UTILS.KmphToMps( KickSpeed ) self.KickSpeed = UTILS.KmphToMps( KickSpeed )
end end
--- Set the maximum speed in Miph until the player gets kicked. --- Set the maximum speed in Miph until the player gets kicked.
-- @param #AIRBASEPOLICE_BASE self -- @param #ATC_GROUND self
-- @param #number KickSpeedMiph Set the maximum speed in Mph until the player gets kicked. -- @param #number KickSpeedMiph Set the maximum speed in Mph until the player gets kicked.
-- @return #AIRBASEPOLICE_BASE self -- @return #ATC_GROUND self
function AIRBASEPOLICE_BASE:SetKickSpeedMiph( KickSpeedMiph ) function ATC_GROUND:SetKickSpeedMiph( KickSpeedMiph )
self.KickSpeed = UTILS.MiphToMps( KickSpeedMiph ) self.KickSpeed = UTILS.MiphToMps( KickSpeedMiph )
end end
--- @param #AIRBASEPOLICE_BASE self --- @param #ATC_GROUND self
function AIRBASEPOLICE_BASE:_AirbaseMonitor() function ATC_GROUND:_AirbaseMonitor()
self:E( "In Scheduler") self:E( "In Scheduler")
@@ -144,94 +144,96 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
NotInRunwayZone = ( Client:IsNotInZone( ZoneRunway ) == true ) and NotInRunwayZone or false NotInRunwayZone = ( Client:IsNotInZone( ZoneRunway ) == true ) and NotInRunwayZone or false
end end
local IsOnGround = Client:InAir() == false
if NotInRunwayZone then if NotInRunwayZone then
local Taxi = Client:GetState( self, "Taxi" )
self:E( Taxi )
if Taxi == false then
Client:Message( "Welcome at " .. AirbaseID .. ". The maximum taxiing speed is " .. AirbaseMeta.MaximumSpeed .. " km/h.", 20, "ATC" )
Client:SetState( self, "Taxi", true )
end
-- TODO: GetVelocityKMH function usage
local Velocity = VELOCITY_POSITIONABLE:New( Client )
--MESSAGE:New( "Velocity = " .. Velocity:ToString(), 1 ):ToAll()
local IsAboveRunway = Client:IsAboveRunway()
local IsOnGround = Client:InAir() == false
self:T( IsAboveRunway, IsOnGround )
if IsOnGround then if IsOnGround then
if Velocity:Get() > self.KickSpeed then local Taxi = Client:GetState( self, "Taxi" )
MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() .. " is kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll() self:E( Taxi )
Client:Destroy() if Taxi == false then
Client:SetState( self, "Speeding", false ) Client:Message( "Welcome at " .. AirbaseID .. ". The maximum taxiing speed is " .. AirbaseMeta.MaximumSpeed .. " km/h.", 20, "ATC" )
Client:SetState( self, "Warnings", 0 ) Client:SetState( self, "Taxi", true )
end
-- TODO: GetVelocityKMH function usage
local Velocity = VELOCITY_POSITIONABLE:New( Client )
--MESSAGE:New( "Velocity = " .. Velocity:ToString(), 1 ):ToAll()
local IsAboveRunway = Client:IsAboveRunway()
self:T( IsAboveRunway, IsOnGround )
if IsOnGround then
if Velocity:Get() > self.KickSpeed then
MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() .. " is kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll()
Client:Destroy()
Client:SetState( self, "Speeding", false )
Client:SetState( self, "Warnings", 0 )
end
end
if IsOnGround then
if Velocity:GetKmph() > AirbaseMeta.MaximumSpeed then
local IsSpeeding = Client:GetState( self, "Speeding" )
if IsSpeeding == true then
local SpeedingWarnings = Client:GetState( self, "Warnings" )
self:T( SpeedingWarnings )
if SpeedingWarnings <= 3 then
Client:Message( "Warning " .. SpeedingWarnings .. "/3! Airbase traffic rule violation! Slow down now! Your speed is " ..
string.format( "%s", Velocity:ToString() ), 5, "ATC" )
Client:SetState( self, "Warnings", SpeedingWarnings + 1 )
else
MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() .. " is kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll()
--- @param Wrapper.Client#CLIENT Client
Client:Destroy()
Client:SetState( self, "Speeding", false )
Client:SetState( self, "Warnings", 0 )
end
else
Client:Message( "Attention! You are speeding on the taxiway, slow down! Your speed is " .. string.format( "%s", Velocity:ToString() ), 5, "ATC" )
Client:SetState( self, "Speeding", true )
Client:SetState( self, "Warnings", 1 )
end
else
Client:SetState( self, "Speeding", false )
Client:SetState( self, "Warnings", 0 )
end
end end
end
if IsOnGround then if IsOnGround and not IsAboveRunway then
if Velocity:GetKmph() > AirbaseMeta.MaximumSpeed then local IsOffRunway = Client:GetState( self, "IsOffRunway" )
local IsSpeeding = Client:GetState( self, "Speeding" )
if IsOffRunway == true then
if IsSpeeding == true then local OffRunwayWarnings = Client:GetState( self, "OffRunwayWarnings" )
local SpeedingWarnings = Client:GetState( self, "Warnings" ) self:T( OffRunwayWarnings )
self:T( SpeedingWarnings )
if OffRunwayWarnings <= 3 then
if SpeedingWarnings <= 3 then Client:Message( "Warning " .. OffRunwayWarnings .. "/3! Airbase traffic rule violation! Get back on the taxi immediately!", 5, "ATC" )
Client:Message( "Warning " .. SpeedingWarnings .. "/3! Airbase traffic rule violation! Slow down now! Your speed is " .. Client:SetState( self, "OffRunwayWarnings", OffRunwayWarnings + 1 )
string.format( "%s", Velocity:ToString() ), 5, "ATC" )
Client:SetState( self, "Warnings", SpeedingWarnings + 1 )
else else
MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() .. " is kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll() MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() .. " is kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll()
--- @param Wrapper.Client#CLIENT Client --- @param Wrapper.Client#CLIENT Client
Client:Destroy() Client:Destroy()
Client:SetState( self, "Speeding", false ) Client:SetState( self, "IsOffRunway", false )
Client:SetState( self, "Warnings", 0 ) Client:SetState( self, "OffRunwayWarnings", 0 )
end end
else else
Client:Message( "Attention! You are speeding on the taxiway, slow down! Your speed is " .. string.format( "%s", Velocity:ToString() ), 5, "ATC" ) Client:Message( "Attention! You are off the taxiway. Get back on the taxiway immediately!", 5, "ATC" )
Client:SetState( self, "Speeding", true ) Client:SetState( self, "IsOffRunway", true )
Client:SetState( self, "Warnings", 1 ) Client:SetState( self, "OffRunwayWarnings", 1 )
end end
else else
Client:SetState( self, "Speeding", false ) Client:SetState( self, "IsOffRunway", false )
Client:SetState( self, "Warnings", 0 ) Client:SetState( self, "OffRunwayWarnings", 0 )
end end
end end
if IsOnGround and not IsAboveRunway then
local IsOffRunway = Client:GetState( self, "IsOffRunway" )
if IsOffRunway == true then
local OffRunwayWarnings = Client:GetState( self, "OffRunwayWarnings" )
self:T( OffRunwayWarnings )
if OffRunwayWarnings <= 3 then
Client:Message( "Warning " .. OffRunwayWarnings .. "/3! Airbase traffic rule violation! Get back on the taxi immediately!", 5, "ATC" )
Client:SetState( self, "OffRunwayWarnings", OffRunwayWarnings + 1 )
else
MESSAGE:New( "Penalty! Player " .. Client:GetPlayerName() .. " is kicked, due to a severe airbase traffic rule violation ...", 10, "ATC" ):ToAll()
--- @param Wrapper.Client#CLIENT Client
Client:Destroy()
Client:SetState( self, "IsOffRunway", false )
Client:SetState( self, "OffRunwayWarnings", 0 )
end
else
Client:Message( "Attention! You are off the taxiway. Get back on the taxiway immediately!", 5, "ATC" )
Client:SetState( self, "IsOffRunway", true )
Client:SetState( self, "OffRunwayWarnings", 1 )
end
else
Client:SetState( self, "IsOffRunway", false )
Client:SetState( self, "OffRunwayWarnings", 0 )
end
else else
Client:SetState( self, "Speeding", false ) Client:SetState( self, "Speeding", false )
Client:SetState( self, "Warnings", 0 ) Client:SetState( self, "Warnings", 0 )
@@ -243,6 +245,8 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
Client:SetState( self, "Taxi", false ) Client:SetState( self, "Taxi", false )
end end
end end
else
Client:SetState( self, "Taxi", false )
end end
end end
) )
@@ -253,14 +257,14 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
end end
--- @type AIRBASEPOLICE_CAUCASUS --- @type ATC_GROUND_CAUCASUS
-- @extends #AIRBASEPOLICE_BASE -- @extends #ATC_GROUND
--- # AIRBASEPOLICE_CAUCASUS, extends @{#AIRBASEPOLICE_BASE} --- # ATC_GROUND_CAUCASUS, extends @{#ATC_GROUND}
-- --
-- ![Banner Image](..\Presentations\AIRBASEPOLICE\Dia1.JPG) -- ![Banner Image](..\Presentations\ATC_GROUND\Dia1.JPG)
-- --
-- The AIRBASEPOLICE_CAUCASUS class monitors the speed of the airplanes at the airbase during taxi. -- The ATC_GROUND_CAUCASUS class monitors the speed of the airplanes at the airbase during taxi.
-- The pilots may not drive faster than the maximum speed for the airbase, or they will be despawned. -- The pilots may not drive faster than the maximum speed for the airbase, or they will be despawned.
-- --
-- The maximum speed for the airbases at Caucasus is **50 km/h**. -- The maximum speed for the airbases at Caucasus is **50 km/h**.
@@ -272,44 +276,45 @@ end
-- --
-- # Airbases monitored -- # Airbases monitored
-- --
-- The following airbases are monitored at the Caucasus region: -- The following airbases are monitored at the Caucasus region.
-- Use the AIRBASE.Caucasus enumeration to select the airbases to be monitored.
-- --
-- * Anapa Vityazevo -- * ´AIRBASE.Caucasus.Anapa_Vityazevo´
-- * Batumi -- * ´AIRBASE.Caucasus.Batumi´
-- * Beslan -- * ´AIRBASE.Caucasus.Beslan´
-- * Gelendzhik -- * ´AIRBASE.Caucasus.Gelendzhik´
-- * Gudauta -- * ´AIRBASE.Caucasus.Gudauta´
-- * Kobuleti -- * ´AIRBASE.Caucasus.Kobuleti´
-- * Krasnodar Center -- * ´AIRBASE.Caucasus.Krasnodar_Center´
-- * Krasnodar Pashkovsky -- * ´AIRBASE.Caucasus.Krasnodar_Pashkovsky´
-- * Krymsk -- * ´AIRBASE.Caucasus.Krymsk´
-- * Kutaisi -- * ´AIRBASE.Caucasus.Kutaisi´
-- * Maykop Khanskaya -- * ´AIRBASE.Caucasus.Maykop_Khanskaya´
-- * Mineralnye Vody -- * ´AIRBASE.Caucasus.Mineralnye_Vody´
-- * Mozdok -- * ´AIRBASE.Caucasus.Mozdok´
-- * Nalchik -- * ´AIRBASE.Caucasus.Nalchik´
-- * Novorossiysk -- * ´AIRBASE.Caucasus.Novorossiysk´
-- * Senaki Kolkhi -- * ´AIRBASE.Caucasus.Senaki_Kolkhi´
-- * Sochi Adler -- * ´AIRBASE.Caucasus.Sochi_Adler´
-- * Soganlug -- * ´AIRBASE.Caucasus.Soganlug´
-- * Sukhumi Babushara -- * ´AIRBASE.Caucasus.Sukhumi_Babushara´
-- * Tbilisi Lochini -- * ´AIRBASE.Caucasus.Tbilisi_Lochini´
-- * Vaziani -- * ´AIRBASE.Caucasus.Vaziani´
-- --
-- --
-- # Installation -- # Installation
-- --
-- ## In Single Player Missions -- ## In Single Player Missions
-- --
-- AIRBASEPOLICE is fully functional in single player. -- ATC_GROUND is fully functional in single player.
-- --
-- ## In Multi Player Missions -- ## In Multi Player Missions
-- --
-- AIRBASEPOLICE is NOT functional in multi player, for client machines connecting to the server, running the mission. -- ATC_GROUND is NOT functional in multi player, for client machines connecting to the server, running the mission.
-- Due to a bug in DCS since release 1.5, the despawning of clients are not anymore working in multi player. -- Due to a bug in DCS since release 1.5, the despawning of clients are not anymore working in multi player.
-- To work around this problem, a much better solution has been made, using the slot blocker script designed -- To work around this problem, a much better solution has been made, using the slot blocker script designed
-- by Ciribob. With the help of __Ciribob__, this script has been extended to also kick client players while in flight. -- by Ciribob. With the help of __Ciribob__, this script has been extended to also kick client players while in flight.
-- AIRBASEPOLICE is communicating with this modified script to kick players! -- ATC_GROUND is communicating with this modified script to kick players!
-- --
-- Install the file **SimpleSlotBlockGameGUI.lua** on the server, following the installation instructions described by Ciribob. -- Install the file **SimpleSlotBlockGameGUI.lua** on the server, following the installation instructions described by Ciribob.
-- --
@@ -317,18 +322,26 @@ end
-- --
-- # Script it! -- # Script it!
-- --
-- ## 1. AIRBASEPOLICE_CAUCASUS Constructor -- ## 1. ATC_GROUND_CAUCASUS Constructor
-- --
-- Creates a new AIRBASEPOLICE_CAUCASUS object that will monitor pilots taxiing behaviour. -- Creates a new ATC_GROUND_CAUCASUS object that will monitor pilots taxiing behaviour.
-- --
-- -- This creates a new AIRBASEPOLICE_CAUCASUS object. -- -- This creates a new ATC_GROUND_CAUCASUS object.
-- --
-- -- Monitor for these clients the airbases. -- -- Monitor all the airbases.
-- AirbasePoliceCaucasus = AIRBASEPOLICE_CAUCASUS:New() -- AirbasePoliceCaucasus = ATC_GROUND_CAUCASUS:New()
--
-- -- Monitor specific airbases only.
-- --
-- @field #AIRBASEPOLICE_CAUCASUS -- ATC_Ground = ATC_GROUND_CAUCASUS:New(
AIRBASEPOLICE_CAUCASUS = { -- { AIRBASE.Caucasus.Gelendzhik,
ClassName = "AIRBASEPOLICE_CAUCASUS", -- AIRBASE.Caucasus.Krymsk
-- }
-- )
--
-- @field #ATC_GROUND_CAUCASUS
ATC_GROUND_CAUCASUS = {
ClassName = "ATC_GROUND_CAUCASUS",
Airbases = { Airbases = {
[AIRBASE.Caucasus.Anapa_Vityazevo] = { [AIRBASE.Caucasus.Anapa_Vityazevo] = {
PointsRunways = { PointsRunways = {
@@ -615,14 +628,14 @@ AIRBASEPOLICE_CAUCASUS = {
}, },
} }
--- Creates a new AIRBASEPOLICE_CAUCASUS object. --- Creates a new ATC_GROUND_CAUCASUS object.
-- @param #AIRBASEPOLICE_CAUCASUS self -- @param #ATC_GROUND_CAUCASUS self
-- @param AirbaseNames A list {} of airbase names (Use AIRBASE.Caucasus enumerator). -- @param AirbaseNames A list {} of airbase names (Use AIRBASE.Caucasus enumerator).
-- @return #AIRBASEPOLICE_CAUCASUS self -- @return #ATC_GROUND_CAUCASUS self
function AIRBASEPOLICE_CAUCASUS:New( AirbaseNames ) function ATC_GROUND_CAUCASUS:New( AirbaseNames )
-- Inherits from BASE -- Inherits from BASE
local self = BASE:Inherit( self, AIRBASEPOLICE_BASE:New( self.Airbases, AirbaseNames ) ) local self = BASE:Inherit( self, ATC_GROUND:New( self.Airbases, AirbaseNames ) )
@@ -838,15 +851,15 @@ end
--- @type AIRBASEPOLICE_NEVADA --- @type ATC_GROUND_NEVADA
-- @extends #AIRBASEPOLICE_BASE -- @extends #ATC_GROUND
--- # AIRBASEPOLICE_NEVADA, extends @{#AIRBASEPOLICE_BASE} --- # ATC_GROUND_NEVADA, extends @{#ATC_GROUND}
-- --
-- ![Banner Image](..\Presentations\AIRBASEPOLICE\Dia1.JPG) -- ![Banner Image](..\Presentations\ATC_GROUND\Dia1.JPG)
-- --
-- The AIRBASEPOLICE_NEVADA class monitors the speed of the airplanes at the airbase during taxi. -- The ATC_GROUND_NEVADA class monitors the speed of the airplanes at the airbase during taxi.
-- The pilots may not drive faster than the maximum speed for the airbase, or they will be despawned. -- The pilots may not drive faster than the maximum speed for the airbase, or they will be despawned.
-- --
-- The pilot will receive 3 times a warning during speeding. After the 3rd warning, if the pilot is still driving -- The pilot will receive 3 times a warning during speeding. After the 3rd warning, if the pilot is still driving
@@ -856,27 +869,41 @@ end
-- --
-- # Airbases monitored -- # Airbases monitored
-- --
-- The following airbases are monitored at the Caucasus region: -- The following airbases are monitored at the Nevada region.
-- Use the AIRBASE.Nevada enumeration to select the airbases to be monitored.
-- --
-- * Nellis -- * `AIRBASE.Nevada.Beatty_Airport`
-- * McCarran -- * `AIRBASE.Nevada.Boulder_City_Airport`
-- * Creech -- * `AIRBASE.Nevada.Creech_AFB`
-- * GroomLake -- * `AIRBASE.Nevada.Echo_Bay`
-- -- * `AIRBASE.Nevada.Groom_Lake_AFB`
-- * `AIRBASE.Nevada.Henderson_Executive_Airport`
-- * `AIRBASE.Nevada.Jean_Airport`
-- * `AIRBASE.Nevada.Laughlin_Airport`
-- * `AIRBASE.Nevada.Lincoln_County`
-- * `AIRBASE.Nevada.McCarran_International_Airport`
-- * `AIRBASE.Nevada.Mellan_Airstrip`
-- * `AIRBASE.Nevada.Mesquite`
-- * `AIRBASE.Nevada.Mina_Airport_3Q0`
-- * `AIRBASE.Nevada.Nellis_AFB`
-- * `AIRBASE.Nevada.North_Las_Vegas`
-- * `AIRBASE.Nevada.Pahute_Mesa_Airstrip`
-- * `AIRBASE.Nevada.Tonopah_Airport`
-- * `AIRBASE.Nevada.Tonopah_Test_Range_Airfield`
-- --
-- # Installation -- # Installation
-- --
-- ## In Single Player Missions -- ## In Single Player Missions
-- --
-- AIRBASEPOLICE is fully functional in single player. -- ATC_GROUND is fully functional in single player.
-- --
-- ## In Multi Player Missions -- ## In Multi Player Missions
-- --
-- AIRBASEPOLICE is NOT functional in multi player, for client machines connecting to the server, running the mission. -- ATC_GROUND is NOT functional in multi player, for client machines connecting to the server, running the mission.
-- Due to a bug in DCS since release 1.5, the despawning of clients are not anymore working in multi player. -- Due to a bug in DCS since release 1.5, the despawning of clients are not anymore working in multi player.
-- To work around this problem, a much better solution has been made, using the slot blocker script designed -- To work around this problem, a much better solution has been made, using the slot blocker script designed
-- by Ciribob. With the help of Ciribob, this script has been extended to also kick client players while in flight. -- by Ciribob. With the help of Ciribob, this script has been extended to also kick client players while in flight.
-- AIRBASEPOLICE is communicating with this modified script to kick players! -- ATC_GROUND is communicating with this modified script to kick players!
-- --
-- Install the file **SimpleSlotBlockGameGUI.lua** on the server, following the installation instructions described by Ciribob. -- Install the file **SimpleSlotBlockGameGUI.lua** on the server, following the installation instructions described by Ciribob.
-- --
@@ -884,18 +911,29 @@ end
-- --
-- # Script it! -- # Script it!
-- --
-- ## 1. AIRBASEPOLICE_NEVADA Constructor -- ## 1. ATC_GROUND_NEVADA Constructor
-- --
-- Creates a new AIRBASEPOLICE_NEVADA object that will monitor pilots taxiing behaviour. -- Creates a new ATC_GROUND_NEVADA object that will monitor pilots taxiing behaviour.
-- --
-- -- This creates a new AIRBASEPOLICE_NEVADA object. -- -- This creates a new ATC_GROUND_NEVADA object.
-- --
-- -- Monitor for these clients the airbases. -- -- Monitor all the airbases.
-- AirbasePoliceCaucasus = AIRBASEPOLICE_NEVADA:New() -- AirbasePoliceCaucasus = ATC_GROUND_NEVADA:New()
-- --
-- @field #AIRBASEPOLICE_NEVADA --
AIRBASEPOLICE_NEVADA = { -- -- Monitor specific airbases.
ClassName = "AIRBASEPOLICE_NEVADA", -- ATC_Ground = ATC_GROUND_NEVADA:New(
-- { AIRBASE.Nevada.Laughlin_Airport,
-- AIRBASE.Nevada.Mellan_Airstrip,
-- AIRBASE.Nevada.Lincoln_County,
-- AIRBASE.Nevada.North_Las_Vegas,
-- AIRBASE.Nevada.McCarran_International_Airport
-- }
-- )
--
-- @field #ATC_GROUND_NEVADA
ATC_GROUND_NEVADA = {
ClassName = "ATC_GROUND_NEVADA",
Airbases = { Airbases = {
[AIRBASE.Nevada.Beatty_Airport] = { [AIRBASE.Nevada.Beatty_Airport] = {
@@ -1165,14 +1203,14 @@ AIRBASEPOLICE_NEVADA = {
}, },
} }
--- Creates a new AIRBASEPOLICE_NEVADA object. --- Creates a new ATC_GROUND_NEVADA object.
-- @param #AIRBASEPOLICE_NEVADA self -- @param #ATC_GROUND_NEVADA self
-- @param AirbaseNames A list {} of airbase names (Use AIRBASE.Nevada enumerator). -- @param AirbaseNames A list {} of airbase names (Use AIRBASE.Nevada enumerator).
-- @return #AIRBASEPOLICE_NEVADA self -- @return #ATC_GROUND_NEVADA self
function AIRBASEPOLICE_NEVADA:New( AirbaseNames ) function ATC_GROUND_NEVADA:New( AirbaseNames )
-- Inherits from BASE -- Inherits from BASE
local self = BASE:Inherit( self, AIRBASEPOLICE_BASE:New( self.Airbases, AirbaseNames ) ) local self = BASE:Inherit( self, ATC_GROUND:New( self.Airbases, AirbaseNames ) )
@@ -1335,15 +1373,15 @@ function AIRBASEPOLICE_NEVADA:New( AirbaseNames )
end end
--- @type AIRBASEPOLICE_NORMANDY --- @type ATC_GROUND_NORMANDY
-- @extends Functional.AirbasePolice#AIRBASEPOLICE_BASE -- @extends #ATC_GROUND
--- # AIRBASEPOLICE_NORMANDY, extends @{#AIRBASEPOLICE_BASE} --- # ATC_GROUND_NORMANDY, extends @{#ATC_GROUND}
-- --
-- ![Banner Image](..\Presentations\AIRBASEPOLICE\Dia1.JPG) -- ![Banner Image](..\Presentations\ATC_GROUND\Dia1.JPG)
-- --
-- The AIRBASEPOLICE_NORMANDY class monitors the speed of the airplanes at the airbase during taxi. -- The ATC_GROUND_NORMANDY class monitors the speed of the airplanes at the airbase during taxi.
-- The pilots may not drive faster than the maximum speed for the airbase, or they will be despawned. -- The pilots may not drive faster than the maximum speed for the airbase, or they will be despawned.
-- --
-- The pilot will receive 3 times a warning during speeding. After the 3rd warning, if the pilot is still driving -- The pilot will receive 3 times a warning during speeding. After the 3rd warning, if the pilot is still driving
@@ -1353,27 +1391,54 @@ end
-- --
-- # Airbases monitored -- # Airbases monitored
-- --
-- The following airbases are monitored at the Caucasus region: -- The following airbases are monitored at the Normandy region.
-- Use the AIRBASE.Normandy enumeration to select the airbases to be monitored.
-- --
-- * Nellis -- * ´AIRBASE.Normandy.Azeville´
-- * McCarran -- * ´AIRBASE.Normandy.Bazenville´
-- * Creech -- * ´AIRBASE.Normandy.Beny_sur_Mer´
-- * GroomLake -- * ´AIRBASE.Normandy.Beuzeville´
-- -- * ´AIRBASE.Normandy.Biniville´
-- * ´AIRBASE.Normandy.Brucheville´
-- * ´AIRBASE.Normandy.Cardonville´
-- * ´AIRBASE.Normandy.Carpiquet´
-- * ´AIRBASE.Normandy.Chailey´
-- * ´AIRBASE.Normandy.Chippelle´
-- * ´AIRBASE.Normandy.Cretteville´
-- * ´AIRBASE.Normandy.Cricqueville_en_Bessin´
-- * ´AIRBASE.Normandy.Deux_Jumeaux´
-- * ´AIRBASE.Normandy.Evreux´
-- * ´AIRBASE.Normandy.Ford´
-- * ´AIRBASE.Normandy.Funtington´
-- * ´AIRBASE.Normandy.Lantheuil´
-- * ´AIRBASE.Normandy.Le_Molay´
-- * ´AIRBASE.Normandy.Lessay´
-- * ´AIRBASE.Normandy.Lignerolles´
-- * ´AIRBASE.Normandy.Longues_sur_Mer´
-- * ´AIRBASE.Normandy.Maupertus´
-- * ´AIRBASE.Normandy.Meautis´
-- * ´AIRBASE.Normandy.Needs_Oar_Point´
-- * ´AIRBASE.Normandy.Picauville´
-- * ´AIRBASE.Normandy.Rucqueville´
-- * ´AIRBASE.Normandy.Saint_Pierre_du_Mont´
-- * ´AIRBASE.Normandy.Sainte_Croix_sur_Mer´
-- * ´AIRBASE.Normandy.Sainte_Laurent_sur_Mer´
-- * ´AIRBASE.Normandy.Sommervieu´
-- * ´AIRBASE.Normandy.Tangmere´
-- --
-- # Installation -- # Installation
-- --
-- ## In Single Player Missions -- ## In Single Player Missions
-- --
-- AIRBASEPOLICE is fully functional in single player. -- ATC_GROUND is fully functional in single player.
-- --
-- ## In Multi Player Missions -- ## In Multi Player Missions
-- --
-- AIRBASEPOLICE is NOT functional in multi player, for client machines connecting to the server, running the mission. -- ATC_GROUND is NOT functional in multi player, for client machines connecting to the server, running the mission.
-- Due to a bug in DCS since release 1.5, the despawning of clients are not anymore working in multi player. -- Due to a bug in DCS since release 1.5, the despawning of clients are not anymore working in multi player.
-- To work around this problem, a much better solution has been made, using the slot blocker script designed -- To work around this problem, a much better solution has been made, using the slot blocker script designed
-- by Ciribob. With the help of Ciribob, this script has been extended to also kick client players while in flight. -- by Ciribob. With the help of Ciribob, this script has been extended to also kick client players while in flight.
-- AIRBASEPOLICE is communicating with this modified script to kick players! -- ATC_GROUND is communicating with this modified script to kick players!
-- --
-- Install the file **SimpleSlotBlockGameGUI.lua** on the server, following the installation instructions described by Ciribob. -- Install the file **SimpleSlotBlockGameGUI.lua** on the server, following the installation instructions described by Ciribob.
-- --
@@ -1381,18 +1446,25 @@ end
-- --
-- # Script it! -- # Script it!
-- --
-- ## 1. AIRBASEPOLICE_NORMANDY Constructor -- ## 1. ATC_GROUND_NORMANDY Constructor
-- --
-- Creates a new AIRBASEPOLICE_NORMANDY object that will monitor pilots taxiing behaviour. -- Creates a new ATC_GROUND_NORMANDY object that will monitor pilots taxiing behaviour.
-- --
-- -- This creates a new AIRBASEPOLICE_NORMANDY object. -- -- This creates a new ATC_GROUND_NORMANDY object.
-- --
-- -- Monitor for these clients the airbases. -- -- Monitor for these clients the airbases.
-- AirbasePoliceCaucasus = AIRBASEPOLICE_NORMANDY:New() -- AirbasePoliceCaucasus = ATC_GROUND_NORMANDY:New()
--
-- ATC_Ground = ATC_GROUND_NORMANDY:New(
-- { AIRBASE.Normandy.Chippelle,
-- AIRBASE.Normandy.Beuzeville
-- }
-- )
--
-- --
-- @field #AIRBASEPOLICE_NORMANDY -- @field #ATC_GROUND_NORMANDY
AIRBASEPOLICE_NORMANDY = { ATC_GROUND_NORMANDY = {
ClassName = "AIRBASEPOLICE_NORMANDY", ClassName = "ATC_GROUND_NORMANDY",
Airbases = { Airbases = {
[AIRBASE.Normandy.Azeville] = { [AIRBASE.Normandy.Azeville] = {
PointsRunways = { PointsRunways = {
@@ -1784,14 +1856,14 @@ AIRBASEPOLICE_NORMANDY = {
} }
--- Creates a new AIRBASEPOLICE_NORMANDY object. --- Creates a new ATC_GROUND_NORMANDY object.
-- @param #AIRBASEPOLICE_NORMANDY self -- @param #ATC_GROUND_NORMANDY self
-- @param AirbaseNames A list {} of airbase names (Use AIRBASE.Normandy enumerator). -- @param AirbaseNames A list {} of airbase names (Use AIRBASE.Normandy enumerator).
-- @return #AIRBASEPOLICE_NORMANDY self -- @return #ATC_GROUND_NORMANDY self
function AIRBASEPOLICE_NORMANDY:New( AirbaseNames ) function ATC_GROUND_NORMANDY:New( AirbaseNames )
-- Inherits from BASE -- Inherits from BASE
local self = BASE:Inherit( self, AIRBASEPOLICE_BASE:New( self.Airbases, AirbaseNames ) ) local self = BASE:Inherit( self, ATC_GROUND:New( self.Airbases, AirbaseNames ) )
-- These lines here are for the demonstration mission. -- These lines here are for the demonstration mission.
-- They create in the dcs.log the coordinates of the runway polygons, that are then -- They create in the dcs.log the coordinates of the runway polygons, that are then

View File

@@ -149,7 +149,7 @@ function AIRBASE:Register( AirbaseName )
local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) ) local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) )
self.AirbaseName = AirbaseName self.AirbaseName = AirbaseName
self.AirbaseZone = ZONE_RADIUS:New( AirbaseName, self:GetVec2(), 8000 ) self.AirbaseZone = ZONE_RADIUS:New( AirbaseName, self:GetVec2(), 2000 )
return self return self
end end

View File

@@ -41,7 +41,7 @@ Functional/Movement.lua
Functional/Sead.lua Functional/Sead.lua
Functional/Escort.lua Functional/Escort.lua
Functional/MissileTrainer.lua Functional/MissileTrainer.lua
Functional/AirbasePolice.lua Functional/ATC_Ground.lua
Functional/Detection.lua Functional/Detection.lua
Functional/Designate.lua Functional/Designate.lua
Functional/RAT.lua Functional/RAT.lua

View File

@@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20171023_1007' ) env.info( 'Moose Generation Timestamp: 20171026_0958' )
local base = _G local base = _G
@@ -61,7 +61,7 @@ __Moose.Include( 'Functional/Movement.lua' )
__Moose.Include( 'Functional/Sead.lua' ) __Moose.Include( 'Functional/Sead.lua' )
__Moose.Include( 'Functional/Escort.lua' ) __Moose.Include( 'Functional/Escort.lua' )
__Moose.Include( 'Functional/MissileTrainer.lua' ) __Moose.Include( 'Functional/MissileTrainer.lua' )
__Moose.Include( 'Functional/AirbasePolice.lua' ) __Moose.Include( 'Functional/ATC_Ground.lua' )
__Moose.Include( 'Functional/Detection.lua' ) __Moose.Include( 'Functional/Detection.lua' )
__Moose.Include( 'Functional/Designate.lua' ) __Moose.Include( 'Functional/Designate.lua' )
__Moose.Include( 'Functional/RAT.lua' ) __Moose.Include( 'Functional/RAT.lua' )

View File

@@ -1,5 +1,5 @@
env.info('*** MOOSE DYNAMIC INCLUDE START *** ') env.info('*** MOOSE DYNAMIC INCLUDE START *** ')
env.info('Moose Generation Timestamp: 20171023_1007') env.info('Moose Generation Timestamp: 20171026_0958')
local base=_G local base=_G
__Moose={} __Moose={}
__Moose.Include=function(IncludeFile) __Moose.Include=function(IncludeFile)
@@ -56,7 +56,7 @@ __Moose.Include('Functional/Movement.lua')
__Moose.Include('Functional/Sead.lua') __Moose.Include('Functional/Sead.lua')
__Moose.Include('Functional/Escort.lua') __Moose.Include('Functional/Escort.lua')
__Moose.Include('Functional/MissileTrainer.lua') __Moose.Include('Functional/MissileTrainer.lua')
__Moose.Include('Functional/AirbasePolice.lua') __Moose.Include('Functional/ATC_Ground.lua')
__Moose.Include('Functional/Detection.lua') __Moose.Include('Functional/Detection.lua')
__Moose.Include('Functional/Designate.lua') __Moose.Include('Functional/Designate.lua')
__Moose.Include('Functional/RAT.lua') __Moose.Include('Functional/RAT.lua')

View File

@@ -3285,7 +3285,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#boolean</em> <em></em>
<a id="#(SPAWN).SpawnUnControlled" > <a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong> <strong>SPAWN.SpawnUnControlled</strong>
</a> </a>

View File

@@ -562,7 +562,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function"> <dl class="function">
<dt> <dt>
<em><a href="Core.Cargo.html##(CARGO)">Core.Cargo#CARGO</a></em> <em><a href="Core.Cargo.html##(CARGO_GROUP)">Core.Cargo#CARGO_GROUP</a></em>
<a id="#(FSM_PROCESS).Cargo" > <a id="#(FSM_PROCESS).Cargo" >
<strong>FSM_PROCESS.Cargo</strong> <strong>FSM_PROCESS.Cargo</strong>
</a> </a>

View File

@@ -276,7 +276,7 @@ even when there are hardly any players in the mission.</strong></p>
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="AirbasePolice.html">AirbasePolice</a></td> <td class="name" nowrap="nowrap"><a href="AirbasePolice.html">AirbasePolice</a></td>
<td class="summary"> <td class="summary">
<p><strong>Functional</strong> -- The AIRBASEPOLICE classes monitor airbase traffic and regulate speed while taxiing.</p> <p><strong>Functional</strong> -- The ATC_GROUND classes monitor airbase traffic and regulate speed while taxiing.</p>
</td> </td>
</tr> </tr>
<tr> <tr>