Skip to content

Commit

Permalink
Added slow slow mode back
Browse files Browse the repository at this point in the history
  • Loading branch information
quiet-node committed Mar 22, 2022
1 parent e2c31b9 commit 700ba60
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Airborne-CPS.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<TargetName>AirborneCPS</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\X-Plane 10\Resources\plugins</OutDir>
<OutDir>..\..\..\..\X-Plane 10\Resources\plugins</OutDir>
<IntDir>.\Debug\64\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetExt>.xpl</TargetExt>
Expand Down Expand Up @@ -298,7 +298,7 @@
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<AdditionalIncludeDirectories>C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\SDK\Delphi\Widgets;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\SDK\Delphi\XPLM;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\SDK\CHeaders\Widgets;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\SDK\CHeaders\XPLM;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\SDK\CHeaders;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\src</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>C:\Users\Oswego\Desktop\Airborne-CPS\SDK\Delphi\XPLM;C:\Users\Oswego\Desktop\Airborne-CPS\SDK\Delphi\Widgets;C:\Users\Oswego\Desktop\Airborne-CPS\SDK\CHeaders\XPLM;C:\Users\Oswego\Desktop\Airborne-CPS\SDK\CHeaders\Widgets;C:\Users\Oswego\Desktop\Airborne-CPS\SDK\CHeaders;C:\Users\Oswego\Desktop\Airborne-CPS\src</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMDATA_EXPORTS;IBM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Debug\64\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Debug\64\AirborneCPS.pch</PrecompiledHeaderOutputFile>
Expand Down Expand Up @@ -329,7 +329,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<ImportLibrary>.\Debug\64\ExampleGauge.lib</ImportLibrary>
<AdditionalLibraryDirectories>$(SolutionDir)\SDK\CHeaders\google\protobuf;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\Release\32;C:\Users\Oswego\Source\Repos\Logan31\Airborne-CPS\SDK\Libraries\Win</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\Users\Oswego\Desktop\Airborne-CPS\SDK\Libraries\Win</AdditionalLibraryDirectories>
<AdditionalDependencies>Opengl32.lib;odbc32.lib;odbccp32.lib;XPLM_64.lib;XPWidgets_64.lib;glaux.lib;glu32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down
Binary file modified utilities/TCPBeacons_CPP/TCPBeaconsServer.exe
Binary file not shown.
32 changes: 22 additions & 10 deletions utilities/TCPBeacons_CPP/TCPBeaconsServer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ void sendBeacons(SOCKET sock_, std::vector<std::string> beacons, int innerDelay,

int __cdecl main(int argc, char* argv[])
{
// >>> ATTRIBUTES <<<
std::string fileName, mode;
// >>> ATTRIBUTES <<<
std::string fileName, mode1, mode2;
int innerDelay = 10, outerDelay = 1000, wsOk;
std::vector<std::string> beacons;
sockaddr_in hint;
Expand All @@ -62,26 +62,38 @@ int __cdecl main(int argc, char* argv[])
std::cin >> fileName;
std::cout << "Parsing File: " + fileName << std::endl;
}
else if (argc == 2 || argc == 3 ) {
else if (argc == 2 || argc == 3 || argc == 4) {
fileName = argv[1];
std::cout << "Parsing File: " + fileName << std::endl;
if (argc == 3 ) {
mode = argv[2];
if (mode == "slow") {
if (argc == 3) {
mode1 = argv[2];
if (mode1 == "slow")
{
innerDelay = 100;
outerDelay = 10;
}
else if (mode == "slowest")
else
{
std::cout << "Unknown argument!! Please use the syntax : \nTCPBeaconsServer <filename> slow\nif you wish to invoke slow mode" << std::endl;
return 0;
}

}
else if (argc == 4) {
mode2 = argv[3];

if (mode2 == "slow")
{
innerDelay = 500;
outerDelay = 10;
}
else {
else
{
std::cout << "Unknown argument!! Please use the syntax : \nTCPBeaconsServer <filename> slow\nif you wish to invoke slow mode" << std::endl;
return 0;
}

}

}


Expand Down Expand Up @@ -196,7 +208,7 @@ int __cdecl main(int argc, char* argv[])
bool exit = false;
char buf[4096];

// Server sends beacons to clients through different threads
// Server sends beacons to clients through multi threads
std::thread th(sendBeacons, clientSocket, beacons, innerDelay, outerDelay);
th.detach();

Expand Down

0 comments on commit 700ba60

Please sign in to comment.