mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 19:55:40 +02:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
073b9a72e2 | ||
|
|
ad299b227b | ||
|
|
7d3b99c1fd | ||
|
|
57771d94b7 | ||
|
|
d1bedf3e1c | ||
|
|
c4eb824c32 | ||
|
|
ab1e19b340 | ||
|
|
ba646a6c22 | ||
|
|
7e8b01c2aa | ||
|
|
7b907190f9 | ||
|
|
7f484bc1a1 | ||
|
|
c053d5d461 | ||
|
|
5b3d19e134 | ||
|
|
d885d2cd90 | ||
|
|
9f50bb1397 | ||
|
|
f7f688d1a5 | ||
|
|
81ff34014a | ||
|
|
9e0c515af0 | ||
|
|
9391d8778f | ||
|
|
1cfe5a1ea9 | ||
|
|
8d1835f6f5 |
@@ -14,17 +14,19 @@ Perun.UDPSourcePort = 48621 -- (int) UDP port to send data from
|
||||
Perun.Instance = 1 -- (int) Id number of instance (if multiple DCS instances are to run at the same PC)
|
||||
Perun.JsonStatusLocation = "Scripts\\Json\\" -- (string) folder relative do user's SaveGames DCS folder -> status file updated each RefreshMission
|
||||
Perun.MOTD_L1 = "Witamy na serwerze Gildia.org !" -- (string) Message send to players connecting the server - Line 1
|
||||
Perun.MOTD_L2 = "Wymagamy obecnosci na 255Mhz (DCS SRS)" -- (string) Message send to players connecting the server - Line 2
|
||||
Perun.MOTD_L2 = "Wymagamy obecnosci DCS SRS oraz TeamSpeak - szczegoly na forum" -- (string) Message send to players connecting the server - Line 2
|
||||
|
||||
-- ###################### END OF SETTINGS - DO NOT MODIFY OUTSIDE THIS SECTION ######################
|
||||
|
||||
|
||||
-- Variable init
|
||||
Perun.Version = "v0.4.1"
|
||||
Perun.Version = "v0.7.0"
|
||||
Perun.StatusData = {}
|
||||
Perun.SlotsData = {}
|
||||
Perun.MissionData = {}
|
||||
Perun.ServerData = {}
|
||||
Perun.StatData = {}
|
||||
Perun.StatDataLastType = {}
|
||||
Perun.MissionHash=""
|
||||
Perun.lastSentStatus =0
|
||||
Perun.lastSentMission =0
|
||||
@@ -169,7 +171,6 @@ Perun.UpdateJsonStatus = function()
|
||||
perun_export = io.open(Perun.JsonStatusLocation .. "perun_status_data.json", "w")
|
||||
perun_export:write(_temp .. "\n")
|
||||
perun_export:close()
|
||||
|
||||
end
|
||||
|
||||
Perun.Send = function(data_id, data_package)
|
||||
@@ -184,7 +185,7 @@ Perun.Send = function(data_id, data_package)
|
||||
temp=stripChars(temp)
|
||||
|
||||
Perun.UDP:send(temp)
|
||||
Perun.AddLog("Packet send")
|
||||
Perun.AddLog("Packet send "..data_id)
|
||||
end
|
||||
|
||||
Perun.UpdateStatusPart = function(part_id, data_package)
|
||||
@@ -237,6 +238,18 @@ Perun.UpdateStatus = function()
|
||||
|
||||
for j, i in pairs(Perun.SlotsData['coalitions']) do
|
||||
Perun.SlotsData['slots'][j]=DCS.getAvailableSlots(j)
|
||||
|
||||
for sj, si in pairs(Perun.SlotsData['slots'][j]) do
|
||||
Perun.SlotsData['slots'][j][sj]['countryName']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['onboard_num']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['groupSize']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['groupName']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['callsign']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['task']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['airdromeId']= nil
|
||||
Perun.SlotsData['slots'][j][sj]['helipadName']= nil
|
||||
end
|
||||
|
||||
end
|
||||
-- Send
|
||||
Perun.Send(3,Perun.SlotsData)
|
||||
@@ -262,11 +275,13 @@ Perun.LogChat = function(playerID,msg,all)
|
||||
Perun.Send(50,data)
|
||||
end
|
||||
|
||||
Perun.LogEvent = function(log_type,log_content)
|
||||
Perun.LogEvent = function(log_type,log_content,log_arg_1,log_arg_2)
|
||||
-- Log chat messages
|
||||
|
||||
data={}
|
||||
data['log_type']= log_type
|
||||
data['log_arg_1']= log_arg_1
|
||||
data['log_arg_2']= log_arg_2
|
||||
data['log_content']=log_content
|
||||
data['log_datetime']=os.date('%Y-%m-%d %H:%M:%S')
|
||||
data['log_missionhash']=Perun.MissionHash
|
||||
@@ -274,23 +289,140 @@ Perun.LogEvent = function(log_type,log_content)
|
||||
Perun.Send(51,data)
|
||||
end
|
||||
|
||||
Perun.LogStatsCount = function(argPlayerID,argAction,argType)
|
||||
-- Creates or updates Perun statistics array
|
||||
_ucid=net.get_player_info(argPlayerID, 'ucid')..argType
|
||||
|
||||
if Perun.StatData[_ucid] == nil then
|
||||
-- Create empty element
|
||||
_temp={}
|
||||
_temp['ps_type'] = argType
|
||||
_temp['ps_pvp'] = 0
|
||||
_temp['ps_deaths'] = 0
|
||||
_temp['ps_ejections'] = 0
|
||||
_temp['ps_crashes'] = 0
|
||||
_temp['ps_teamkills'] = 0
|
||||
_temp['ps_kills_planes'] = 0
|
||||
_temp['ps_kills_helicopters'] = 0
|
||||
_temp['ps_kills_air_defense'] = 0
|
||||
_temp['ps_kills_armor'] = 0
|
||||
_temp['ps_kills_unarmed'] = 0
|
||||
_temp['ps_kills_infantry'] = 0
|
||||
_temp['ps_kills_ships'] = 0
|
||||
_temp['ps_kills_fortification'] = 0
|
||||
_temp['ps_kills_other'] = 0
|
||||
_temp['ps_airfield_takeoffs'] = 0
|
||||
_temp['ps_airfield_landings'] = 0
|
||||
_temp['ps_ship_takeoffs'] = 0
|
||||
_temp['ps_ship_landings'] = 0
|
||||
_temp['ps_farp_takeoffs'] = 0
|
||||
_temp['ps_farp_landings'] = 0
|
||||
_temp['ps_other_takeoffs'] = 0
|
||||
_temp['ps_other_landings'] = 0
|
||||
|
||||
Perun.StatData[_ucid]=_temp
|
||||
end
|
||||
|
||||
if argType ~= nil then
|
||||
Perun.StatData[_ucid]['ps_type']=argType;
|
||||
Perun.StatDataLastType[net.get_player_info(argPlayerID, 'ucid')]=_ucid
|
||||
else
|
||||
-- Do nothing
|
||||
end
|
||||
|
||||
if argAction == "eject" then
|
||||
Perun.StatData[_ucid]['ps_ejections']=Perun.StatData[_ucid]['ps_ejections']+1
|
||||
elseif argAction == "pilot_death" then
|
||||
Perun.StatData[_ucid]['ps_deaths']=Perun.StatData[_ucid]['ps_deaths']+1
|
||||
elseif argAction == "friendly_fire" then
|
||||
Perun.StatData[_ucid]['ps_teamkills']=Perun.StatData[_ucid]['ps_teamkills']+1
|
||||
elseif argAction == "crash" then
|
||||
Perun.StatData[_ucid]['ps_crashes']=Perun.StatData[_ucid]['ps_crashes']+1
|
||||
elseif argAction == "landing_FARP" then
|
||||
Perun.StatData[_ucid]['ps_farp_landings']=Perun.StatData[_ucid]['ps_farp_landings']+1
|
||||
elseif argAction == "landing_SHIP" then
|
||||
Perun.StatData[_ucid]['ps_ship_landings']=Perun.StatData[_ucid]['ps_ship_landings']+1
|
||||
elseif argAction == "landing_AIRFIELD" then
|
||||
Perun.StatData[_ucid]['ps_airfield_landings']=Perun.StatData[_ucid]['ps_airfield_landings']+1
|
||||
elseif argAction == "tookoff_FARP" then
|
||||
Perun.StatData[_ucid]['ps_farp_takeoffs']=Perun.StatData[_ucid]['ps_farp_takeoffs']+1
|
||||
elseif argAction == "tookoff_SHIP" then
|
||||
Perun.StatData[_ucid]['ps_ship_takeoffs']=Perun.StatData[_ucid]['ps_ship_takeoffs']+1
|
||||
elseif argAction == "tookoff_AIRFIELD" then
|
||||
Perun.StatData[_ucid]['ps_airfield_takeoffs']=Perun.StatData[_ucid]['ps_airfield_takeoffs']+1
|
||||
elseif argAction == "kill_Planes" then
|
||||
Perun.StatData[_ucid]['ps_kills_planes']=Perun.StatData[_ucid]['ps_kills_planes']+1
|
||||
elseif argAction == "kill_Helicopters" then
|
||||
Perun.StatData[_ucid]['ps_kills_helicopters']=Perun.StatData[_ucid]['ps_kills_helicopters']+1
|
||||
elseif argAction == "kill_Ships" then
|
||||
Perun.StatData[_ucid]['ps_kills_ships']=Perun.StatData[_ucid]['ps_kills_ships']+1
|
||||
elseif argAction == "kill_Air_Defence" then
|
||||
Perun.StatData[_ucid]['ps_kills_air_defense']=Perun.StatData[_ucid]['ps_kills_air_defense']+1
|
||||
elseif argAction == "kill_Unarmed" then
|
||||
Perun.StatData[_ucid]['ps_kills_unarmed']=Perun.StatData[_ucid]['ps_kills_unarmed']+1
|
||||
elseif argAction == "kill_Armor" then
|
||||
Perun.StatData[_ucid]['ps_kills_armor']=Perun.StatData[_ucid]['ps_kills_armor']+1
|
||||
elseif argAction == "kill_Infantry" then
|
||||
Perun.StatData[_ucid]['ps_kills_infantry']=Perun.StatData[_ucid]['ps_kills_infantry']+1
|
||||
elseif argAction == "kill_Fortification" then
|
||||
Perun.StatData[_ucid]['ps_kills_fortification']=Perun.StatData[_ucid]['ps_kills_fortification']+1
|
||||
elseif argAction == "kill_Other" then
|
||||
Perun.StatData[_ucid]['ps_kills_other']=Perun.StatData[_ucid]['ps_kills_other']+1
|
||||
elseif argAction == "kill_PvP" then
|
||||
Perun.StatData[_ucid]['ps_pvp']=Perun.StatData[_ucid]['ps_pvp']+1
|
||||
elseif argAction == "landing_OTHER" then
|
||||
Perun.StatData[_ucid]['ps_other_landings']=Perun.StatData[_ucid]['ps_other_landings']+1
|
||||
elseif argAction == "tookoff_OTHER" then
|
||||
Perun.StatData[_ucid]['ps_other_takeoffs']=Perun.StatData[_ucid]['ps_other_takeoffs']+1
|
||||
end
|
||||
|
||||
Perun.LogStats(argPlayerID);
|
||||
end
|
||||
|
||||
Perun.LogStatsGet = function(playerID)
|
||||
-- Gets Perun statistics array per player
|
||||
|
||||
local next = next
|
||||
if next(Perun.StatDataLastType) == nil then
|
||||
_ucid=net.get_player_info(playerID, 'ucid')..DCS.getUnitType(playerID)
|
||||
elseif Perun.StatDataLastType[net.get_player_info(playerID, 'ucid')]== nil then
|
||||
_ucid=net.get_player_info(playerID, 'ucid')..DCS.getUnitType(playerID)
|
||||
else
|
||||
_ucid=Perun.StatDataLastType[net.get_player_info(playerID, 'ucid')]
|
||||
end
|
||||
|
||||
local next = next
|
||||
if next(Perun.StatData) == nil then
|
||||
Perun.LogStatsCount(playerID,'init')
|
||||
|
||||
end
|
||||
if Perun.StatData[_ucid]== nil then
|
||||
Perun.LogStatsCount(playerID,'init')
|
||||
end
|
||||
return Perun.StatData[_ucid];
|
||||
end
|
||||
|
||||
|
||||
|
||||
Perun.LogStats = function(playerID)
|
||||
-- Log player status
|
||||
|
||||
-- TBD : not working at the moment WIP
|
||||
p_stats={}
|
||||
p_stats['PS_CAR']=net.get_stat(playerID,2)
|
||||
p_stats['PS_PLANE']=net.get_stat(playerID,3)
|
||||
p_stats['PS_SHIP']=net.get_stat(playerID,4)
|
||||
p_stats['PS_SCORE']=net.get_stat(playerID,5)
|
||||
p_stats['PS_LAND']=net.get_stat(playerID,6)
|
||||
p_stats['PS_PING']=net.get_stat(playerID,0)
|
||||
p_stats['PS_CRASH']=net.get_stat(playerID,1)
|
||||
p_stats['PS_EJECT']=net.get_stat(playerID,7)
|
||||
p_stats['debug']="ok"
|
||||
-- TBD : DCS stats not working at the moment WIP
|
||||
p_stats_dcs={}
|
||||
p_stats_dcs['PS_CAR']=net.get_stat(playerID,2)
|
||||
p_stats_dcs['PS_PLANE']=net.get_stat(playerID,3)
|
||||
p_stats_dcs['PS_SHIP']=net.get_stat(playerID,4)
|
||||
p_stats_dcs['PS_SCORE']=net.get_stat(playerID,5)
|
||||
p_stats_dcs['PS_LAND']=net.get_stat(playerID,6)
|
||||
p_stats_dcs['PS_PING']=net.get_stat(playerID,0)
|
||||
p_stats_dcs['PS_CRASH']=net.get_stat(playerID,1)
|
||||
p_stats_dcs['PS_EJECT']=net.get_stat(playerID,7)
|
||||
|
||||
_temp=Perun.LogStatsGet(playerID)
|
||||
data={}
|
||||
data['stat_data']=p_stats
|
||||
data['stat_data_dcs']=p_stats_dcs
|
||||
data['stat_data_perun']=_temp
|
||||
data['stat_data_type']=_temp['ps_type'];
|
||||
data['stat_ucid']=net.get_player_info(playerID, 'ucid')
|
||||
data['stat_datetime']=os.date('%Y-%m-%d %H:%M:%S')
|
||||
data['stat_missionhash']=Perun.MissionHash
|
||||
@@ -314,15 +446,20 @@ end
|
||||
|
||||
Perun.onSimulationStart = function()
|
||||
Perun.MissionHash=DCS.getMissionName( ).."@".. Perun.Instance .. "@"..os.date('%Y%m%d_%H%M%S');
|
||||
Perun.LogEvent("SimStart","Mission " .. Perun.MissionHash .. " started");
|
||||
Perun.LogEvent("SimStart","Mission " .. Perun.MissionHash .. " started",nil,nil);
|
||||
Perun.StatData = {}
|
||||
Perun.StatDataLastType = {}
|
||||
end
|
||||
|
||||
Perun.onSimulationStop = function()
|
||||
Perun.LogEvent("SimStop","Mission " .. Perun.MissionHash .. " finished");
|
||||
Perun.LogEvent("SimStop","Mission " .. Perun.MissionHash .. " finished",nil,nil);
|
||||
Perun.MissionHash="";
|
||||
Perun.StatData = {}
|
||||
Perun.StatDataLastType = {}
|
||||
end
|
||||
|
||||
Perun.onPlayerDisconnect = function(id, err_code)
|
||||
Perun.LogEvent("disconnect", "Player " .. net.get_player_info(id, "name") .. " disconnected; " .. err_code);
|
||||
Perun.LogEvent("disconnect", "Player " .. net.get_player_info(id, "name") .. " disconnected; " .. err_code,net.get_player_info(id, "name"),err_code);
|
||||
end
|
||||
|
||||
Perun.onSimulationFrame = function()
|
||||
@@ -347,15 +484,11 @@ Perun.onSimulationFrame = function()
|
||||
|
||||
Perun.UpdateStatus()
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
Perun.onPlayerStart = function (id)
|
||||
net.send_chat(Perun.MOTD_L1, id);
|
||||
net.send_chat(Perun.MOTD_L2, id);
|
||||
net.send_chat_to(Perun.MOTD_L1, id);
|
||||
net.send_chat_to(Perun.MOTD_L2, id);
|
||||
end
|
||||
|
||||
Perun.onPlayerTrySendChat = function (playerID, msg, all)
|
||||
@@ -367,47 +500,74 @@ Perun.onPlayerTrySendChat = function (playerID, msg, all)
|
||||
end
|
||||
|
||||
Perun.onGameEvent = function (eventName,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
|
||||
|
||||
if eventName == "friendly_fire" then
|
||||
--"friendly_fire", playerID, weaponName, victimPlayerID
|
||||
|
||||
if arg2 == nil then
|
||||
arg2 = Gun
|
||||
if arg2 == "" then
|
||||
arg2 = "Cannon"
|
||||
end
|
||||
|
||||
Perun.LogEvent(eventName,Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name").." killed friendy " .. net.get_player_info(arg3, "name") .. " using " .. arg2);
|
||||
Perun.LogStats(arg1);
|
||||
Perun.LogEvent(eventName,Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name").." killed friendy " .. net.get_player_info(arg3, "name") .. " using " .. arg2,nil,nil);
|
||||
|
||||
if arg1 ~= arg3 then
|
||||
-- Perun.LogStatsCount(arg1,"friendly_fire",DCS.getUnitType(net.get_player_info(arg1 , 'slot')))
|
||||
end
|
||||
|
||||
elseif eventName == "mission_end" then
|
||||
--"mission_end", winner, msg
|
||||
Perun.LogEvent(eventName,"Mission finished, winner " .. arg1 .. " message: " .. arg2);
|
||||
Perun.LogEvent(eventName,"Mission finished, winner " .. arg1 .. " message: " .. arg2,nil,nil);
|
||||
|
||||
elseif eventName == "kill" then
|
||||
--"kill", killerPlayerID, killerUnitType, killerSide, victimPlayerID, victimUnitType, victimSide, weaponName
|
||||
_tempX=""
|
||||
if net.get_player_info(arg4, "name") ~= nil then
|
||||
_temp = " player ".. net.get_player_info(arg4, "name") .." ";
|
||||
_tempX = " player ".. net.get_player_info(arg4, "name") .." ";
|
||||
|
||||
Perun.LogStats(arg4);
|
||||
else
|
||||
_temp = " AI ";
|
||||
_tempX = " AI ";
|
||||
end
|
||||
|
||||
if net.get_player_info(arg1, "name") ~= nil then
|
||||
_temp2 = " player ".. net.get_player_info(arg1, "name") .." ";
|
||||
Perun.LogStats(arg1);
|
||||
if Perun.GetCategory(arg5) == "Planes" then
|
||||
Perun.LogStatsCount(arg1,"kill_Planes",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Helicopters" then
|
||||
Perun.LogStatsCount(arg1,"kill_Helicopters",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Ships" then
|
||||
Perun.LogStatsCount(arg1,"kill_Ships",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Air Defence" then
|
||||
Perun.LogStatsCount(arg1,"kill_Air_Defence",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Unarmed" then
|
||||
Perun.LogStatsCount(arg1,"kill_Unarmed",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Armor" then
|
||||
Perun.LogStatsCount(arg1,"kill_Armor",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Infantry" then
|
||||
Perun.LogStatsCount(arg1,"kill_Infantry",arg2)
|
||||
elseif Perun.GetCategory(arg5) == "Fortification" then
|
||||
Perun.LogStatsCount(arg1,"kill_Fortification",arg2)
|
||||
else
|
||||
Perun.LogStatsCount(arg1,"kill_Other",arg2)
|
||||
end
|
||||
if net.get_player_info(arg4, "name") ~= nil and arg3 ~= arg6 then
|
||||
Perun.LogStatsCount(arg1,"kill_PvP",arg2)
|
||||
end
|
||||
|
||||
if arg3 == arg6 then
|
||||
Perun.LogStatsCount(arg1,"friendly_fire",arg2)
|
||||
end
|
||||
|
||||
else
|
||||
_temp2 = " AI ";
|
||||
end
|
||||
|
||||
if arg7 == nil then
|
||||
arg7 = Gun
|
||||
if arg7 == "" then
|
||||
arg7 = "Cannon"
|
||||
end
|
||||
|
||||
Perun.LogEvent(eventName,Perun.SideID2Name(arg3) .. _temp2 .. " in " .. arg2 .. " killed " .. Perun.SideID2Name(arg6) .. _temp .. " in " .. arg5 .. " using " .. arg7 .. " [".. Perun.GetCategory(arg5).."]");
|
||||
|
||||
|
||||
Perun.LogEvent(eventName,Perun.SideID2Name(arg3) .. _temp2 .. " in " .. arg2 .. " killed " .. Perun.SideID2Name(arg6) .. _tempX .. " in " .. arg5 .. " using " .. arg7 .. " [".. Perun.GetCategory(arg5).."]",arg7,Perun.GetCategory(arg5));
|
||||
elseif eventName == "self_kill" then
|
||||
--"self_kill", playerID
|
||||
Perun.LogEvent(eventName,net.get_player_info(arg1, "name") .. " killed himself");
|
||||
Perun.LogEvent(eventName,net.get_player_info(arg1, "name") .. " killed himself",nil,nil);
|
||||
Perun.LogStats(arg1);
|
||||
|
||||
elseif eventName == "change_slot" then
|
||||
@@ -419,56 +579,74 @@ Perun.onGameEvent = function (eventName,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
|
||||
_temp = "SPECTATOR";
|
||||
end
|
||||
|
||||
Perun.LogEvent(eventName,Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " changed slot to " .. _temp);
|
||||
Perun.LogStats(arg1);
|
||||
Perun.LogEvent(eventName,Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " changed slot to " .. _temp,nil,nil);
|
||||
Perun.LogStatsCount(arg1,"init",_temp)
|
||||
|
||||
elseif eventName == "connect" then
|
||||
--"connect", playerID, name
|
||||
Perun.LogLogin(arg1);
|
||||
Perun.LogEvent(eventName,"Player "..net.get_player_info(arg1, "name") .. " connected");
|
||||
Perun.LogEvent(eventName,"Player "..net.get_player_info(arg1, "name") .. " connected",nil,nil);
|
||||
|
||||
elseif eventName == "disconnect" then
|
||||
--"disconnect", playerID, name, playerSide, reason_code
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name(arg3) .. " player " ..net.get_player_info(arg1, "name") .. " disconnected");
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name(arg3) .. " player " ..net.get_player_info(arg1, "name") .. " disconnected",nil,nil);
|
||||
Perun.LogStats(arg1);
|
||||
|
||||
elseif eventName == "crash" then
|
||||
--"crash", playerID, unit_missionID
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " crashed in " .. DCS.getUnitType(arg2));
|
||||
Perun.LogStats(arg1);
|
||||
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " crashed in " .. DCS.getUnitType(arg2),nil,nil);
|
||||
Perun.LogStatsCount(arg1,"crash",DCS.getUnitType(arg2))
|
||||
elseif eventName == "eject" then
|
||||
--"eject", playerID, unit_missionID
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " ejected " .. DCS.getUnitType(arg2));
|
||||
Perun.LogStats(arg1);
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " ejected " .. DCS.getUnitType(arg2),nil,nil);
|
||||
Perun.LogStatsCount(arg1,"eject",DCS.getUnitType(arg2));
|
||||
|
||||
elseif eventName == "takeoff" then
|
||||
--"takeoff", playerID, unit_missionID, airdromeName
|
||||
if arg3 then
|
||||
if arg3 ~= "" then
|
||||
_temp = " from " .. arg3;
|
||||
else
|
||||
_temp = "";
|
||||
end
|
||||
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " took off in ".. DCS.getUnitType(arg2) .. _temp);
|
||||
Perun.LogStats(arg1);
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " took off in ".. DCS.getUnitType(arg2) .. _temp,arg3,nil);
|
||||
|
||||
if string.find(arg3, "FARP",1,true) then
|
||||
Perun.LogStatsCount(arg1,"tookoff_FARP",DCS.getUnitType(arg2))
|
||||
elseif string.find(arg3, "CVN-74 John C. Stennis",1,true) or string.find(arg3, "LHA-1 Tarawa",1,true) then
|
||||
Perun.LogStatsCount(arg1,"tookoff_SHIP",DCS.getUnitType(arg2))
|
||||
elseif arg3 ~= "" then
|
||||
Perun.LogStatsCount(arg1,"tookoff_AIRFIELD",DCS.getUnitType(arg2))
|
||||
else
|
||||
Perun.LogStatsCount(arg1,"tookoff_OTHER",DCS.getUnitType(arg2))
|
||||
end
|
||||
|
||||
elseif eventName == "landing" then
|
||||
--"landing", playerID, unit_missionID, airdromeName
|
||||
if arg3 then
|
||||
if arg3 ~= "" then
|
||||
_temp = " at " .. arg3;
|
||||
else
|
||||
_temp ="";
|
||||
end
|
||||
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " landed in " .. DCS.getUnitType(arg2).. _temp);
|
||||
Perun.LogStats(arg1);
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " landed in " .. DCS.getUnitType(arg2).. _temp,arg3,nil);
|
||||
|
||||
if string.find(arg3, "FARP",1,true) then
|
||||
Perun.LogStatsCount(arg1,"landing_FARP",DCS.getUnitType(arg2))
|
||||
elseif string.find(arg3, "CVN-74 John C. Stennis",1,true) or string.find(arg3, "LHA-1 Tarawa",1,true) then
|
||||
Perun.LogStatsCount(arg1,"landing_SHIP",DCS.getUnitType(arg2))
|
||||
elseif arg3 ~= "" then
|
||||
Perun.LogStatsCount(arg1,"landing_AIRFIELD",DCS.getUnitType(arg2))
|
||||
else
|
||||
Perun.LogStatsCount(arg1,"landing_OTHER",DCS.getUnitType(arg2))
|
||||
end
|
||||
|
||||
elseif eventName == "pilot_death" then
|
||||
--"pilot_death", playerID, unit_missionID
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " in " .. DCS.getUnitType(arg2) .. " died");
|
||||
Perun.LogStats(arg1);
|
||||
|
||||
Perun.LogEvent(eventName, Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name") .. " in " .. DCS.getUnitType(arg2) .. " died",nil,nil);
|
||||
Perun.LogStatsCount(arg1,"pilot_death",DCS.getUnitType(arg2))
|
||||
else
|
||||
Perun.LogEvent(eventName,"Unknown event type");
|
||||
Perun.LogEvent(eventName,"Unknown event type",nil,nil);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -15,6 +15,7 @@ internal class DatabaseController
|
||||
string strUDPFrameTimestamp = strUDPFrame.timestamp;
|
||||
string strUDPFrameInstance = strUDPFrame.instance;
|
||||
string strUDPFramePayload = "";
|
||||
string strUDPFramePayload_Perun = "";
|
||||
string strSQLQueryTxt = "";
|
||||
|
||||
|
||||
@@ -49,19 +50,21 @@ internal class DatabaseController
|
||||
// Add entry to event log
|
||||
strSQLQueryTxt = "INSERT INTO `pe_DataMissionHashes` (`pe_DataMissionHashes_hash`,`pe_DataMissionHashes_instance`) SELECT '" + strUDPFrame.payload.log_missionhash + "','" + strUDPFrameInstance + "' FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_DataMissionHashes` where `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.log_missionhash + "' AND `pe_DataMissionHashes_instance`=" + strUDPFrameInstance + ");";
|
||||
strSQLQueryTxt += "UPDATE `pe_DataMissionHashes` SET `pe_DataMissionHashes_datetime` = " + strUDPFrameTimestamp + " WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.log_missionhash + "' AND `pe_DataMissionHashes_instance`=" + strUDPFrameInstance + ";";
|
||||
strSQLQueryTxt += "INSERT INTO `pe_LogEvent` (`pe_LogEvent_id`, `pe_LogEvent_datetime`, `pe_LogEvent_type`, `pe_LogEvent_content`,`pe_LogEvent_missionhash_id`) VALUES ( NULL, '" + strUDPFrame.payload.log_datetime + "', '" + strUDPFrame.payload.log_type + "', '" + strUDPFrame.payload.log_content + "', (SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.log_missionhash + "'));";
|
||||
strSQLQueryTxt += "INSERT INTO `pe_LogEvent` (`pe_LogEvent_arg1`,`pe_LogEvent_arg2`,`pe_LogEvent_id`, `pe_LogEvent_datetime`, `pe_LogEvent_type`, `pe_LogEvent_content`,`pe_LogEvent_missionhash_id`) VALUES ('"+ strUDPFrame.payload.log_arg_1 + "','"+ strUDPFrame.payload.log_arg_2 + "', NULL, '" + strUDPFrame.payload.log_datetime + "', '" + strUDPFrame.payload.log_type + "', '" + strUDPFrame.payload.log_content + "', (SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.log_missionhash + "'));";
|
||||
}
|
||||
else if (strUDPFrameType == "52")
|
||||
{
|
||||
// Update user stats
|
||||
strUDPFramePayload = JsonConvert.SerializeObject(strUDPFrame.payload.stat_data); // Deserialize payload
|
||||
strUDPFramePayload = JsonConvert.SerializeObject(strUDPFrame.payload.stat_data_dcs); // Deserialize payload
|
||||
strUDPFramePayload_Perun = JsonConvert.SerializeObject(strUDPFrame.payload.stat_data_perun); // Deserialize payload
|
||||
|
||||
strSQLQueryTxt = "INSERT INTO `pe_DataMissionHashes` (`pe_DataMissionHashes_hash`,`pe_DataMissionHashes_instance`) SELECT '" + strUDPFrame.payload.stat_missionhash + "','" + strUDPFrameInstance + "' FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_DataMissionHashes` where `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "' AND `pe_DataMissionHashes_instance`=" + strUDPFrameInstance + ");";
|
||||
strSQLQueryTxt += "UPDATE `pe_DataMissionHashes` SET `pe_DataMissionHashes_datetime` = " + strUDPFrameTimestamp + " WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "' AND `pe_DataMissionHashes_instance`=" + strUDPFrameInstance + " ;";
|
||||
strSQLQueryTxt += "INSERT INTO `pe_DataPlayers` (`pe_DataPlayers_ucid`) SELECT '" + strUDPFrame.payload.stat_ucid + "' FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_DataPlayers` where `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "');";
|
||||
strSQLQueryTxt += "UPDATE `pe_DataPlayers` SET `pe_DataPlayers_updated`=" + strUDPFrameTimestamp + " WHERE `pe_DataPlayers_ucid`='" + strUDPFrame.payload.stat_ucid + "';";
|
||||
strSQLQueryTxt += "INSERT INTO `pe_LogStats` (`pe_LogStats_playerid`,`pe_LogStats_missionhash_id`) SELECT (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "'), (SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_LogStats` WHERE `pe_LogStats_missionhash_id`=(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') AND `pe_LogStats_playerid` = (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "') );";
|
||||
strSQLQueryTxt += "UPDATE `pe_LogStats` SET `pe_LogStats_datetime`='" + strUDPFrame.payload.stat_datetime + "',`pe_LogStats_playerid` = (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "'),`pe_LogStats_debug`=JSON_QUOTE('" + strUDPFramePayload + "'),`pe_LogStats_missionhash_id`=(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') WHERE `pe_LogStats_missionhash_id`=(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') AND `pe_LogStats_playerid` = (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "');";
|
||||
strSQLQueryTxt += "INSERT INTO `pe_DataTypes` (`pe_DataTypes_name`) SELECT '" + strUDPFrame.payload.stat_data_type + "' FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_DataTypes` where `pe_DataTypes_name` = '" + strUDPFrame.payload.stat_data_type + "');";
|
||||
strSQLQueryTxt += "INSERT INTO `pe_LogStats` (`pe_LogStats_playerid`,`pe_LogStats_missionhash_id`,`pe_LogStats_typeid`) SELECT (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "'), (SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "'), (SELECT pe_DataTypes_id FROM `pe_DataTypes` where `pe_DataTypes_name` = '" + strUDPFrame.payload.stat_data_type + "') FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_LogStats` WHERE `pe_LogStats_missionhash_id`=(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') AND `pe_LogStats_playerid` = (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "') AND `pe_LogStats_typeid`= (SELECT pe_DataTypes_id FROM `pe_DataTypes` where `pe_DataTypes_name` = '" + strUDPFrame.payload.stat_data_type + "'));";
|
||||
strSQLQueryTxt += "UPDATE `pe_LogStats` SET `ps_kills_fortification`=" + strUDPFrame.payload.stat_data_perun.ps_kills_fortification + ",`ps_other_landings`=" + strUDPFrame.payload.stat_data_perun.ps_other_landings + ",`ps_other_takeoffs`=" + strUDPFrame.payload.stat_data_perun.ps_other_takeoffs + ",`ps_pvp`=" + strUDPFrame.payload.stat_data_perun.ps_pvp + ",`ps_deaths`=" + strUDPFrame.payload.stat_data_perun.ps_deaths + ",`ps_ejections`=" + strUDPFrame.payload.stat_data_perun.ps_ejections + ",`ps_crashes`=" + strUDPFrame.payload.stat_data_perun.ps_crashes + ",`ps_teamkills`=" + strUDPFrame.payload.stat_data_perun.ps_teamkills + ",`ps_kills_planes`=" + strUDPFrame.payload.stat_data_perun.ps_kills_planes + ",`ps_kills_helicopters`=" + strUDPFrame.payload.stat_data_perun.ps_kills_helicopters + ",`ps_kills_air_defense`=" + strUDPFrame.payload.stat_data_perun.ps_kills_air_defense + ",`ps_kills_armor`=" + strUDPFrame.payload.stat_data_perun.ps_kills_armor + ",`ps_kills_unarmed`=" + strUDPFrame.payload.stat_data_perun.ps_kills_unarmed + ",`ps_kills_infantry`=" + strUDPFrame.payload.stat_data_perun.ps_kills_infantry + ",`ps_kills_ships`=" + strUDPFrame.payload.stat_data_perun.ps_kills_ships + ",`ps_kills_other`=" + strUDPFrame.payload.stat_data_perun.ps_kills_other + ",`ps_airfield_takeoffs`=" + strUDPFrame.payload.stat_data_perun.ps_airfield_takeoffs + ",`ps_airfield_landings`=" + strUDPFrame.payload.stat_data_perun.ps_airfield_landings + ",`ps_ship_takeoffs`=" + strUDPFrame.payload.stat_data_perun.ps_ship_takeoffs + ",`ps_ship_landings`=" + strUDPFrame.payload.stat_data_perun.ps_ship_landings + ",`ps_farp_takeoffs`=" + strUDPFrame.payload.stat_data_perun.ps_farp_takeoffs + ",`ps_farp_landings`=" + strUDPFrame.payload.stat_data_perun.ps_farp_landings + ", `pe_LogStats_datetime`='" + strUDPFrame.payload.stat_datetime + "',`pe_LogStats_playerid` = (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "'),`pe_LogStats_missionhash_id`=(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') WHERE `pe_LogStats_missionhash_id`=(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = '" + strUDPFrame.payload.stat_missionhash + "') AND `pe_LogStats_playerid` = (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = '" + strUDPFrame.payload.stat_ucid + "') AND `pe_LogStats_typeid`=(SELECT pe_DataTypes_id FROM `pe_DataTypes` where `pe_DataTypes_name` = '" + strUDPFrame.payload.stat_data_type + "');";
|
||||
}
|
||||
else if (strUDPFrameType == "53")
|
||||
{
|
||||
@@ -95,7 +98,7 @@ internal class DatabaseController
|
||||
Console.WriteLine(rdrMySQL[0] + " -- " + rdrMySQL[1]);
|
||||
}
|
||||
rdrMySQL.Close();
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "MySQL updated, package type: " + strUDPFrameType);
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#"+strUDPFrameInstance + " > MySQL updated, package type: " + strUDPFrameType);
|
||||
}
|
||||
catch (ArgumentException a_ex)
|
||||
{
|
||||
|
||||
@@ -60,9 +60,15 @@
|
||||
this.tim_10000ms = new System.Windows.Forms.Timer(this.components);
|
||||
this.tim_200ms = new System.Windows.Forms.Timer(this.components);
|
||||
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.con_txt_3rd_lotatc2 = new System.Windows.Forms.MaskedTextBox();
|
||||
this.con_txt_3rd_srs2 = new System.Windows.Forms.MaskedTextBox();
|
||||
this.con_check_3rd_lotatc2 = new System.Windows.Forms.CheckBox();
|
||||
this.con_check_3rd_srs2 = new System.Windows.Forms.CheckBox();
|
||||
this.con_GroupBox_1.SuspendLayout();
|
||||
this.con_GroupBox_2.SuspendLayout();
|
||||
this.con_GroupBox_3.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// con_List_Received
|
||||
@@ -73,12 +79,12 @@
|
||||
"Welcome to Perun for DCS World!"});
|
||||
this.con_List_Received.Location = new System.Drawing.Point(6, 19);
|
||||
this.con_List_Received.Name = "con_List_Received";
|
||||
this.con_List_Received.Size = new System.Drawing.Size(307, 134);
|
||||
this.con_List_Received.Size = new System.Drawing.Size(307, 147);
|
||||
this.con_List_Received.TabIndex = 0;
|
||||
//
|
||||
// con_Button_Listen_ON
|
||||
//
|
||||
this.con_Button_Listen_ON.Location = new System.Drawing.Point(12, 434);
|
||||
this.con_Button_Listen_ON.Location = new System.Drawing.Point(12, 517);
|
||||
this.con_Button_Listen_ON.Name = "con_Button_Listen_ON";
|
||||
this.con_Button_Listen_ON.Size = new System.Drawing.Size(86, 39);
|
||||
this.con_Button_Listen_ON.TabIndex = 2;
|
||||
@@ -89,7 +95,7 @@
|
||||
// con_Button_Listen_OFF
|
||||
//
|
||||
this.con_Button_Listen_OFF.Enabled = false;
|
||||
this.con_Button_Listen_OFF.Location = new System.Drawing.Point(104, 434);
|
||||
this.con_Button_Listen_OFF.Location = new System.Drawing.Point(104, 517);
|
||||
this.con_Button_Listen_OFF.Name = "con_Button_Listen_OFF";
|
||||
this.con_Button_Listen_OFF.Size = new System.Drawing.Size(86, 39);
|
||||
this.con_Button_Listen_OFF.TabIndex = 3;
|
||||
@@ -100,9 +106,9 @@
|
||||
// con_GroupBox_1
|
||||
//
|
||||
this.con_GroupBox_1.Controls.Add(this.con_List_Received);
|
||||
this.con_GroupBox_1.Location = new System.Drawing.Point(12, 261);
|
||||
this.con_GroupBox_1.Location = new System.Drawing.Point(12, 335);
|
||||
this.con_GroupBox_1.Name = "con_GroupBox_1";
|
||||
this.con_GroupBox_1.Size = new System.Drawing.Size(324, 167);
|
||||
this.con_GroupBox_1.Size = new System.Drawing.Size(324, 176);
|
||||
this.con_GroupBox_1.TabIndex = 4;
|
||||
this.con_GroupBox_1.TabStop = false;
|
||||
this.con_GroupBox_1.Text = "UDP log";
|
||||
@@ -224,7 +230,7 @@
|
||||
this.con_GroupBox_3.Size = new System.Drawing.Size(324, 68);
|
||||
this.con_GroupBox_3.TabIndex = 6;
|
||||
this.con_GroupBox_3.TabStop = false;
|
||||
this.con_GroupBox_3.Text = "3rd Party";
|
||||
this.con_GroupBox_3.Text = "Instance #1";
|
||||
//
|
||||
// con_txt_3rd_lotatc
|
||||
//
|
||||
@@ -264,7 +270,7 @@
|
||||
//
|
||||
// con_Button_Quit
|
||||
//
|
||||
this.con_Button_Quit.Location = new System.Drawing.Point(250, 434);
|
||||
this.con_Button_Quit.Location = new System.Drawing.Point(251, 517);
|
||||
this.con_Button_Quit.Name = "con_Button_Quit";
|
||||
this.con_Button_Quit.Size = new System.Drawing.Size(86, 39);
|
||||
this.con_Button_Quit.TabIndex = 7;
|
||||
@@ -324,11 +330,61 @@
|
||||
this.notifyIcon1.Text = "notifyIcon1";
|
||||
this.notifyIcon1.Visible = true;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.con_txt_3rd_lotatc2);
|
||||
this.groupBox1.Controls.Add(this.con_txt_3rd_srs2);
|
||||
this.groupBox1.Controls.Add(this.con_check_3rd_lotatc2);
|
||||
this.groupBox1.Controls.Add(this.con_check_3rd_srs2);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 261);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(324, 68);
|
||||
this.groupBox1.TabIndex = 7;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Instance #2";
|
||||
//
|
||||
// con_txt_3rd_lotatc2
|
||||
//
|
||||
this.con_txt_3rd_lotatc2.Location = new System.Drawing.Point(123, 39);
|
||||
this.con_txt_3rd_lotatc2.Name = "con_txt_3rd_lotatc2";
|
||||
this.con_txt_3rd_lotatc2.Size = new System.Drawing.Size(190, 20);
|
||||
this.con_txt_3rd_lotatc2.TabIndex = 4;
|
||||
this.con_txt_3rd_lotatc2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.con_txt_3rd_lotatc2_Click);
|
||||
//
|
||||
// con_txt_3rd_srs2
|
||||
//
|
||||
this.con_txt_3rd_srs2.Location = new System.Drawing.Point(123, 16);
|
||||
this.con_txt_3rd_srs2.Name = "con_txt_3rd_srs2";
|
||||
this.con_txt_3rd_srs2.Size = new System.Drawing.Size(190, 20);
|
||||
this.con_txt_3rd_srs2.TabIndex = 3;
|
||||
this.con_txt_3rd_srs2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.con_txt_3rd_srs2_Click);
|
||||
//
|
||||
// con_check_3rd_lotatc2
|
||||
//
|
||||
this.con_check_3rd_lotatc2.AutoSize = true;
|
||||
this.con_check_3rd_lotatc2.Location = new System.Drawing.Point(6, 42);
|
||||
this.con_check_3rd_lotatc2.Name = "con_check_3rd_lotatc2";
|
||||
this.con_check_3rd_lotatc2.Size = new System.Drawing.Size(100, 17);
|
||||
this.con_check_3rd_lotatc2.TabIndex = 1;
|
||||
this.con_check_3rd_lotatc2.Text = "LotATC json file";
|
||||
this.con_check_3rd_lotatc2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// con_check_3rd_srs2
|
||||
//
|
||||
this.con_check_3rd_srs2.AutoSize = true;
|
||||
this.con_check_3rd_srs2.Location = new System.Drawing.Point(6, 19);
|
||||
this.con_check_3rd_srs2.Name = "con_check_3rd_srs2";
|
||||
this.con_check_3rd_srs2.Size = new System.Drawing.Size(111, 17);
|
||||
this.con_check_3rd_srs2.TabIndex = 0;
|
||||
this.con_check_3rd_srs2.Text = "DCS SRS json file";
|
||||
this.con_check_3rd_srs2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// form_Main
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(349, 483);
|
||||
this.ClientSize = new System.Drawing.Size(349, 558);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.con_lab_github);
|
||||
this.Controls.Add(this.con_Button_Quit);
|
||||
@@ -351,6 +407,8 @@
|
||||
this.con_GroupBox_2.PerformLayout();
|
||||
this.con_GroupBox_3.ResumeLayout(false);
|
||||
this.con_GroupBox_3.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -388,6 +446,11 @@
|
||||
private System.Windows.Forms.TextBox con_txt_mysql_port;
|
||||
private System.Windows.Forms.Timer tim_200ms;
|
||||
private System.Windows.Forms.NotifyIcon notifyIcon1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.MaskedTextBox con_txt_3rd_lotatc2;
|
||||
private System.Windows.Forms.MaskedTextBox con_txt_3rd_srs2;
|
||||
private System.Windows.Forms.CheckBox con_check_3rd_lotatc2;
|
||||
private System.Windows.Forms.CheckBox con_check_3rd_srs2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ namespace Perun_v1
|
||||
con_txt_3rd_srs.Text = Properties.Settings.Default.OTHER_SRS_FILE;
|
||||
con_check_3rd_lotatc.Checked = Properties.Settings.Default.OTHER_LOTATC_USE;
|
||||
con_check_3rd_srs.Checked = Properties.Settings.Default.OTHER_SRS_USE;
|
||||
con_txt_3rd_lotatc2.Text = Properties.Settings.Default.OTHER_LOTATC_FILE2;
|
||||
con_txt_3rd_srs2.Text = Properties.Settings.Default.OTHER_SRS_FILE2;
|
||||
con_check_3rd_lotatc2.Checked = Properties.Settings.Default.OTHER_LOTATC_USE2;
|
||||
con_check_3rd_srs2.Checked = Properties.Settings.Default.OTHER_SRS_USE2;
|
||||
}
|
||||
|
||||
private void form_Main_SaveSettings()
|
||||
@@ -57,6 +61,10 @@ namespace Perun_v1
|
||||
Properties.Settings.Default.OTHER_SRS_FILE = con_txt_3rd_srs.Text;
|
||||
Properties.Settings.Default.OTHER_LOTATC_USE = con_check_3rd_lotatc.Checked;
|
||||
Properties.Settings.Default.OTHER_SRS_USE = con_check_3rd_srs.Checked;
|
||||
Properties.Settings.Default.OTHER_LOTATC_FILE2 = con_txt_3rd_lotatc2.Text;
|
||||
Properties.Settings.Default.OTHER_SRS_FILE2 = con_txt_3rd_srs2.Text;
|
||||
Properties.Settings.Default.OTHER_LOTATC_USE2 = con_check_3rd_lotatc2.Checked;
|
||||
Properties.Settings.Default.OTHER_SRS_USE2 = con_check_3rd_srs2.Checked;
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
@@ -75,6 +83,10 @@ namespace Perun_v1
|
||||
con_txt_3rd_srs.Enabled = false;
|
||||
con_check_3rd_lotatc.Enabled = false;
|
||||
con_check_3rd_srs.Enabled = false;
|
||||
con_txt_3rd_lotatc2.Enabled = false;
|
||||
con_txt_3rd_srs2.Enabled = false;
|
||||
con_check_3rd_lotatc2.Enabled = false;
|
||||
con_check_3rd_srs2.Enabled = false;
|
||||
}
|
||||
|
||||
private void form_Main_EnableControls()
|
||||
@@ -92,6 +104,10 @@ namespace Perun_v1
|
||||
con_txt_3rd_srs.Enabled = true;
|
||||
con_check_3rd_lotatc.Enabled = true;
|
||||
con_check_3rd_srs.Enabled = true;
|
||||
con_txt_3rd_lotatc2.Enabled = true;
|
||||
con_txt_3rd_srs2.Enabled = true;
|
||||
con_check_3rd_lotatc2.Enabled = true;
|
||||
con_check_3rd_srs2.Enabled = true;
|
||||
}
|
||||
|
||||
// ################################ User input ################################
|
||||
@@ -172,6 +188,36 @@ namespace Perun_v1
|
||||
}
|
||||
}
|
||||
|
||||
private void con_txt_3rd_srs2_Click(object sender, MouseEventArgs e)
|
||||
{
|
||||
// Chose SRS Json file
|
||||
if (openFileDialog_SRS.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
con_txt_3rd_srs2.Text = openFileDialog_SRS.FileName;
|
||||
con_check_3rd_srs2.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
con_txt_3rd_srs2.Text = "";
|
||||
con_check_3rd_srs2.Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void con_txt_3rd_lotatc2_Click(object sender, MouseEventArgs e)
|
||||
{
|
||||
// Chose LotATC Json file
|
||||
if (openFileDialog_LotATC.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
con_txt_3rd_lotatc2.Text = openFileDialog_LotATC.FileName;
|
||||
con_check_3rd_lotatc2.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
con_txt_3rd_lotatc2.Text = "";
|
||||
con_check_3rd_lotatc2.Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
// ################################ Form state ################################
|
||||
private void con_Button_Quit_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -277,11 +323,15 @@ namespace Perun_v1
|
||||
// Main timer to send JSON files to MySQL
|
||||
string strSRSJson = "";
|
||||
string strLotATCJson = "";
|
||||
string strSRSJson2 = "";
|
||||
string strLotATCJson2 = "";
|
||||
|
||||
bool boolSRSdefault = true;
|
||||
bool boolLotATCdefault = true;
|
||||
bool boolSRSdefault2 = true;
|
||||
bool boolLotATCdefault2 = true;
|
||||
|
||||
// Handle SRS
|
||||
// Handle SRS - TBD clean code for multiinstance
|
||||
if (con_check_3rd_srs.Checked)
|
||||
{
|
||||
try
|
||||
@@ -330,12 +380,12 @@ namespace Perun_v1
|
||||
strSRSJson = "{'type':'100','instance':'1','payload':{'ignore':'false'}}"; // No SRS clients connected
|
||||
}
|
||||
boolSRSdefault = false;
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "SRS data loaded");
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#1 > SRS data loaded");
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "SRS data ERROR");
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#1 > SRS data ERROR");
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +396,71 @@ namespace Perun_v1
|
||||
}
|
||||
DatabaseController.SendToMySql(strSRSJson);
|
||||
|
||||
// Handle LotATC
|
||||
if (con_check_3rd_srs2.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
strSRSJson2 = System.IO.File.ReadAllText(con_txt_3rd_srs2.Text);
|
||||
dynamic raw_lotatc = JsonConvert.DeserializeObject(strSRSJson2);
|
||||
|
||||
for (int i = 0; i < raw_lotatc.Count; i++)
|
||||
{
|
||||
|
||||
if (raw_lotatc[i].RadioInfo != null)
|
||||
{
|
||||
|
||||
int temp = raw_lotatc[i].RadioInfo.radios.Count - 1;
|
||||
for (int j = temp; j >= 0; j--)
|
||||
{
|
||||
raw_lotatc[i].RadioInfo.radios[j].enc.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].encKey.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].encMode.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].freqMax.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].freqMin.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].modulation.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].freqMode.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].volMode.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].expansion.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].channel.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.radios[j].simul.Parent.Remove();
|
||||
|
||||
if (raw_lotatc[i].RadioInfo.radios[j].name == "No Radio")
|
||||
{
|
||||
raw_lotatc[i].RadioInfo.radios[j].Remove();
|
||||
}
|
||||
}
|
||||
raw_lotatc[i].ClientChannelId.Parent.Remove();
|
||||
raw_lotatc[i].RadioInfo.simultaneousTransmission.Parent.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (raw_lotatc.Count > 0)
|
||||
{
|
||||
strSRSJson2 = JsonConvert.SerializeObject(raw_lotatc);
|
||||
strSRSJson2 = "{'type':'100','instance':'2','payload':'" + strSRSJson2 + "'}";
|
||||
}
|
||||
else
|
||||
{
|
||||
strSRSJson2 = "{'type':'100','instance':'2','payload':{'ignore':'false'}}"; // No SRS clients connected
|
||||
}
|
||||
boolSRSdefault2 = false;
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#2 > SRS data loaded");
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#2 > SRS data ERROR");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (boolSRSdefault2)
|
||||
{
|
||||
strSRSJson = "{'type':'100','instance':'2','payload':{'ignore':'true'}}";
|
||||
}
|
||||
DatabaseController.SendToMySql(strSRSJson2);
|
||||
|
||||
// Handle LotATC - TBD clean code for multiinstance
|
||||
if (con_check_3rd_lotatc.Checked)
|
||||
{
|
||||
try
|
||||
@@ -356,21 +470,44 @@ namespace Perun_v1
|
||||
|
||||
strLotATCJson = "{'type':'101','instance':'1','payload':'" + strLotATCJson + "'}";
|
||||
boolLotATCdefault = false;
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "LotATC data loaded");
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#1 > LotATC data loaded");
|
||||
}
|
||||
catch
|
||||
{
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "LotATC data ERROR");
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#1 > LotATC data ERROR");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (boolLotATCdefault)
|
||||
{
|
||||
strLotATCJson = "{'type':'101','instance':'1','payload':{'ignore':'true'}}"; // No LotATC controller connected
|
||||
}
|
||||
DatabaseController.SendToMySql(strLotATCJson);
|
||||
|
||||
if (con_check_3rd_lotatc2.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
strLotATCJson2 = System.IO.File.ReadAllText(con_txt_3rd_lotatc2.Text);
|
||||
dynamic raw_srs = JsonConvert.DeserializeObject(strLotATCJson2);
|
||||
|
||||
strLotATCJson2 = "{'type':'101','instance':'2','payload':'" + strLotATCJson2 + "'}";
|
||||
boolLotATCdefault2 = false;
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#2 > LotATC data loaded");
|
||||
}
|
||||
catch
|
||||
{
|
||||
PerunHelper.LogHistoryAdd(ref Globals.arrLogHistory, "#2 > LotATC data ERROR");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (boolLotATCdefault2)
|
||||
{
|
||||
strLotATCJson = "{'type':'101','instance':'2','payload':{'ignore':'true'}}"; // No LotATC controller connected
|
||||
}
|
||||
DatabaseController.SendToMySql(strLotATCJson2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
<SuiteName>Perun</SuiteName>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>Perun.htm</WebPage>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>0.4.1.%2a</ApplicationVersion>
|
||||
<ApplicationRevision>6</ApplicationRevision>
|
||||
<ApplicationVersion>0.7.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
@@ -144,6 +144,7 @@
|
||||
</Compile>
|
||||
<None Include="00_Config\packages.config" />
|
||||
<None Include="00_Config\Perun_v1_TemporaryKey.pfx" />
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\app.manifest" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
|
||||
@@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
|
||||
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
|
||||
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.4.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.4.0.0")]
|
||||
[assembly: AssemblyVersion("0.7.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.0.0")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
|
||||
@@ -130,5 +130,53 @@ namespace Perun_v1.Properties {
|
||||
this["MYSQL_Port"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string OTHER_LOTATC_FILE2 {
|
||||
get {
|
||||
return ((string)(this["OTHER_LOTATC_FILE2"]));
|
||||
}
|
||||
set {
|
||||
this["OTHER_LOTATC_FILE2"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string OTHER_SRS_FILE2 {
|
||||
get {
|
||||
return ((string)(this["OTHER_SRS_FILE2"]));
|
||||
}
|
||||
set {
|
||||
this["OTHER_SRS_FILE2"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool OTHER_LOTATC_USE2 {
|
||||
get {
|
||||
return ((bool)(this["OTHER_LOTATC_USE2"]));
|
||||
}
|
||||
set {
|
||||
this["OTHER_LOTATC_USE2"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool OTHER_SRS_USE2 {
|
||||
get {
|
||||
return ((bool)(this["OTHER_SRS_USE2"]));
|
||||
}
|
||||
set {
|
||||
this["OTHER_SRS_USE2"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,5 +29,17 @@
|
||||
<Setting Name="MYSQL_Port" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">3306</Value>
|
||||
</Setting>
|
||||
<Setting Name="OTHER_LOTATC_FILE2" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="OTHER_SRS_FILE2" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="OTHER_LOTATC_USE2" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="OTHER_SRS_USE2" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
51
02_Windows_App/Perun_v1/app.config
Normal file
51
02_Windows_App/Perun_v1/app.config
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="Perun_v1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
<Perun_v1.Properties.Settings>
|
||||
<setting name="MYSQL_Server" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="MYSQL_User" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="MYSQL_Password" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="MYSQL_DB" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="OTHER_LOTATC_FILE" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="OTHER_SRS_FILE" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="OTHER_LOTATC_USE" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="OTHER_SRS_USE" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="MYSQL_Port" serializeAs="String">
|
||||
<value>3306</value>
|
||||
</setting>
|
||||
<setting name="OTHER_LOTATC_FILE2" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="OTHER_SRS_FILE2" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="OTHER_LOTATC_USE2" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="OTHER_SRS_USE2" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</Perun_v1.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
@@ -29,7 +29,8 @@ CREATE TABLE IF NOT EXISTS `pe_DataMissionHashes` (
|
||||
`pe_DataMissionHashes_hash` varchar(150) NOT NULL,
|
||||
`pe_DataMissionHashes_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`pe_DataMissionHashes_id`),
|
||||
UNIQUE KEY `UNIQUE_hash` (`pe_DataMissionHashes_hash`)
|
||||
UNIQUE KEY `UNIQUE_hash` (`pe_DataMissionHashes_hash`),
|
||||
KEY `pe_DataMissionHashes_instance` (`pe_DataMissionHashes_instance`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -42,8 +43,8 @@ DROP TABLE IF EXISTS `pe_DataPlayers`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_DataPlayers` (
|
||||
`pe_DataPlayers_id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`pe_DataPlayers_ucid` varchar(150) NOT NULL,
|
||||
`pe_DataPlayers_lastip` varchar(100) NOT NULL,
|
||||
`pe_DataPlayers_lastname` varchar(150) NOT NULL,
|
||||
`pe_DataPlayers_lastip` varchar(100) NOT NULL,
|
||||
`pe_DataPlayers_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`pe_DataPlayers_id`),
|
||||
UNIQUE KEY `UNIQUE_UCID` (`pe_DataPlayers_ucid`)
|
||||
@@ -66,6 +67,21 @@ CREATE TABLE IF NOT EXISTS `pe_DataRaw` (
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabeli dla tabeli `pe_DataTypes`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `pe_DataTypes`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_DataTypes` (
|
||||
`pe_DataTypes_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`pe_DataTypes_name` varchar(100) NOT NULL,
|
||||
`pe_DataTypes_update` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`pe_DataTypes_id`),
|
||||
UNIQUE KEY `UNIQUE_TYPE_NAME` (`pe_DataTypes_name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabeli dla tabeli `pe_LogChat`
|
||||
--
|
||||
@@ -78,7 +94,9 @@ CREATE TABLE IF NOT EXISTS `pe_LogChat` (
|
||||
`pe_LogChat_playerid` varchar(100) NOT NULL,
|
||||
`pe_LogChat_msg` text NOT NULL,
|
||||
`pe_LogChat_all` varchar(10) NOT NULL,
|
||||
PRIMARY KEY (`pe_LogChat_id`)
|
||||
PRIMARY KEY (`pe_LogChat_id`),
|
||||
KEY `pe_LogChat_missionhash_id` (`pe_LogChat_missionhash_id`),
|
||||
KEY `pe_LogChat_playerid` (`pe_LogChat_playerid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -90,11 +108,14 @@ CREATE TABLE IF NOT EXISTS `pe_LogChat` (
|
||||
DROP TABLE IF EXISTS `pe_LogEvent`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_LogEvent` (
|
||||
`pe_LogEvent_id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`pe_LogEvent_missionhash_id` bigint(20) DEFAULT NULL,
|
||||
`pe_LogEvent_datetime` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`pe_LogEvent_missionhash_id` bigint(20) DEFAULT NULL,
|
||||
`pe_LogEvent_type` varchar(100) NOT NULL,
|
||||
`pe_LogEvent_content` text NOT NULL,
|
||||
PRIMARY KEY (`pe_LogEvent_id`)
|
||||
`pe_LogEvent_arg1` varchar(150) DEFAULT NULL,
|
||||
`pe_LogEvent_arg2` varchar(150) DEFAULT NULL,
|
||||
PRIMARY KEY (`pe_LogEvent_id`),
|
||||
KEY `pe_LogEvent_missionhash_id` (`pe_LogEvent_missionhash_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -111,7 +132,8 @@ CREATE TABLE IF NOT EXISTS `pe_LogLogins` (
|
||||
`pe_LogLogins_playerid` bigint(20) DEFAULT NULL,
|
||||
`pe_LogLogins_name` varchar(150) NOT NULL,
|
||||
`pe_LogLogins_ip` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`pe_LogLogins_id`)
|
||||
PRIMARY KEY (`pe_LogLogins_id`),
|
||||
KEY `pe_LogLogins_playerid` (`pe_LogLogins_playerid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -123,12 +145,35 @@ CREATE TABLE IF NOT EXISTS `pe_LogLogins` (
|
||||
DROP TABLE IF EXISTS `pe_LogStats`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_LogStats` (
|
||||
`pe_LogStats_id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`pe_LogStats_missionhash_id` bigint(20) DEFAULT NULL,
|
||||
`pe_LogStats_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`pe_LogStats_missionhash_id` bigint(20) DEFAULT NULL,
|
||||
`pe_LogStats_playerid` bigint(20) DEFAULT NULL,
|
||||
`pe_LogStats_debug` text,
|
||||
`pe_LogStats_typeid` int(11) DEFAULT NULL,
|
||||
`ps_kills` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_pvp` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_deaths` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_ejections` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_crashes` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_teamkills` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_planes` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_helicopters` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_air_defense` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_armor` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_unarmed` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_infantry` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_ships` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_fortification` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_other` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_airfield_takeoffs` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_airfield_landings` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_ship_takeoffs` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_ship_landings` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_farp_takeoffs` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_farp_landings` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_other_landings` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_other_takeoffs` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`pe_LogStats_id`),
|
||||
UNIQUE KEY `UNIQUE_STATS_PER_MISSION_AND_UCID` (`pe_LogStats_playerid`,`pe_LogStats_missionhash_id`) USING BTREE
|
||||
UNIQUE KEY `UNIQUE_STATS_PER_MISSION_AND_UCID_AND_TYPE` (`pe_LogStats_playerid`,`pe_LogStats_missionhash_id`,`pe_LogStats_typeid`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
COMMIT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user