├── .gitattributes ├── .gitignore ├── App.config ├── AudioForVatsim ├── AfvManager.cs └── IAfvManager.cs ├── CONTRIBUTING.md ├── Common ├── AudioUtils.cs ├── CallsignStringExtensions.cs ├── ComboboxExtensions.cs ├── FileChecksum.cs ├── FlashTaskbar.cs ├── FlightPlan.cs ├── FlightPlanTypeExtensions.cs ├── FrequencyUtils.cs ├── JsonUtils.cs ├── ScreenUtils.cs ├── SerializationUtils.cs ├── SingleInstance.cs ├── StringUtils.cs ├── SystemIdentifier.cs ├── VoiceType.cs ├── VoiceTypeExtensions.cs ├── WindowProperties.cs └── WorldPoint.cs ├── Config ├── AppConfig.cs ├── IAppConfig.cs ├── PTTConfiguration.cs ├── StrictIntConverter.cs └── ToggleDisplayConfiguration.cs ├── ConnectForm.Designer.cs ├── ConnectForm.cs ├── ConnectForm.resx ├── Core ├── EventBus │ ├── EventBus.cs │ └── IEventBus.cs ├── EventTopics.cs ├── Events │ ├── AircraftUpdateReceivedEventArgs.cs │ ├── ChatSessionStartedEventArgs.cs │ ├── ClientEventArgs.cs │ ├── ComFrequencyAliasChangedEventArgs.cs │ ├── ComRadioTxRxChangedEventArgs.cs │ ├── ControllerEventArgs.cs │ ├── ControllerUpdateReceivedEventArgs.cs │ ├── DataRefEventArgs.cs │ ├── FlightPlanReceivedEventArgs.cs │ ├── IsValidAtcReceivedEventArgs.cs │ ├── MetarRequestedEventArgs.cs │ ├── NetworkConnectedEventArgs.cs │ ├── NetworkDataReceivedEventArgs.cs │ ├── NetworkDisconnectedEventArgs.cs │ ├── NotificationPostedEventArgs.cs │ ├── OverrideComStatusEventArgs.cs │ ├── PlaySoundEventArgs.cs │ ├── PrivateMessageSentEventArgs.cs │ ├── PushToTalkStateChangedEventArgs.cs │ ├── RadioMessageReceivedEventArgs.cs │ ├── RadioMessageSentEventArgs.cs │ ├── RadioStackStateChangedEventArgs.cs │ ├── RadioVolumeChangedEventArgs.cs │ ├── RealNameRequestedEventArgs.cs │ ├── RequestControllerAtisEventArgs.cs │ ├── RequestedAtisReceivedEventArgs.cs │ ├── SelcalAlertReceivedEventArgs.cs │ ├── SimulatorMessageEventArgs.cs │ ├── SquawkingIdentChangedEventArgs.cs │ ├── UserAircraftDataUpdatedEventArgs.cs │ └── WallopReceivedEventArgs.cs ├── IPttManager.cs ├── ISoundManager.cs ├── ITabPages.cs ├── IUserInterface.cs ├── IVersionCheck.cs ├── InjectionModules.cs ├── PttManager.cs ├── SoundManager.cs └── VersionCheck.cs ├── FlightPlanForm.Designer.cs ├── FlightPlanForm.cs ├── FlightPlanForm.resx ├── LICENSE ├── Libraries ├── GeoVR │ ├── GeoVR.Client │ │ ├── Audio │ │ │ ├── AfvMeteringSampleProvider.cs │ │ │ ├── Audio Tree │ │ │ │ ├── BiQuadFilterExt.cs │ │ │ │ ├── BlockingToneSampleProvider.cs │ │ │ │ ├── CallsignSampleProvider.cs │ │ │ │ ├── EqualizerSampleProvider.cs │ │ │ │ ├── ReceiverSampleProvider.cs │ │ │ │ ├── ResourceSoundSampleProvider.cs │ │ │ │ ├── Samples.cs │ │ │ │ └── SoundcardSampleProvider.cs │ │ │ ├── CallsignDelayCache.cs │ │ │ ├── Input.cs │ │ │ ├── LimiterEffect.cs │ │ │ ├── Output.cs │ │ │ └── ResourceSound.cs │ │ ├── CallRequestEventArgs.cs │ │ ├── CallResponseEventArgs.cs │ │ ├── Classes │ │ │ ├── AudioConfig.cs │ │ │ ├── ClientAudioUtilities.cs │ │ │ └── DataServerAcks.cs │ │ ├── Clients │ │ │ ├── BaseClient.cs │ │ │ ├── BotClient.cs │ │ │ ├── IClient.cs │ │ │ └── UserClient.cs │ │ ├── FodyWeavers.xml │ │ ├── FodyWeavers.xsd │ │ ├── GeoVR.Client.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Samples │ │ │ ├── AC_Bus_f32.wav │ │ │ ├── Click_f32.wav │ │ │ ├── Crackle_f32.wav │ │ │ ├── HF_WhiteNoise_f32.wav │ │ │ ├── Land_Line_Ring_f32.wav │ │ │ └── WhiteNoise_f32.wav │ ├── GeoVR.Connection │ │ ├── ApiServerConnection.cs │ │ ├── ApiServerConnectionPublic.cs │ │ ├── Classes │ │ │ └── ClientConnectionData.cs │ │ ├── ClientConnection.cs │ │ ├── Extension Methods │ │ │ └── DealerSocketExtensions.cs │ │ └── GeoVR.Connection.csproj │ ├── GeoVR.Shared │ │ ├── Classes │ │ │ ├── CallsignOnTransceiverNames.cs │ │ │ ├── Consts.cs │ │ │ └── XMLSettings.cs │ │ ├── DTOs │ │ │ ├── Client to API Server │ │ │ │ ├── PutUserEnableDto.cs │ │ │ │ ├── Request │ │ │ │ │ ├── PostCallsignRequestDto.cs │ │ │ │ │ ├── PostFsdStationRequestDto.cs │ │ │ │ │ ├── PostImpersonateUserRequestDto.cs │ │ │ │ │ ├── PostStationRequestDto.cs │ │ │ │ │ ├── PostStationSearchRequestDto.cs │ │ │ │ │ ├── PostStationTransceiverRequestDto.cs │ │ │ │ │ ├── PostStationTransceiverSearchRequestDto.cs │ │ │ │ │ ├── PostUserRequestDto.cs │ │ │ │ │ ├── PutBotRequestDto.cs │ │ │ │ │ ├── PutStationRequestDto.cs │ │ │ │ │ ├── PutStationTransceiverExclusionsRequestDto.cs │ │ │ │ │ ├── PutStationTransceiverRequestDto.cs │ │ │ │ │ └── PutVccsStationsRequestDto.cs │ │ │ │ └── Response │ │ │ │ │ ├── GetTokensResponseDto.cs │ │ │ │ │ ├── PostStationSearchResponseDto.cs │ │ │ │ │ └── PostTransceiverSearchResponseDto.cs │ │ │ ├── Client to Data Server │ │ │ │ ├── Ack │ │ │ │ │ └── UserDataHeartbeatAckDto.cs │ │ │ │ └── CallsignDataHeartbeatDto.cs │ │ │ ├── Client to Voice Server │ │ │ │ ├── AudioTxDto.cs │ │ │ │ ├── CallDto.cs │ │ │ │ ├── HeartbeatAckDto.cs │ │ │ │ └── HeartbeatDto.cs │ │ │ ├── Domain │ │ │ │ ├── CallsignTxTransceiversRxCallsigns.cs │ │ │ │ ├── CrossCoupleGroupDto.cs │ │ │ │ ├── DirectConfigurationDto.cs │ │ │ │ ├── DirectToCallsign.cs │ │ │ │ ├── PositionDto.cs │ │ │ │ ├── RxCallsignDto.cs │ │ │ │ ├── RxTransceiverDto.cs │ │ │ │ ├── StationDto.cs │ │ │ │ ├── StationFlatDto.cs │ │ │ │ ├── StationTransceiverDto.cs │ │ │ │ ├── StationTreeDto.cs │ │ │ │ ├── TransceiverDto.cs │ │ │ │ ├── TxTelephoneDto.cs │ │ │ │ ├── TxTransceiverDto.cs │ │ │ │ ├── TxTransceiverRxCallsigns.cs │ │ │ │ ├── UserDataDto.cs │ │ │ │ ├── UserDto.cs │ │ │ │ ├── VoiceRoomDto.cs │ │ │ │ └── VoiceRoomRxCallsignsDto.cs │ │ │ ├── IAck.cs │ │ │ ├── ShortDtoNames.cs │ │ │ └── Voice Server to Client │ │ │ │ └── AudioRxDto.cs │ │ ├── Enums │ │ │ └── DisconnectReasons.cs │ │ ├── Events │ │ │ ├── ConnectedEventArgs.cs │ │ │ ├── DisconnectedEventArgs.cs │ │ │ ├── NotificationEventArgs.cs │ │ │ └── TransceiverReceivingCallsignsChangedEventArgs.cs │ │ ├── Extensions │ │ │ ├── DebugStringExtensions.cs │ │ │ ├── ListTransceiversDtoExtensions.cs │ │ │ └── StationTransceiverDtoExtensions.cs │ │ ├── GeoVR.Shared.csproj │ │ └── Interfaces │ │ │ ├── IAudioDto.cs │ │ │ ├── ICallDto.cs │ │ │ ├── IMsgPack.cs │ │ │ └── IMsgPackTypeName.cs │ ├── GeoVR.sln │ └── Libraries │ │ ├── MessagePack.CryptoDto │ │ ├── Aead.cs │ │ ├── CryptoDtoAttribute.cs │ │ ├── CryptoDtoChannel.cs │ │ ├── CryptoDtoChannelConfigDto.cs │ │ ├── CryptoDtoChannelStore.cs │ │ ├── CryptoDtoDeserializer.cs │ │ ├── CryptoDtoHeaderDto.cs │ │ ├── CryptoDtoMode.cs │ │ ├── CryptoDtoSerializer.cs │ │ └── MessagePack.CryptoDto.csproj │ │ └── NaCl.Core │ │ ├── AssemblyInfo.cs │ │ ├── Base │ │ ├── ChaCha20Base.cs │ │ ├── ChaCha20BaseIntrinsics.cs │ │ ├── Snuffle.cs │ │ └── SnufflePoly1305.cs │ │ ├── ChaCha20.cs │ │ ├── ChaCha20Poly1305.cs │ │ ├── Internal │ │ ├── Array16.cs │ │ ├── Array8.cs │ │ ├── ByteIntegerConverter.cs │ │ └── CryptoBytes.cs │ │ ├── NaCl.Core.csproj │ │ ├── Poly1305.cs │ │ ├── XChaCha20.cs │ │ └── XChaCha20Poly1305.cs └── XPlaneConnector │ ├── Commands.cs │ ├── DataRefElement.cs │ ├── DataRefs.cs │ ├── StringDataRefElement.cs │ ├── XPDatagram.cs │ ├── XPlaneCommand.cs │ ├── XPlaneConnector.cs │ ├── XPlaneConnector.csproj │ └── license.txt ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Network ├── Aircraft │ ├── AircraftConfigurationInfo.cs │ ├── INetworkAircraftManager.cs │ ├── LegacyClientConfigFlags.cs │ ├── NetworkAircraft.cs │ ├── NetworkAircraftConfig.cs │ ├── NetworkAircraftManager.cs │ ├── NetworkAircraftState.cs │ └── NetworkAircraftTransponder.cs ├── ConnectInfo.cs ├── Controllers │ ├── Controller.cs │ ├── ControllerAtisManager.cs │ ├── ControllerManager.cs │ ├── IControllerAtisManager.cs │ └── IControllerManager.cs ├── DisconnectInfo.cs ├── FsdManager.cs ├── IFsdManger.cs ├── ISelcalGenerator.cs ├── SelcalGenerator.cs └── VatsimData.cs ├── PilotClient.licenseheader ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── README.md ├── Resources └── xPilot_Logo.png ├── SettingsForm.Designer.cs ├── SettingsForm.cs ├── SettingsForm.resx ├── SetupGuide.Designer.cs ├── SetupGuide.cs ├── SetupGuide.resx ├── SetupGuide ├── AudioConfiguration.Designer.cs ├── AudioConfiguration.cs ├── AudioConfiguration.resx ├── ConflictingPlugins.Designer.cs ├── ConflictingPlugins.cs ├── ConflictingPlugins.resx ├── CslConfiguration.Designer.cs ├── CslConfiguration.cs ├── CslConfiguration.resx ├── ISetup.cs ├── ISetupScreen.cs ├── NetworkCredentials.Designer.cs ├── NetworkCredentials.cs ├── NetworkCredentials.resx ├── PushToTalk.Designer.cs ├── PushToTalk.cs ├── PushToTalk.resx ├── SetXplanePath.Designer.cs ├── SetXplanePath.cs ├── SetXplanePath.resx ├── SetupScreen.cs ├── WelcomeView.Designer.cs ├── WelcomeView.cs └── WelcomeView.resx ├── UI ├── ChatBox.Designer.cs ├── ChatBox.cs ├── CustomTabControl.cs ├── FlatButton.cs ├── FlatCheckbox.cs ├── LevelMeter.cs ├── NotesTab.cs ├── PrivateMessageTab.cs ├── TextCommandLine.cs ├── TransparentClickLabel.cs └── TransparentClickPanel.cs ├── UpdateForm.Designer.cs ├── UpdateForm.cs ├── UpdateForm.resx ├── XPilot.PilotClient.csproj ├── XPilot.PilotClient.sln ├── XplaneAdapter ├── IUserAircraftManager.cs ├── IXplaneConnectionManager.cs ├── UserAircraftData.cs ├── UserAircraftManager.cs ├── UserAircraftRadioStack.cs ├── WhosOnlineList.cs ├── XplaneConnect.cs └── XplaneConnectionManager.cs ├── icon.ico └── packages.config /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AudioForVatsim/IAfvManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.AudioForVatsim 19 | { 20 | public interface IAfvManager 21 | { 22 | void UpdateVolumes(); 23 | void SetAudioEffectsDisabled(bool disabled); 24 | } 25 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to xPilot 3 | Thank you for your interest in contributing to the xPilot project! 4 | 5 | ## Contributions 6 | All contributions to this project should be made in the form of a GitHub pull request. Each pull request will be reviewed by the project owner. If the contribution is deemed to be beneficial, it will either be merged in or presented with feedback for changes that would be required. All accepted contributions will be licensed under [GPLv3](LICENSE.md). 7 | 8 | ## Getting started 9 | The first thing you should do is search through the [issues](https://github.com/xpilot-project/Pilot-Client/issues) and [pull requests](https://github.com/xpilot-project/Pilot-Client/pulls) to see if someone else had a similar idea or question. 10 | 11 | Pull requests are the easiest (and most preferred) way to contribute changes because they offer a clean way for commenting and revising of proposed changes. 12 | 13 | 1. Create a [GitHub account](https://github.com/join) if you don't already have one. 14 | 2. `Fork` the project repository by clicking the **Fork** button on top right of the repository page. ![fork](https://help.github.com/assets/images/help/repository/fork_button.jpg) 15 | 3. `Clone` your forked repository `git clone https://github.com/xpilot-project/Pilot-Client.git` 16 | 4. Add a new feature branch `git checkout -b My-Feature-Branch` 17 | 5. Make changes to the code and commit them locally (your commit message should describe what the changes are) 18 | 6. Push your new branch to your fork on GitHub `git push -u origin My-Feature-Branch` 19 | 7. From your forked GitHub repository, open a pull request in the branch that contains your contributions. If you need to add additional commits to your pull request, you can commit the changes to your local branch and then use the `git push` command to automatically update your pull request. 20 | 8. At this point, your contribution has been submitted for review. Any comments about your contribution will be posted in the pull request. 21 | 9. If your contributions are approved, your pull request will be merged into the main project. 22 | 23 | ## How do I test my changes on the network? 24 | Development builds of xPilot are prohibited from being connected to the live VATSIM network for testing. If you have a development build that you would like to test, please contact Justin Shannon on the [xPilot Discord](https://vats.im/xpilot-discord) for access to a FSD Developer server. 25 | -------------------------------------------------------------------------------- /Common/AudioUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Common 25 | { 26 | public static class AudioUtils 27 | { 28 | public static float ScaleVolumeDb(float valueIn, float limitMin, float limitMax, float baseMin, float baseMax) 29 | { 30 | return ((limitMax - limitMin) * (valueIn - baseMin) / (baseMax - baseMin)) + limitMin; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Common/CallsignStringExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Common 25 | { 26 | public static class CallsignStringExtensions 27 | { 28 | internal static bool FuzzyMatches(this string callsign, string compareTo) 29 | { 30 | GetPrefixSuffix(callsign, out string prefixA, out string suffixA); 31 | GetPrefixSuffix(compareTo, out string prefixB, out string suffixB); 32 | return (prefixA == prefixB) && (suffixA == suffixB); 33 | } 34 | 35 | private static void GetPrefixSuffix(string callsign, out string prefix, out string suffix) 36 | { 37 | string[] parts = callsign.Split(new char[] { '_', '-' }, StringSplitOptions.RemoveEmptyEntries); 38 | prefix = parts.First(); 39 | suffix = parts.Last(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Common/ComboboxExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.ComponentModel; 21 | using System.Linq; 22 | using System.Text; 23 | using System.Threading.Tasks; 24 | using System.Windows.Forms; 25 | 26 | namespace XPilot.PilotClient.Common 27 | { 28 | public static class ComboboxExtensions 29 | { 30 | public static void BindEnumToCombobox(this ComboBox comboBox, T defaultSelection) 31 | { 32 | var list = Enum.GetValues(typeof(T)) 33 | .Cast() 34 | .Select(value => new 35 | { 36 | Description = (Attribute.GetCustomAttribute(value.GetType().GetField(value.ToString()), typeof(DescriptionAttribute)) as DescriptionAttribute)?.Description ?? value.ToString(), 37 | Value = value 38 | }) 39 | .OrderBy(item => item.Value.ToString()) 40 | .ToList(); 41 | 42 | comboBox.DataSource = list; 43 | comboBox.DisplayMember = "Description"; 44 | comboBox.ValueMember = "Value"; 45 | 46 | foreach (var opts in list) 47 | { 48 | if (opts.Value.ToString() == defaultSelection.ToString()) 49 | { 50 | comboBox.SelectedItem = opts; 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Common/FileChecksum.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.IO; 20 | using System.Security.Cryptography; 21 | 22 | namespace XPilot.PilotClient.Common 23 | { 24 | public static class FileChecksum 25 | { 26 | public static string CalculateCheckSum(string file) 27 | { 28 | using (FileStream stream = File.OpenRead(file)) 29 | { 30 | SHA256 sha = new SHA256Managed(); 31 | byte[] hash = sha.ComputeHash(stream); 32 | return BitConverter.ToString(hash).Replace("-", string.Empty).ToLower(); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Common/FlightPlanTypeExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Common 25 | { 26 | public static class FlightPlanTypeExtensions 27 | { 28 | public static char ToChar(this FlightPlanType type) 29 | { 30 | char result; 31 | switch (type) 32 | { 33 | case FlightPlanType.IFR: 34 | result = 'I'; 35 | break; 36 | case FlightPlanType.VFR: 37 | result = 'V'; 38 | break; 39 | case FlightPlanType.DVFR: 40 | result = 'D'; 41 | break; 42 | case FlightPlanType.SVFR: 43 | result = 'S'; 44 | break; 45 | default: 46 | result = ' '; 47 | break; 48 | } 49 | return result; 50 | } 51 | 52 | public static FlightPlanType FromString(this FlightPlanType type, string typeString) 53 | { 54 | string text = typeString.ToUpper(); 55 | FlightPlanType result; 56 | switch (text) 57 | { 58 | case "IFR": 59 | case "I": 60 | result = FlightPlanType.IFR; 61 | break; 62 | case "VFR": 63 | case "V": 64 | result = FlightPlanType.VFR; 65 | break; 66 | case "DVFR": 67 | case "D": 68 | result = FlightPlanType.DVFR; 69 | break; 70 | case "SVFR": 71 | case "S": 72 | result = FlightPlanType.SVFR; 73 | break; 74 | default: 75 | result = FlightPlanType.IFR; 76 | break; 77 | } 78 | return result; 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Common/JsonUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using Newtonsoft.Json; 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Text; 23 | using System.Threading.Tasks; 24 | 25 | namespace XPilot.PilotClient.Common 26 | { 27 | public static class JsonUtils 28 | { 29 | public static string ToJSON(this object obj) 30 | { 31 | return JsonConvert.SerializeObject(obj, new JsonSerializerSettings 32 | { 33 | NullValueHandling = NullValueHandling.Ignore 34 | }); 35 | } 36 | 37 | public static T FromJSON(string str) 38 | { 39 | return JsonConvert.DeserializeObject(str); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Common/SerializationUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System.IO; 19 | using System.Xml; 20 | using System.Xml.Serialization; 21 | 22 | namespace XPilot.PilotClient.Common 23 | { 24 | public static class SerializationUtils 25 | { 26 | public static void SerializeObjectToFile(T obj, string path) 27 | { 28 | XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); 29 | using (StreamWriter streamWriter = new StreamWriter(path)) 30 | { 31 | xmlSerializer.Serialize(streamWriter, obj); 32 | } 33 | } 34 | 35 | public static T DeserializeObjectFromFile(string path) 36 | { 37 | XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); 38 | T result; 39 | using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read)) 40 | { 41 | T t = (T)((object)xmlSerializer.Deserialize(new XmlTextReader(fileStream) 42 | { 43 | Normalization = false 44 | })); 45 | bool flag = t is IDeserializationCallback; 46 | if (flag) 47 | { 48 | (t as IDeserializationCallback).OnDeserialize(); 49 | } 50 | result = t; 51 | } 52 | return result; 53 | } 54 | } 55 | 56 | public interface IDeserializationCallback 57 | { 58 | void OnDeserialize(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Common/StringUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.ComponentModel; 20 | using System.Globalization; 21 | using System.IO; 22 | using System.Linq; 23 | using System.Security.Cryptography; 24 | using System.Text; 25 | 26 | namespace XPilot.PilotClient.Common 27 | { 28 | public static class StringUtils 29 | { 30 | public static string GetDescription(this T e) where T : IConvertible 31 | { 32 | if (e is Enum) 33 | { 34 | Type type = e.GetType(); 35 | Array values = Enum.GetValues(type); 36 | 37 | foreach (int val in values) 38 | { 39 | if (val == e.ToInt32(CultureInfo.InvariantCulture)) 40 | { 41 | var memInfo = type.GetMember(type.GetEnumName(val)); 42 | var descriptionAttribute = memInfo[0] 43 | .GetCustomAttributes(typeof(DescriptionAttribute), false) 44 | .FirstOrDefault() as DescriptionAttribute; 45 | 46 | if (descriptionAttribute != null) 47 | { 48 | return descriptionAttribute.Description; 49 | } 50 | } 51 | } 52 | } 53 | return ""; 54 | } 55 | 56 | public static string CheckSum(this string filePath) 57 | { 58 | using (SHA512 crypto = SHA512.Create()) 59 | { 60 | using (FileStream fileStream = File.OpenRead(filePath)) 61 | return crypto.ComputeHash(fileStream).ToHex(); 62 | } 63 | } 64 | 65 | public static string ToHex(this byte[] bytes) 66 | { 67 | StringBuilder result = new StringBuilder(bytes.Length * 2); 68 | for (int i = 0; i < bytes.Length; i++) 69 | result.Append(bytes[i].ToString("x2")); 70 | return result.ToString(); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Common/SystemIdentifier.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Globalization; 20 | using System.Management; 21 | 22 | namespace XPilot.PilotClient.Common 23 | { 24 | public static class SystemIdentifier 25 | { 26 | public static string GetSystemDriveVolumeId() 27 | { 28 | try 29 | { 30 | string environmentVariable = Environment.GetEnvironmentVariable("SystemDrive"); 31 | ManagementObject managementObject = new ManagementObject(string.Format("win32_logicaldisk.deviceid=\"{0}\"", environmentVariable.ToUpper())); 32 | return int.Parse(managementObject.Properties["VolumeSerialNumber"].Value.ToString(), NumberStyles.HexNumber).ToString(); 33 | } 34 | catch 35 | { 36 | return "Unknown"; 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Common/VoiceType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Common 25 | { 26 | public enum VoiceType 27 | { 28 | Unknown, 29 | Full, 30 | ReceiveOnly, 31 | TextOnly 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Common/WindowProperties.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Drawing; 20 | using System.Text; 21 | using System.Windows.Forms; 22 | 23 | namespace XPilot.PilotClient.Common 24 | { 25 | public class WindowProperties 26 | { 27 | public Point Location = new Point(10, 10); 28 | public Size Size = new Size(800, 280); 29 | public bool Maximized = false; 30 | public bool Minimized = false; 31 | 32 | public WindowProperties() 33 | { 34 | 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Common/WorldPoint.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | 20 | namespace XPilot.PilotClient.Common 21 | { 22 | public struct WorldPoint 23 | { 24 | public double Lat { get; set; } 25 | public double Lon { get; set; } 26 | public WorldPoint(double lon, double lat) 27 | { 28 | this = default; 29 | Lat = lat; 30 | Lon = lon; 31 | } 32 | private static double RadiansToDegrees(double radians) 33 | { 34 | return radians / Math.PI * 180.0; 35 | } 36 | private static double DegreesToRadians(double degrees) 37 | { 38 | return degrees * 0.0174532925; 39 | } 40 | public override string ToString() 41 | { 42 | return string.Format("{0}, {1}", this.Lat, this.Lon); 43 | } 44 | public override bool Equals(object obj) 45 | { 46 | if (!(obj is WorldPoint other)) return false; 47 | return other.Lat == Lat && other.Lon == Lon; 48 | } 49 | public override int GetHashCode() 50 | { 51 | return base.GetHashCode(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Config/ToggleDisplayConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using System.Windows.Forms; 24 | 25 | namespace XPilot.PilotClient.Config 26 | { 27 | public enum ShortcutType { None, Keyboard } 28 | 29 | public class ToggleDisplayConfiguration : IEquatable 30 | { 31 | public ShortcutType ShortcutType { get; set; } 32 | 33 | public int KeyCode { get; set; } 34 | 35 | public override string ToString() 36 | { 37 | return string.Format("{0}", (Keys)KeyCode); 38 | } 39 | 40 | public bool Equals(ToggleDisplayConfiguration other) 41 | { 42 | return 43 | (other != null) && 44 | (other.ShortcutType == ShortcutType) && 45 | (other.KeyCode == KeyCode); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Core/EventBus/EventBus.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using Appccelerate.EventBroker; 19 | using System; 20 | 21 | namespace XPilot.PilotClient 22 | { 23 | public abstract class EventBus : IDisposable, IEventBus 24 | { 25 | protected IEventBroker eventBroker; 26 | protected EventBus(IEventBroker broker) 27 | { 28 | eventBroker = broker; 29 | } 30 | public virtual void Register() 31 | { 32 | eventBroker.Register(this); 33 | } 34 | public virtual void Dispose() 35 | { 36 | eventBroker?.Unregister(this); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Core/EventBus/IEventBus.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient 19 | { 20 | public interface IEventBus 21 | { 22 | void Register(); 23 | } 24 | } -------------------------------------------------------------------------------- /Core/Events/AircraftUpdateReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Aircraft; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class AircraftUpdateReceivedEventArgs : NetworkDataReceivedEventArgs 28 | { 29 | public NetworkAircraftState State { get; set; } 30 | public AircraftUpdateReceivedEventArgs() { } 31 | public AircraftUpdateReceivedEventArgs(string from, NetworkAircraftState aircraftState) : base(from, null) 32 | { 33 | State = aircraftState; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Core/Events/ChatSessionStartedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class ChatSessionStartedEventArgs : EventArgs 27 | { 28 | public string Callsign { get; set; } 29 | public ChatSessionStartedEventArgs() { } 30 | public ChatSessionStartedEventArgs(string callsign) : this() 31 | { 32 | Callsign = callsign; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/ClientEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class ClientEventArgs : EventArgs 27 | { 28 | public T Value { get; set; } 29 | public ClientEventArgs(T value) 30 | { 31 | Value = value; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Core/Events/ComFrequencyAliasChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class ComFrequencyAliasChangedEventArgs : EventArgs 27 | { 28 | public uint RadioNumber { get; set; } 29 | public uint HfFrequency { get; set; } 30 | public ComFrequencyAliasChangedEventArgs() 31 | { 32 | 33 | } 34 | public ComFrequencyAliasChangedEventArgs(uint id, uint hf) : this() 35 | { 36 | RadioNumber = id; 37 | HfFrequency = hf; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Core/Events/ComRadioTxRxChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class ComRadioTxRxChangedEventArgs : EventArgs 27 | { 28 | public int Radio { get; set; } 29 | public bool TxRx { get; set; } 30 | 31 | public ComRadioTxRxChangedEventArgs() 32 | { 33 | 34 | } 35 | public ComRadioTxRxChangedEventArgs(int radio, bool txRx) 36 | { 37 | Radio = radio; 38 | TxRx = txRx; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Core/Events/ControllerEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Network.Controllers; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class ControllerEventArgs : EventArgs 28 | { 29 | public Controller Controller { get; set; } 30 | public ControllerEventArgs() { } 31 | public ControllerEventArgs(Controller controller) : this() 32 | { 33 | Controller = controller; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Events/ControllerUpdateReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Common; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class ControllerUpdateReceivedEventArgs : NetworkDataReceivedEventArgs 28 | { 29 | public uint Frequency { get; set; } 30 | public WorldPoint Location { get; set; } 31 | public ControllerUpdateReceivedEventArgs() { } 32 | public ControllerUpdateReceivedEventArgs(string from, uint frequency, WorldPoint location) : base(from, null) 33 | { 34 | Frequency = frequency; 35 | Location = location; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Events/DataRefEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPlaneConnector; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class DataRefEventArgs : EventArgs 28 | { 29 | public XPlaneConnector.DataRefElement DataRef { get; set; } 30 | public float Value { get; set; } 31 | public DataRefEventArgs() { } 32 | public DataRefEventArgs(XPlaneConnector.DataRefElement dataRef, float value) 33 | { 34 | DataRef = dataRef; 35 | Value = value; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Events/FlightPlanReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Common; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class FlightPlanReceivedEventArgs : EventArgs 28 | { 29 | public FlightPlan FlightPlan { get; set; } 30 | public FlightPlanReceivedEventArgs() { } 31 | public FlightPlanReceivedEventArgs(FlightPlan flightPlan) : this() 32 | { 33 | FlightPlan = flightPlan; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Events/IsValidAtcReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class IsValidAtcReceivedEventArgs : NetworkDataReceivedEventArgs 27 | { 28 | public bool IsValidAtc { get; set; } 29 | public IsValidAtcReceivedEventArgs() { } 30 | public IsValidAtcReceivedEventArgs(string from, bool valid) : base(from, null) 31 | { 32 | IsValidAtc = valid; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/MetarRequestedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class MetarRequestedEventArgs : NetworkDataReceivedEventArgs 27 | { 28 | public string Station { get; set; } 29 | public MetarRequestedEventArgs() { } 30 | public MetarRequestedEventArgs(string station) : this() 31 | { 32 | Station = station; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/NetworkConnectedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Network; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class NetworkConnectedEventArgs : EventArgs 28 | { 29 | public ConnectInfo ConnectInfo { get; set; } 30 | public NetworkConnectedEventArgs() { } 31 | public NetworkConnectedEventArgs(ConnectInfo info) : this() 32 | { 33 | ConnectInfo = info; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Events/NetworkDataReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class NetworkDataReceivedEventArgs : EventArgs 27 | { 28 | public string From { get; set; } 29 | public string Data { get; set; } 30 | public NetworkDataReceivedEventArgs() { } 31 | public NetworkDataReceivedEventArgs(string from, string data) : this() 32 | { 33 | From = from; 34 | Data = data; 35 | } 36 | public NetworkDataReceivedEventArgs(string from) : this(from, null) 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Core/Events/NetworkDisconnectedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Network; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class NetworkDisconnectedEventArgs : EventArgs 28 | { 29 | public DisconnectInfo Info { get; set; } 30 | public NetworkDisconnectedEventArgs() { } 31 | public NetworkDisconnectedEventArgs(DisconnectInfo info) : this() 32 | { 33 | Info = info; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Events/NotificationPostedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public enum NotificationType 27 | { 28 | Info, 29 | Warning, 30 | Error, 31 | RadioMessage, 32 | DirectRadioMessage, 33 | SentRadioMessage, 34 | ServerMessage, 35 | BroadcastMessage 36 | } 37 | 38 | public class NotificationPostedEventArgs : EventArgs 39 | { 40 | public NotificationType Type { get; set; } 41 | public string Message { get; set; } 42 | public NotificationPostedEventArgs() { } 43 | public NotificationPostedEventArgs(NotificationType notificationType, string msgString) : this() 44 | { 45 | Type = notificationType; 46 | Message = msgString; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Core/Events/OverrideComStatusEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class OverrideComStatusEventArgs : EventArgs 27 | { 28 | public bool Com1Rx { get; set; } 29 | public bool Com1Tx { get; set; } 30 | public bool Com2Rx { get; set; } 31 | public bool Com2Tx { get; set; } 32 | public OverrideComStatusEventArgs() 33 | { 34 | 35 | } 36 | public OverrideComStatusEventArgs(bool com1Rx, bool com1Tx, bool com2Rx, bool com2Tx) : this() 37 | { 38 | Com1Rx = com1Rx; 39 | Com1Tx = com1Tx; 40 | Com2Rx = com2Rx; 41 | Com2Tx = com2Tx; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Core/Events/PlaySoundEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class PlaySoundEventArgs : EventArgs 27 | { 28 | public SoundEvent Sound { get; set; } 29 | public PlaySoundEventArgs() { } 30 | public PlaySoundEventArgs(SoundEvent sound) : this() 31 | { 32 | Sound = sound; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/PrivateMessageSentEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class PrivateMessageSentEventArgs : EventArgs 27 | { 28 | public string From { get; set; } 29 | public string To { get; set; } 30 | public string Message { get; set; } 31 | public PrivateMessageSentEventArgs() { } 32 | public PrivateMessageSentEventArgs(string from, string to, string message) : this() 33 | { 34 | From = from; 35 | To = to; 36 | Message = message; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Core/Events/PushToTalkStateChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class PushToTalkStateChangedEventArgs : EventArgs 27 | { 28 | public bool Down { get; set; } 29 | public PushToTalkStateChangedEventArgs() { } 30 | public PushToTalkStateChangedEventArgs(bool down) : this() 31 | { 32 | Down = down; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/RadioMessageReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class RadioMessageReceivedEventArgs : NetworkDataReceivedEventArgs 27 | { 28 | public int[] Frequencies { get; set; } 29 | public bool IsDirect { get; set; } 30 | public RadioMessageReceivedEventArgs() { } 31 | public RadioMessageReceivedEventArgs(string from, int[] frequencies, string data, bool direct) : base(from, data) 32 | { 33 | Frequencies = frequencies; 34 | IsDirect = direct; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Core/Events/RadioMessageSentEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class RadioMessageSentEventArgs : EventArgs 27 | { 28 | public string Callsign { get; set; } 29 | public string Message { get; set; } 30 | public int[] Frequencies { get; set; } 31 | public RadioMessageSentEventArgs() { } 32 | public RadioMessageSentEventArgs(string callsign, string message, int[] frequencies) : this() 33 | { 34 | Callsign = callsign; 35 | Message = message; 36 | Frequencies = frequencies; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Core/Events/RadioStackStateChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.XplaneAdapter; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class RadioStackStateChangedEventArgs : EventArgs 28 | { 29 | public UserAircraftRadioStack RadioStackState { get; set; } 30 | public RadioStackStateChangedEventArgs() { } 31 | public RadioStackStateChangedEventArgs(UserAircraftRadioStack data) : this() 32 | { 33 | RadioStackState = data; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Events/RadioVolumeChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class RadioVolumeChangedEventArgs : EventArgs 27 | { 28 | public int Radio { get; set; } 29 | public float Volume { get; set; } 30 | public RadioVolumeChangedEventArgs() { } 31 | public RadioVolumeChangedEventArgs(int radio, float volume) : this() 32 | { 33 | Radio = radio; 34 | Volume = volume; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Core/Events/RealNameRequestedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class RealNameRequestedEventArgs : EventArgs 27 | { 28 | public string Callsign { get; set; } 29 | public RealNameRequestedEventArgs() { } 30 | public RealNameRequestedEventArgs(string callsign) : this() 31 | { 32 | Callsign = callsign; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/RequestControllerAtisEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class RequestControllerAtisEventArgs : EventArgs 27 | { 28 | public string Callsign { get; set; } 29 | public RequestControllerAtisEventArgs() 30 | { 31 | 32 | } 33 | public RequestControllerAtisEventArgs(string callsign) 34 | { 35 | Callsign = callsign; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Events/RequestedAtisReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class RequestedAtisReceivedEventArgs : EventArgs 27 | { 28 | public string From { get; set; } 29 | public List Lines { get; set; } 30 | public RequestedAtisReceivedEventArgs() 31 | { 32 | 33 | } 34 | public RequestedAtisReceivedEventArgs(string from, List lines) : this() 35 | { 36 | From = from; 37 | Lines = lines; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Core/Events/SelcalAlertReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class SelcalAlertReceivedEventArgs : NetworkDataReceivedEventArgs 27 | { 28 | public int[] Frequencies { get; set; } 29 | public SelcalAlertReceivedEventArgs() { } 30 | public SelcalAlertReceivedEventArgs(string from, int[] frequencies) : base(from, null) 31 | { 32 | Frequencies = frequencies; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/SimulatorMessageEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class SimulatorMessageEventArgs : EventArgs 27 | { 28 | public string Text { get; set; } 29 | public bool PriorityMessage { get; set; } 30 | public int Red { get; set; } 31 | public int Green { get; set; } 32 | public int Blue { get; set; } 33 | public SimulatorMessageEventArgs() 34 | { 35 | 36 | } 37 | public SimulatorMessageEventArgs(string text, int red = 255, int green = 255, int blue = 255, bool priorityMessage = false) : this() 38 | { 39 | Text = text; 40 | Red = red; 41 | Green = green; 42 | Blue = blue; 43 | PriorityMessage = priorityMessage; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Core/Events/SquawkingIdentChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class SquawkingIdentChangedEventArgs : EventArgs 27 | { 28 | public bool SquawkingIdent { get; set; } 29 | public SquawkingIdentChangedEventArgs() { } 30 | public SquawkingIdentChangedEventArgs(bool ident) : this() 31 | { 32 | SquawkingIdent = ident; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Events/UserAircraftDataUpdatedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.XplaneAdapter; 24 | 25 | namespace XPilot.PilotClient.Core.Events 26 | { 27 | public class UserAircraftDataUpdatedEventArgs : EventArgs 28 | { 29 | public UserAircraftData UserAircraftData { get; set; } 30 | public UserAircraftDataUpdatedEventArgs() { } 31 | public UserAircraftDataUpdatedEventArgs(UserAircraftData data) : this() 32 | { 33 | UserAircraftData = data; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Events/WallopReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core.Events 25 | { 26 | public class WallopReceivedEventArgs : EventArgs 27 | { 28 | public string Message { get; set; } 29 | public WallopReceivedEventArgs() { } 30 | public WallopReceivedEventArgs(string message) : this() 31 | { 32 | Message = message; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/IPttManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Core 19 | { 20 | public interface IPttManager 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /Core/ISoundManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Core 19 | { 20 | public interface ISoundManager 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /Core/ITabPages.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Core 25 | { 26 | public interface ITabPages 27 | { 28 | PrivateMessageTab CreatePrivateMessageTab(string tabName, string initialMessage, bool isOurMessage, string ourCallsign); 29 | NotesTab CreateNotesTab(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Core/IUserInterface.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using XPilot.PilotClient.Properties; 24 | 25 | namespace XPilot.PilotClient.Core 26 | { 27 | public interface IUserInterface 28 | { 29 | MainForm CreateMainForm(); 30 | UpdateForm CreateUpdateForm(); 31 | SettingsForm CreateSettingsForm(); 32 | ConnectForm CreateConnectForm(); 33 | FlightPlanForm CreateFlightPlanForm(); 34 | SetupGuide CreateSetupGuideForm(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/IVersionCheck.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Core 19 | { 20 | public interface IVersionCheck 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /Core/InjectionModules.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using XPilot.PilotClient.AudioForVatsim; 19 | using XPilot.PilotClient.Config; 20 | using XPilot.PilotClient.Network; 21 | using XPilot.PilotClient.XplaneAdapter; 22 | using Appccelerate.EventBroker; 23 | using Ninject.Extensions.Factory; 24 | using Ninject.Modules; 25 | using XPilot.PilotClient.Network.Aircraft; 26 | using XPilot.PilotClient.Network.Controllers; 27 | 28 | namespace XPilot.PilotClient.Core 29 | { 30 | public class InjectionModules : NinjectModule 31 | { 32 | public override void Load() 33 | { 34 | Bind().ToFactory(); 35 | Bind().ToFactory(); 36 | Bind().To(typeof(EventBroker)).InSingletonScope(); 37 | Bind().To(typeof(AppConfig)).InSingletonScope(); 38 | Bind().To(typeof(FsdManager)).InSingletonScope(); 39 | Bind().To(typeof(AfvManager)).InSingletonScope(); 40 | Bind().To(typeof(SoundManager)).InSingletonScope(); 41 | Bind().To(typeof(XplaneConnectionManager)).InSingletonScope(); 42 | Bind().To(typeof(VersionCheck)).InSingletonScope(); 43 | Bind().To(typeof(UserAircraftManager)).InSingletonScope(); 44 | Bind().To(typeof(SelcalGenerator)).InSingletonScope(); 45 | Bind().To(typeof(NetworkAircraftManager)).InSingletonScope(); 46 | Bind().To(typeof(PttManager)).InSingletonScope(); 47 | Bind().To(typeof(ControllerManager)).InSingletonScope(); 48 | Bind().To(typeof(ControllerAtisManager)).InSingletonScope(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Audio/Audio Tree/BiQuadFilterExt.cs: -------------------------------------------------------------------------------- 1 | using NAudio.Dsp; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace GeoVR.Client 10 | { 11 | public class BiQuadFilterExt 12 | { 13 | public static BiQuadFilter Build(double a0, double a1, double a2, double b0, double b1, double b2) 14 | { 15 | Type[] paramTypes = new Type[] { typeof(double), typeof(double), typeof(double), typeof(double), typeof(double), typeof(double) }; 16 | object[] paramValues = new object[] { a0, a1, a2, b0, b1, b2 }; 17 | return Construct(paramTypes, paramValues); 18 | } 19 | 20 | public static T Construct(Type[] paramTypes, object[] paramValues) 21 | { 22 | Type t = typeof(T); 23 | 24 | ConstructorInfo ci = t.GetConstructor( 25 | BindingFlags.Instance | BindingFlags.NonPublic, 26 | null, paramTypes, null); 27 | 28 | return (T)ci.Invoke(paramValues); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Audio/Audio Tree/ResourceSoundSampleProvider.cs: -------------------------------------------------------------------------------- 1 | using NAudio.Wave; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GeoVR.Client 9 | { 10 | public class ResourceSoundSampleProvider : ISampleProvider 11 | { 12 | public float Gain { get; set; } 13 | public bool Looping { get; set; } 14 | 15 | private readonly ResourceSound resourceSound; 16 | private long position; 17 | private const int tempBufferSize = 9600; //9600 = 200ms 18 | private readonly float[] tempBuffer = new float[tempBufferSize]; 19 | 20 | public ResourceSoundSampleProvider(ResourceSound resourceSound) 21 | { 22 | Gain = 1f; 23 | this.resourceSound = resourceSound; 24 | } 25 | 26 | public int Read(float[] buffer, int offset, int count) 27 | { 28 | if (count > tempBufferSize) 29 | throw new Exception("Count too large for temp buffer"); 30 | 31 | var availableSamples = resourceSound.AudioData.Length - position; 32 | var samplesToCopy = Math.Min(availableSamples, count); 33 | 34 | if (Gain == 0.0f) 35 | { 36 | for (int i = 0; i < samplesToCopy; i++) 37 | { 38 | buffer[i] = 0; 39 | } 40 | } 41 | else 42 | { 43 | Array.Copy(resourceSound.AudioData, position, tempBuffer, 0, samplesToCopy); 44 | if (Gain != 1f) 45 | { 46 | for (int i = 0; i < samplesToCopy; i++) 47 | { 48 | tempBuffer[i] *= Gain; 49 | } 50 | } 51 | Array.Copy(tempBuffer, 0, buffer, offset, samplesToCopy); 52 | } 53 | position += samplesToCopy; 54 | if (Looping) 55 | { 56 | if(samplesToCopy < count) 57 | { 58 | //Inject a small amount of silence at the end before looping 59 | samplesToCopy = count; 60 | } 61 | if (position > resourceSound.AudioData.Length - 1) 62 | { 63 | position = 0; 64 | if (Gain != 0) 65 | position = 0; 66 | } 67 | } 68 | return (int)samplesToCopy; 69 | } 70 | 71 | public void ResetToStart(float gain) 72 | { 73 | position = 0; 74 | Gain = gain; 75 | } 76 | 77 | public WaveFormat WaveFormat { get { return resourceSound.WaveFormat; } } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Audio/Audio Tree/Samples.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Client 8 | { 9 | public class Samples 10 | { 11 | //Singleton Pattern 12 | private static readonly Lazy lazy = new Lazy(() => new Samples()); 13 | 14 | public static Samples Instance { get { return lazy.Value; } } 15 | 16 | private Samples() 17 | { 18 | HFWhiteNoise = new ResourceSound("GeoVR.Client.Samples.HF_WhiteNoise_f32.wav"); 19 | WhiteNoise = new ResourceSound("GeoVR.Client.Samples.WhiteNoise_f32.wav"); 20 | Crackle = new ResourceSound("GeoVR.Client.Samples.Crackle_f32.wav"); 21 | Click = new ResourceSound("GeoVR.Client.Samples.Click_f32.wav"); 22 | AcBus = new ResourceSound("GeoVR.Client.Samples.AC_Bus_f32.wav"); 23 | LandLineRing = new ResourceSound("GeoVR.Client.Samples.Land_Line_Ring_f32.wav"); 24 | } 25 | //End of Singleton Pattern 26 | 27 | public ResourceSound Crackle { get; private set; } 28 | public ResourceSound Click { get; private set; } 29 | public ResourceSound WhiteNoise { get; private set; } 30 | public ResourceSound HFWhiteNoise { get; private set; } 31 | public ResourceSound AcBus { get; private set; } 32 | public ResourceSound LandLineRing { get; private set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Audio/LimiterEffect.cs: -------------------------------------------------------------------------------- 1 | using NAudio.Wave; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GeoVR.Client.Audio 9 | { 10 | public class LimiterEffect : ISampleProvider 11 | { 12 | private readonly ISampleProvider sourceStream; 13 | private readonly object lockObject = new object(); 14 | 15 | public WaveFormat WaveFormat => sourceStream.WaveFormat; 16 | public bool Enabled { get; set; } = true; 17 | 18 | public LimiterEffect(ISampleProvider sourceStream) 19 | { 20 | this.sourceStream = sourceStream; 21 | } 22 | 23 | public int Read(float[] buffer, int offset, int count) 24 | { 25 | lock (lockObject) 26 | { 27 | int samplesRead = sourceStream.Read(buffer, offset, count); 28 | if (Enabled) 29 | { 30 | for (int sample = 0; sample < samplesRead; sample++) 31 | { 32 | if (buffer[offset + sample] > 1.0f) 33 | buffer[offset + sample] = 1.0f; 34 | if (buffer[offset + sample] < -1.0f) 35 | buffer[offset + sample] = -1.0f; 36 | } 37 | } 38 | return samplesRead; 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Audio/Output.cs: -------------------------------------------------------------------------------- 1 | using NAudio.CoreAudioApi; 2 | using NAudio.Wave; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace GeoVR.Client 10 | { 11 | public class Output 12 | { 13 | //private WaveOutEvent waveOut; 14 | private WasapiOut waveOut; 15 | 16 | public bool Started { get; private set; } 17 | 18 | public void Start(string outputDevice, ISampleProvider sampleProvider) 19 | { 20 | if (Started) 21 | throw new Exception("Output already started"); 22 | 23 | MMDevice device = ClientAudioUtilities.MapWasapiOutputDevice(outputDevice); 24 | waveOut = new WasapiOut(device, AudioClientShareMode.Shared, true, 20); 25 | waveOut.Init(sampleProvider); 26 | waveOut.Play(); 27 | 28 | Started = true; 29 | } 30 | 31 | public void Stop() 32 | { 33 | if (!Started) 34 | throw new Exception("Output not started"); 35 | 36 | Started = false; 37 | 38 | waveOut.Stop(); 39 | waveOut.Dispose(); 40 | waveOut = null; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Audio/ResourceSound.cs: -------------------------------------------------------------------------------- 1 | using NAudio.Wave; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace GeoVR.Client 10 | { 11 | public class ResourceSound 12 | { 13 | public float[] AudioData { get; private set; } 14 | public WaveFormat WaveFormat { get; private set; } 15 | public string FileName { get; private set; } 16 | public ResourceSound(string audioFileName) 17 | { 18 | FileName = audioFileName; 19 | using (var audioFileReader = new WaveFileReader(ExtractResourceStream(audioFileName))) 20 | { 21 | // TODO: could add resampling in here if required 22 | WaveFormat = audioFileReader.WaveFormat; 23 | var sampleProvider = audioFileReader.ToSampleProvider(); 24 | AudioData = new float[audioFileReader.SampleCount]; 25 | sampleProvider.Read(AudioData, 0, (int)audioFileReader.SampleCount); 26 | } 27 | } 28 | 29 | private static Stream ExtractResourceStream(string filename) 30 | { 31 | System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly(); 32 | return a.GetManifestResourceStream(filename); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/CallRequestEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Client 8 | { 9 | public class CallRequestEventArgs 10 | { 11 | public string Callsign { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/CallResponseEventArgs.cs: -------------------------------------------------------------------------------- 1 | using GeoVR.Shared; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GeoVR.Client 9 | { 10 | public class CallResponseEventArgs 11 | { 12 | public string Callsign { get; set; } 13 | public CallResponseEvent Event { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Classes/AudioConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Client 8 | { 9 | public class AudioConfig 10 | { 11 | //Thread-safe singleton Pattern 12 | private static readonly Lazy lazy = new Lazy(() => new AudioConfig()); 13 | 14 | public static AudioConfig Instance { get { return lazy.Value; } } 15 | 16 | private AudioConfig() 17 | { 18 | VhfEqualizer = EqualizerPresets.VHFEmulation; 19 | } 20 | //End of singleton pattern 21 | 22 | public EqualizerPresets VhfEqualizer { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Classes/DataServerAcks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Client 8 | { 9 | public class DataServerAcks 10 | { 11 | public int Heartbeat { get; set; } 12 | public int RadioTransceiverUpdate { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Clients/IClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Client 8 | { 9 | public interface IClient 10 | { 11 | //ClientStatistics ClientStatistics { get; } 12 | //ClientData ClientData { get; } 13 | 14 | //void SetupTransceivers(int numberOfTransceivers, string callsign); 15 | //bool PTT(int transceiverID, bool ptt); 16 | //void Frequency(int transceiverID, string frequency); 17 | //void Position(int transceiverID, double latDeg, double lonDeg, double groundAltM); 18 | 19 | bool Started { get; } 20 | DateTime StartDateTimeUtc { get; } 21 | 22 | void Stop(); //Can't have Start - different parameters 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | GeoVR.Shared 6 | GeoVR.Connection 7 | 8 | 9 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GeoVR.Client")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GeoVR.Client")] 13 | [assembly: AssemblyCopyright("Copyright © 2019 GeoVR")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d36af179-eb0e-4cef-aee8-68abd7abdb38")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.0.0")] 36 | [assembly: AssemblyFileVersion("1.1.0.0")] 37 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Samples/AC_Bus_f32.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Libraries/GeoVR/GeoVR.Client/Samples/AC_Bus_f32.wav -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Samples/Click_f32.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Libraries/GeoVR/GeoVR.Client/Samples/Click_f32.wav -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Samples/Crackle_f32.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Libraries/GeoVR/GeoVR.Client/Samples/Crackle_f32.wav -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Samples/HF_WhiteNoise_f32.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Libraries/GeoVR/GeoVR.Client/Samples/HF_WhiteNoise_f32.wav -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Samples/Land_Line_Ring_f32.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Libraries/GeoVR/GeoVR.Client/Samples/Land_Line_Ring_f32.wav -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Client/Samples/WhiteNoise_f32.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Libraries/GeoVR/GeoVR.Client/Samples/WhiteNoise_f32.wav -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Connection/ApiServerConnectionPublic.cs: -------------------------------------------------------------------------------- 1 | using GeoVR.Shared; 2 | using Newtonsoft.Json; 3 | using NLog; 4 | using RestSharp; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Diagnostics; 8 | using System.Threading.Tasks; 9 | 10 | namespace GeoVR.Connection 11 | { 12 | public class ApiServerConnectionPublic 13 | { 14 | private readonly Logger logger = NLog.LogManager.GetCurrentClassLogger(); 15 | private readonly string address; 16 | 17 | public ApiServerConnectionPublic(string address) 18 | { 19 | this.address = address; 20 | } 21 | 22 | public async Task> GetOnlineCallsigns() 23 | { 24 | return await Get>("api/v1/network/online/callsigns"); 25 | } 26 | 27 | public async Task>> GetOnlineCallsignsReceivingTransceivers() 28 | { 29 | return await Get>>("api/v1/network/online/callsignsReceivingTransceivers"); 30 | } 31 | 32 | private async Task Get(string resource) 33 | { 34 | var watch = Stopwatch.StartNew(); 35 | var client = new RestClient(address); 36 | var request = new RestRequest(resource, Method.GET); 37 | IRestResponse response = await client.ExecuteTaskAsync(request); 38 | watch.Stop(); 39 | logger.Debug(resource + " (" + watch.ElapsedMilliseconds + "ms)"); 40 | if (!response.IsSuccessful) 41 | throw new Exception(resource + " failed (" + response.StatusCode + " - " + response.Content + ")"); 42 | 43 | var responseDto = JsonConvert.DeserializeObject(response.Content); 44 | return responseDto; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Connection/Classes/ClientConnectionData.cs: -------------------------------------------------------------------------------- 1 | using GeoVR.Shared; 2 | using MessagePack.CryptoDto; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace GeoVR.Connection 10 | { 11 | public class ClientConnectionData 12 | { 13 | public ApiServerConnection ApiServerConnection { get; set; } 14 | 15 | public string Username { get; set; } 16 | public string Callsign { get; set; } 17 | 18 | public PostCallsignResponseDto Tokens { get; set; } 19 | public CryptoDtoChannel VoiceCryptoChannel { get; set; } 20 | //public CryptoDtoChannel DataCryptoChannel { get; set; } 21 | 22 | public DateTime VoiceConnectionDateTimeUtc { get; set; } 23 | public TimeSpan TimeSinceVoiceConnection { get { return DateTime.UtcNow.Subtract(VoiceConnectionDateTimeUtc); } } 24 | //public DateTime LastDataServerHeartbeatAckUtc { get; set; } 25 | public DateTime LastVoiceServerHeartbeatAckUtc { get; set; } 26 | public TimeSpan ServerTimeout { get; set; } = TimeSpan.FromSeconds(10); 27 | public bool VoiceServerAlive { get { return TimeSinceVoiceConnection < ServerTimeout || DateTime.UtcNow.Subtract(LastVoiceServerHeartbeatAckUtc) < ServerTimeout; } } 28 | //public bool DataServerAlive { get { return TimeSinceAuthentication < serverTimeout || DateTime.UtcNow.Subtract(LastDataServerHeartbeatAckUtc) < serverTimeout; } } 29 | 30 | public long VoiceServerBytesSent { get; set; } 31 | public long VoiceServerBytesReceived { get; set; } 32 | //public long DataServerBytesSent { get; set; } 33 | //public long DataServerBytesReceived { get; set; } 34 | 35 | public bool ReceiveAudio { get; set; } 36 | 37 | public bool IsConnected { get; set; } 38 | 39 | public Task TaskVoiceServerTransmit { get; set; } 40 | public Task TaskVoiceServerReceive { get; set; } 41 | public Task TaskVoiceServerHeartbeat { get; set; } 42 | 43 | public void CreateCryptoChannels() 44 | { 45 | if (Tokens == null) 46 | throw new Exception(nameof(Tokens) + " not set"); 47 | 48 | VoiceCryptoChannel = new CryptoDtoChannel(Tokens.VoiceServer.ChannelConfig); 49 | //DataCryptoChannel = new CryptoDtoChannel(Tokens.DataServer.ChannelConfig); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Connection/Extension Methods/DealerSocketExtensions.cs: -------------------------------------------------------------------------------- 1 | using MessagePack.CryptoDto; 2 | using MessagePack.CryptoDto.Managed; 3 | using NetMQ; 4 | using NetMQ.Sockets; 5 | 6 | namespace GeoVR.Connection 7 | { 8 | public static class DealerSocketExtensions 9 | { 10 | public static long SerialiseCryptoDto(this DealerSocket dealerSocket, object data, CryptoDtoChannel channel, CryptoDtoMode mode) 11 | { 12 | T typedData = (T)data; 13 | byte[] cryptoData = CryptoDtoSerializer.Serialize(channel, mode, typedData); 14 | 15 | dealerSocket 16 | .SendMoreFrameEmpty() 17 | .SendFrame(cryptoData); 18 | 19 | return cryptoData.Length; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Connection/GeoVR.Connection.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Classes/CallsignOnTransceiverNames.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Shared 8 | { 9 | public class CallsignOnTransceiverNames 10 | { 11 | public string Callsign { get; set; } 12 | public List TransceiverNames { get; set; } 13 | 14 | public override string ToString() 15 | { 16 | return Callsign + " [" + string.Join(", ", TransceiverNames) + "]"; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Classes/Consts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Shared 8 | { 9 | public static class Consts 10 | { 11 | public const double MilesToMeters = 1609.34; 12 | public const double MetersToFeet = 3.28084; 13 | public const double FeetToMeters = 0.3048; 14 | public const double NauticalMilesToMeters = 1852; 15 | public const double MetersToNauticalMiles = 0.000539957; 16 | public const double RadToDeg = 57.295779513082320876798154814105; 17 | public const double DegToRad = 0.01745329251994329576923690768489; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Classes/XMLSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using System.Xml.Serialization; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | public enum SettingsLocation 9 | { 10 | PublicDocuments, 11 | Local, 12 | Unknown 13 | } 14 | 15 | public static class XMLSettings 16 | { 17 | public static void Save(this T objectToSerialize, string name, SettingsLocation location) 18 | { 19 | string file = GetLocationPath(name, location); 20 | using (var stream = new FileStream(file, FileMode.Create)) 21 | { 22 | new XmlSerializer(typeof(T)).Serialize(stream, objectToSerialize); 23 | } 24 | } 25 | 26 | public static T Load(string name, SettingsLocation location) 27 | { 28 | string file = GetLocationPath(name, location); 29 | using (var stream = new FileStream(file, FileMode.Open)) 30 | { 31 | XmlSerializer s = new XmlSerializer(typeof(T)); 32 | return (T)s.Deserialize(stream); 33 | } 34 | } 35 | 36 | public static SettingsLocation GetLocation(string name) 37 | { 38 | string file = GetLocationPath(name, SettingsLocation.Local); 39 | if (File.Exists(file)) 40 | return SettingsLocation.Local; 41 | 42 | file = GetLocationPath(name, SettingsLocation.PublicDocuments); 43 | if (File.Exists(file)) 44 | return SettingsLocation.PublicDocuments; 45 | 46 | return SettingsLocation.Unknown; 47 | } 48 | 49 | private static string GetLocationPath(string name, SettingsLocation location) 50 | { 51 | switch (location) 52 | { 53 | case SettingsLocation.PublicDocuments: 54 | return Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), name + ".xml"); 55 | case SettingsLocation.Local: 56 | return Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), name + ".xml"); 57 | default: 58 | throw new Exception("SettingsLocation enum value not handled"); 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/PutUserEnableDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared.DTOs 6 | { 7 | public class PutUserEnabledDto 8 | { 9 | public string Username { get; set; } 10 | public bool Enabled { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostCallsignRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared.DTOs 6 | { 7 | public class PostCallsignRequestDto 8 | { 9 | public string Type { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostFsdStationRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostFsdStationUpdateRequestDto 8 | { 9 | public uint Frequency { get; set; } 10 | public double LatDeg { get; set; } 11 | public double LonDeg { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostImpersonateUserRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostImpersonateUserRequestDto 8 | { 9 | public string Username { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostStationRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostStationRequestDto 8 | { 9 | public string Name { get; set; } 10 | public uint? Frequency { get; set; } 11 | public uint? FrequencyAlias { get; set; } 12 | public List TransceiverIDs { get; set; } 13 | public List ChildStationIDs { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostStationSearchRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostStationSearchRequestDto 8 | { 9 | public int Take { get; set; } 10 | public int Skip { get; set; } 11 | public string SearchText { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostStationTransceiverRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostStationTransceiverRequestDto 8 | { 9 | public string Name { get; set; } 10 | public double LatDeg { get; set; } 11 | public double LonDeg { get; set; } 12 | public double HeightMslM { get; set; } 13 | public double HeightAglM { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostStationTransceiverSearchRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostStationTransceiverSearchRequestDto 8 | { 9 | public int Take { get; set; } 10 | public int Skip { get; set; } 11 | public string SearchText { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PostUserRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | public class PostUserRequestDto 9 | { 10 | public string Username { get; set; } 11 | public string Password { get; set; } 12 | public Guid NetworkVersion { get; set; } 13 | public string Client { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PutBotRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PutBotRequestDto 8 | { 9 | public List Transceivers { get; set; } 10 | public TimeSpan Interval { get; set; } 11 | public List OpusData { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PutStationRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PutStationRequestDto 8 | { 9 | public Guid ID { get; set; } 10 | public string Name { get; set; } 11 | public uint? Frequency { get; set; } 12 | public uint? FrequencyAlias { get; set; } 13 | public List TransceiverIDs { get; set; } 14 | public List ChildStationIDs { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PutStationTransceiverExclusionsRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PutStationTransceiverExclusionsRequestDto 8 | { 9 | public List TransceiverIDs { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PutStationTransceiverRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PutStationTransceiverRequestDto 8 | { 9 | public Guid ID { get; set; } 10 | public string Name { get; set; } 11 | public double LatDeg { get; set; } 12 | public double LonDeg { get; set; } 13 | public double HeightMslM { get; set; } 14 | public double HeightAglM { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Request/PutVccsStationsRequestDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PutVccsStationsRequestDto 8 | { 9 | public List StationIDs { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Response/GetTokensResponseDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack.CryptoDto; 2 | 3 | namespace GeoVR.Shared 4 | { 5 | public class VoiceServerConnectionDataDto 6 | { 7 | public string AddressIpV4 { get; set; } // Example: 123.123.123.123:50000 8 | public string AddressIpV6 { get; set; } // Example: 123.123.123.123:50000 9 | public CryptoDtoChannelConfigDto ChannelConfig { get; set; } 10 | } 11 | 12 | //public class DataServerConnectionDataDto 13 | //{ 14 | // public string AddressIpV4 { get; set; } // Example: 123.123.123.123:50000 15 | // public string AddressIpV6 { get; set; } // Example: 123.123.123.123:50000 16 | // public CryptoDtoChannelConfigDto ChannelConfig { get; set; } 17 | //} 18 | 19 | public class PostCallsignResponseDto 20 | { 21 | public VoiceServerConnectionDataDto VoiceServer { get; set; } 22 | //public DataServerConnectionDataDto DataServer { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Response/PostStationSearchResponseDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostStationSearchResponseDto 8 | { 9 | public IEnumerable Stations { get; set; } 10 | public int Total { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to API Server/Response/PostTransceiverSearchResponseDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class PostTransceiverSearchResponseDto 8 | { 9 | public IEnumerable Transceivers { get; set; } 10 | public int Total { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to Data Server/Ack/UserDataHeartbeatAckDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | 4 | namespace GeoVR.Shared 5 | { 6 | //[MessagePackObject] 7 | //[CryptoDto(ShortDtoNames.UserDataHeartbeatAckDto)] 8 | //public class UserDataHeartbeatAckDto : IMsgPack, IAck 9 | //{ 10 | // [Key(0)] 11 | // public bool Success { get; set; } 12 | //} 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to Data Server/CallsignDataHeartbeatDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | 4 | namespace GeoVR.Shared 5 | { 6 | //[MessagePackObject] 7 | //[CryptoDto(ShortDtoNames.CallsignDataHeartbeatDto)] 8 | //public class CallsignDataHeartbeatDtoDeprecated : IMsgPack 9 | //{ 10 | // [Key(0)] 11 | // public string Callsign { get; set; } 12 | //} 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to Voice Server/AudioTxDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | 4 | namespace GeoVR.Shared 5 | { 6 | [MessagePackObject] 7 | [CryptoDto(ShortDtoNames.AudioTxDto)] 8 | public class AudioTxDto : IMsgPackTypeName, IAudioDto //Tx from the perspective of the client 9 | { 10 | [IgnoreMember] 11 | public const string TypeNameConst = ShortDtoNames.AudioTxDto; 12 | [IgnoreMember] 13 | public string TypeName { get { return TypeNameConst; } } 14 | [Key(0)] 15 | public string Callsign { get; set; } 16 | [Key(1)] 17 | public uint SequenceCounter { get; set; } 18 | [Key(2)] 19 | public byte[] Audio { get; set; } 20 | [Key(3)] 21 | public bool LastPacket { get; set; } 22 | 23 | [Key(4)] 24 | public TxTransceiverDto[] Transceivers { get; set; } 25 | [Key(5)] 26 | public VoiceRoomDto[] VoiceRooms { get; set; } 27 | [Key(6)] 28 | public DirectDto[] Directs { get; set; } 29 | //[Key(5)] 30 | //public TxTelephoneDto[] Telephones { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to Voice Server/CallDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace GeoVR.Shared 8 | { 9 | public enum CallResponseEvent 10 | { 11 | Undefined = 0, 12 | //Server response 13 | Routed = 1, 14 | NoRoute = 2, 15 | //Remote party response 16 | Busy = 3, 17 | Accept = 4, 18 | Reject = 5, 19 | } 20 | 21 | [MessagePackObject] 22 | [CryptoDto(ShortDtoNames.CallRequest)] 23 | public class CallRequestDto : IMsgPackTypeName, ICallDto 24 | { 25 | [IgnoreMember] 26 | public const string TypeNameConst = ShortDtoNames.CallRequest; 27 | [IgnoreMember] 28 | public string TypeName { get { return TypeNameConst; } } 29 | [Key(0)] 30 | public string FromCallsign { get; set; } 31 | [Key(1)] 32 | public string ToCallsign { get; set; } //The callsign being rung 33 | } 34 | 35 | [MessagePackObject] 36 | [CryptoDto(ShortDtoNames.CallResponse)] 37 | public class CallResponseDto : IMsgPackTypeName, ICallDto 38 | { 39 | [IgnoreMember] 40 | public const string TypeNameConst = ShortDtoNames.CallResponse; 41 | [IgnoreMember] 42 | public string TypeName { get { return TypeNameConst; } } 43 | [Key(0)] 44 | public CallRequestDto Request { get; set; } 45 | [Key(1)] 46 | public CallResponseEvent Event { get; set; } 47 | } 48 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to Voice Server/HeartbeatAckDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace GeoVR.Shared 8 | { 9 | [MessagePackObject] 10 | [CryptoDto(ShortDtoNames.HeartbeatAckDto)] //If a client receives this response, it means they're still authenticated 11 | public class HeartbeatAckDto : IMsgPackTypeName 12 | { 13 | [IgnoreMember] 14 | public const string TypeNameConst = ShortDtoNames.HeartbeatAckDto; 15 | [IgnoreMember] 16 | public string TypeName { get { return TypeNameConst; } } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Client to Voice Server/HeartbeatDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | 4 | namespace GeoVR.Shared 5 | { 6 | [MessagePackObject] 7 | [CryptoDto(ShortDtoNames.HeartbeatDto)] 8 | public class HeartbeatDto : IMsgPackTypeName 9 | { 10 | [IgnoreMember] 11 | public const string TypeNameConst = ShortDtoNames.HeartbeatDto; 12 | [IgnoreMember] 13 | public string TypeName { get { return TypeNameConst; } } 14 | [Key(0)] 15 | public string Callsign { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/CallsignTxTransceiversRxCallsigns.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | [MessagePackObject] 9 | public class CallsignTxTransceiversRxCallsigns //Used for Web API return 10 | { 11 | [Key(0)] 12 | public string Callsign { get; set; } 13 | [Key(1)] 14 | public TxTransceiverRxCallsignsDto[] TxTransceivers { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/CrossCoupleGroupDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | [MessagePackObject] 9 | public class CrossCoupleGroupDto : IMsgPack 10 | { 11 | [Key(0)] 12 | public ushort ID { get; set; } 13 | [Key(1)] 14 | public List TransceiverIDs { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/DirectConfigurationDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | public enum DirectMode 9 | { 10 | Disabled = 0, 11 | AllowForWhitelist = 1, 12 | AllowAll = 2 13 | } 14 | 15 | [MessagePackObject] 16 | public class DirectConfigurationDto : IMsgPack 17 | { 18 | [Key(0)] 19 | public DirectMode Mode { get; set; } 20 | [Key(1)] 21 | public List Whitelist { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/DirectToCallsign.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace GeoVR.Shared 4 | { 5 | [MessagePackObject] 6 | public class DirectDto : IMsgPack 7 | { 8 | [Key(0)] 9 | public string Callsign { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/PositionDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared.DTOs.Domain 7 | { 8 | [MessagePackObject] 9 | class PositionDto 10 | { 11 | [Key(0)] 12 | public uint SequenceCounter { get; set; } //4 bytes 13 | [Key(1)] 14 | public ushort MsCounter { get; set; } //2 bytes goes from 0 - 59999 (1 minute) 15 | [Key(2)] 16 | public double LatDeg { get; set; } //8 bytes 17 | [Key(3)] 18 | public double LonDeg { get; set; } //8 bytes 19 | [Key(4)] 20 | public float HeightMslM { get; set; } //4 bytes 21 | [Key(5)] 22 | public float HeightAglM { get; set; } //4 bytes 23 | [Key(6)] 24 | public float PitchDeg { get; set; } //4 bytes 25 | [Key(7)] 26 | public float BankDeg { get; set; } //4 bytes 27 | [Key(8)] 28 | public float HeadingDeg { get; set; } //4 bytes 29 | } //42 bytes 30 | } 31 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/RxCallsignDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System.Collections.Generic; 3 | 4 | namespace GeoVR.Shared 5 | { 6 | [MessagePackObject] 7 | public class RxCallsignDto : IMsgPack 8 | { 9 | [Key(0)] 10 | public string Callsign { get; set; } 11 | [Key(1)] 12 | public RxTransceiverDto[] RxTransceivers { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/RxTransceiverDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace GeoVR.Shared 4 | { 5 | [MessagePackObject] 6 | public class RxTransceiverDto : IMsgPack //Changed to class to prevent copy-by-value (https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/choosing-between-class-and-struct) 7 | { 8 | [Key(0)] 9 | public ushort ID { get; set; } 10 | [Key(1)] 11 | public uint Frequency { get; set; } //from 0 to 4.29GHz. Note: Not strictly necessary but fixes the situation where a user changes frequency but still receives audio on the old frequency due to the network update being a fraction of a second slower. 12 | [Key(2)] 13 | public float DistanceRatio { get; set; } //This is the distance ratio from 0.0 to 1.0 (where 0.1 is on the very edge of reception range) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/StationDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class StationDto 8 | { 9 | public Guid ID { get; set; } 10 | public string Name { get; set; } 11 | public uint? Frequency { get; set; } 12 | public uint? FrequencyAlias { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/StationFlatDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class StationFlatDto : StationDto 8 | { 9 | public IEnumerable TransceiverIDs { get; set; } 10 | public IEnumerable ChildStationIDs { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/StationTransceiverDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class StationTransceiverDto 8 | { 9 | public Guid ID { get; set; } 10 | public string Name { get; set; } 11 | public double LatDeg { get; set; } 12 | public double LonDeg { get; set; } 13 | public double HeightMslM { get; set; } 14 | public double HeightAglM { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/TransceiverDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace GeoVR.Shared 4 | { 5 | [MessagePackObject] 6 | public class TransceiverDto : IMsgPack 7 | { 8 | [Key(0)] 9 | public ushort ID { get; set; } 10 | [Key(1)] 11 | public uint Frequency { get; set; } //from 0 to 4.29GHz 12 | [Key(2)] 13 | public double LatDeg { get; set; } 14 | [Key(3)] 15 | public double LonDeg { get; set; } 16 | [Key(4)] 17 | public double HeightMslM { get; set; } 18 | [Key(5)] 19 | public double HeightAglM { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/TxTelephoneDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace GeoVR.Shared 4 | { 5 | [MessagePackObject] 6 | public class TxTelephoneDto : IMsgPack 7 | { 8 | [Key(0)] 9 | public ushort ID { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/TxTransceiverDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | [MessagePackObject] 9 | public class TxTransceiverDto : IMsgPack 10 | { 11 | [Key(0)] 12 | public ushort ID { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/TxTransceiverRxCallsigns.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System.Collections.Generic; 3 | 4 | namespace GeoVR.Shared 5 | { 6 | [MessagePackObject] 7 | public class TxTransceiverRxCallsignsDto : IMsgPack //This is a computed object 8 | { 9 | [Key(0)] 10 | public ushort ID { get; set; } 11 | [Key(1)] 12 | public RxCallsignDto[] RxCallsigns { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/UserDataDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | [MessagePackObject] 9 | public class CallsignDataDto : IMsgPack //Basically a copy of GeoVR.Shared.Server.CallsignTransceiversDto 10 | { 11 | [Key(0)] 12 | public string Callsign { get; set; } 13 | [Key(1)] 14 | public TransceiverDto[] Transceivers { get; set; } 15 | 16 | public CallsignDataDto() { } 17 | public CallsignDataDto(string callsign) 18 | { 19 | Callsign = callsign; 20 | Transceivers = new TransceiverDto[0]; 21 | } 22 | } 23 | 24 | [MessagePackObject] 25 | public class UserDataDto : IMsgPack 26 | { 27 | [Key(0)] 28 | public string User { get; set; } 29 | [Key(1)] 30 | public List Callsigns { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/UserDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class UserDto 8 | { 9 | public Guid ID { get; set; } 10 | public string Username { get; set; } 11 | public bool Enabled { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/VoiceRoomDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace GeoVR.Shared 4 | { 5 | [MessagePackObject] 6 | public class VoiceRoomDto : IMsgPack 7 | { 8 | [Key(0)] 9 | public string Name { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Domain/VoiceRoomRxCallsignsDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | [MessagePackObject] 9 | public class VoiceRoomRxCallsignsDto : IMsgPack //This is a computed object 10 | { 11 | [Key(0)] 12 | public VoiceRoomDto VoiceRoom { get; set; } 13 | [Key(1)] 14 | public string[] RxCallsigns { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/IAck.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public interface IAck 8 | { 9 | bool Success { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/ShortDtoNames.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public static class ShortDtoNames 8 | { 9 | public const string HeartbeatDto = "H"; 10 | public const string HeartbeatAckDto = "HA"; 11 | public const string AudioTxDto = "AT"; 12 | public const string AudioRxDto = "AR"; 13 | public const string CallRequest = "CQ"; 14 | public const string CallResponse = "CR"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/DTOs/Voice Server to Client/AudioRxDto.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using MessagePack.CryptoDto; 3 | using System.Collections.Generic; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | [MessagePackObject] 8 | [CryptoDto(ShortDtoNames.AudioRxDto)] 9 | public class AudioRxDto : IMsgPackTypeName, IAudioDto 10 | { 11 | [IgnoreMember] 12 | public const string TypeNameConst = ShortDtoNames.AudioRxDto; 13 | [IgnoreMember] 14 | public string TypeName { get { return TypeNameConst; } } 15 | [Key(0)] 16 | public string Callsign { get; set; } 17 | [Key(1)] 18 | public uint SequenceCounter { get; set; } 19 | [Key(2)] 20 | public byte[] Audio { get; set; } 21 | [Key(3)] 22 | public bool LastPacket { get; set; } 23 | 24 | [Key(4)] 25 | public List Transceivers { get; set; } 26 | [Key(5)] 27 | public List VoiceRooms { get; set; } 28 | [Key(6)] 29 | public bool Direct { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Enums/DisconnectReasons.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public enum DisconnectReasons 8 | { 9 | LostConnection, 10 | InternalLibraryError10, 11 | InternalLibraryError20, 12 | InternalLibraryError30 13 | } 14 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Events/ConnectedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class ConnectedEventArgs 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Events/DisconnectedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GeoVR.Shared 8 | { 9 | public class DisconnectedEventArgs 10 | { 11 | public string Reason { get; set; } 12 | public bool AutoReconnect { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Events/NotificationEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class NotificationEventArgs : EventArgs 8 | { 9 | public string Message { get; set; } 10 | 11 | public NotificationEventArgs(string message) 12 | { 13 | Message = message; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Events/TransceiverReceivingCallsignsChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public class TransceiverReceivingCallsignsChangedEventArgs 8 | { 9 | public ushort TransceiverID { get; private set; } 10 | public List ReceivingCallsigns { get; private set; } 11 | 12 | public TransceiverReceivingCallsignsChangedEventArgs(ushort transceiverID, List receivingCallsigns) 13 | { 14 | TransceiverID = transceiverID; 15 | ReceivingCallsigns = receivingCallsigns; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Extensions/DebugStringExtensions.cs: -------------------------------------------------------------------------------- 1 | using GeoVR.Shared; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GeoVR.Shared 9 | { 10 | public static class DebugStringExtensions 11 | { 12 | public static string ToDebugString(this AudioRxDto dto) 13 | { 14 | return nameof(AudioRxDto) + 15 | " [Callsign: " + dto.Callsign + 16 | "] [SequenceCounter: " + dto.SequenceCounter.ToString() + 17 | "] [Last Packet: " + dto.LastPacket + 18 | "] [TransceiverIDs: " + string.Join(",", dto.Transceivers.Select(x => "{" + x.ID.ToString() + " " + x.DistanceRatio.ToString() + "}")) + 19 | "]"; 20 | } 21 | 22 | public static string ToDebugString(this AudioTxDto dto) 23 | { 24 | return nameof(AudioTxDto) + 25 | " [Callsign: " + dto.Callsign + 26 | "] [SequenceCounter: " + dto.SequenceCounter.ToString() + 27 | "] [Last Packet: " + dto.LastPacket + 28 | "] [TransceiverIDs: " + string.Join(",", dto.Transceivers.Select(x => "{" + x.ID.ToString() + "}")) + 29 | "]"; 30 | } 31 | 32 | //public static string ToDebugString(this AudioOnVoiceRoomDto dto) 33 | //{ 34 | // return nameof(AudioOnVoiceRoomDto) + 35 | // " [Callsign: " + dto.Callsign + 36 | // "] [SequenceCounter: " + dto.SequenceCounter.ToString() + 37 | // "] [Last Packet: " + dto.LastPacket + 38 | // "] [Voice Room: " + dto.VoiceRoom + 39 | // "]"; 40 | //} 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Extensions/ListTransceiversDtoExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace GeoVR.Shared 7 | { 8 | public static class ListTransceiversDtoExtensions 9 | { 10 | public static void AddStationTransceivers(this List transceivers, List stationTransceivers, uint frequency) 11 | { 12 | ushort id = 0; 13 | if (transceivers.Count > 0) 14 | { 15 | id = transceivers.Max(x => x.ID); 16 | } 17 | 18 | foreach (var stationTransceiver in stationTransceivers) 19 | { 20 | transceivers.Add(stationTransceiver.ToTransceiverDto(id++, frequency)); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Extensions/StationTransceiverDtoExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public static class StationTransceiverDtoExtensions 8 | { 9 | public static TransceiverDto ToTransceiverDto(this StationTransceiverDto stationTransceiver, ushort id, uint frequency) 10 | { 11 | return new TransceiverDto() 12 | { 13 | ID = id, 14 | Frequency = frequency, 15 | LatDeg = stationTransceiver.LatDeg, 16 | LonDeg = stationTransceiver.LonDeg, 17 | HeightMslM = stationTransceiver.HeightMslM, 18 | HeightAglM = stationTransceiver.HeightAglM 19 | }; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/GeoVR.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Interfaces/IAudioDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public interface IAudioDto 8 | { 9 | string Callsign { get; set; } // Callsign that audio originates from 10 | uint SequenceCounter { get; set; } // Receiver optionally uses this in reordering algorithm/gap detection 11 | byte[] Audio { get; set; } // Opus compressed audio 12 | bool LastPacket { get; set; } // Used to indicate to receiver that the sender has stopped sending 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Interfaces/ICallDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public interface ICallDto 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Interfaces/IMsgPack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public interface IMsgPack //This is a promise that the developer has implemented [MessagePackObject] 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Libraries/GeoVR/GeoVR.Shared/Interfaces/IMsgPackTypeName.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeoVR.Shared 6 | { 7 | public interface IMsgPackTypeName //This is a promise that the developer has implemented [MessagePackObject] and will implement TypeName & TypeNameConst 8 | { 9 | string TypeName { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/MessagePack.CryptoDto/Aead.cs: -------------------------------------------------------------------------------- 1 | namespace MessagePack.CryptoDto 2 | { 3 | /// 4 | /// AEAD constants. 5 | /// 6 | public static class Aead 7 | { 8 | /// 9 | /// Secret key size in bytes. 10 | /// 11 | public const int KeySize = 32; 12 | 13 | /// 14 | /// Nonce size in bytes. 15 | /// 16 | public const int NonceSize = 12; 17 | 18 | /// 19 | /// Authentication tag size in bytes. 20 | /// 21 | public const int TagSize = 16; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/MessagePack.CryptoDto/CryptoDtoAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MessagePack.CryptoDto 4 | { 5 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 6 | public class CryptoDtoAttribute : Attribute 7 | { 8 | public string ShortDtoName { get; private set; } 9 | 10 | public CryptoDtoAttribute(string shortDtoName) 11 | { 12 | ShortDtoName = shortDtoName; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/MessagePack.CryptoDto/CryptoDtoChannelConfigDto.cs: -------------------------------------------------------------------------------- 1 | namespace MessagePack.CryptoDto 2 | { 3 | //This should be exchanged from server to client [using serverChannel.GetRemoteEndpointChannelConfig()] over a secure transport like a HTTPS REST API 4 | [MessagePackObject] 5 | public class CryptoDtoChannelConfigDto 6 | { 7 | [Key(0)] 8 | public string ChannelTag { get; set; } 9 | [Key(1)] 10 | public byte[] AeadReceiveKey { get; set; } 11 | [Key(2)] 12 | public byte[] AeadTransmitKey { get; set; } 13 | [Key(3)] 14 | public byte[] HmacKey { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/MessagePack.CryptoDto/CryptoDtoHeaderDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MessagePack; 5 | 6 | namespace MessagePack.CryptoDto 7 | { 8 | [MessagePackObject] 9 | public class CryptoDtoHeaderDto 10 | { 11 | [Key(0)] 12 | public string ChannelTag { get; set; } 13 | [Key(1)] 14 | public ulong Sequence { get; set; } 15 | [Key(2)] 16 | public CryptoDtoMode Mode { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/MessagePack.CryptoDto/CryptoDtoMode.cs: -------------------------------------------------------------------------------- 1 | namespace MessagePack.CryptoDto 2 | { 3 | public enum CryptoDtoMode 4 | { 5 | Undefined = 0, 6 | None = 1, 7 | ChaCha20Poly1305 = 2 8 | } 9 | } -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/MessagePack.CryptoDto/MessagePack.CryptoDto.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("NaCl.Core.Benchmarks")] 2 | [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("NaCl.Core.Tests")] -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/ChaCha20.cs: -------------------------------------------------------------------------------- 1 | namespace NaCl.Core 2 | { 3 | using System; 4 | using System.Security.Cryptography; 5 | 6 | using Base; 7 | using Internal; 8 | 9 | /// 10 | /// A stream cipher based on RFC 8439 (previously RFC 7539) (i.e., uses 96-bit random nonces). 11 | /// https://tools.ietf.org/html/rfc8439#section-2.8 12 | /// https://tools.ietf.org/html/rfc7539#section-2.8 13 | /// 14 | /// This cipher is meant to be used to construct an AEAD with Poly1305. 15 | /// 16 | /// 17 | public class ChaCha20 : ChaCha20Base 18 | { 19 | /// 20 | /// Initializes a new instance of the class. 21 | /// 22 | /// The key. 23 | /// The initial counter. 24 | public ChaCha20(in byte[] key, int initialCounter) : base(key, initialCounter) { } 25 | 26 | /// 27 | protected override Array16 CreateInitialState(ReadOnlySpan nonce, int counter) 28 | { 29 | if (nonce.IsEmpty || nonce.Length != NonceSizeInBytes()) 30 | throw new CryptographicException(FormatNonceLengthExceptionMessage(GetType().Name, nonce.Length, NonceSizeInBytes())); 31 | 32 | // Set the initial state based on https://tools.ietf.org/html/rfc8439#section-2.3 33 | var state = new Array16(); 34 | 35 | // The first four words (0-3) are constants: 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574. 36 | // The next eight words (4-11) are taken from the 256-bit key in little-endian order, in 4-byte chunks. 37 | SetSigma(ref state); 38 | SetKey(ref state, Key); 39 | 40 | // Word 12 is a block counter. Since each block is 64-byte, a 32-bit word is enough for 256 gigabytes of data. Ref: https://tools.ietf.org/html/rfc8439#section-2.3. 41 | state.x12 = (uint)counter; 42 | 43 | // Words 13-15 are a nonce, which must not be repeated for the same key. 44 | // The 13th word is the first 32 bits of the input nonce taken as a little-endian integer, while the 15th word is the last 32 bits. 45 | state.x13 = ByteIntegerConverter.LoadLittleEndian32(nonce, 0); 46 | state.x14 = ByteIntegerConverter.LoadLittleEndian32(nonce, 4); 47 | state.x15 = ByteIntegerConverter.LoadLittleEndian32(nonce, 8); 48 | 49 | return state; 50 | } 51 | 52 | /// 53 | /// The size of the randomly generated nonces. 54 | /// 55 | /// System.Int32. 56 | public override int NonceSizeInBytes() => 12; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/ChaCha20Poly1305.cs: -------------------------------------------------------------------------------- 1 | namespace NaCl.Core 2 | { 3 | using Base; 4 | 5 | /// 6 | /// ChaCha20-Poly1305 AEAD construction, as described in RFC 8439, section 2.8. 7 | /// 8 | /// 9 | public class ChaCha20Poly1305 : SnufflePoly1305 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The key. 15 | public ChaCha20Poly1305(in byte[] key) : base(key) { } 16 | 17 | /// 18 | /// Creates the snuffle instance. 19 | /// 20 | /// The key. 21 | /// The initial counter. 22 | /// Snuffle. 23 | protected override Snuffle CreateSnuffleInstance(in byte[] key, int initialCounter) => new ChaCha20(key, initialCounter); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/Internal/Array16.cs: -------------------------------------------------------------------------------- 1 | namespace NaCl.Core.Internal 2 | { 3 | // Array16 ChaCha20 and Salsa20 state 4 | // Array16 SHA-512 block 5 | public struct Array16 6 | { 7 | public T x0; 8 | public T x1; 9 | public T x2; 10 | public T x3; 11 | public T x4; 12 | public T x5; 13 | public T x6; 14 | public T x7; 15 | public T x8; 16 | public T x9; 17 | public T x10; 18 | public T x11; 19 | public T x12; 20 | public T x13; 21 | public T x14; 22 | public T x15; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/Internal/Array8.cs: -------------------------------------------------------------------------------- 1 | namespace NaCl.Core.Internal 2 | { 3 | // Array8 Poly1305 key 4 | // Array8 SHA-512 state/output 5 | public struct Array8 6 | { 7 | public T x0; 8 | public T x1; 9 | public T x2; 10 | public T x3; 11 | public T x4; 12 | public T x5; 13 | public T x6; 14 | public T x7; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/NaCl.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3;netstandard2.0;netcoreapp3.0 5 | net45;net47;netstandard1.3;netstandard2.0;netcoreapp3.0 6 | 1.2.0 7 | David De Smet 8 | 9 | A managed-only cryptography library for .NET which provides modern cryptographic primitives. 10 | Copyright © 2018 David De Smet 11 | https://opensource.org/licenses/MIT 12 | NaCl cryptography dotnet dotnet-core netstandard 13 | https://github.com/idaviddesmet/NaCl.Core 14 | https://github.com/idaviddesmet/NaCl.Core.git 15 | git 16 | master 17 | 18 | 19 | 20 | true 21 | 22 | 23 | 24 | latest 25 | 26 | 27 | 28 | latest 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/XChaCha20.cs: -------------------------------------------------------------------------------- 1 | namespace NaCl.Core 2 | { 3 | using System; 4 | using System.Security.Cryptography; 5 | 6 | using Base; 7 | using Internal; 8 | 9 | /// 10 | /// A stream cipher based on https://download.libsodium.org/doc/advanced/xchacha20.html and https://tools.ietf.org/html/draft-arciszewski-xchacha-02. 11 | /// 12 | /// This cipher is meant to be used to construct an AEAD with Poly1305. 13 | /// 14 | /// 15 | public class XChaCha20 : ChaCha20Base 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// The key. 21 | /// The initial counter. 22 | public XChaCha20(in byte[] key, int initialCounter) : base(key, initialCounter) { } 23 | 24 | /// 25 | protected override Array16 CreateInitialState(ReadOnlySpan nonce, int counter) 26 | { 27 | if (nonce.IsEmpty || nonce.Length != NonceSizeInBytes()) 28 | throw new CryptographicException(FormatNonceLengthExceptionMessage(GetType().Name, nonce.Length, NonceSizeInBytes())); 29 | 30 | // Set the initial state based on https://tools.ietf.org/html/draft-arciszewski-xchacha-01#section-2.3. 31 | var state = new Array16(); 32 | 33 | // The first four words (0-3) are constants: 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574. 34 | // The next eight words (4-11) are taken from the 256-bit key in little-endian order, in 4-byte chunks; and the first 16 bytes of the 24-byte nonce to obtain the subkey. 35 | SetSigma(ref state); 36 | SetKey(ref state, HChaCha20(nonce)); 37 | 38 | // Word 12 is a block counter. 39 | state.x12 = (uint)counter; 40 | 41 | // Word 13 is a prefix of 4 null bytes, since RFC 8439 specifies a 12-byte nonce. 42 | state.x13 = 0; 43 | 44 | // Words 14-15 are the remaining 8-byte nonce (used in HChaCha20). Ref: https://tools.ietf.org/html/draft-arciszewski-xchacha-01#section-2.3. 45 | state.x14 = ByteIntegerConverter.LoadLittleEndian32(nonce, 16); 46 | state.x15 = ByteIntegerConverter.LoadLittleEndian32(nonce, 20); 47 | 48 | return state; 49 | } 50 | 51 | /// 52 | /// The size of the randomly generated nonces. 53 | /// 54 | /// System.Int32. 55 | public override int NonceSizeInBytes() => 24; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Libraries/GeoVR/Libraries/NaCl.Core/XChaCha20Poly1305.cs: -------------------------------------------------------------------------------- 1 | namespace NaCl.Core 2 | { 3 | using System; 4 | 5 | using Base; 6 | 7 | /// 8 | /// XChaCha20-Poly1305 AEAD construction, as described in draft. 9 | /// 10 | /// 11 | public class XChaCha20Poly1305 : SnufflePoly1305 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The key. 17 | public XChaCha20Poly1305(in byte[] key) : base(key) { } 18 | 19 | /// 20 | /// Creates the snuffle instance. 21 | /// 22 | /// The key. 23 | /// The initial counter. 24 | /// Snuffle. 25 | protected override Snuffle CreateSnuffleInstance(in byte[] key, int initialCounter) => new XChaCha20(key, initialCounter); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Libraries/XPlaneConnector/DataRefElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace XPlaneConnector 4 | { 5 | public class DataRefElement 6 | { 7 | private static object lockElement = new object(); 8 | private static int current_id = 0; 9 | 10 | public int Id { get; set; } 11 | public string DataRef { get; set; } 12 | public int Frequency { get; set; } 13 | public bool IsInitialized { get; set; } 14 | public DateTime LastUpdate { get; set; } 15 | public string Units { get; set; } 16 | public string Description { get; set; } 17 | public float Value { get; set; } 18 | 19 | public delegate void NotifyChangeHandler(DataRefElement sender, float newValue); 20 | public event NotifyChangeHandler OnValueChange; 21 | 22 | public DataRefElement() 23 | { 24 | lock (lockElement) 25 | { 26 | Id = ++current_id; 27 | } 28 | IsInitialized = false; 29 | LastUpdate = DateTime.MinValue; 30 | Value = float.MinValue; 31 | } 32 | 33 | public TimeSpan Age 34 | { 35 | get 36 | { 37 | return DateTime.Now - LastUpdate; 38 | } 39 | } 40 | 41 | public bool Update(int id, float value) 42 | { 43 | if (id == Id) 44 | { 45 | LastUpdate = DateTime.Now; 46 | 47 | if (value != Value) 48 | { 49 | Value = value; 50 | IsInitialized = true; 51 | OnValueChange?.Invoke(this, Value); 52 | return true; 53 | } 54 | } 55 | 56 | return false; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Libraries/XPlaneConnector/StringDataRefElement.cs: -------------------------------------------------------------------------------- 1 | namespace XPlaneConnector 2 | { 3 | public class StringDataRefElement 4 | { 5 | private static readonly object lockElement = new object(); 6 | public string DataRef { get; set; } 7 | public int Frequency { get; set; } 8 | public int StringLenght { get; set; } 9 | public string Value { get; set; } 10 | 11 | private int CharactersInitialized; 12 | 13 | public bool IsCompletelyInitialized 14 | { 15 | get 16 | { 17 | return CharactersInitialized >= StringLenght; 18 | } 19 | } 20 | 21 | public delegate void NotifyChangeHandler(StringDataRefElement sender, string newValue); 22 | public event NotifyChangeHandler OnValueChange; 23 | 24 | public void Update(int index, char character) 25 | { 26 | lock (lockElement) 27 | { 28 | var fireEvent = !IsCompletelyInitialized; 29 | 30 | if (!IsCompletelyInitialized) 31 | CharactersInitialized++; 32 | 33 | if (character > 0) 34 | { 35 | if (Value.Length <= index) 36 | Value = Value.PadRight(index + 1, ' '); 37 | 38 | var current = Value[index]; 39 | if (current != character) 40 | { 41 | Value = Value.Remove(index, 1).Insert(index, character.ToString()); 42 | fireEvent = true; 43 | } 44 | } 45 | 46 | if (IsCompletelyInitialized && fireEvent) 47 | { 48 | OnValueChange?.Invoke(this, Value); 49 | CharactersInitialized = 0; 50 | } 51 | } 52 | } 53 | 54 | public StringDataRefElement() 55 | { 56 | CharactersInitialized = 0; 57 | Value = ""; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Libraries/XPlaneConnector/XPDatagram.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace XPlaneConnector 5 | { 6 | public class XPDatagram 7 | { 8 | public List Bytes { get; set; } 9 | 10 | public XPDatagram() 11 | { 12 | Bytes = new List(); 13 | } 14 | 15 | public byte[] Get() 16 | { 17 | return Bytes.ToArray(); 18 | } 19 | 20 | public void Add(byte value) 21 | { 22 | Bytes.Add(value); 23 | } 24 | 25 | public void Add(int value) 26 | { 27 | var bElement = BitConverter.GetBytes(value); 28 | if (BitConverter.IsLittleEndian) 29 | { 30 | Bytes.Add(bElement[0]); 31 | Bytes.Add(bElement[1]); 32 | Bytes.Add(bElement[2]); 33 | Bytes.Add(bElement[3]); 34 | } 35 | else 36 | { 37 | Bytes.Add(bElement[3]); 38 | Bytes.Add(bElement[2]); 39 | Bytes.Add(bElement[1]); 40 | Bytes.Add(bElement[0]); 41 | } 42 | } 43 | public void Add(float value) 44 | { 45 | var bElement = BitConverter.GetBytes(value); 46 | if (BitConverter.IsLittleEndian) 47 | { 48 | Bytes.Add(bElement[0]); 49 | Bytes.Add(bElement[1]); 50 | Bytes.Add(bElement[2]); 51 | Bytes.Add(bElement[3]); 52 | } 53 | else 54 | { 55 | Bytes.Add(bElement[3]); 56 | Bytes.Add(bElement[2]); 57 | Bytes.Add(bElement[1]); 58 | Bytes.Add(bElement[0]); 59 | } 60 | } 61 | public void Add(string value) 62 | { 63 | foreach (var character in value) 64 | Bytes.Add((byte)character); 65 | Bytes.Add(0x00); 66 | } 67 | 68 | public void FillTo(int count, byte filler = 0x00) 69 | { 70 | for (var i = Bytes.Count; i < count; i++) 71 | Bytes.Add(filler); 72 | } 73 | 74 | public int Len 75 | { 76 | get 77 | { 78 | return Bytes.Count; 79 | } 80 | } 81 | } 82 | } 83 | 84 | 85 | -------------------------------------------------------------------------------- /Libraries/XPlaneConnector/XPlaneCommand.cs: -------------------------------------------------------------------------------- 1 | namespace XPlaneConnector 2 | { 3 | public sealed class XPlaneCommand 4 | { 5 | private readonly string command; 6 | private readonly string description; 7 | 8 | public string Command { get { return command; } } 9 | public string Description { get { return description; } } 10 | 11 | public XPlaneCommand(string command, string description) 12 | { 13 | this.command = command; 14 | this.description = description; 15 | } 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Libraries/XPlaneConnector/XPlaneConnector.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net46; 5 | 1.2.0 6 | Max Ferretti 7 | 8 | C# UDP connector for X-Plane. Send Commands and read DataRefs 9 | https://maxferretti.github.io/XPlaneConnector/ 10 | XPlaneConnector 11 | XPlaneConnector 12 | https://opensource.org/licenses/MIT 13 | https://github.com/MaxFerretti/XPlaneConnector 14 | git 15 | XPlane DataRef 16 | license.txt 17 | 18 | 19 | 20 | 21 | True 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Libraries/XPlaneConnector/license.txt: -------------------------------------------------------------------------------- 1 | Copyright 2020 Max Ferretti 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Network/Aircraft/INetworkAircraftManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Network.Aircraft 19 | { 20 | internal interface INetworkAircraftManager 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /Network/Aircraft/LegacyClientConfigFlags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Aircraft 25 | { 26 | public class LegacyClientConfigFlags 27 | { 28 | public bool OnGround { get; set; } 29 | public bool GearDown { get; set; } 30 | public bool EnginesRunning { get; set; } 31 | public bool BeaconLightsOn { get; set; } 32 | public bool NavLightsOn { get; set; } 33 | public bool StrobeLightsOn { get; set; } 34 | public bool LandingLightsOn { get; set; } 35 | public bool TaxiLightsOn { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Network/Aircraft/NetworkAircraftState.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using XPilot.PilotClient.Common; 19 | 20 | namespace XPilot.PilotClient.Aircraft 21 | { 22 | public class NetworkAircraftState 23 | { 24 | public WorldPoint Location { get; set; } 25 | public double Altitude { get; set; } 26 | public double Pitch { get; set; } 27 | public double Bank { get; set; } 28 | public double Heading { get; set; } 29 | public double GroundSpeed { get; set; } 30 | public NetworkAircraftTransponder Transponder { get; set; } 31 | public double VerticalSpeed { get; set; } 32 | public NetworkAircraftState() 33 | { 34 | Transponder = new NetworkAircraftTransponder(); 35 | } 36 | public NetworkAircraftState Clone() 37 | { 38 | return new NetworkAircraftState 39 | { 40 | Location = Location, 41 | Altitude = Altitude, 42 | Pitch = Pitch, 43 | Bank = Bank, 44 | Heading = Heading, 45 | GroundSpeed = GroundSpeed, 46 | Transponder = Transponder 47 | }; 48 | } 49 | public override int GetHashCode() 50 | { 51 | return base.GetHashCode(); 52 | } 53 | public override bool Equals(object obj) 54 | { 55 | if (!(obj is NetworkAircraftState other)) return false; 56 | return (other.Location.Equals(Location) 57 | && other.Altitude == Altitude 58 | && other.Pitch == Pitch 59 | && other.Bank == Bank 60 | && other.Heading == Heading 61 | && other.GroundSpeed == GroundSpeed 62 | && other.Transponder.Equals(Transponder)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Network/Aircraft/NetworkAircraftTransponder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Aircraft 19 | { 20 | public class NetworkAircraftTransponder 21 | { 22 | public bool TransponderModeC { get; set; } 23 | public bool TransponderIdent { get; set; } 24 | public int TransponderCode { get; set; } 25 | 26 | public override int GetHashCode() 27 | { 28 | return base.GetHashCode(); 29 | } 30 | 31 | public override bool Equals(object obj) 32 | { 33 | if (!(obj is NetworkAircraftTransponder other)) return false; 34 | return (other.TransponderModeC == TransponderModeC 35 | && other.TransponderIdent == TransponderIdent 36 | && other.TransponderCode == TransponderCode); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Network/ConnectInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Network 25 | { 26 | public class ConnectInfo 27 | { 28 | public string Callsign { get; set; } 29 | public string TypeCode { get; set; } 30 | public string SelCalCode { get; set; } 31 | public bool ObserverMode { get; set; } 32 | public bool TowerViewMode { get; set; } 33 | 34 | public ConnectInfo() 35 | { 36 | Callsign = ""; 37 | TypeCode = ""; 38 | SelCalCode = ""; 39 | } 40 | 41 | public ConnectInfo(string callsign, string typeCode, string selCalCode, bool observerMode = false, bool towerMode = false) : this() 42 | { 43 | Callsign = callsign; 44 | TypeCode = typeCode; 45 | SelCalCode = selCalCode; 46 | ObserverMode = observerMode; 47 | TowerViewMode = towerMode; 48 | } 49 | 50 | public override string ToString() 51 | { 52 | return string.Format("{0} ({1}){2}", Callsign, TypeCode, ObserverMode ? " - Observer Mode" : ""); 53 | } 54 | 55 | public override int GetHashCode() 56 | { 57 | return base.GetHashCode(); 58 | } 59 | 60 | public override bool Equals(object obj) 61 | { 62 | if (!(obj is ConnectInfo other)) return false; 63 | return other.Callsign == Callsign 64 | && other.TypeCode == TypeCode 65 | && other.SelCalCode == SelCalCode; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Network/Controllers/Controller.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using XPilot.PilotClient.Common; 20 | 21 | namespace XPilot.PilotClient.Network.Controllers 22 | { 23 | public class Controller 24 | { 25 | public string Callsign { get; set; } 26 | public uint Frequency { get; set; } 27 | public uint NormalizedFrequency { get; set; } 28 | public string RealName { get; set; } 29 | public bool IsValidATC { get; set; } 30 | public bool SupportsNewInfo { get; set; } 31 | public bool IsValid { get; set; } 32 | public WorldPoint Location { get; set; } 33 | public DateTime LastUpdate { get; set; } 34 | 35 | public override string ToString() 36 | { 37 | return Callsign; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Network/Controllers/IControllerAtisManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Network.Controllers 19 | { 20 | public interface IControllerAtisManager 21 | { 22 | void RequestControllerAtis(string callsign); 23 | } 24 | } -------------------------------------------------------------------------------- /Network/Controllers/IControllerManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Network.Controllers 19 | { 20 | public interface IControllerManager 21 | { 22 | uint GetFrequencyByCallsign(string callsign); 23 | } 24 | } -------------------------------------------------------------------------------- /Network/DisconnectInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.Network 25 | { 26 | public enum DisconnectType 27 | { 28 | Intentional, 29 | Forcible, 30 | Other, 31 | Quiet 32 | } 33 | 34 | public class DisconnectInfo 35 | { 36 | public DisconnectType Type { get; set; } 37 | public string Reason { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Network/IFsdManger.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System.Collections.Generic; 19 | using Vatsim.Fsd.Connector; 20 | using XPilot.PilotClient.Aircraft; 21 | 22 | namespace XPilot.PilotClient.Network 23 | { 24 | public interface IFsdManger 25 | { 26 | void Connect(ConnectInfo info, string address); 27 | void Disconnect(DisconnectInfo info); 28 | void ForceDisconnect(string reason = ""); 29 | void DownloadNetworkServers(); 30 | List ReturnServerList(); 31 | void RequestClientCapabilities(string callsign); 32 | void RequestRealName(string callsign); 33 | void RequestControllerInfo(string callsign); 34 | void RequestRemoteFlightPlan(string callsign); 35 | void CheckIfValidATC(string callsign); 36 | void SquawkIdent(); 37 | bool IsConnected { get; } 38 | bool IsObserver { get; } 39 | string OurCallsign { get; set; } 40 | void RequestPlaneInformation(string callsign); 41 | void SendAircraftConfiguration(string to, AircraftConfiguration config); 42 | void SendIncrementalAircraftConfigurationUpdate(AircraftConfiguration config); 43 | void RequestFullAircraftConfiguration(string to); 44 | void SendClientCaps(string from); 45 | void RequestInfoQuery(string to); 46 | string SelcalCode { get; } 47 | ClientProperties ClientProperties { get; set; } 48 | } 49 | } -------------------------------------------------------------------------------- /Network/ISelcalGenerator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.Network 19 | { 20 | public interface ISelcalGenerator 21 | { 22 | bool ValidateSelcal(string code); 23 | void PlaySelcal(string code); 24 | } 25 | } -------------------------------------------------------------------------------- /PilotClient.licenseheader: -------------------------------------------------------------------------------- 1 | extensions: designer.cs generated.cs 2 | extensions: .cs .cpp .h 3 | /* 4 | * xPilot: X-Plane pilot client for VATSIM 5 | * Copyright (C) 2019-%CurrentYear% Justin Shannon 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see http://www.gnu.org/licenses/. 19 | */ -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System.Reflection; 19 | using System.Runtime.CompilerServices; 20 | using System.Runtime.InteropServices; 21 | 22 | // General Information about an assembly is controlled through the following 23 | // set of attributes. Change these attribute values to modify the information 24 | // associated with an assembly. 25 | [assembly: AssemblyTitle("xPilot")] 26 | [assembly: AssemblyDescription("X-Plane Pilot Client for VATSIM")] 27 | [assembly: AssemblyConfiguration("")] 28 | [assembly: AssemblyCompany("Justin Shannon")] 29 | [assembly: AssemblyProduct("xPilot")] 30 | [assembly: AssemblyCopyright("Copyright © 2020 Justin Shannon")] 31 | [assembly: AssemblyTrademark("")] 32 | [assembly: AssemblyCulture("")] 33 | 34 | // Setting ComVisible to false makes the types in this assembly not visible 35 | // to COM components. If you need to access a type in this assembly from 36 | // COM, set the ComVisible attribute to true on that type. 37 | [assembly: ComVisible(false)] 38 | 39 | // The following GUID is for the ID of the typelib if this project is exposed to COM 40 | [assembly: Guid("ce803edf-b7d4-4822-b7d2-d59ff58ffb42")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | [assembly: AssemblyVersion("1.3.37")] 53 | [assembly: AssemblyInformationalVersion("1.3.37")] 54 | -------------------------------------------------------------------------------- /Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace XPilot.PilotClient.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Archived 2 | 3 | This repository is archived. No further updates will be made available for this version of xPilot. 4 | 5 | Users are encouraged to upgrade to xPilot 2.0, which brings native support to macOS and Linux. 6 | 7 | You can download and follow the progress on the new version here: https://github.com/xpilot-project/xpilot 8 | 9 | Happy flying! ✈️ 10 | 11 | ----- 12 | 13 | # xPilot - Pilot Client 14 | 15 | xPilot is an intuitive and easy to use X-Plane pilot client for the VATSIM network. The pilot client is a Windows c# WinForms application that utilizes NetMQ to transport data to and from the [X-Plane Plugin](https://github.com/xpilot-project/Plugin) through the use of TCP socket communication. 16 | 17 | ### Prerequisites 18 | 19 | * VisualStudio v16 (or newer) 20 | * .NET 4.7.2 Framework (or newer) 21 | * [FSD-Connector](https://github.com/xpilot-project/FSD-Connector) 22 | 23 | ## Getting Started 24 | 25 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. 26 | 27 | `git clone https://github.com/xpilot-project/Pilot-Client.git` 28 | 29 | * Open the solution `XPilot.PilotClient.sln` in VisualStudio 30 | * Build from within VisualStudio 31 | 32 | ## Contributing 33 | 34 | Please read the [Contribution Guide](CONTRIBUTING.md) for details on how to contribute to the project. 35 | 36 | ## Testing 37 | 38 | Development builds of the xPilot client **cannot** be connected on the live VATSIM network. If you are interested in contributing to the xPilot project, please contact Justin Shannon in the [xPilot Discord](https://vats.im/xpilot-discord) for access to a development FSD server. 39 | 40 | ## Versioning 41 | 42 | xPilot uses [Semantic Versioning](http://semver.org/). See [tags](https://github.com/xpilot-project/Pilot-Client/tags) on this repository for published versions. 43 | 44 | ## License 45 | 46 | This project is licensed under the [GPLv3 License](LICENSE). 47 | 48 | ## Acknowledgments 49 | 50 | * [GeoVR](https://github.com/macaba/GeoVR) Audio for VATSIM Client Library 51 | * [XPlaneConnector](https://github.com/MaxFerretti/XPlaneConnector) Read X-Plane datarefs via UDP 52 | * [Appccelerate](http://www.appccelerate.com/) EventBroker 53 | * [NetMQ](https://github.com/zeromq/netmq) Messaging Library 54 | * [NAudio](https://github.com/naudio/NAudio) 55 | * [Ninject](https://github.com/ninject/Ninject) Dependecy Injector 56 | * [SharpDX](http://sharpdx.org/) 57 | * Application icon created by [Freepik](https://www.flaticon.com/authors/freepik) 58 | -------------------------------------------------------------------------------- /Resources/xPilot_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/Resources/xPilot_Logo.png -------------------------------------------------------------------------------- /SetupGuide.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace XPilot.PilotClient 2 | { 3 | partial class SetupGuide 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupGuide)); 32 | this.SuspendLayout(); 33 | // 34 | // SetupGuide 35 | // 36 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 37 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 38 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); 39 | this.ClientSize = new System.Drawing.Size(484, 461); 40 | this.ControlBox = false; 41 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 42 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 43 | this.KeyPreview = true; 44 | this.MaximizeBox = false; 45 | this.MinimizeBox = false; 46 | this.Name = "SetupGuide"; 47 | this.Padding = new System.Windows.Forms.Padding(10); 48 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 49 | this.Text = "xPilot Guided Setup"; 50 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TutorialForm_KeyDown); 51 | this.ResumeLayout(false); 52 | 53 | } 54 | 55 | #endregion 56 | } 57 | } -------------------------------------------------------------------------------- /SetupGuide/ISetup.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient 25 | { 26 | public interface ISetup 27 | { 28 | void SwitchScreen(string name); 29 | void SetTitle(string title); 30 | void EndSetup(); 31 | void ManualSetup(); 32 | void SetupFinished(); 33 | bool XSquawkBox { get; set; } 34 | bool XSwiftBus { get; set; } 35 | string XplanePath { get; set; } 36 | SetupScreen CurrentScreen { get; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SetupGuide/ISetupScreen.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using System.Windows.Forms; 24 | 25 | namespace XPilot.PilotClient 26 | { 27 | public interface ISetupScreen 28 | { 29 | void KeyDownHandler(KeyEventArgs key); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SetupGuide/SetupScreen.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | using System.Windows.Forms; 24 | using XPilot.PilotClient.Config; 25 | using XPilot.PilotClient.Network; 26 | 27 | namespace XPilot.PilotClient 28 | { 29 | public class SetupScreen : UserControl 30 | { 31 | protected IAppConfig mConfig; 32 | public virtual ISetup Host { get; } 33 | 34 | protected SetupScreen() 35 | { 36 | 37 | } 38 | 39 | protected SetupScreen(ISetup host, IAppConfig config) 40 | { 41 | Host = host; 42 | mConfig = config; 43 | Dock = DockStyle.Fill; 44 | AutoSize = true; 45 | } 46 | 47 | public virtual void KeyDownHandler(KeyEventArgs key) 48 | { 49 | 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /UI/TransparentClickLabel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Drawing; 21 | using System.Linq; 22 | using System.Text; 23 | using System.Threading.Tasks; 24 | using System.Windows.Forms; 25 | 26 | namespace XPilot.PilotClient 27 | { 28 | public class TransparentClickLabel : Label 29 | { 30 | private const int WM_NCHITTEST = 0x84; 31 | private const int HTTRANSPARENT = -1; 32 | 33 | public bool HasBorder { get; set; } = false; 34 | 35 | public Color BorderColor { get; set; } 36 | 37 | protected override void OnPaint(PaintEventArgs e) 38 | { 39 | if (HasBorder) 40 | { 41 | Rectangle rect = new Rectangle(ClientRectangle.Left, ClientRectangle.Top, ClientRectangle.Width - 1, ClientRectangle.Height - 1); 42 | using (Pen pen = new Pen(BorderColor)) 43 | { 44 | e.Graphics.DrawRectangle(pen, rect); 45 | } 46 | } 47 | base.OnPaint(e); 48 | } 49 | 50 | protected override void WndProc(ref Message m) 51 | { 52 | switch (m.Msg) 53 | { 54 | case WM_NCHITTEST: 55 | m.Result = (IntPtr)HTTRANSPARENT; 56 | break; 57 | default: 58 | base.WndProc(ref m); 59 | break; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /UI/TransparentClickPanel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Drawing; 20 | using System.Windows.Forms; 21 | 22 | namespace XPilot.PilotClient 23 | { 24 | public class TransparentClickPanel : Panel 25 | { 26 | private const int WM_NCHITTEST = 0x84; 27 | private const int HTTRANSPARENT = -1; 28 | 29 | public Color BorderColor { get; set; } = Color.FromArgb(92, 92, 92); 30 | 31 | public TransparentClickPanel() 32 | { 33 | base.SetStyle(ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); 34 | } 35 | 36 | protected override void WndProc(ref Message m) 37 | { 38 | switch (m.Msg) 39 | { 40 | case WM_NCHITTEST: 41 | m.Result = (IntPtr)HTTRANSPARENT; 42 | break; 43 | default: 44 | base.WndProc(ref m); 45 | break; 46 | } 47 | } 48 | 49 | protected override void OnPaint(PaintEventArgs pevent) 50 | { 51 | base.OnPaint(pevent); 52 | Rectangle rect = new Rectangle(ClientRectangle.Left, ClientRectangle.Top, ClientRectangle.Width - 1, ClientRectangle.Height - 1); 53 | using (Pen pen = new Pen(BorderColor)) 54 | { 55 | pevent.Graphics.DrawRectangle(pen, rect); 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /XplaneAdapter/IUserAircraftManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.XplaneAdapter 19 | { 20 | internal interface IUserAircraftManager 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /XplaneAdapter/IXplaneConnectionManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | namespace XPilot.PilotClient.XplaneAdapter 19 | { 20 | public interface IXplaneConnectionManager 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /XplaneAdapter/WhosOnlineList.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * xPilot: X-Plane pilot client for VATSIM 3 | * Copyright (C) 2019-2020 Justin Shannon 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see http://www.gnu.org/licenses/. 17 | */ 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Text; 22 | using System.Threading.Tasks; 23 | 24 | namespace XPilot.PilotClient.XplaneAdapter 25 | { 26 | public class WhosOnlineList 27 | { 28 | public string Callsign { get; set; } 29 | public string Frequency { get; set; } 30 | public uint XplaneFrequency { get; set; } 31 | public string RealName { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpilot-project/pilot-client/8ac1382ec204b4941f81788379f5d2326799aafb/icon.ico -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | --------------------------------------------------------------------------------