Port N00BS to linux

This commit is contained in:
Li 2022-07-25 19:16:21 +12:00
parent 64fed1c6c4
commit 8297c56f21
181 changed files with 282 additions and 132 deletions

0
HorseIsleServer/LibHISP/Server/ConfigReader.cs Normal file → Executable file
View file

0
HorseIsleServer/LibHISP/Server/DataFixerUpper.cs Normal file → Executable file
View file

0
HorseIsleServer/LibHISP/Server/Database.cs Normal file → Executable file
View file

0
HorseIsleServer/LibHISP/Server/Entry.cs Normal file → Executable file
View file

19
HorseIsleServer/LibHISP/Server/GameClient.cs Normal file → Executable file
View file

@ -113,13 +113,18 @@ namespace HISP.Server
}
public static void CreateClient(object sender, SocketAsyncEventArgs e)
{
do
{
Socket eSocket = e.AcceptSocket;
if(eSocket != null)
new GameClient(eSocket);
e.AcceptSocket = null;
} while (!GameServer.ServerSocket.AcceptAsync(e));
try{
do
{
Socket eSocket = e.AcceptSocket;
if(eSocket != null)
new GameClient(eSocket);
e.AcceptSocket = null;
if(GameServer.ServerSocket == null)
return;
} while (!GameServer.ServerSocket.AcceptAsync(e));
}catch(ObjectDisposedException) {} // server shutdown
}
private void timeoutTimerTick(object state)
{

0
HorseIsleServer/LibHISP/Server/GameDataJson.cs Normal file → Executable file
View file

0
HorseIsleServer/LibHISP/Server/GameServer.cs Normal file → Executable file
View file

0
HorseIsleServer/LibHISP/Server/Logger.cs Normal file → Executable file
View file

0
HorseIsleServer/LibHISP/Server/PacketBuilder.cs Normal file → Executable file
View file

144
HorseIsleServer/LibHISP/Server/ServerVersion.cs Normal file → Executable file
View file

@ -1,78 +1,78 @@
using System;
using System.Globalization;
using HISP.Properties;
namespace HISP.Server
{
public class ServerVersion
{
public static string PRODUCT = "HISP";
public static string GetArchitecture()
{
#if ARCH_ANYCPU
return "ANYCPU";
#elif ARCH_X86_64
return "x86_64";
#elif ARCH_X86
return "x86";
#elif ARCH_ARM
return "ARM";
#elif ARCH_ARM64
return "ARM64";
#else
return "UNK_ARCH";
#endif
}
public static string GetPlatform()
{
#if OS_DEBUG
return "DEBUG";
#elif OS_WINDOWS
return "WINDOWS";
#elif OS_ANDROID
return "ANDROID";
#elif OS_IOS
return "IOS";
#elif OS_LINUX
return "LINUX";
#elif OS_MACOS
return "MACOS";
#else
return "UNK_PLATFORM";
#endif
}
public static string GetVersionString()
{
return Resources.GitTag.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBranch()
{
return Resources.GitBranch.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBuildDate()
{
return Resources.BuildDate.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBuildTime()
{
return Resources.BuildTime.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
namespace HISP.Server
{
public class ServerVersion
{
public static string PRODUCT = "HISP";
public static string GetArchitecture()
{
#if ARCH_ANYCPU
return "ANYCPU";
#elif ARCH_X86_64
return "x86_64";
#elif ARCH_X86
return "x86";
#elif ARCH_ARM
return "ARM";
#elif ARCH_ARM64
return "ARM64";
#else
return "UNK_ARCH";
#endif
}
public static string GetPlatform()
{
#if OS_DEBUG
return "DEBUG";
#elif OS_WINDOWS
return "WINDOWS";
#elif OS_ANDROID
return "ANDROID";
#elif OS_IOS
return "IOS";
#elif OS_LINUX
return "LINUX";
#elif OS_MACOS
return "MACOS";
#else
return "UNK_PLATFORM";
#endif
}
public static string GetVersionString()
{
return Resources.GitTag.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBranch()
{
return Resources.GitBranch.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBuildDate()
{
return Resources.BuildDate.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBuildTime()
{
return Resources.BuildTime.Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetCommitHashVersion()
{
return UInt16.Parse(Resources.GitCommit.Substring(0, 4), NumberStyles.HexNumber).ToString();
}
public static string GetCommitHash(int TotalBytes)
{
return Resources.GitCommit.Substring(0, TotalBytes).Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBuildString()
{
return PRODUCT + " " + GetVersionString() + " " + GetBranch() + "@" + GetCommitHash(6) + " (" + GetArchitecture() + "; " + GetPlatform() + "); Built @ " + GetBuildDate() + " " + GetBuildTime();
}
}
}
}
public static string GetCommitHash(int TotalBytes)
{
return Resources.GitCommit.Substring(0, TotalBytes).Replace("\r", "").Replace("\n", "").ToString().Trim();
}
public static string GetBuildString()
{
return PRODUCT + " " + GetVersionString() + " " + GetBranch() + "@" + GetCommitHash(6) + " (" + GetArchitecture() + "; " + GetPlatform() + "); Built @ " + GetBuildDate() + " " + GetBuildTime();
}
}
}

0
HorseIsleServer/LibHISP/Server/Util.cs Normal file → Executable file
View file