-
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.
Migrate to .NET 8 and some other changes
- Loading branch information
Showing
14 changed files
with
77 additions
and
687 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,32 +1,34 @@ | ||
using FikaServerTools.Config; | ||
using FikaServerTools.Networking; | ||
using System.Threading; | ||
|
||
namespace FikaServerTools | ||
{ | ||
internal class FikaServerTools | ||
{ | ||
public static FikaServerToolsConfig Config { get; set; } | ||
public static FikaServerToolsConfig Config; | ||
private static FikaNatPunchServer _fikaNatPunchServer; | ||
|
||
static void Main(string[] args) | ||
{ | ||
Config = ConfigManager.Load(args); | ||
Config = ConfigManager.LoadFromArgs(args); | ||
|
||
Logger.LogInfo("FikaServerTools started!"); | ||
if (Config == null) | ||
{ | ||
Console.WriteLine("Unable to load configuration from arguments."); | ||
return; | ||
} | ||
|
||
if(Config.NatPunchServer.Enable) | ||
if (Config.NatPunchServer.Enable) | ||
{ | ||
_fikaNatPunchServer = new FikaNatPunchServer(Config.NatPunchServer); | ||
_fikaNatPunchServer.Start(); | ||
} | ||
|
||
// Main thread loop | ||
while(true) | ||
{ | ||
_fikaNatPunchServer?.PollEvents(); | ||
Thread.Sleep(10); | ||
while (true) | ||
{ | ||
_fikaNatPunchServer.PollEvents(); | ||
Thread.Sleep(10); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,98 +1,12 @@ | ||
<?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')" /> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{4C300ECA-8244-4B95-94DD-03A9339B5C5B}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>FikaServerTools</RootNamespace> | ||
<AssemblyName>FikaServerTools</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<Deterministic>true</Deterministic> | ||
<TargetFrameworkProfile /> | ||
</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> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</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> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>disable</Nullable> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Runtime.Serialization" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Config\ConfigManager.cs" /> | ||
<Compile Include="Logger.cs" /> | ||
<Compile Include="Config\FikaServerToolsConfig.cs" /> | ||
<Compile Include="Networking\FikaNatPunchServer.cs" /> | ||
<Compile Include="FikaServerTools.cs" /> | ||
<Compile Include="Networking\LiteNetLib\BaseChannel.cs" /> | ||
<Compile Include="Networking\LiteNetLib\ConnectionRequest.cs" /> | ||
<Compile Include="Networking\LiteNetLib\INetEventListener.cs" /> | ||
<Compile Include="Networking\LiteNetLib\InternalPackets.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Layers\Crc32cLayer.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Layers\PacketLayerBase.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Layers\XorEncryptLayer.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NativeSocket.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NatPunchModule.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetConstants.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetDebug.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetManager.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetManager.HashSet.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetManager.PacketPool.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetManager.Socket.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetPacket.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetPeer.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetStatistics.cs" /> | ||
<Compile Include="Networking\LiteNetLib\NetUtils.cs" /> | ||
<Compile Include="Networking\LiteNetLib\PausedSocketFix.cs" /> | ||
<Compile Include="Networking\LiteNetLib\PooledPacket.cs" /> | ||
<Compile Include="Networking\LiteNetLib\ReliableChannel.cs" /> | ||
<Compile Include="Networking\LiteNetLib\SequencedChannel.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Trimming.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\CRC32C.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\FastBitConverter.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\INetSerializable.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\NetDataReader.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\NetDataWriter.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\NetPacketProcessor.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\NetSerializer.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\NtpPacket.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\NtpRequest.cs" /> | ||
<Compile Include="Networking\LiteNetLib\Utils\Preserve.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="Networking\LiteNetLib\LICENSE.md" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup /> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> | ||
|
||
</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
Oops, something went wrong.