mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 17:05:39 +02:00
Additionaly diagostic package will carry total players connected as well.
This commit is contained in:
@@ -17,11 +17,11 @@
|
|||||||
-- ########### END OF SETTINGS ###########
|
-- ########### END OF SETTINGS ###########
|
||||||
|
|
||||||
-- Variable init
|
-- Variable init
|
||||||
Perun.Version = "v0.3.6"
|
Perun.Version = "v0.3.7"
|
||||||
Perun.StatusData = {}
|
Perun.StatusData = {}
|
||||||
Perun.SlotsData = {}
|
Perun.SlotsData = {}
|
||||||
Perun.MissionData = {}
|
Perun.MissionData = {}
|
||||||
Perun.VersionData = {}
|
Perun.ServerData = {}
|
||||||
Perun.MissionHash=""
|
Perun.MissionHash=""
|
||||||
Perun.lastSentStatus =0
|
Perun.lastSentStatus =0
|
||||||
Perun.lastSentMission =0
|
Perun.lastSentMission =0
|
||||||
@@ -68,10 +68,10 @@
|
|||||||
Perun.UpdateJson = function()
|
Perun.UpdateJson = function()
|
||||||
-- Updates main json file
|
-- Updates main json file
|
||||||
TempData={}
|
TempData={}
|
||||||
TempData["1"]=Perun.VersionData
|
TempData["1"]=Perun.ServerData
|
||||||
TempData["2"]=Perun.StatusData
|
TempData["2"]=Perun.StatusData
|
||||||
TempData["3"]=Perun.SlotsData
|
TempData["3"]=Perun.SlotsData
|
||||||
-- TempData["4"]=Perun.MissionData
|
TempData["4"]=Perun.MissionData
|
||||||
TempData["debug"]=net.get_player_list()
|
TempData["debug"]=net.get_player_list()
|
||||||
|
|
||||||
io.open(Perun.JsonLocation,"w"):close()
|
io.open(Perun.JsonLocation,"w"):close()
|
||||||
@@ -85,6 +85,7 @@
|
|||||||
TempData={}
|
TempData={}
|
||||||
TempData["type"]=data_id
|
TempData["type"]=data_id
|
||||||
TempData["payload"]=data_package
|
TempData["payload"]=data_package
|
||||||
|
TempData["timestamp"]=os.date('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
temp=net.lua2json(TempData)
|
temp=net.lua2json(TempData)
|
||||||
Perun.UDP:send(temp)
|
Perun.UDP:send(temp)
|
||||||
@@ -96,14 +97,20 @@
|
|||||||
Perun.StatusData[part_id] = data_package
|
Perun.StatusData[part_id] = data_package
|
||||||
end
|
end
|
||||||
|
|
||||||
Perun.UpdateVersion = function()
|
Perun.UpdateServer = function()
|
||||||
-- Main function for debug/version information
|
-- Main function for debug/version information
|
||||||
|
|
||||||
-- Update Mission data
|
-- Update version data
|
||||||
Perun.VersionData['v_dcs_hook']=Perun.Version
|
Perun.ServerData['v_dcs_hook']=Perun.Version
|
||||||
|
|
||||||
|
-- Update server data
|
||||||
|
_table=net.get_player_list()
|
||||||
|
_count = 0
|
||||||
|
for _ in pairs(_table) do _count = _count + 1 end
|
||||||
|
Perun.ServerData['c_players']=_count
|
||||||
|
|
||||||
-- Send
|
-- Send
|
||||||
Perun.Send(1,Perun.VersionData)
|
Perun.Send(1,Perun.ServerData)
|
||||||
end
|
end
|
||||||
|
|
||||||
Perun.UpdateStatus = function()
|
Perun.UpdateStatus = function()
|
||||||
@@ -124,8 +131,8 @@
|
|||||||
-- 2 - Players
|
-- 2 - Players
|
||||||
_temp = net.get_player_list()
|
_temp = net.get_player_list()
|
||||||
_temp2={}
|
_temp2={}
|
||||||
for _, i in pairs(_temp) do
|
for k, i in ipairs(_temp) do
|
||||||
_temp2[i]=net.get_player_info(i)
|
_temp2[k]=net.get_player_info(i)
|
||||||
end
|
end
|
||||||
Perun.UpdateStatusPart("players",_temp2)
|
Perun.UpdateStatusPart("players",_temp2)
|
||||||
|
|
||||||
@@ -242,7 +249,6 @@
|
|||||||
Perun.lastSentStatus = _now
|
Perun.lastSentStatus = _now
|
||||||
|
|
||||||
Perun.UpdateStatus()
|
Perun.UpdateStatus()
|
||||||
Perun.UpdateJson()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Send mission update
|
-- Send mission update
|
||||||
@@ -251,6 +257,7 @@
|
|||||||
|
|
||||||
Perun.UpdateSlots()
|
Perun.UpdateSlots()
|
||||||
Perun.UpdateMission()
|
Perun.UpdateMission()
|
||||||
|
Perun.UpdateServer()
|
||||||
|
|
||||||
Perun.UpdateJson()
|
Perun.UpdateJson()
|
||||||
end
|
end
|
||||||
@@ -260,8 +267,7 @@
|
|||||||
Perun.onMissionLoadEnd = function()
|
Perun.onMissionLoadEnd = function()
|
||||||
Perun.UpdateMission()
|
Perun.UpdateMission()
|
||||||
Perun.UpdateSlots()
|
Perun.UpdateSlots()
|
||||||
Perun.UpdateVersion()
|
Perun.UpdateServer()
|
||||||
Perun.UpdateJson()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Perun.onPlayerStart = function (id)
|
Perun.onPlayerStart = function (id)
|
||||||
|
|||||||
Reference in New Issue
Block a user