초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,53 @@

using ServerCore;
using ServerBase;
namespace ServerCommon;
public enum EchoSystemMethod
{
None = 0,
Get = 1,
Put = 2,
Delete = 3,
Post = 4
}
public static class EchoSystemHelper
{
public const int DoubleCalculateDigitsLong = 100;
public static void checkDeltaDouble(this CaliumEventRequest request)
{
request.m_calium_delta = checkDouble(request.m_calium_delta);
request.m_sapphire_delta = checkDouble(request.m_sapphire_delta);
}
public static HttpRequestMessage makeRequestMessage(EchoSystemMethod method, string urlPath)
{
var http_method = getMethod(method);
NullReferenceCheckHelper.throwIfNull(http_method);
var request = new HttpRequestMessage(http_method, urlPath);
return request;
}
private static double checkDouble(double delta)
{
var delta_long = (long)(delta * DoubleCalculateDigitsLong);
return delta_long / (double)DoubleCalculateDigitsLong;
}
private static HttpMethod? getMethod(EchoSystemMethod method)
{
return method switch
{
EchoSystemMethod.Get => new HttpMethod("GET"),
EchoSystemMethod.Put => new HttpMethod("PUT"),
EchoSystemMethod.Delete => new HttpMethod("DELETE"),
EchoSystemMethod.Post => new HttpMethod("POST"),
_ => null
};
}
}