mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2026-07-19 21:37:53 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6e14558a2 | |||
| b5d905fd6e | |||
| 94629d2cfd | |||
| 4922d756d5 | |||
| 67f2c5f983 | |||
| 9c3c67817b | |||
| debded08f4 | |||
| 52555f73f7 | |||
| effa8eb5b1 | |||
| b5c7b16500 | |||
| de420ca158 | |||
| 240b8a3abb |
@@ -35,7 +35,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 4
|
mist.majorVersion = 4
|
||||||
mist.minorVersion = 5
|
mist.minorVersion = 5
|
||||||
mist.build = 128
|
mist.build = 122
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@@ -695,6 +695,7 @@ do -- the main scope
|
|||||||
["FARP"] = "farps",
|
["FARP"] = "farps",
|
||||||
["Fueltank"] = "fueltank_cargo",
|
["Fueltank"] = "fueltank_cargo",
|
||||||
["Gate"] = "gate",
|
["Gate"] = "gate",
|
||||||
|
["FARP Fuel Depot"] = "gsm rus",
|
||||||
["Armed house"] = "home1_a",
|
["Armed house"] = "home1_a",
|
||||||
["FARP Command Post"] = "kp-ug",
|
["FARP Command Post"] = "kp-ug",
|
||||||
["Watch Tower Armed"] = "ohr-vyshka",
|
["Watch Tower Armed"] = "ohr-vyshka",
|
||||||
@@ -703,6 +704,7 @@ do -- the main scope
|
|||||||
["Pipes big"] = "pipes_big_cargo",
|
["Pipes big"] = "pipes_big_cargo",
|
||||||
["Oil platform"] = "plavbaza",
|
["Oil platform"] = "plavbaza",
|
||||||
["Tetrapod"] = "tetrapod_cargo",
|
["Tetrapod"] = "tetrapod_cargo",
|
||||||
|
["Fuel tank"] = "toplivo",
|
||||||
["Trunks long"] = "trunks_long_cargo",
|
["Trunks long"] = "trunks_long_cargo",
|
||||||
["Trunks small"] = "trunks_small_cargo",
|
["Trunks small"] = "trunks_small_cargo",
|
||||||
["Passenger liner"] = "yastrebow",
|
["Passenger liner"] = "yastrebow",
|
||||||
@@ -1072,12 +1074,6 @@ do -- the main scope
|
|||||||
|
|
||||||
newTable.units[unitId].type = unitData:getTypeName()
|
newTable.units[unitId].type = unitData:getTypeName()
|
||||||
newTable.units[unitId].unitId = tonumber(unitData:getID())
|
newTable.units[unitId].unitId = tonumber(unitData:getID())
|
||||||
|
|
||||||
local pName = unitData:getPlayerName()
|
|
||||||
--log:warn("'$1'", pName)
|
|
||||||
if (pName and pName ~= "") and not mist.DBs.MEunitsByName[newTable.units[unitId].unitName] then
|
|
||||||
newTable.dynamicSlot = timer.getTime()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
newTable.units[unitId].groupName = newTable.groupName
|
newTable.units[unitId].groupName = newTable.groupName
|
||||||
@@ -1098,11 +1094,7 @@ do -- the main scope
|
|||||||
mistAddedObjects[index] = nil
|
mistAddedObjects[index] = nil
|
||||||
end
|
end
|
||||||
if found == false then
|
if found == false then
|
||||||
if newTable.dynamicSlot then
|
newTable.units[unitId].skill = "High"
|
||||||
newTable.units[unitId].skill = "Client"
|
|
||||||
else
|
|
||||||
newTable.units[unitId].skill = "High"
|
|
||||||
end
|
|
||||||
newTable.units[unitId].alt_type = "BARO"
|
newTable.units[unitId].alt_type = "BARO"
|
||||||
end
|
end
|
||||||
if newTable.units[unitId].alt_type == "RADIO" then -- raw postition MSL was grabbed for group, but spawn is AGL, so re-offset it
|
if newTable.units[unitId].alt_type == "RADIO" then -- raw postition MSL was grabbed for group, but spawn is AGL, so re-offset it
|
||||||
@@ -1160,12 +1152,10 @@ do -- the main scope
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--dbLog:warn(newTable)
|
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'msg', newTable}, timer.getAbsTime() ..'Group.lua')
|
--mist.debug.writeData(mist.utils.serialize,{'msg', newTable}, timer.getAbsTime() ..'Group.lua')
|
||||||
newTable.timeAdded = timer.getAbsTime() -- only on the dynGroupsAdded table. For other reference, see start time
|
newTable.timeAdded = timer.getAbsTime() -- only on the dynGroupsAdded table. For other reference, see start time
|
||||||
--mist.debug.dumpDBs()
|
--mist.debug.dumpDBs()
|
||||||
--end
|
--end
|
||||||
--dbLog:warn(newTable)
|
|
||||||
--dbLog:info('endDbUpdate')
|
--dbLog:info('endDbUpdate')
|
||||||
return newTable
|
return newTable
|
||||||
end
|
end
|
||||||
@@ -1257,12 +1247,8 @@ do -- the main scope
|
|||||||
if stillExists == true and (updated == true or not mist.DBs.groupsByName[name]) then
|
if stillExists == true and (updated == true or not mist.DBs.groupsByName[name]) then
|
||||||
--dbLog:info('Get Table')
|
--dbLog:info('Get Table')
|
||||||
local dbData = dbUpdate(name, gData.type, staticGroupName)
|
local dbData = dbUpdate(name, gData.type, staticGroupName)
|
||||||
if dbData and type(dbData) == 'table' then
|
if dbData and type(dbData) == 'table' then
|
||||||
if dbData.name then
|
writeGroups[#writeGroups+1] = {data = dbData, isUpdated = updated}
|
||||||
writeGroups[#writeGroups+1] = {data = dbData, isUpdated = updated}
|
|
||||||
else
|
|
||||||
dbLog:warn("dbUpdate failed to populate data: $1 $2 $3", name, gData.type, gData)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Work done, so remove
|
-- Work done, so remove
|
||||||
@@ -1282,11 +1268,6 @@ do -- the main scope
|
|||||||
--dbLog:info(newTable)
|
--dbLog:info(newTable)
|
||||||
|
|
||||||
local state = 0
|
local state = 0
|
||||||
if not newTable.name then
|
|
||||||
dbLog:warn("Failed to add to database; sufficent data missing $1", newTable)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if updateChecker[newTable.name] then
|
if updateChecker[newTable.name] then
|
||||||
dbLog:warn("Failed to add to database: $1. Stopped at state: $2", newTable.name, updateChecker[newTable.name])
|
dbLog:warn("Failed to add to database: $1. Stopped at state: $2", newTable.name, updateChecker[newTable.name])
|
||||||
return false
|
return false
|
||||||
@@ -1362,13 +1343,6 @@ do -- the main scope
|
|||||||
--dbLog:info('byId')
|
--dbLog:info('byId')
|
||||||
mist.DBs.unitsById[tonumber(newUnitData.unitId)] = ldeepCopy(newUnitData)
|
mist.DBs.unitsById[tonumber(newUnitData.unitId)] = ldeepCopy(newUnitData)
|
||||||
end
|
end
|
||||||
|
|
||||||
if newTable.dynamicSlot then
|
|
||||||
mist.DBs.humansByName[newTable.units[1].unitName] = ldeepCopy(newUnitData)
|
|
||||||
if newUnitData.unitId then
|
|
||||||
mist.DBs.humansById[newTable.units[1].unitId] = ldeepCopy(newUnitData)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mist.DBs.unitsByName[newUnitData.unitName] = ldeepCopy(newUnitData)
|
mist.DBs.unitsByName[newUnitData.unitName] = ldeepCopy(newUnitData)
|
||||||
end
|
end
|
||||||
-- this is a really annoying DB to populate. Gotta create new tables in case its missing
|
-- this is a really annoying DB to populate. Gotta create new tables in case its missing
|
||||||
@@ -1411,9 +1385,6 @@ do -- the main scope
|
|||||||
--dbLog:info('add to dynGroups')
|
--dbLog:info('add to dynGroups')
|
||||||
mist.DBs.dynGroupsAdded[#mist.DBs.dynGroupsAdded + 1] = ldeepCopy(newTable)
|
mist.DBs.dynGroupsAdded[#mist.DBs.dynGroupsAdded + 1] = ldeepCopy(newTable)
|
||||||
--dbLog:info('clear entry')
|
--dbLog:info('clear entry')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateChecker[newTable.name] = nil
|
updateChecker[newTable.name] = nil
|
||||||
--dbLog:info('return')
|
--dbLog:info('return')
|
||||||
return true
|
return true
|
||||||
@@ -1443,8 +1414,7 @@ do -- the main scope
|
|||||||
if i > 0 then
|
if i > 0 then
|
||||||
--dbLog:info('updateDBTables: $1', #writeGroups)
|
--dbLog:info('updateDBTables: $1', #writeGroups)
|
||||||
|
|
||||||
for x = i, 1, -1 do
|
for x = 1, i do
|
||||||
--dbLog:info(x)
|
|
||||||
local res = writeDBTables(writeGroups[x])
|
local res = writeDBTables(writeGroups[x])
|
||||||
if res and res == true then
|
if res and res == true then
|
||||||
--dbLog:info('result: complete')
|
--dbLog:info('result: complete')
|
||||||
@@ -1454,7 +1424,6 @@ do -- the main scope
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if x%savesPerRun == 0 then
|
if x%savesPerRun == 0 then
|
||||||
--dbLog:info("yield")
|
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
end
|
end
|
||||||
if timer.getTime() > lastUpdateTime then
|
if timer.getTime() > lastUpdateTime then
|
||||||
@@ -1469,15 +1438,14 @@ do -- the main scope
|
|||||||
-- dont need to add units spawned in at the start of the mission if mist is loaded in init line
|
-- dont need to add units spawned in at the start of the mission if mist is loaded in init line
|
||||||
if event.id == world.event.S_EVENT_BIRTH and timer.getTime0() < timer.getAbsTime() then
|
if event.id == world.event.S_EVENT_BIRTH and timer.getTime0() < timer.getAbsTime() then
|
||||||
|
|
||||||
if Object.getCategory(event.initiator) == 1 then
|
if Object.getCategory(event.initiator) == 1 and not Unit.getPlayerName(event.initiator) then -- simple player check, will need to later check to see if unit was spawned with a player in a flight
|
||||||
--log:info('Object is a Unit')
|
--log:info('Object is a Unit')
|
||||||
local g = Unit.getGroup(event.initiator)
|
if Unit.getGroup(event.initiator) then
|
||||||
if g and event.initiator:getPlayerName() ~= "" and not mist.DBs.MEunitsByName[event.initiator:getName()] then
|
|
||||||
-- log:info(Unit.getGroup(event.initiator):getName())
|
-- log:info(Unit.getGroup(event.initiator):getName())
|
||||||
local gName = g:getName()
|
local g = Unit.getGroup(event.initiator)
|
||||||
if not tempSpawnedGroups[gName] then
|
if not tempSpawnedGroups[g:getName()] then
|
||||||
--log:warn('addedTo tempSpawnedGroups: $1', gName)
|
--log:info('added')
|
||||||
tempSpawnedGroups[gName] = {type = 'group', gp = g}
|
tempSpawnedGroups[g:getName()] = {type = 'group', gp = g}
|
||||||
tempSpawnGroupsCounter = tempSpawnGroupsCounter + 1
|
tempSpawnGroupsCounter = tempSpawnGroupsCounter + 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -1525,7 +1493,7 @@ do -- the main scope
|
|||||||
task.t = timer.getTime() + task.rep --schedule next run
|
task.t = timer.getTime() + task.rep --schedule next run
|
||||||
local err, errmsg = pcall(task.f, unpack(task.vars, 1, table.maxn(task.vars)))
|
local err, errmsg = pcall(task.f, unpack(task.vars, 1, table.maxn(task.vars)))
|
||||||
if not err then
|
if not err then
|
||||||
log:error('Error in scheduled function: $1', errmsg)
|
log:error('Error in scheduled function: $1' .. errmsg)
|
||||||
end
|
end
|
||||||
--scheduledTasks[i].f(unpack(scheduledTasks[i].vars, 1, table.maxn(scheduledTasks[i].vars))) -- do the task
|
--scheduledTasks[i].f(unpack(scheduledTasks[i].vars, 1, table.maxn(scheduledTasks[i].vars))) -- do the task
|
||||||
i = i + 1
|
i = i + 1
|
||||||
@@ -1551,63 +1519,53 @@ do -- the main scope
|
|||||||
id = tostring(original_id) .. ' #' .. tostring(id_ind)
|
id = tostring(original_id) .. ' #' .. tostring(id_ind)
|
||||||
id_ind = id_ind + 1
|
id_ind = id_ind + 1
|
||||||
end
|
end
|
||||||
local valid
|
|
||||||
if mist.DBs.aliveUnits and mist.DBs.aliveUnits[val.object.id_] then
|
if mist.DBs.aliveUnits and mist.DBs.aliveUnits[val.object.id_] then
|
||||||
--log:info('object found in alive_units')
|
--log:info('object found in alive_units')
|
||||||
val.objectData = mist.utils.deepCopy(mist.DBs.aliveUnits[val.object.id_])
|
val.objectData = mist.utils.deepCopy(mist.DBs.aliveUnits[val.object.id_])
|
||||||
if Object.isExist(val.object) then
|
local pos = Object.getPosition(val.object)
|
||||||
local pos = Object.getPosition(val.object)
|
if pos then
|
||||||
if pos then
|
val.objectPos = pos.p
|
||||||
val.objectPos = pos.p
|
|
||||||
end
|
|
||||||
val.objectType = mist.DBs.aliveUnits[val.object.id_].category
|
|
||||||
--[[if mist.DBs.activeHumans[Unit.getName(val.object)] then
|
|
||||||
--trigger.action.outText('remove via death: ' .. Unit.getName(val.object),20)
|
|
||||||
mist.DBs.activeHumans[Unit.getName(val.object)] = nil
|
|
||||||
end]]
|
|
||||||
valid = true
|
|
||||||
end
|
end
|
||||||
|
val.objectType = mist.DBs.aliveUnits[val.object.id_].category
|
||||||
|
--[[if mist.DBs.activeHumans[Unit.getName(val.object)] then
|
||||||
|
--trigger.action.outText('remove via death: ' .. Unit.getName(val.object),20)
|
||||||
|
mist.DBs.activeHumans[Unit.getName(val.object)] = nil
|
||||||
|
end]]
|
||||||
elseif mist.DBs.removedAliveUnits and mist.DBs.removedAliveUnits[val.object.id_] then -- it didn't exist in alive_units, check old_alive_units
|
elseif mist.DBs.removedAliveUnits and mist.DBs.removedAliveUnits[val.object.id_] then -- it didn't exist in alive_units, check old_alive_units
|
||||||
--log:info('object found in old_alive_units')
|
--log:info('object found in old_alive_units')
|
||||||
val.objectData = mist.utils.deepCopy(mist.DBs.removedAliveUnits[val.object.id_])
|
val.objectData = mist.utils.deepCopy(mist.DBs.removedAliveUnits[val.object.id_])
|
||||||
if Object.isExist(val.object) then
|
local pos = Object.getPosition(val.object)
|
||||||
local pos = Object.getPosition(val.object)
|
if pos then
|
||||||
if pos then
|
val.objectPos = pos.p
|
||||||
val.objectPos = pos.p
|
|
||||||
end
|
|
||||||
val.objectType = mist.DBs.removedAliveUnits[val.object.id_].category
|
|
||||||
valid = true
|
|
||||||
end
|
end
|
||||||
|
val.objectType = mist.DBs.removedAliveUnits[val.object.id_].category
|
||||||
|
|
||||||
else --attempt to determine if static object...
|
else --attempt to determine if static object...
|
||||||
--log:info('object not found in alive units or old alive units')
|
--log:info('object not found in alive units or old alive units')
|
||||||
if Object.isExist(val.object) then
|
local pos = Object.getPosition(val.object)
|
||||||
local pos = Object.getPosition(val.object)
|
if pos then
|
||||||
if pos then
|
local static_found = false
|
||||||
local static_found = false
|
for ind, static in pairs(mist.DBs.unitsByCat.static) do
|
||||||
for ind, static in pairs(mist.DBs.unitsByCat.static) do
|
if ((pos.p.x - static.point.x)^2 + (pos.p.z - static.point.y)^2)^0.5 < 0.1 then --really, it should be zero...
|
||||||
if ((pos.p.x - static.point.x)^2 + (pos.p.z - static.point.y)^2)^0.5 < 0.1 then --really, it should be zero...
|
--log:info('correlated dead static object to position')
|
||||||
--log:info('correlated dead static object to position')
|
val.objectData = static
|
||||||
val.objectData = static
|
|
||||||
val.objectPos = pos.p
|
|
||||||
val.objectType = 'static'
|
|
||||||
static_found = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if not static_found then
|
|
||||||
val.objectPos = pos.p
|
val.objectPos = pos.p
|
||||||
val.objectType = 'building'
|
val.objectType = 'static'
|
||||||
val.typeName = Object.getTypeName(val.object)
|
static_found = true
|
||||||
|
break
|
||||||
end
|
end
|
||||||
else
|
|
||||||
val.objectType = 'unknown'
|
|
||||||
end
|
end
|
||||||
valid = true
|
if not static_found then
|
||||||
|
val.objectPos = pos.p
|
||||||
|
val.objectType = 'building'
|
||||||
|
val.typeName = Object.getTypeName(val.object)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
val.objectType = 'unknown'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if valid then
|
mist.DBs.deadObjects[id] = val
|
||||||
mist.DBs.deadObjects[id] = val
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1777,7 +1735,7 @@ do -- the main scope
|
|||||||
function mist.dynAddStatic(n)
|
function mist.dynAddStatic(n)
|
||||||
|
|
||||||
local newObj = mist.utils.deepCopy(n)
|
local newObj = mist.utils.deepCopy(n)
|
||||||
--log:warn(newObj)
|
log:warn(newObj)
|
||||||
if newObj.units and newObj.units[1] then -- if its mist format
|
if newObj.units and newObj.units[1] then -- if its mist format
|
||||||
for entry, val in pairs(newObj.units[1]) do
|
for entry, val in pairs(newObj.units[1]) do
|
||||||
if newObj[entry] and newObj[entry] ~= val or not newObj[entry] then
|
if newObj[entry] and newObj[entry] ~= val or not newObj[entry] then
|
||||||
@@ -2061,7 +2019,7 @@ do -- the main scope
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'msg', newGroup}, newGroup.name ..'.lua')
|
--mist.debug.writeData(mist.utils.serialize,{'msg', newGroup}, 'newGroupPushedToAddGroup.lua')
|
||||||
--log:warn(newGroup)
|
--log:warn(newGroup)
|
||||||
-- sanitize table
|
-- sanitize table
|
||||||
newGroup.groupName = nil
|
newGroup.groupName = nil
|
||||||
@@ -3602,7 +3560,7 @@ function mist.getUnitsInMovingZones(unit_names, zone_unit_names, radius, zone_ty
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mist.getUnitsLOS(unitset1, altoffset1, unitset2, altoffset2, radius)
|
function mist.getUnitsLOS(unitset1, altoffset1, unitset2, altoffset2, radius)
|
||||||
--log:info("$1, $2, $3, $4, $5", unitset1, altoffset1, unitset2, altoffset2, radius)
|
log:info("$1, $2, $3, $4, $5", unitset1, altoffset1, unitset2, altoffset2, radius)
|
||||||
radius = radius or math.huge
|
radius = radius or math.huge
|
||||||
local unit_info1 = {}
|
local unit_info1 = {}
|
||||||
local unit_info2 = {}
|
local unit_info2 = {}
|
||||||
@@ -3610,25 +3568,21 @@ function mist.getUnitsLOS(unitset1, altoffset1, unitset2, altoffset2, radius)
|
|||||||
-- get the positions all in one step, saves execution time.
|
-- get the positions all in one step, saves execution time.
|
||||||
for unitset1_ind = 1, #unitset1 do
|
for unitset1_ind = 1, #unitset1 do
|
||||||
local unit1 = Unit.getByName(unitset1[unitset1_ind])
|
local unit1 = Unit.getByName(unitset1[unitset1_ind])
|
||||||
if unit1 then
|
local lCat = Object.getCategory(unit1)
|
||||||
local lCat = Object.getCategory(unit1)
|
if unit1 and ((lCat == 1 and unit1:isActive()) or lCat ~= 1) and unit:isExist() == true then
|
||||||
if ((lCat == 1 and unit1:isActive()) or lCat ~= 1) and unit1:isExist() == true then
|
unit_info1[#unit_info1 + 1] = {}
|
||||||
unit_info1[#unit_info1 + 1] = {}
|
unit_info1[#unit_info1].unit = unit1
|
||||||
unit_info1[#unit_info1].unit = unit1
|
unit_info1[#unit_info1].pos = unit1:getPosition().p
|
||||||
unit_info1[#unit_info1].pos = unit1:getPosition().p
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for unitset2_ind = 1, #unitset2 do
|
for unitset2_ind = 1, #unitset2 do
|
||||||
local unit2 = Unit.getByName(unitset2[unitset2_ind])
|
local unit2 = Unit.getByName(unitset2[unitset2_ind])
|
||||||
if unit2 then
|
local lCat = Object.getCategory(unit2)
|
||||||
local lCat = Object.getCategory(unit2)
|
if unit2 and ((lCat == 1 and unit2:isActive()) or lCat ~= 1) and unit:isExist() == true then
|
||||||
if ((lCat == 1 and unit2:isActive()) or lCat ~= 1) and unit2:isExist() == true then
|
unit_info2[#unit_info2 + 1] = {}
|
||||||
unit_info2[#unit_info2 + 1] = {}
|
unit_info2[#unit_info2].unit = unit2
|
||||||
unit_info2[#unit_info2].unit = unit2
|
unit_info2[#unit_info2].pos = unit2:getPosition().p
|
||||||
unit_info2[#unit_info2].pos = unit2:getPosition().p
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4058,14 +4012,13 @@ do -- group functions scope
|
|||||||
|
|
||||||
if Group.getByName(gpName) and Group.getByName(gpName):isExist() == true then
|
if Group.getByName(gpName) and Group.getByName(gpName):isExist() == true then
|
||||||
local newGroup = Group.getByName(gpName)
|
local newGroup = Group.getByName(gpName)
|
||||||
local newData = mist.utils.deepCopy(dbData)
|
local newData = {}
|
||||||
newData.name = gpName
|
newData.name = gpName
|
||||||
newData.groupId = tonumber(newGroup:getID())
|
newData.groupId = tonumber(newGroup:getID())
|
||||||
newData.category = newGroup:getCategory()
|
newData.category = newGroup:getCategory()
|
||||||
newData.groupName = gpName
|
newData.groupName = gpName
|
||||||
newData.hidden = dbData.hidden
|
newData.hidden = dbData.hidden
|
||||||
|
|
||||||
|
|
||||||
if newData.category == 2 then
|
if newData.category == 2 then
|
||||||
newData.category = 'vehicle'
|
newData.category = 'vehicle'
|
||||||
elseif newData.category == 3 then
|
elseif newData.category == 3 then
|
||||||
@@ -4837,9 +4790,6 @@ do -- group functions scope
|
|||||||
highNum = secondNum
|
highNum = secondNum
|
||||||
end
|
end
|
||||||
local total = 1
|
local total = 1
|
||||||
if highNum > 50 then
|
|
||||||
return math.random(lowNum, highNum)
|
|
||||||
end
|
|
||||||
if math.abs(highNum - lowNum + 1) < 50 then -- if total values is less than 50
|
if math.abs(highNum - lowNum + 1) < 50 then -- if total values is less than 50
|
||||||
total = math.modf(50/math.abs(highNum - lowNum + 1)) -- make x copies required to be above 50
|
total = math.modf(50/math.abs(highNum - lowNum + 1)) -- make x copies required to be above 50
|
||||||
end
|
end
|
||||||
@@ -5243,8 +5193,7 @@ do -- mist.util scope
|
|||||||
|
|
||||||
function mist.utils.getHeadingPoints(point1, point2, north) -- sick of writing this out.
|
function mist.utils.getHeadingPoints(point1, point2, north) -- sick of writing this out.
|
||||||
if north then
|
if north then
|
||||||
local p1 = mist.utils.makeVec3(point1)
|
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), mist.utils.makeVec3(point1)), (mist.utils.makeVec3(point1)))
|
||||||
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), p1), p1)
|
|
||||||
else
|
else
|
||||||
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), mist.utils.makeVec3(point1)))
|
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), mist.utils.makeVec3(point1)))
|
||||||
end
|
end
|
||||||
@@ -5888,8 +5837,8 @@ do -- mist.debug scope
|
|||||||
log:alert('insufficient libraries to run mist.debug.dump_G, you must disable the sanitization of the io and lfs libraries in ./Scripts/MissionScripting.lua')
|
log:alert('insufficient libraries to run mist.debug.dump_G, you must disable the sanitization of the io and lfs libraries in ./Scripts/MissionScripting.lua')
|
||||||
--trigger.action.outText(errmsg, 10)
|
--trigger.action.outText(errmsg, 10)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Write debug data to file.
|
--- Write debug data to file.
|
||||||
-- This function requires you to disable script sanitization
|
-- This function requires you to disable script sanitization
|
||||||
-- in $DCS_ROOT\Scripts\MissionScripting.lua to access lfs and io
|
-- in $DCS_ROOT\Scripts\MissionScripting.lua to access lfs and io
|
||||||
@@ -7704,10 +7653,7 @@ do
|
|||||||
--log:warn(s)
|
--log:warn(s)
|
||||||
if type(s) == 'table' then
|
if type(s) == 'table' then
|
||||||
local mType = s.markType
|
local mType = s.markType
|
||||||
--log:echo(s)
|
if mType == 'panel' then
|
||||||
|
|
||||||
if mType == 'panel' then
|
|
||||||
local markScope = s.markScope or "all"
|
|
||||||
if markScope == 'coa' then
|
if markScope == 'coa' then
|
||||||
trigger.action.markToCoalition(s.markId, s.text, s.pos, s.markFor, s.readOnly)
|
trigger.action.markToCoalition(s.markId, s.text, s.pos, s.markFor, s.readOnly)
|
||||||
elseif markScope == 'group' then
|
elseif markScope == 'group' then
|
||||||
@@ -7765,15 +7711,10 @@ do
|
|||||||
|
|
||||||
local function validateColor(val)
|
local function validateColor(val)
|
||||||
if type(val) == 'table' then
|
if type(val) == 'table' then
|
||||||
for i = 1, 4 do
|
for i = 1, #val do
|
||||||
if val[i] then
|
if type(val[i]) == 'number' and val[i] > 1 then
|
||||||
if type(val[i]) == 'number' and val[i] > 1 then
|
val[i] = val[i]/255 -- convert RGB values from 0-255 to 0-1 equivilent.
|
||||||
val[i] = val[i]/255 -- convert RGB values from 0-255 to 0-1 equivilent.
|
end
|
||||||
end
|
|
||||||
else
|
|
||||||
val[i] = 0.8
|
|
||||||
log:warn("index $1 of color to mist.marker.add was missing, defaulted to 0.8", i)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
elseif type(val) == 'string' then
|
elseif type(val) == 'string' then
|
||||||
val = mist.utils.hexToRGB(val)
|
val = mist.utils.hexToRGB(val)
|
||||||
@@ -7814,7 +7755,7 @@ do
|
|||||||
--log:info('create maker DB: $1', e.idx)
|
--log:info('create maker DB: $1', e.idx)
|
||||||
mist.DBs.markList[e.idx] = {time = e.time, pos = e.pos, groupId = e.groupId, mType = 'panel', text = e.text, markId = e.idx, coalition = e.coalition}
|
mist.DBs.markList[e.idx] = {time = e.time, pos = e.pos, groupId = e.groupId, mType = 'panel', text = e.text, markId = e.idx, coalition = e.coalition}
|
||||||
if e.unit then
|
if e.unit then
|
||||||
mist.DBs.markList[e.idx].unit = e.initiator:getName()
|
mist.DBs.markList[e.idx].unit = e.intiator:getName()
|
||||||
end
|
end
|
||||||
--log:info(mist.marker.list[e.idx])
|
--log:info(mist.marker.list[e.idx])
|
||||||
end
|
end
|
||||||
@@ -7837,7 +7778,7 @@ do
|
|||||||
else
|
else
|
||||||
for mEntry, mData in pairs(mist.DBs.markList) do
|
for mEntry, mData in pairs(mist.DBs.markList) do
|
||||||
if id == mData.name or id == mData.id then
|
if id == mData.name or id == mData.id then
|
||||||
return mData.markId
|
return mData.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -7847,16 +7788,11 @@ do
|
|||||||
|
|
||||||
|
|
||||||
local function removeMark(id)
|
local function removeMark(id)
|
||||||
--log:info("Removing Mark: $1", id)
|
--log:info("Removing Mark: $1", id
|
||||||
local removed = false
|
local removed = false
|
||||||
if type(id) == 'table' then
|
if type(id) == 'table' then
|
||||||
for ind, val in pairs(id) do
|
for ind, val in pairs(id) do
|
||||||
local r
|
local r = getMarkId(val)
|
||||||
if type(val) == "table" and val.markId then
|
|
||||||
r = val.markId
|
|
||||||
else
|
|
||||||
r = getMarkId(val)
|
|
||||||
end
|
|
||||||
if r then
|
if r then
|
||||||
trigger.action.removeMark(r)
|
trigger.action.removeMark(r)
|
||||||
mist.DBs.markList[r] = nil
|
mist.DBs.markList[r] = nil
|
||||||
@@ -7866,11 +7802,9 @@ do
|
|||||||
|
|
||||||
else
|
else
|
||||||
local r = getMarkId(id)
|
local r = getMarkId(id)
|
||||||
if r then
|
trigger.action.removeMark(r)
|
||||||
trigger.action.removeMark(r)
|
mist.DBs.markList[r] = nil
|
||||||
mist.DBs.markList[r] = nil
|
removed = true
|
||||||
removed = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return removed
|
return removed
|
||||||
end
|
end
|
||||||
@@ -7992,7 +7926,6 @@ do
|
|||||||
|
|
||||||
if markForCoa then
|
if markForCoa then
|
||||||
if type(markForCoa) == 'string' then
|
if type(markForCoa) == 'string' then
|
||||||
--log:warn("coa is string")
|
|
||||||
if tonumber(markForCoa) then
|
if tonumber(markForCoa) then
|
||||||
coa = coas[tonumber(markForCoa)]
|
coa = coas[tonumber(markForCoa)]
|
||||||
markScope = 'coa'
|
markScope = 'coa'
|
||||||
@@ -8007,10 +7940,11 @@ do
|
|||||||
end
|
end
|
||||||
elseif type(markForCoa) == 'number' and markForCoa >=-1 and markForCoa <= #coas then
|
elseif type(markForCoa) == 'number' and markForCoa >=-1 and markForCoa <= #coas then
|
||||||
coa = markForCoa
|
coa = markForCoa
|
||||||
--log:warn("coa is number")
|
markScore = 'coa'
|
||||||
markScope = 'coa'
|
|
||||||
end
|
end
|
||||||
markFor = coa
|
|
||||||
|
|
||||||
|
|
||||||
elseif markFor then
|
elseif markFor then
|
||||||
if type(markFor) == 'number' then -- groupId
|
if type(markFor) == 'number' then -- groupId
|
||||||
if mist.DBs.groupsById[markFor] then
|
if mist.DBs.groupsById[markFor] then
|
||||||
@@ -8119,7 +8053,7 @@ do
|
|||||||
end
|
end
|
||||||
for i = 1, #markForTable do
|
for i = 1, #markForTable do
|
||||||
local newId = iterate()
|
local newId = iterate()
|
||||||
local data = {markId = newId, text = text, pos = pos[i], markScope = markScope, markFor = markForTable[i], markType = 'panel', name = name, readOnly = readOnly, time = timer.getTime()}
|
local data = {markId = newId, text = text, pos = pos[i], markFor = markForTable[i], markType = 'panel', name = name, readOnly = readOnly, time = timer.getTime()}
|
||||||
mist.DBs.markList[newId] = data
|
mist.DBs.markList[newId] = data
|
||||||
table.insert(list, data)
|
table.insert(list, data)
|
||||||
|
|
||||||
@@ -8243,7 +8177,6 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mist.marker.remove(id)
|
function mist.marker.remove(id)
|
||||||
|
|
||||||
return removeMark(id)
|
return removeMark(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -8775,13 +8708,6 @@ do -- group tasks scope
|
|||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
function mist.insertTaskToWP(wp, task)
|
|
||||||
if not wp.task then
|
|
||||||
wp.task = {["id"] = "ComboTask", ["params"] = {tasks = {}}}
|
|
||||||
end
|
|
||||||
table.insert(wp.task.params.tasks, task)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mist.ground.patrol(gpData, pType, form, speed)
|
function mist.ground.patrol(gpData, pType, form, speed)
|
||||||
local vars = {}
|
local vars = {}
|
||||||
@@ -9041,8 +8967,8 @@ do -- group tasks scope
|
|||||||
minR = mist.utils.get2DDist(avg, zone[i])
|
minR = mist.utils.get2DDist(avg, zone[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--log:warn('minR: $1', minR)
|
|
||||||
--log:warn('Radius: $1', radius)
|
--log:warn('Radius: $1', radius)
|
||||||
|
--log:warn('minR: $1', minR)
|
||||||
local lSpawnPos = {}
|
local lSpawnPos = {}
|
||||||
for j = 1, 100 do
|
for j = 1, 100 do
|
||||||
newCoord = mist.getRandPointInCircle(avg, radius)
|
newCoord = mist.getRandPointInCircle(avg, radius)
|
||||||
@@ -9274,7 +9200,7 @@ do -- group tasks scope
|
|||||||
function mist.groupIsDead(groupName) -- copy more or less from on station
|
function mist.groupIsDead(groupName) -- copy more or less from on station
|
||||||
local gp = Group.getByName(groupName)
|
local gp = Group.getByName(groupName)
|
||||||
if gp then
|
if gp then
|
||||||
if #gp:getUnits() > 0 and gp:isExist() == true then
|
if #gp:getUnits() > 0 or gp:isExist() == true then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 4
|
mist.majorVersion = 4
|
||||||
mist.minorVersion = 5
|
mist.minorVersion = 5
|
||||||
mist.build = 128
|
mist.build = 122
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@@ -695,6 +695,7 @@ do -- the main scope
|
|||||||
["FARP"] = "farps",
|
["FARP"] = "farps",
|
||||||
["Fueltank"] = "fueltank_cargo",
|
["Fueltank"] = "fueltank_cargo",
|
||||||
["Gate"] = "gate",
|
["Gate"] = "gate",
|
||||||
|
["FARP Fuel Depot"] = "gsm rus",
|
||||||
["Armed house"] = "home1_a",
|
["Armed house"] = "home1_a",
|
||||||
["FARP Command Post"] = "kp-ug",
|
["FARP Command Post"] = "kp-ug",
|
||||||
["Watch Tower Armed"] = "ohr-vyshka",
|
["Watch Tower Armed"] = "ohr-vyshka",
|
||||||
@@ -703,6 +704,7 @@ do -- the main scope
|
|||||||
["Pipes big"] = "pipes_big_cargo",
|
["Pipes big"] = "pipes_big_cargo",
|
||||||
["Oil platform"] = "plavbaza",
|
["Oil platform"] = "plavbaza",
|
||||||
["Tetrapod"] = "tetrapod_cargo",
|
["Tetrapod"] = "tetrapod_cargo",
|
||||||
|
["Fuel tank"] = "toplivo",
|
||||||
["Trunks long"] = "trunks_long_cargo",
|
["Trunks long"] = "trunks_long_cargo",
|
||||||
["Trunks small"] = "trunks_small_cargo",
|
["Trunks small"] = "trunks_small_cargo",
|
||||||
["Passenger liner"] = "yastrebow",
|
["Passenger liner"] = "yastrebow",
|
||||||
@@ -1072,12 +1074,6 @@ do -- the main scope
|
|||||||
|
|
||||||
newTable.units[unitId].type = unitData:getTypeName()
|
newTable.units[unitId].type = unitData:getTypeName()
|
||||||
newTable.units[unitId].unitId = tonumber(unitData:getID())
|
newTable.units[unitId].unitId = tonumber(unitData:getID())
|
||||||
|
|
||||||
local pName = unitData:getPlayerName()
|
|
||||||
--log:warn("'$1'", pName)
|
|
||||||
if (pName and pName ~= "") and not mist.DBs.MEunitsByName[newTable.units[unitId].unitName] then
|
|
||||||
newTable.dynamicSlot = timer.getTime()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
newTable.units[unitId].groupName = newTable.groupName
|
newTable.units[unitId].groupName = newTable.groupName
|
||||||
@@ -1098,11 +1094,7 @@ do -- the main scope
|
|||||||
mistAddedObjects[index] = nil
|
mistAddedObjects[index] = nil
|
||||||
end
|
end
|
||||||
if found == false then
|
if found == false then
|
||||||
if newTable.dynamicSlot then
|
newTable.units[unitId].skill = "High"
|
||||||
newTable.units[unitId].skill = "Client"
|
|
||||||
else
|
|
||||||
newTable.units[unitId].skill = "High"
|
|
||||||
end
|
|
||||||
newTable.units[unitId].alt_type = "BARO"
|
newTable.units[unitId].alt_type = "BARO"
|
||||||
end
|
end
|
||||||
if newTable.units[unitId].alt_type == "RADIO" then -- raw postition MSL was grabbed for group, but spawn is AGL, so re-offset it
|
if newTable.units[unitId].alt_type == "RADIO" then -- raw postition MSL was grabbed for group, but spawn is AGL, so re-offset it
|
||||||
@@ -1160,12 +1152,10 @@ do -- the main scope
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--dbLog:warn(newTable)
|
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'msg', newTable}, timer.getAbsTime() ..'Group.lua')
|
--mist.debug.writeData(mist.utils.serialize,{'msg', newTable}, timer.getAbsTime() ..'Group.lua')
|
||||||
newTable.timeAdded = timer.getAbsTime() -- only on the dynGroupsAdded table. For other reference, see start time
|
newTable.timeAdded = timer.getAbsTime() -- only on the dynGroupsAdded table. For other reference, see start time
|
||||||
--mist.debug.dumpDBs()
|
--mist.debug.dumpDBs()
|
||||||
--end
|
--end
|
||||||
--dbLog:warn(newTable)
|
|
||||||
--dbLog:info('endDbUpdate')
|
--dbLog:info('endDbUpdate')
|
||||||
return newTable
|
return newTable
|
||||||
end
|
end
|
||||||
@@ -1257,12 +1247,8 @@ do -- the main scope
|
|||||||
if stillExists == true and (updated == true or not mist.DBs.groupsByName[name]) then
|
if stillExists == true and (updated == true or not mist.DBs.groupsByName[name]) then
|
||||||
--dbLog:info('Get Table')
|
--dbLog:info('Get Table')
|
||||||
local dbData = dbUpdate(name, gData.type, staticGroupName)
|
local dbData = dbUpdate(name, gData.type, staticGroupName)
|
||||||
if dbData and type(dbData) == 'table' then
|
if dbData and type(dbData) == 'table' then
|
||||||
if dbData.name then
|
writeGroups[#writeGroups+1] = {data = dbData, isUpdated = updated}
|
||||||
writeGroups[#writeGroups+1] = {data = dbData, isUpdated = updated}
|
|
||||||
else
|
|
||||||
dbLog:warn("dbUpdate failed to populate data: $1 $2 $3", name, gData.type, gData)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Work done, so remove
|
-- Work done, so remove
|
||||||
@@ -1282,11 +1268,6 @@ do -- the main scope
|
|||||||
--dbLog:info(newTable)
|
--dbLog:info(newTable)
|
||||||
|
|
||||||
local state = 0
|
local state = 0
|
||||||
if not newTable.name then
|
|
||||||
dbLog:warn("Failed to add to database; sufficent data missing $1", newTable)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if updateChecker[newTable.name] then
|
if updateChecker[newTable.name] then
|
||||||
dbLog:warn("Failed to add to database: $1. Stopped at state: $2", newTable.name, updateChecker[newTable.name])
|
dbLog:warn("Failed to add to database: $1. Stopped at state: $2", newTable.name, updateChecker[newTable.name])
|
||||||
return false
|
return false
|
||||||
@@ -1362,13 +1343,6 @@ do -- the main scope
|
|||||||
--dbLog:info('byId')
|
--dbLog:info('byId')
|
||||||
mist.DBs.unitsById[tonumber(newUnitData.unitId)] = ldeepCopy(newUnitData)
|
mist.DBs.unitsById[tonumber(newUnitData.unitId)] = ldeepCopy(newUnitData)
|
||||||
end
|
end
|
||||||
|
|
||||||
if newTable.dynamicSlot then
|
|
||||||
mist.DBs.humansByName[newTable.units[1].unitName] = ldeepCopy(newUnitData)
|
|
||||||
if newUnitData.unitId then
|
|
||||||
mist.DBs.humansById[newTable.units[1].unitId] = ldeepCopy(newUnitData)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mist.DBs.unitsByName[newUnitData.unitName] = ldeepCopy(newUnitData)
|
mist.DBs.unitsByName[newUnitData.unitName] = ldeepCopy(newUnitData)
|
||||||
end
|
end
|
||||||
-- this is a really annoying DB to populate. Gotta create new tables in case its missing
|
-- this is a really annoying DB to populate. Gotta create new tables in case its missing
|
||||||
@@ -1411,9 +1385,6 @@ do -- the main scope
|
|||||||
--dbLog:info('add to dynGroups')
|
--dbLog:info('add to dynGroups')
|
||||||
mist.DBs.dynGroupsAdded[#mist.DBs.dynGroupsAdded + 1] = ldeepCopy(newTable)
|
mist.DBs.dynGroupsAdded[#mist.DBs.dynGroupsAdded + 1] = ldeepCopy(newTable)
|
||||||
--dbLog:info('clear entry')
|
--dbLog:info('clear entry')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateChecker[newTable.name] = nil
|
updateChecker[newTable.name] = nil
|
||||||
--dbLog:info('return')
|
--dbLog:info('return')
|
||||||
return true
|
return true
|
||||||
@@ -1443,8 +1414,7 @@ do -- the main scope
|
|||||||
if i > 0 then
|
if i > 0 then
|
||||||
--dbLog:info('updateDBTables: $1', #writeGroups)
|
--dbLog:info('updateDBTables: $1', #writeGroups)
|
||||||
|
|
||||||
for x = i, 1, -1 do
|
for x = 1, i do
|
||||||
--dbLog:info(x)
|
|
||||||
local res = writeDBTables(writeGroups[x])
|
local res = writeDBTables(writeGroups[x])
|
||||||
if res and res == true then
|
if res and res == true then
|
||||||
--dbLog:info('result: complete')
|
--dbLog:info('result: complete')
|
||||||
@@ -1454,7 +1424,6 @@ do -- the main scope
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if x%savesPerRun == 0 then
|
if x%savesPerRun == 0 then
|
||||||
--dbLog:info("yield")
|
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
end
|
end
|
||||||
if timer.getTime() > lastUpdateTime then
|
if timer.getTime() > lastUpdateTime then
|
||||||
@@ -1469,15 +1438,14 @@ do -- the main scope
|
|||||||
-- dont need to add units spawned in at the start of the mission if mist is loaded in init line
|
-- dont need to add units spawned in at the start of the mission if mist is loaded in init line
|
||||||
if event.id == world.event.S_EVENT_BIRTH and timer.getTime0() < timer.getAbsTime() then
|
if event.id == world.event.S_EVENT_BIRTH and timer.getTime0() < timer.getAbsTime() then
|
||||||
|
|
||||||
if Object.getCategory(event.initiator) == 1 then
|
if Object.getCategory(event.initiator) == 1 and not Unit.getPlayerName(event.initiator) then -- simple player check, will need to later check to see if unit was spawned with a player in a flight
|
||||||
--log:info('Object is a Unit')
|
--log:info('Object is a Unit')
|
||||||
local g = Unit.getGroup(event.initiator)
|
if Unit.getGroup(event.initiator) then
|
||||||
if g and event.initiator:getPlayerName() ~= "" and not mist.DBs.MEunitsByName[event.initiator:getName()] then
|
|
||||||
-- log:info(Unit.getGroup(event.initiator):getName())
|
-- log:info(Unit.getGroup(event.initiator):getName())
|
||||||
local gName = g:getName()
|
local g = Unit.getGroup(event.initiator)
|
||||||
if not tempSpawnedGroups[gName] then
|
if not tempSpawnedGroups[g:getName()] then
|
||||||
--log:warn('addedTo tempSpawnedGroups: $1', gName)
|
--log:info('added')
|
||||||
tempSpawnedGroups[gName] = {type = 'group', gp = g}
|
tempSpawnedGroups[g:getName()] = {type = 'group', gp = g}
|
||||||
tempSpawnGroupsCounter = tempSpawnGroupsCounter + 1
|
tempSpawnGroupsCounter = tempSpawnGroupsCounter + 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -1525,7 +1493,7 @@ do -- the main scope
|
|||||||
task.t = timer.getTime() + task.rep --schedule next run
|
task.t = timer.getTime() + task.rep --schedule next run
|
||||||
local err, errmsg = pcall(task.f, unpack(task.vars, 1, table.maxn(task.vars)))
|
local err, errmsg = pcall(task.f, unpack(task.vars, 1, table.maxn(task.vars)))
|
||||||
if not err then
|
if not err then
|
||||||
log:error('Error in scheduled function: $1', errmsg)
|
log:error('Error in scheduled function: $1' .. errmsg)
|
||||||
end
|
end
|
||||||
--scheduledTasks[i].f(unpack(scheduledTasks[i].vars, 1, table.maxn(scheduledTasks[i].vars))) -- do the task
|
--scheduledTasks[i].f(unpack(scheduledTasks[i].vars, 1, table.maxn(scheduledTasks[i].vars))) -- do the task
|
||||||
i = i + 1
|
i = i + 1
|
||||||
@@ -1551,63 +1519,53 @@ do -- the main scope
|
|||||||
id = tostring(original_id) .. ' #' .. tostring(id_ind)
|
id = tostring(original_id) .. ' #' .. tostring(id_ind)
|
||||||
id_ind = id_ind + 1
|
id_ind = id_ind + 1
|
||||||
end
|
end
|
||||||
local valid
|
|
||||||
if mist.DBs.aliveUnits and mist.DBs.aliveUnits[val.object.id_] then
|
if mist.DBs.aliveUnits and mist.DBs.aliveUnits[val.object.id_] then
|
||||||
--log:info('object found in alive_units')
|
--log:info('object found in alive_units')
|
||||||
val.objectData = mist.utils.deepCopy(mist.DBs.aliveUnits[val.object.id_])
|
val.objectData = mist.utils.deepCopy(mist.DBs.aliveUnits[val.object.id_])
|
||||||
if Object.isExist(val.object) then
|
local pos = Object.getPosition(val.object)
|
||||||
local pos = Object.getPosition(val.object)
|
if pos then
|
||||||
if pos then
|
val.objectPos = pos.p
|
||||||
val.objectPos = pos.p
|
|
||||||
end
|
|
||||||
val.objectType = mist.DBs.aliveUnits[val.object.id_].category
|
|
||||||
--[[if mist.DBs.activeHumans[Unit.getName(val.object)] then
|
|
||||||
--trigger.action.outText('remove via death: ' .. Unit.getName(val.object),20)
|
|
||||||
mist.DBs.activeHumans[Unit.getName(val.object)] = nil
|
|
||||||
end]]
|
|
||||||
valid = true
|
|
||||||
end
|
end
|
||||||
|
val.objectType = mist.DBs.aliveUnits[val.object.id_].category
|
||||||
|
--[[if mist.DBs.activeHumans[Unit.getName(val.object)] then
|
||||||
|
--trigger.action.outText('remove via death: ' .. Unit.getName(val.object),20)
|
||||||
|
mist.DBs.activeHumans[Unit.getName(val.object)] = nil
|
||||||
|
end]]
|
||||||
elseif mist.DBs.removedAliveUnits and mist.DBs.removedAliveUnits[val.object.id_] then -- it didn't exist in alive_units, check old_alive_units
|
elseif mist.DBs.removedAliveUnits and mist.DBs.removedAliveUnits[val.object.id_] then -- it didn't exist in alive_units, check old_alive_units
|
||||||
--log:info('object found in old_alive_units')
|
--log:info('object found in old_alive_units')
|
||||||
val.objectData = mist.utils.deepCopy(mist.DBs.removedAliveUnits[val.object.id_])
|
val.objectData = mist.utils.deepCopy(mist.DBs.removedAliveUnits[val.object.id_])
|
||||||
if Object.isExist(val.object) then
|
local pos = Object.getPosition(val.object)
|
||||||
local pos = Object.getPosition(val.object)
|
if pos then
|
||||||
if pos then
|
val.objectPos = pos.p
|
||||||
val.objectPos = pos.p
|
|
||||||
end
|
|
||||||
val.objectType = mist.DBs.removedAliveUnits[val.object.id_].category
|
|
||||||
valid = true
|
|
||||||
end
|
end
|
||||||
|
val.objectType = mist.DBs.removedAliveUnits[val.object.id_].category
|
||||||
|
|
||||||
else --attempt to determine if static object...
|
else --attempt to determine if static object...
|
||||||
--log:info('object not found in alive units or old alive units')
|
--log:info('object not found in alive units or old alive units')
|
||||||
if Object.isExist(val.object) then
|
local pos = Object.getPosition(val.object)
|
||||||
local pos = Object.getPosition(val.object)
|
if pos then
|
||||||
if pos then
|
local static_found = false
|
||||||
local static_found = false
|
for ind, static in pairs(mist.DBs.unitsByCat.static) do
|
||||||
for ind, static in pairs(mist.DBs.unitsByCat.static) do
|
if ((pos.p.x - static.point.x)^2 + (pos.p.z - static.point.y)^2)^0.5 < 0.1 then --really, it should be zero...
|
||||||
if ((pos.p.x - static.point.x)^2 + (pos.p.z - static.point.y)^2)^0.5 < 0.1 then --really, it should be zero...
|
--log:info('correlated dead static object to position')
|
||||||
--log:info('correlated dead static object to position')
|
val.objectData = static
|
||||||
val.objectData = static
|
|
||||||
val.objectPos = pos.p
|
|
||||||
val.objectType = 'static'
|
|
||||||
static_found = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if not static_found then
|
|
||||||
val.objectPos = pos.p
|
val.objectPos = pos.p
|
||||||
val.objectType = 'building'
|
val.objectType = 'static'
|
||||||
val.typeName = Object.getTypeName(val.object)
|
static_found = true
|
||||||
|
break
|
||||||
end
|
end
|
||||||
else
|
|
||||||
val.objectType = 'unknown'
|
|
||||||
end
|
end
|
||||||
valid = true
|
if not static_found then
|
||||||
|
val.objectPos = pos.p
|
||||||
|
val.objectType = 'building'
|
||||||
|
val.typeName = Object.getTypeName(val.object)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
val.objectType = 'unknown'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if valid then
|
mist.DBs.deadObjects[id] = val
|
||||||
mist.DBs.deadObjects[id] = val
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1777,7 +1735,7 @@ do -- the main scope
|
|||||||
function mist.dynAddStatic(n)
|
function mist.dynAddStatic(n)
|
||||||
|
|
||||||
local newObj = mist.utils.deepCopy(n)
|
local newObj = mist.utils.deepCopy(n)
|
||||||
--log:warn(newObj)
|
log:warn(newObj)
|
||||||
if newObj.units and newObj.units[1] then -- if its mist format
|
if newObj.units and newObj.units[1] then -- if its mist format
|
||||||
for entry, val in pairs(newObj.units[1]) do
|
for entry, val in pairs(newObj.units[1]) do
|
||||||
if newObj[entry] and newObj[entry] ~= val or not newObj[entry] then
|
if newObj[entry] and newObj[entry] ~= val or not newObj[entry] then
|
||||||
@@ -2061,7 +2019,7 @@ do -- the main scope
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'msg', newGroup}, newGroup.name ..'.lua')
|
--mist.debug.writeData(mist.utils.serialize,{'msg', newGroup}, 'newGroupPushedToAddGroup.lua')
|
||||||
--log:warn(newGroup)
|
--log:warn(newGroup)
|
||||||
-- sanitize table
|
-- sanitize table
|
||||||
newGroup.groupName = nil
|
newGroup.groupName = nil
|
||||||
@@ -3602,7 +3560,7 @@ function mist.getUnitsInMovingZones(unit_names, zone_unit_names, radius, zone_ty
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mist.getUnitsLOS(unitset1, altoffset1, unitset2, altoffset2, radius)
|
function mist.getUnitsLOS(unitset1, altoffset1, unitset2, altoffset2, radius)
|
||||||
--log:info("$1, $2, $3, $4, $5", unitset1, altoffset1, unitset2, altoffset2, radius)
|
log:info("$1, $2, $3, $4, $5", unitset1, altoffset1, unitset2, altoffset2, radius)
|
||||||
radius = radius or math.huge
|
radius = radius or math.huge
|
||||||
local unit_info1 = {}
|
local unit_info1 = {}
|
||||||
local unit_info2 = {}
|
local unit_info2 = {}
|
||||||
@@ -3610,25 +3568,21 @@ function mist.getUnitsLOS(unitset1, altoffset1, unitset2, altoffset2, radius)
|
|||||||
-- get the positions all in one step, saves execution time.
|
-- get the positions all in one step, saves execution time.
|
||||||
for unitset1_ind = 1, #unitset1 do
|
for unitset1_ind = 1, #unitset1 do
|
||||||
local unit1 = Unit.getByName(unitset1[unitset1_ind])
|
local unit1 = Unit.getByName(unitset1[unitset1_ind])
|
||||||
if unit1 then
|
local lCat = Object.getCategory(unit1)
|
||||||
local lCat = Object.getCategory(unit1)
|
if unit1 and ((lCat == 1 and unit1:isActive()) or lCat ~= 1) and unit:isExist() == true then
|
||||||
if ((lCat == 1 and unit1:isActive()) or lCat ~= 1) and unit1:isExist() == true then
|
unit_info1[#unit_info1 + 1] = {}
|
||||||
unit_info1[#unit_info1 + 1] = {}
|
unit_info1[#unit_info1].unit = unit1
|
||||||
unit_info1[#unit_info1].unit = unit1
|
unit_info1[#unit_info1].pos = unit1:getPosition().p
|
||||||
unit_info1[#unit_info1].pos = unit1:getPosition().p
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for unitset2_ind = 1, #unitset2 do
|
for unitset2_ind = 1, #unitset2 do
|
||||||
local unit2 = Unit.getByName(unitset2[unitset2_ind])
|
local unit2 = Unit.getByName(unitset2[unitset2_ind])
|
||||||
if unit2 then
|
local lCat = Object.getCategory(unit2)
|
||||||
local lCat = Object.getCategory(unit2)
|
if unit2 and ((lCat == 1 and unit2:isActive()) or lCat ~= 1) and unit:isExist() == true then
|
||||||
if ((lCat == 1 and unit2:isActive()) or lCat ~= 1) and unit2:isExist() == true then
|
unit_info2[#unit_info2 + 1] = {}
|
||||||
unit_info2[#unit_info2 + 1] = {}
|
unit_info2[#unit_info2].unit = unit2
|
||||||
unit_info2[#unit_info2].unit = unit2
|
unit_info2[#unit_info2].pos = unit2:getPosition().p
|
||||||
unit_info2[#unit_info2].pos = unit2:getPosition().p
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4058,14 +4012,13 @@ do -- group functions scope
|
|||||||
|
|
||||||
if Group.getByName(gpName) and Group.getByName(gpName):isExist() == true then
|
if Group.getByName(gpName) and Group.getByName(gpName):isExist() == true then
|
||||||
local newGroup = Group.getByName(gpName)
|
local newGroup = Group.getByName(gpName)
|
||||||
local newData = mist.utils.deepCopy(dbData)
|
local newData = {}
|
||||||
newData.name = gpName
|
newData.name = gpName
|
||||||
newData.groupId = tonumber(newGroup:getID())
|
newData.groupId = tonumber(newGroup:getID())
|
||||||
newData.category = newGroup:getCategory()
|
newData.category = newGroup:getCategory()
|
||||||
newData.groupName = gpName
|
newData.groupName = gpName
|
||||||
newData.hidden = dbData.hidden
|
newData.hidden = dbData.hidden
|
||||||
|
|
||||||
|
|
||||||
if newData.category == 2 then
|
if newData.category == 2 then
|
||||||
newData.category = 'vehicle'
|
newData.category = 'vehicle'
|
||||||
elseif newData.category == 3 then
|
elseif newData.category == 3 then
|
||||||
@@ -4837,9 +4790,6 @@ do -- group functions scope
|
|||||||
highNum = secondNum
|
highNum = secondNum
|
||||||
end
|
end
|
||||||
local total = 1
|
local total = 1
|
||||||
if highNum > 50 then
|
|
||||||
return math.random(lowNum, highNum)
|
|
||||||
end
|
|
||||||
if math.abs(highNum - lowNum + 1) < 50 then -- if total values is less than 50
|
if math.abs(highNum - lowNum + 1) < 50 then -- if total values is less than 50
|
||||||
total = math.modf(50/math.abs(highNum - lowNum + 1)) -- make x copies required to be above 50
|
total = math.modf(50/math.abs(highNum - lowNum + 1)) -- make x copies required to be above 50
|
||||||
end
|
end
|
||||||
@@ -5243,8 +5193,7 @@ do -- mist.util scope
|
|||||||
|
|
||||||
function mist.utils.getHeadingPoints(point1, point2, north) -- sick of writing this out.
|
function mist.utils.getHeadingPoints(point1, point2, north) -- sick of writing this out.
|
||||||
if north then
|
if north then
|
||||||
local p1 = mist.utils.makeVec3(point1)
|
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), mist.utils.makeVec3(point1)), (mist.utils.makeVec3(point1)))
|
||||||
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), p1), p1)
|
|
||||||
else
|
else
|
||||||
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), mist.utils.makeVec3(point1)))
|
return mist.utils.getDir(mist.vec.sub(mist.utils.makeVec3(point2), mist.utils.makeVec3(point1)))
|
||||||
end
|
end
|
||||||
@@ -5888,8 +5837,8 @@ do -- mist.debug scope
|
|||||||
log:alert('insufficient libraries to run mist.debug.dump_G, you must disable the sanitization of the io and lfs libraries in ./Scripts/MissionScripting.lua')
|
log:alert('insufficient libraries to run mist.debug.dump_G, you must disable the sanitization of the io and lfs libraries in ./Scripts/MissionScripting.lua')
|
||||||
--trigger.action.outText(errmsg, 10)
|
--trigger.action.outText(errmsg, 10)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Write debug data to file.
|
--- Write debug data to file.
|
||||||
-- This function requires you to disable script sanitization
|
-- This function requires you to disable script sanitization
|
||||||
-- in $DCS_ROOT\Scripts\MissionScripting.lua to access lfs and io
|
-- in $DCS_ROOT\Scripts\MissionScripting.lua to access lfs and io
|
||||||
@@ -7704,10 +7653,7 @@ do
|
|||||||
--log:warn(s)
|
--log:warn(s)
|
||||||
if type(s) == 'table' then
|
if type(s) == 'table' then
|
||||||
local mType = s.markType
|
local mType = s.markType
|
||||||
--log:echo(s)
|
if mType == 'panel' then
|
||||||
|
|
||||||
if mType == 'panel' then
|
|
||||||
local markScope = s.markScope or "all"
|
|
||||||
if markScope == 'coa' then
|
if markScope == 'coa' then
|
||||||
trigger.action.markToCoalition(s.markId, s.text, s.pos, s.markFor, s.readOnly)
|
trigger.action.markToCoalition(s.markId, s.text, s.pos, s.markFor, s.readOnly)
|
||||||
elseif markScope == 'group' then
|
elseif markScope == 'group' then
|
||||||
@@ -7765,15 +7711,10 @@ do
|
|||||||
|
|
||||||
local function validateColor(val)
|
local function validateColor(val)
|
||||||
if type(val) == 'table' then
|
if type(val) == 'table' then
|
||||||
for i = 1, 4 do
|
for i = 1, #val do
|
||||||
if val[i] then
|
if type(val[i]) == 'number' and val[i] > 1 then
|
||||||
if type(val[i]) == 'number' and val[i] > 1 then
|
val[i] = val[i]/255 -- convert RGB values from 0-255 to 0-1 equivilent.
|
||||||
val[i] = val[i]/255 -- convert RGB values from 0-255 to 0-1 equivilent.
|
end
|
||||||
end
|
|
||||||
else
|
|
||||||
val[i] = 0.8
|
|
||||||
log:warn("index $1 of color to mist.marker.add was missing, defaulted to 0.8", i)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
elseif type(val) == 'string' then
|
elseif type(val) == 'string' then
|
||||||
val = mist.utils.hexToRGB(val)
|
val = mist.utils.hexToRGB(val)
|
||||||
@@ -7814,7 +7755,7 @@ do
|
|||||||
--log:info('create maker DB: $1', e.idx)
|
--log:info('create maker DB: $1', e.idx)
|
||||||
mist.DBs.markList[e.idx] = {time = e.time, pos = e.pos, groupId = e.groupId, mType = 'panel', text = e.text, markId = e.idx, coalition = e.coalition}
|
mist.DBs.markList[e.idx] = {time = e.time, pos = e.pos, groupId = e.groupId, mType = 'panel', text = e.text, markId = e.idx, coalition = e.coalition}
|
||||||
if e.unit then
|
if e.unit then
|
||||||
mist.DBs.markList[e.idx].unit = e.initiator:getName()
|
mist.DBs.markList[e.idx].unit = e.intiator:getName()
|
||||||
end
|
end
|
||||||
--log:info(mist.marker.list[e.idx])
|
--log:info(mist.marker.list[e.idx])
|
||||||
end
|
end
|
||||||
@@ -7837,7 +7778,7 @@ do
|
|||||||
else
|
else
|
||||||
for mEntry, mData in pairs(mist.DBs.markList) do
|
for mEntry, mData in pairs(mist.DBs.markList) do
|
||||||
if id == mData.name or id == mData.id then
|
if id == mData.name or id == mData.id then
|
||||||
return mData.markId
|
return mData.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -7847,16 +7788,11 @@ do
|
|||||||
|
|
||||||
|
|
||||||
local function removeMark(id)
|
local function removeMark(id)
|
||||||
--log:info("Removing Mark: $1", id)
|
--log:info("Removing Mark: $1", id
|
||||||
local removed = false
|
local removed = false
|
||||||
if type(id) == 'table' then
|
if type(id) == 'table' then
|
||||||
for ind, val in pairs(id) do
|
for ind, val in pairs(id) do
|
||||||
local r
|
local r = getMarkId(val)
|
||||||
if type(val) == "table" and val.markId then
|
|
||||||
r = val.markId
|
|
||||||
else
|
|
||||||
r = getMarkId(val)
|
|
||||||
end
|
|
||||||
if r then
|
if r then
|
||||||
trigger.action.removeMark(r)
|
trigger.action.removeMark(r)
|
||||||
mist.DBs.markList[r] = nil
|
mist.DBs.markList[r] = nil
|
||||||
@@ -7866,11 +7802,9 @@ do
|
|||||||
|
|
||||||
else
|
else
|
||||||
local r = getMarkId(id)
|
local r = getMarkId(id)
|
||||||
if r then
|
trigger.action.removeMark(r)
|
||||||
trigger.action.removeMark(r)
|
mist.DBs.markList[r] = nil
|
||||||
mist.DBs.markList[r] = nil
|
removed = true
|
||||||
removed = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return removed
|
return removed
|
||||||
end
|
end
|
||||||
@@ -7992,7 +7926,6 @@ do
|
|||||||
|
|
||||||
if markForCoa then
|
if markForCoa then
|
||||||
if type(markForCoa) == 'string' then
|
if type(markForCoa) == 'string' then
|
||||||
--log:warn("coa is string")
|
|
||||||
if tonumber(markForCoa) then
|
if tonumber(markForCoa) then
|
||||||
coa = coas[tonumber(markForCoa)]
|
coa = coas[tonumber(markForCoa)]
|
||||||
markScope = 'coa'
|
markScope = 'coa'
|
||||||
@@ -8007,10 +7940,11 @@ do
|
|||||||
end
|
end
|
||||||
elseif type(markForCoa) == 'number' and markForCoa >=-1 and markForCoa <= #coas then
|
elseif type(markForCoa) == 'number' and markForCoa >=-1 and markForCoa <= #coas then
|
||||||
coa = markForCoa
|
coa = markForCoa
|
||||||
--log:warn("coa is number")
|
markScore = 'coa'
|
||||||
markScope = 'coa'
|
|
||||||
end
|
end
|
||||||
markFor = coa
|
|
||||||
|
|
||||||
|
|
||||||
elseif markFor then
|
elseif markFor then
|
||||||
if type(markFor) == 'number' then -- groupId
|
if type(markFor) == 'number' then -- groupId
|
||||||
if mist.DBs.groupsById[markFor] then
|
if mist.DBs.groupsById[markFor] then
|
||||||
@@ -8119,7 +8053,7 @@ do
|
|||||||
end
|
end
|
||||||
for i = 1, #markForTable do
|
for i = 1, #markForTable do
|
||||||
local newId = iterate()
|
local newId = iterate()
|
||||||
local data = {markId = newId, text = text, pos = pos[i], markScope = markScope, markFor = markForTable[i], markType = 'panel', name = name, readOnly = readOnly, time = timer.getTime()}
|
local data = {markId = newId, text = text, pos = pos[i], markFor = markForTable[i], markType = 'panel', name = name, readOnly = readOnly, time = timer.getTime()}
|
||||||
mist.DBs.markList[newId] = data
|
mist.DBs.markList[newId] = data
|
||||||
table.insert(list, data)
|
table.insert(list, data)
|
||||||
|
|
||||||
@@ -8243,7 +8177,6 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mist.marker.remove(id)
|
function mist.marker.remove(id)
|
||||||
|
|
||||||
return removeMark(id)
|
return removeMark(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -8775,13 +8708,6 @@ do -- group tasks scope
|
|||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
function mist.insertTaskToWP(wp, task)
|
|
||||||
if not wp.task then
|
|
||||||
wp.task = {["id"] = "ComboTask", ["params"] = {tasks = {}}}
|
|
||||||
end
|
|
||||||
table.insert(wp.task.params.tasks, task)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mist.ground.patrol(gpData, pType, form, speed)
|
function mist.ground.patrol(gpData, pType, form, speed)
|
||||||
local vars = {}
|
local vars = {}
|
||||||
@@ -9041,8 +8967,8 @@ do -- group tasks scope
|
|||||||
minR = mist.utils.get2DDist(avg, zone[i])
|
minR = mist.utils.get2DDist(avg, zone[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--log:warn('minR: $1', minR)
|
|
||||||
--log:warn('Radius: $1', radius)
|
--log:warn('Radius: $1', radius)
|
||||||
|
--log:warn('minR: $1', minR)
|
||||||
local lSpawnPos = {}
|
local lSpawnPos = {}
|
||||||
for j = 1, 100 do
|
for j = 1, 100 do
|
||||||
newCoord = mist.getRandPointInCircle(avg, radius)
|
newCoord = mist.getRandPointInCircle(avg, radius)
|
||||||
@@ -9274,7 +9200,7 @@ do -- group tasks scope
|
|||||||
function mist.groupIsDead(groupName) -- copy more or less from on station
|
function mist.groupIsDead(groupName) -- copy more or less from on station
|
||||||
local gp = Group.getByName(groupName)
|
local gp = Group.getByName(groupName)
|
||||||
if gp then
|
if gp then
|
||||||
if #gp:getUnits() > 0 and gp:isExist() == true then
|
if #gp:getUnits() > 0 or gp:isExist() == true then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user