Skip to content

Commit

Permalink
Fix autoconnect disable
Browse files Browse the repository at this point in the history
Fix autoconnect disable
Fix VHF Encryption not working
Add channels to OH58
Fix F15E cold start SRS connection
  • Loading branch information
ciribob committed Jun 8, 2024
1 parent 9b165e9 commit e7d329f
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 38 deletions.
4 changes: 2 additions & 2 deletions AutoUpdater/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0.6")]
[assembly: AssemblyFileVersion("2.1.0.6")]
[assembly: AssemblyVersion("2.1.0.7")]
[assembly: AssemblyFileVersion("2.1.0.7")]
26 changes: 15 additions & 11 deletions DCS-SR-Client/Network/DCS/DCSAutoConnectHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DCSAutoConnectHandler
private UdpClient _dcsUdpListener;

private volatile bool _stop;

private static object _lock = new object();

public DCSAutoConnectHandler(MainWindow.ReceivedAutoConnect receivedAutoConnect)
{
Expand Down Expand Up @@ -108,22 +108,26 @@ private void HandleMessage(string message)
Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
new ThreadStart(delegate
{
message = message.Trim();
if (message.Contains(':'))
//ensure we only send one autoconnect at a time
lock (_lock)
{
try
message = message.Trim();
if (message.Contains(':'))
{
_receivedAutoConnect(address[0].Trim(), int.Parse(address[1].Trim()));
try
{
_receivedAutoConnect(address[0].Trim(), int.Parse(address[1].Trim()));
}
catch (Exception ex)
{
Logger.Error(ex, "Exception Parsing DCS AutoConnect Message");
}
}
catch (Exception ex)
else
{
Logger.Error(ex, "Exception Parsing DCS AutoConnect Message");
_receivedAutoConnect(message, 5002);
}
}
else
{
_receivedAutoConnect(message, 5002);
}
}));
}

Expand Down
4 changes: 2 additions & 2 deletions DCS-SR-Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.1.0.6")]
[assembly: AssemblyFileVersion("2.1.0.6")]
[assembly: AssemblyVersion("2.1.0.7")]
[assembly: AssemblyFileVersion("2.1.0.7")]
1 change: 1 addition & 0 deletions DCS-SR-Client/UI/ClientWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,7 @@ private void AutoConnect(string address, int port)
if (!enabled)
{
Logger.Info($"Ignored Autoconnect - not Enabled");
return;
}

if (ClientState.IsConnected)
Expand Down
2 changes: 1 addition & 1 deletion DCS-SR-Common/Network/UpdaterChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class UpdaterChecker

public static readonly string MINIMUM_PROTOCOL_VERSION = "1.9.0.0";

public static readonly string VERSION = "2.1.0.6";
public static readonly string VERSION = "2.1.0.7";

private static readonly Logger _logger = LogManager.GetCurrentClassLogger();

Expand Down
4 changes: 2 additions & 2 deletions DCS-SR-ExternalAudio/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0.6")]
[assembly: AssemblyFileVersion("2.1.0.6")]
[assembly: AssemblyVersion("2.1.0.7")]
[assembly: AssemblyFileVersion("2.1.0.7")]
4 changes: 2 additions & 2 deletions DCS-SimpleRadio Server/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.1.0.6")]
[assembly: AssemblyFileVersion("2.1.0.6")]
[assembly: AssemblyVersion("2.1.0.7")]
[assembly: AssemblyFileVersion("2.1.0.7")]
4 changes: 2 additions & 2 deletions Installer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.1.0.6")]
[assembly: AssemblyFileVersion("2.1.0.6")]
[assembly: AssemblyVersion("2.1.0.7")]
[assembly: AssemblyFileVersion("2.1.0.7")]
2 changes: 1 addition & 1 deletion Scripts/DCS-SRS-AutoConnectGameGUI.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Version 2.1.0.6
-- Version 2.1.0.7
-- ONLY COPY THIS WHOLE FILE IS YOU ARE GOING TO HOST A SERVER!
-- The file must be in Saved Games\DCS\Scripts\Hooks or Saved Games\DCS.openalpha\Scripts\Hooks
-- Make sure you enter the correct address into SERVER_SRS_HOST and SERVER_SRS_PORT (5002 by default) below.
Expand Down
6 changes: 3 additions & 3 deletions Scripts/DCS-SRS/Scripts/DCS-SRS-OverlayGameGUI.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- Version 2.1.0.6
-- Version 2.1.0.7
-- Make sure you COPY this file to the same location as the Export.lua as well!
-- Otherwise the Overlay will not work


net.log("Loading - DCS-SRS Overlay GameGUI - Ciribob: 2.1.0.6 ")
net.log("Loading - DCS-SRS Overlay GameGUI - Ciribob: 2.1.0.7 ")

local base = _G

Expand Down Expand Up @@ -704,4 +704,4 @@ end

DCS.setUserCallbacks(srsOverlay)

net.log("Loaded - DCS-SRS Overlay GameGUI - Ciribob: 2.1.0.6 ")
net.log("Loaded - DCS-SRS Overlay GameGUI - Ciribob: 2.1.0.7 ")
6 changes: 3 additions & 3 deletions Scripts/DCS-SRS/Scripts/DCS-SRSGameGUI.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- Version 2.1.0.6
-- Version 2.1.0.7
-- Make sure you COPY this file to the same location as the Export.lua as well!
-- Otherwise the Radio Might not work

net.log("Loading - DCS-SRS GameGUI - Ciribob: 2.1.0.6")
net.log("Loading - DCS-SRS GameGUI - Ciribob: 2.1.0.7")
local SRS = {}

SRS.CLIENT_ACCEPT_AUTO_CONNECT = true --- Set to false if you want to disable AUTO CONNECT
Expand Down Expand Up @@ -354,5 +354,5 @@ end

DCS.setUserCallbacks(SRS)

net.log("Loaded - DCS-SRS GameGUI - Ciribob: 2.1.0.6")
net.log("Loaded - DCS-SRS GameGUI - Ciribob: 2.1.0.7")

18 changes: 10 additions & 8 deletions Scripts/DCS-SRS/Scripts/DCS-SimpleRadioStandalone.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Version 2.1.0.6
-- Version 2.1.0.7
-- Special thanks to Cap. Zeen, Tarres and Splash for all the help
-- with getting the radio information :)
-- Run the installer to correctly install this file
Expand Down Expand Up @@ -1931,11 +1931,11 @@ function SR.exportRadioF15ESE(_data)

local _ufc = SR.getListIndicatorValue(9)

if string.find(_ufc.UFC_SC_05, "G",1,true) and _data.radios[2].freq > 1000 then
if _ufc and _ufc.UFC_SC_05 and string.find(_ufc.UFC_SC_05, "G",1,true) and _data.radios[2].freq > 1000 then
_data.radios[2].secFreq = setGuard(_data.radios[2].freq)
end

if string.find(_ufc.UFC_SC_08, "G",1,true) and _data.radios[3].freq > 1000 then
if _ufc and _ufc.UFC_SC_08 and string.find(_ufc.UFC_SC_08, "G",1,true) and _data.radios[3].freq > 1000 then
_data.radios[3].secFreq = setGuard(_data.radios[3].freq)
end

Expand Down Expand Up @@ -2427,7 +2427,7 @@ function SR.exportRadioOH58D(_data)
_data.radios[4].freq = SR.getRadioFrequency(31)
_data.radios[4].modulation = SR.getRadioModulation(31)
_data.radios[4].volMode = 0
_data.radios[3].encMode = 2
_data.radios[4].encMode = 2


_data.radios[5].name = "FM2"
Expand Down Expand Up @@ -2528,8 +2528,7 @@ function SR.exportRadioOH58D(_data)
-- ENCRYPTION START
for i = 1, 5 do
if _radioDisplay == nil then break end -- Probably no battery power so break
if i ~= 4 then
local _radioTranslate = i < 4 and i + 1 or i
local _radioTranslate = i < 5 and i + 1 or i
local _radioChannel = _radioDisplay["CHNL" .. i]
local _channelToEncKey = function ()
if _radioChannel == 'M' or _radioChannel == 'C' then
Expand All @@ -2541,7 +2540,10 @@ function SR.exportRadioOH58D(_data)

_data.radios[_radioTranslate].enc = tonumber(get_param_handle('Cipher_vis' .. i):get()) == 1 and 1 or 0
_data.radios[_radioTranslate].encKey = _channelToEncKey()
end

if _radioChannel ~= 'M' and _radioChannel ~= 'C' then
_data.radios[_radioTranslate].channel = _data.radios[_radioTranslate].encKey
end
end
-- ENCRYPTION END

Expand Down Expand Up @@ -7030,4 +7032,4 @@ end
-- Load mods' SRS plugins
SR.LoadModsPlugins()

SR.log("Loaded SimpleRadio Standalone Export version: 2.1.0.6")
SR.log("Loaded SimpleRadio Standalone Export version: 2.1.0.7")
2 changes: 1 addition & 1 deletion Scripts/DCS-SRS/entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare_plugin("DCS-SRS", {
developerName = _("Ciribob"),
developerLink = _("https://github.com/ciribob/DCS-SimpleRadioStandalone"),
displayName = _("DCS SimpleRadio Standalone"),
version = "2.1.0.6",
version = "2.1.0.7",
state = "installed",
info = _("DCS-SimpleRadio Standalone\n\nBrings realistic VoIP comms to DCS with a cockpit integration with every aircraft\n\nCheck Special Settings for SRS integration settings\n\nSRS Discord for Support: https://discord.gg/baw7g3t"),
binaries = {"srs.dll"},
Expand Down

0 comments on commit e7d329f

Please sign in to comment.