-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
130 changed files
with
104,189 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+102 KB
CodeSwine-Solo_Public_Lobby/.vs/CodeSwine-Private_Public_Lobby/v15/.suo
Binary file not shown.
Binary file added
BIN
+848 KB
CodeSwine-Solo_Public_Lobby/.vs/CodeSwine-Private_Public_Lobby/v15/sqlite3/storage.ide
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
CodeSwine-Solo_Public_Lobby/CodeSwine-Private_Public_Lobby.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26730.8 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeSwine-Private_Public_Lobby", "CodeSwine-Solo_Public_Lobby\CodeSwine-Private_Public_Lobby.csproj", "{8568F1E3-880F-4CAC-819D-40D1A4D3D863}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{8568F1E3-880F-4CAC-819D-40D1A4D3D863}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8568F1E3-880F-4CAC-819D-40D1A4D3D863}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8568F1E3-880F-4CAC-819D-40D1A4D3D863}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8568F1E3-880F-4CAC-819D-40D1A4D3D863}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {E5EAABC1-CA50-429B-A02A-A78AC5EED8F0} | ||
EndGlobalSection | ||
EndGlobal |
6 changes: 6 additions & 0 deletions
6
CodeSwine-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/App.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | ||
</startup> | ||
</configuration> |
9 changes: 9 additions & 0 deletions
9
CodeSwine-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/App.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="CodeSwine_Solo_Public_Lobby.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:CodeSwine_Solo_Public_Lobby" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
17 changes: 17 additions & 0 deletions
17
CodeSwine-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/App.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace CodeSwine_Solo_Public_Lobby | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
191 changes: 191 additions & 0 deletions
191
...Swine-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/CodeSwine-Private_Public_Lobby.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{8568F1E3-880F-4CAC-819D-40D1A4D3D863}</ProjectGuid> | ||
<OutputType>WinExe</OutputType> | ||
<RootNamespace>CodeSwine_Solo_Public_Lobby</RootNamespace> | ||
<AssemblyName>CodeSwine-Solo_Public_Lobby</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<WarningLevel>4</WarningLevel> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<IsWebBootstrapper>false</IsWebBootstrapper> | ||
<PublishUrl>D:\Downloads\</PublishUrl> | ||
<Install>true</Install> | ||
<InstallFrom>Disk</InstallFrom> | ||
<UpdateEnabled>false</UpdateEnabled> | ||
<UpdateMode>Foreground</UpdateMode> | ||
<UpdateInterval>7</UpdateInterval> | ||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> | ||
<UpdatePeriodically>false</UpdatePeriodically> | ||
<UpdateRequired>false</UpdateRequired> | ||
<MapFileExtensions>true</MapFileExtensions> | ||
<ApplicationRevision>2</ApplicationRevision> | ||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> | ||
<UseApplicationTrust>false</UseApplicationTrust> | ||
<PublishWizardCompleted>true</PublishWizardCompleted> | ||
<BootstrapperEnabled>true</BootstrapperEnabled> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<ApplicationIcon>icon.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<ManifestCertificateThumbprint>C2F190854D8F6F14FA1C9ACDF545758AFD208C57</ManifestCertificateThumbprint> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<ManifestKeyFile>CodeSwine-Solo_Public_Lobby_TemporaryKey.pfx</ManifestKeyFile> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<GenerateManifests>true</GenerateManifests> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SignManifests>true</SignManifests> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xaml"> | ||
<RequiredTargetFramework>4.0</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="WindowsBase" /> | ||
<Reference Include="PresentationCore" /> | ||
<Reference Include="PresentationFramework" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ApplicationDefinition Include="App.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</ApplicationDefinition> | ||
<Page Include="MainWindow.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Compile Include="App.xaml.cs"> | ||
<DependentUpon>App.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="DataAccess\DaWhitelist.cs" /> | ||
<Compile Include="Helpers\ColorBrush.cs" /> | ||
<Compile Include="Helpers\FirewallRule.cs" /> | ||
<Compile Include="Helpers\IPTool.cs" /> | ||
<Compile Include="Helpers\RangeCalculator.cs" /> | ||
<Compile Include="MainWindow.xaml.cs"> | ||
<DependentUpon>MainWindow.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Models\MWhitelist.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="Properties\Resources.Designer.cs"> | ||
<AutoGen>True</AutoGen> | ||
<DesignTime>True</DesignTime> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
<Compile Include="Properties\Settings.Designer.cs"> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Settings.settings</DependentUpon> | ||
<DesignTimeSharedInput>True</DesignTimeSharedInput> | ||
</Compile> | ||
<EmbeddedResource Include="Properties\Resources.resx"> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
<None Include="CodeSwine-Private_Public_Lobby_TemporaryKey.pfx" /> | ||
<None Include="packages.config" /> | ||
<None Include="Properties\Settings.settings"> | ||
<Generator>SettingsSingleFileGenerator</Generator> | ||
<LastGenOutput>Settings.Designer.cs</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<COMReference Include="NetFwTypeLib"> | ||
<Guid>{58FBCF7C-E7A9-467C-80B3-FC65E8FCCA08}</Guid> | ||
<VersionMajor>1</VersionMajor> | ||
<VersionMinor>0</VersionMinor> | ||
<Lcid>0</Lcid> | ||
<WrapperTool>tlbimp</WrapperTool> | ||
<Isolated>False</Isolated> | ||
<EmbedInteropTypes>True</EmbedInteropTypes> | ||
</COMReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="icon.ico" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\wireless.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1"> | ||
<Visible>False</Visible> | ||
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1</ProductName> | ||
<Install>false</Install> | ||
</BootstrapperPackage> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\gears.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\help.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\locked.png" /> | ||
<Resource Include="ImageResources\unlocked.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\add.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\Github.png" /> | ||
<Resource Include="ImageResources\trash.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\mpgh.PNG" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="ImageResources\5mods.jpg" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
...-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/CodeSwine-Private_Public_Lobby.csproj.user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<PublishUrlHistory>publish\</PublishUrlHistory> | ||
<InstallUrlHistory /> | ||
<SupportUrlHistory /> | ||
<UpdateUrlHistory /> | ||
<BootstrapperUrlHistory /> | ||
<ErrorReportUrlHistory /> | ||
<FallbackCulture>en-US</FallbackCulture> | ||
<VerifyUploadedFiles>false</VerifyUploadedFiles> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<EnableSecurityDebugging>false</EnableSecurityDebugging> | ||
</PropertyGroup> | ||
</Project> |
Binary file added
BIN
+1.67 KB
..._Public_Lobby/CodeSwine-Solo_Public_Lobby/CodeSwine-Private_Public_Lobby_TemporaryKey.pfx
Binary file not shown.
70 changes: 70 additions & 0 deletions
70
CodeSwine-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/DataAccess/DaWhitelist.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using CodeSwine_Solo_Public_Lobby.Helpers; | ||
using CodeSwine_Solo_Public_Lobby.Models; | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Net; | ||
|
||
namespace CodeSwine_Solo_Public_Lobby.DataAccess | ||
{ | ||
public class DaWhitelist | ||
{ | ||
public IPTool iPTool = new IPTool(); | ||
private bool useWhitelist; | ||
private string iPCount; | ||
|
||
public DaWhitelist() | ||
{ | ||
ReadIPsFromJSON(); | ||
} | ||
|
||
public List<IPAddress> IpAddressess { | ||
get { return ReadIPsFromJSON(); } | ||
} | ||
|
||
public string IPCount { | ||
get { return iPCount; } | ||
} | ||
|
||
public bool UseWhitelist { | ||
get { return useWhitelist; } | ||
set { useWhitelist = value; } | ||
} | ||
|
||
List<IPAddress> ReadIPsFromJSON() | ||
{ | ||
List<IPAddress> addresses = new List<IPAddress>(); | ||
|
||
string path = Environment.ExpandEnvironmentVariables(AppDomain.CurrentDomain.BaseDirectory + "settings.json"); | ||
|
||
string json = ""; | ||
|
||
if(!File.Exists(path)) | ||
{ | ||
SaveToJson(new MWhitelist()); | ||
} | ||
|
||
using (StreamReader r = new StreamReader(path)) | ||
{ | ||
json = r.ReadToEnd(); | ||
} | ||
|
||
MWhitelist whitelist = JsonConvert.DeserializeObject<MWhitelist>(json); | ||
|
||
foreach (string address in whitelist.Ips) | ||
{ | ||
if(iPTool.ValidateIPv4(address.ToString())) addresses.Add(IPAddress.Parse(address)); | ||
} | ||
|
||
iPCount = addresses.Count.ToString(); | ||
return addresses; | ||
} | ||
|
||
public static void SaveToJson(MWhitelist whitelist) | ||
{ | ||
string json = JsonConvert.SerializeObject(whitelist); | ||
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "settings.json", json); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
CodeSwine-Solo_Public_Lobby/CodeSwine-Solo_Public_Lobby/Helpers/ColorBrush.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Windows.Media; | ||
|
||
namespace CodeSwine_Solo_Public_Lobby.Helpers | ||
{ | ||
public class ColorBrush | ||
{ | ||
public static SolidColorBrush Red { | ||
get { return new SolidColorBrush(Color.FromArgb(255, (byte)220, (byte)53, (byte)69)); } | ||
} | ||
|
||
public static SolidColorBrush Blue { | ||
get { return new SolidColorBrush(Color.FromArgb(255, (byte)0, (byte)123, (byte)255)); } | ||
} | ||
|
||
public static SolidColorBrush Green { | ||
get { return new SolidColorBrush(Color.FromArgb(255, (byte)40, (byte)167, (byte)69)); } | ||
} | ||
|
||
public static SolidColorBrush Yellow { | ||
get { return new SolidColorBrush(Color.FromArgb(255, (byte)255, (byte)193, (byte)7)); } | ||
} | ||
} | ||
} |
Oops, something went wrong.