-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from blaxxun-boop/master
change server config to yaml
- Loading branch information
Showing
7 changed files
with
126 additions
and
96 deletions.
There are no files selected for viewing
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 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using YamlDotNet.Serialization; | ||
|
||
namespace FastLink; | ||
|
||
public class Definition | ||
{ | ||
public string serverName = null!; | ||
|
||
public ushort port { get; set; } | ||
|
||
public string address { get; set; } = null!; | ||
|
||
public string password { get; set; } = ""; | ||
|
||
public static IEnumerable<Definition> Parse(string yaml) => new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, Definition>>(yaml).Select(kv => | ||
{ | ||
Definition def = kv.Value; | ||
def.serverName = kv.Key; | ||
return def; | ||
}); | ||
|
||
public override string ToString() => $"Server(name={serverName},address={address},port={port})"; | ||
} |
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
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,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Target Name="ILRepacker" AfterTargets="Build"> | ||
<ItemGroup> | ||
<InputAssemblies Include="$(TargetPath)"/> | ||
<InputAssemblies Include="$(OutputPath)YamlDotNet.dll"/> | ||
</ItemGroup> | ||
<ILRepack Parallel="true" DebugInfo="true" Internalize="true" InputAssemblies="@(InputAssemblies)" OutputFile="$(TargetPath)" TargetKind="SameAsPrimaryAssembly" LibraryPath="$(OutputPath)"/> | ||
</Target> | ||
</Project> |
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
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
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
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="ILRepack.Lib.MSBuild.Task" version="2.0.18.2" targetFramework="net462" /> | ||
<package id="YamlDotNet" version="11.2.1" targetFramework="net462" /> | ||
</packages> |