mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 18:05:40 +02:00
- motd will not be logged to chat log
- mission data will be added to json
This commit is contained in:
@@ -16,9 +16,10 @@
|
|||||||
-- ########### END OF SETTINGS ###########
|
-- ########### END OF SETTINGS ###########
|
||||||
|
|
||||||
-- Variable init
|
-- Variable init
|
||||||
Perun.Version = "v0.3.0"
|
Perun.Version = "v0.3.1"
|
||||||
Perun.StatusData = {}
|
Perun.StatusData = {}
|
||||||
Perun.SlotsData = {}
|
Perun.SlotsData = {}
|
||||||
|
Perun.MissionData = {}
|
||||||
Perun.VersionData = {}
|
Perun.VersionData = {}
|
||||||
Perun.lastSent =0
|
Perun.lastSent =0
|
||||||
Perun.JsonLocation = lfs.writedir() .. Perun.JsonLocation
|
Perun.JsonLocation = lfs.writedir() .. Perun.JsonLocation
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
TempData["1"]=Perun.VersionData
|
TempData["1"]=Perun.VersionData
|
||||||
TempData["2"]=Perun.StatusData
|
TempData["2"]=Perun.StatusData
|
||||||
TempData["3"]=Perun.SlotsData
|
TempData["3"]=Perun.SlotsData
|
||||||
|
TempData["4"]=Perun.MissionData
|
||||||
|
|
||||||
io.open(Perun.JsonLocation,"w"):close()
|
io.open(Perun.JsonLocation,"w"):close()
|
||||||
perun_export = io.open(Perun.JsonLocation, "w")
|
perun_export = io.open(Perun.JsonLocation, "w")
|
||||||
@@ -97,10 +99,10 @@
|
|||||||
Perun.Send(2,Perun.StatusData)
|
Perun.Send(2,Perun.StatusData)
|
||||||
end
|
end
|
||||||
|
|
||||||
Perun.UpdateMission = function()
|
Perun.UpdateSlots = function()
|
||||||
-- Main function for mission information updates
|
-- Main function for slot
|
||||||
|
|
||||||
-- Update Mission data
|
-- Update slots data
|
||||||
Perun.SlotsData['coalitions']=DCS.getAvailableCoalitions()
|
Perun.SlotsData['coalitions']=DCS.getAvailableCoalitions()
|
||||||
Perun.SlotsData['slots']={}
|
Perun.SlotsData['slots']={}
|
||||||
|
|
||||||
@@ -111,6 +113,16 @@
|
|||||||
Perun.Send(3,Perun.SlotsData)
|
Perun.Send(3,Perun.SlotsData)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Perun.UpdateMission = function()
|
||||||
|
-- Main function for mission information updates
|
||||||
|
|
||||||
|
-- Update Mission data
|
||||||
|
Perun.MissionData=DCS.getCurrentMission()
|
||||||
|
|
||||||
|
-- Send
|
||||||
|
-- Perun.Send(4,Perun.MissionData)
|
||||||
|
end
|
||||||
|
|
||||||
Perun.LogChat = function(playerID,msg,all)
|
Perun.LogChat = function(playerID,msg,all)
|
||||||
-- Log chat messages
|
-- Log chat messages
|
||||||
|
|
||||||
@@ -139,16 +151,17 @@
|
|||||||
if _now > Perun.lastSent + Perun.Refresh then
|
if _now > Perun.lastSent + Perun.Refresh then
|
||||||
Perun.lastSent = _now
|
Perun.lastSent = _now
|
||||||
|
|
||||||
Perun.UpdateMission()
|
Perun.UpdateSlots()
|
||||||
Perun.UpdateStatus()
|
Perun.UpdateStatus()
|
||||||
Perun.UpdateVersion()
|
Perun.UpdateVersion()
|
||||||
|
Perun.UpdateMission()
|
||||||
Perun.UpdateJson()
|
Perun.UpdateJson()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Perun.onMissionLoadEnd = function()
|
Perun.onMissionLoadEnd = function()
|
||||||
Perun.UpdateMission()
|
Perun.UpdateSlots()
|
||||||
Perun.UpdateJson()
|
Perun.UpdateJson()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -158,7 +171,10 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
Perun.onPlayerTrySendChat = function (playerID, msg, all)
|
Perun.onPlayerTrySendChat = function (playerID, msg, all)
|
||||||
|
if msg~=Perun.MOTD_L1 and msg~=Perun.MOTD_L2 then
|
||||||
Perun.LogChat(playerID,msg,all)
|
Perun.LogChat(playerID,msg,all)
|
||||||
|
end
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user