Reorganization, betterer asp.net things, new proxy, other stuff
This commit is contained in:
parent
ad219b095c
commit
febd87782d
|
@ -1,6 +1,6 @@
|
|||
using System.Text.Json;
|
||||
|
||||
namespace Elisa.Data;
|
||||
namespace Elisa.Common.Data;
|
||||
|
||||
public static class JSON
|
||||
{
|
|
@ -1,10 +1,10 @@
|
|||
using Elisa.Data.Tables;
|
||||
using Elisa.Common.Data.Tables;
|
||||
using Serilog;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Elisa.Data;
|
||||
namespace Elisa.Common.Data;
|
||||
|
||||
public enum LoadDataType
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Data.Tables;
|
||||
namespace Elisa.Common.Data.Tables;
|
||||
|
||||
public class GunExpInfo : Model
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Data.Tables;
|
||||
namespace Elisa.Common.Data.Tables;
|
||||
|
||||
public class Daily : Model
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Data.Tables;
|
|
@ -0,0 +1,18 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="3.1.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GetAllBonusRequest
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class ChessGashaDrawRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class ChipEnhanceRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class EquipDevelopMultiRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class ChangeSkinRequest
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class AdjustRequest
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class BikiniVoteResultResponse
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GetAdaptiveTeamResponse
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class FairySkillUpgradeRequest
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Messages;
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class ReadStoryRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class TeamGunsResponse
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Messages;
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GunCombineGunRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class ChangeAdjutantRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class IndexRequest
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Messages;
|
|
@ -1,5 +1,6 @@
|
|||
using Elisa.Models;
|
||||
namespace Elisa.Messages;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GetResourceInMailQuickRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class AbortMissionResponse
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class AbortOperationRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class EstablishBuildFinishRequest
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GetEventPrizeRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class AccomplishAllQuestsResponse
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GetRankRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class SangvisAdvanceRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class GameSettingRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class AddSquadProgressRequest
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class TheaterDataRequest
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Messages;
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Models;
|
||||
using Elisa.Common.Models;
|
||||
|
||||
namespace Elisa.Messages;
|
||||
namespace Elisa.Common.Messages;
|
||||
|
||||
public class VehicleUnlockResponse
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Models;
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class ChessInfo
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
// TODO: check
|
||||
public class Chip
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class DataAnalysisAct
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class DorFurniture
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
// TODO: check
|
||||
public class Equip
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class EventInfo
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Elisa.Messages;
|
||||
using Elisa.Common.Messages;
|
||||
|
||||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class ExploreAct
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
// TODO: check
|
||||
public class Fairy
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class AllFavorupGun
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class FetterBounty
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class FriendAct
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class Guide
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class FixAct
|
||||
{
|
|
@ -0,0 +1 @@
|
|||
namespace Elisa.Common.Models;
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class Index
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
// TODO: check
|
||||
public class CommanderUniform
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class IndexMail
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class Airbone
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class OperationAct
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class OuthouseFurniture
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class AddEquip
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class AccomplishQuestList
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class RankUserInfo
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
// tODO: check
|
||||
public class Sangvis
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class GameConfigInfo
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
// TODO: check
|
||||
public class Squad
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class SquadInTheaterInfo
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class UserInfo
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Models;
|
||||
namespace Elisa.Common.Models;
|
||||
|
||||
public class Vehicle
|
||||
{
|
|
@ -3,7 +3,7 @@ using System.IO.Compression;
|
|||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Elisa.Utils;
|
||||
namespace Elisa.Common.Utils;
|
||||
|
||||
public static class Crypto
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ public static class Crypto
|
|||
if (string.IsNullOrEmpty(body) || string.IsNullOrEmpty(key))
|
||||
return string.Empty;
|
||||
|
||||
if (body.Length == 1 || body.StartsWith("error:") || (body.StartsWith("{") && body.EndsWith("}")))
|
||||
if (body.Length == 1 || body.StartsWith("error:") || body.StartsWith("{") && body.EndsWith("}"))
|
||||
return body;
|
||||
|
||||
try
|
||||
|
@ -27,13 +27,13 @@ public static class Crypto
|
|||
{
|
||||
body = body.Substring(1);
|
||||
|
||||
return GZipDecompress(RC4(ConvertFromBase64String(body), pwd).Skip(26).ToArray<byte>());
|
||||
return GZipDecompress(RC4(ConvertFromBase64String(body), pwd).Skip(26).ToArray());
|
||||
}
|
||||
|
||||
byte[] bytes = RC4(ConvertFromBase64String(body), pwd);
|
||||
string @string = Encoding.UTF8.GetString(bytes);
|
||||
|
||||
return (@string.Length > 26) ? @string.Substring(26) : string.Empty;
|
||||
return @string.Length > 26 ? @string.Substring(26) : string.Empty;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ public static class Crypto
|
|||
string text2 = MD5(text.Substring(16, 16));
|
||||
string pwd = text2 + MD5(text2);
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(string.Format("{0}", Math.Round(GetCurrentSec()) + 3600.0));
|
||||
string s2 = MD5(array.Concat(Encoding.UTF8.GetBytes(s)).ToArray<byte>()).Substring(0, 16);
|
||||
string s2 = MD5(array.Concat(Encoding.UTF8.GetBytes(s)).ToArray()).Substring(0, 16);
|
||||
byte[] array2 = new byte[array.Length + 26];
|
||||
|
||||
Array.Copy(bytes, 0, array2, 0, bytes.Length);
|
||||
|
@ -134,11 +134,11 @@ public static class Crypto
|
|||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
array[i] = (int)pwd[i % pwd.Length];
|
||||
array[i] = pwd[i % pwd.Length];
|
||||
array2[i] = i;
|
||||
}
|
||||
|
||||
for (i = (num = 0); i < 256; i++)
|
||||
for (i = num = 0; i < 256; i++)
|
||||
{
|
||||
int num2 = array2[i];
|
||||
|
||||
|
@ -148,7 +148,7 @@ public static class Crypto
|
|||
}
|
||||
|
||||
int num3;
|
||||
num = (num3 = (i = 0));
|
||||
num = num3 = i = 0;
|
||||
|
||||
while (i < data.Length)
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ public static class Crypto
|
|||
array2[num] = num2;
|
||||
|
||||
int num4 = array2[(array2[num3] + array2[num]) % 256];
|
||||
array3[i] = (byte)((int)data[i] ^ num4);
|
||||
array3[i] = (byte)(data[i] ^ num4);
|
||||
|
||||
i++;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Utils;
|
||||
namespace Elisa.Common.Utils;
|
||||
|
||||
public static class RNG
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public static class RNG
|
|||
{
|
||||
double range = (double)max - min;
|
||||
double sample = random.NextDouble();
|
||||
double scaled = (sample * range) + min;
|
||||
double scaled = sample * range + min;
|
||||
|
||||
return (float)scaled;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Utils;
|
||||
namespace Elisa.Common.Utils;
|
||||
|
||||
public abstract class Singleton<T> where T : new()
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elisa.Utils;
|
||||
namespace Elisa.Common.Utils;
|
||||
|
||||
public static class Time
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ public static class Time
|
|||
=> new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddMonths(1).ToUnixSeconds();
|
||||
}
|
||||
|
||||
internal static class DateTimeExtensions
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
public static long ToUnixSeconds(this DateTime dateTime)
|
||||
=> (long)(dateTime - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
|
|
@ -1,7 +1,7 @@
|
|||
using Serilog;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Elisa.Commands;
|
||||
namespace Elisa.GameServer.Commands;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
||||
public class CommandHandler(string name, string description, string example) : Attribute
|
||||
|
@ -140,7 +140,7 @@ public static class CommandHandlerFactory
|
|||
|
||||
if (connection is not null)
|
||||
{
|
||||
if (!(commandFunctionsUser).TryGetValue(parts[0], out var command))
|
||||
if (!commandFunctionsUser.TryGetValue(parts[0], out var command))
|
||||
{
|
||||
Log.Warning($"Unknown command: {parts[0]}");
|
||||
return;
|
||||
|
@ -150,7 +150,7 @@ public static class CommandHandlerFactory
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(commandFunctions).TryGetValue(parts[0], out var command))
|
||||
if (!commandFunctions.TryGetValue(parts[0], out var command))
|
||||
{
|
||||
Log.Warning($"Unknown command: {parts[0]}");
|
||||
return;
|
|
@ -1,7 +1,7 @@
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Elisa.Commands;
|
||||
namespace Elisa.GameServer.Commands;
|
||||
|
||||
[CommandHandler("help", "Print out all commands with their description and example", "help")]
|
||||
public class HelpCommand : Command
|
|
@ -1,7 +1,7 @@
|
|||
using Elisa.Utils;
|
||||
using Elisa.Common.Utils;
|
||||
using Serilog;
|
||||
|
||||
namespace Elisa.Commands;
|
||||
namespace Elisa.GameServer.Commands;
|
||||
|
||||
[CommandHandler("test", "Command to test various functions", "test type=encrypt value=asdf")]
|
||||
public class tESTcOMMAND : Command
|
|
@ -0,0 +1,17 @@
|
|||
using Elisa.GameServer.Commands;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Elisa.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("/")]
|
||||
public class CommandController : ControllerBase
|
||||
{
|
||||
[HttpGet("command")]
|
||||
public async Task<IResult> Command([FromQuery] string command)
|
||||
{
|
||||
CommandHandlerFactory.HandleCommand(command);
|
||||
|
||||
return Results.Text("Command executed");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
using Elisa.Common.Utils;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Elisa.GameServer.Controllers;
|
||||
|
||||
public class IndexController : Controller
|
||||
{
|
||||
[HttpPost("index.php", Name = "ServerList")]
|
||||
public async Task<IResult> ServerList()
|
||||
{
|
||||
return Results.Text(System.IO.File.ReadAllText(@"Resources\serverList.xml"));
|
||||
}
|
||||
|
||||
[HttpGet("index.php/1001/index/version", Name = "Version")]
|
||||
public async Task<IResult> Version([FromQuery] string req_id)
|
||||
{
|
||||
return Results.Json(new
|
||||
{
|
||||
now = DateTime.Now.ToUnixSeconds(),
|
||||
tomorrow_zero = Time.GetTomorrowZero(),
|
||||
month_zero = Time.GetCurrentMonthZero(),
|
||||
next_month_zero = Time.GetNextMonthZero(),
|
||||
timezone = "PST8PDT",
|
||||
data_version = GameServer.DataVersion,
|
||||
client_version = GameServer.ClientVersion,
|
||||
ab_version = GameServer.ABVersion,
|
||||
is_kick = "0",
|
||||
weekday = 1,
|
||||
authentication_url = $"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh"
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("image/imageconfig.txt", Name = "ImageConfig")]
|
||||
public async Task<IResult> ImageConfig()
|
||||
{
|
||||
return Results.Text(System.IO.File.ReadAllText(@"Resources\image\ImageConfig.txt"));
|
||||
}
|
||||
|
||||
/*
|
||||
[Route("{*url}")]
|
||||
public async Task<IActionResult> HandleAll(string url)
|
||||
{
|
||||
Log.Information("Handling unmatched request for URL: {Url}", url);
|
||||
return Content($"Handled by catch-all route: {url}");
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
@ -12,12 +12,21 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\serverList.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\catchdata\*.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\image\*.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\stc\*.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -29,10 +38,15 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="3.1.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
<PackageReference Include="Titanium.Web.Proxy" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Elisa.Common\Elisa.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,54 @@
|
|||
using Elisa.Common.Data;
|
||||
using Elisa.GameServer.Commands;
|
||||
using Elisa.GameServer.Services;
|
||||
using Serilog;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Text.Encodings.Web;
|
||||
|
||||
namespace Elisa.GameServer;
|
||||
|
||||
public static class GameServer
|
||||
{
|
||||
public static string ClientVersion = 30400.ToString();
|
||||
public static string DataVersion = "d630eea53a1b869fa4d7d1479a3d09e7";
|
||||
public static string ABVersion = 2024051417.ToString();
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
builder.Host.UseSerilog((context, configuration) => configuration.ReadFrom.Configuration(context.Configuration));
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddControllers()
|
||||
.AddJsonOptions(options => options.JsonSerializerOptions.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping);
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddHostedService(provider => new ProxyBackgroundService("127.0.0.1"));
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
app.UseSerilogRequestLogging();
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
Log.Information($"Version {Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion}");
|
||||
Log.Information($"Client Version: {ClientVersion}");
|
||||
Log.Information($"Data Version: {DataVersion}");
|
||||
Log.Information($"AB Version: {ABVersion}");
|
||||
Log.Information($"Starting {Assembly.GetEntryAssembly()?.GetName().Name.Split('.')[0]}...");
|
||||
|
||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
||||
{
|
||||
CommandHandlerFactory.RegisterCommands(Assembly.GetExecutingAssembly());
|
||||
Table.Load();
|
||||
}
|
||||
stopwatch.Stop();
|
||||
Log.Information($"Done! Loaded in {stopwatch.ElapsedMilliseconds}ms");
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:3505",
|
||||
"sslPort": 44376
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://127.0.0.1",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7010;http://localhost:5208",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using Serilog;
|
||||
using System.Text.RegularExpressions;
|
||||
using Titanium.Web.Proxy;
|
||||
using Titanium.Web.Proxy.EventArguments;
|
||||
using Titanium.Web.Proxy.Models;
|
||||
|
||||
namespace Elisa.GameServer;
|
||||
|
||||
public class ProxyControl
|
||||
{
|
||||
static readonly Regex HostFilter = new Regex("(.*).(girlfrontline\\.co\\.kr|ppgame\\.com|txwy\\.tw|sunborngame\\.com|aihelp.net.cn).*");
|
||||
readonly string forwardIpAddress;
|
||||
readonly ProxyServer proxyServer;
|
||||
readonly ExplicitProxyEndPoint explicitEndPoint;
|
||||
|
||||
public ProxyControl(string forwardIpAddress, int port = 9000)
|
||||
{
|
||||
this.forwardIpAddress = forwardIpAddress;
|
||||
proxyServer = new ProxyServer();
|
||||
explicitEndPoint = new ExplicitProxyEndPoint(System.Net.IPAddress.Any, port, true);
|
||||
|
||||
proxyServer.BeforeRequest += OnRequest;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
proxyServer.AddEndPoint(explicitEndPoint);
|
||||
proxyServer.Start();
|
||||
|
||||
// proxyServer.SetAsSystemHttpProxy(explicitEndPoint);
|
||||
// proxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
proxyServer.BeforeRequest -= OnRequest;
|
||||
proxyServer.Stop();
|
||||
}
|
||||
|
||||
private async Task OnRequest(object sender, SessionEventArgs e)
|
||||
{
|
||||
Uri requestUri = e.HttpClient.Request.RequestUri;
|
||||
if (HostFilter.IsMatch(requestUri.Host))
|
||||
{
|
||||
Log.Information($"Forwarding request for {requestUri} to {forwardIpAddress}");
|
||||
|
||||
Uri newUri = new Uri("http://" + forwardIpAddress + requestUri.PathAndQuery, UriKind.Absolute);
|
||||
Log.Information($"Forwarded request to {newUri}");
|
||||
|
||||
e.HttpClient.Request.RequestUri = newUri;
|
||||
|
||||
// Bubble it out to user
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
//类型名|是否会保存到本地|资源名
|
||||
//HotUpdateBackground|true|Background161101.png
|
||||
HotUpdateBackground|true|1ff934568eb9d2a6_draw_221213175434.png
|
||||
LoginBackground|true|201805
|
||||
|
||||
HomeBackground|true|
|
||||
attendance1|true|
|
||||
attendance2|true|d3d1b3e115da2221_draw_240507142255.jpg
|
||||
CDKey2|true|
|
||||
SevenSupply1|true|c30482012b01a83a_draw_181106004.png
|
||||
FirstPurchase1|true|
|
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<servers>
|
||||
<server>
|
||||
<name>GRIFFIN</name>
|
||||
<addr>http://127.0.0.1/</addr>
|
||||
<worldId>1001</worldId>
|
||||
<recommended>0</recommended>
|
||||
<condition>0</condition>
|
||||
<is_check>0</is_check>
|
||||
<nc>0</nc>
|
||||
<ab_version>2024051417</ab_version>
|
||||
<open_time>1714705161</open_time>
|
||||
<naive_switch>1</naive_switch>
|
||||
</server>
|
||||
|
||||
<config>
|
||||
<notice_url>http://127.0.0.1/pages/notice</notice_url>
|
||||
<update_log_url>http://127.0.0.1/pages/update_url</update_log_url>
|
||||
<update_start_time>2018-05-16 20:00:43</update_start_time>
|
||||
<update_end_time>2036-09-01 00:00:00</update_end_time>
|
||||
<client_version>30400</client_version>
|
||||
<platform>https://play.google.com/store/apps/details?id=com.sunborn.girlsfrontline.en</platform>
|
||||
<top_client_version>20410</top_client_version>
|
||||
<version_desc>
|
||||
v.3.0400 Update Content:
|
||||
|
||||
[Mobile Armor System Optimizations]
|
||||
|
||||
1. Optimized: The "Mobile Armor" combat results screen now shows the remaining HP and other such info of the Mobile Armor units in question. An option to "Armor Enhancement" has been added to the Mission Failed screen.
|
||||
|
||||
2. Optimized: If a Mobile Armor 4unit is not "In Combat", Fire Support Units assigned to the armor in question can be independently deployed as normal.
|
||||
|
||||
3. Optimized: The "Tech Tree" display of the Mobile Armor system now features a before and after display of effects when activating certain nodes.
|
||||
|
||||
4. Optimized: Mobile Armor support skills are now labelled with the [Support] tag.
|
||||
|
||||
5. Optimized: The Armor Design Shop's item preview function now adds an indication that an item is being previewed, as well as showing if a certain mobile armor design will clash with others. You can also instantly purchase a desired item after trying it out. Changing an armor's degisn blueprint no longer clears out equipped designs.
|
||||
|
||||
The "Armor Design" set display mode has also been added. You may use this function to preview the look of a scerain set of armor designs as well as purchase it immediately.
|
||||
|
||||
The "Armor Design" purchase screen has been made easier to use.
|
||||
|
||||
The arrangement of items in the "Armor Design" blueprint display screen has been improved.
|
||||
|
||||
6. Optimized: Information display for non-generic components has been improved and the equip screen has been mae easier to use.
|
||||
|
||||
7. Optimized: Information display and filtering for generic components has been improved.
|
||||
|
||||
|
||||
[Other New Content]
|
||||
|
||||
1. Added: "Armored Assault" mode in "Gray Zone Exploration" now has the "Sweep" function. If you have already cleared up to a certain point in the stage, you can click "Sweep" to expend attempts to directly obtain the stage rewards.
|
||||
|
||||
2. Added: The "Gray Zone Exploration" system now features a new Proxy Planning function. At the "Echelon Formation" or the "Gray Zone Exploration" difficulty select, you can click the newly-added "Echelon Pre-Select" button to enter the echelon pre-selection screen.
|
||||
On this screen, you can edit and select echelons for use in Proxy Battle mode, as well as deciding whether the echelons in question will take part in day or night battles.
|
||||
Once you have finished editing, selected and activated your pre-selected echelons, the system will only use these echelons or units during Proxy Battle mode.
|
||||
|
||||
3. Added: Combat Simulations now have the "Sweep" function. During "EXP Mode", "Data Mode", "Capsule Mode", "Neural Cloud Corridor" and "Coalition Drill, you can select the number of times you want to sweep the simulation in question and press the "Sweep" button to expend the corresponding amount of attempts and gain the appropriate materials as rewards.
|
||||
|
||||
4. Added: The "Echelon Formation" screen now has a Share function. By clicking the "Share" button, you can convert your current echelon's data into a bar code or QR code which can be shared with other Commanders. This code can be used by other Commanders to reproduce your echelon.
|
||||
This function is not currently available for vehicle echelons.
|
||||
|
||||
5. Added: The "Search" function has ben aded to the unit display screen. You can enter keywords to search for units which meet the criteria.
|
||||
|
||||
6. Added: The "Favorite" function has been added to unit detail pages. By clicking it, you can favorite the unit in question, which enables the filter option "Only show favorited" units.
|
||||
|
||||
7. Added: The armor components "Vehicle Shotgun", "Mini Mortar", "Laser Rangefinder", "Camouflage Netting", "Top Slat Armor" can be obtained through exploring the "Vitrified - Hell" region during "Gray Zone Exploration".
|
||||
|
||||
[Other Optimizations]
|
||||
|
||||
1. Optimized: The "Repair All " option now includes Fire Support Units and Mobile Armors.
|
||||
|
||||
2. Optimized: Mid-battle nformation display for Fire Support Units has been improved. You can view information on Fire Support Units and Mobile Armors units by clicking and holding on them.
|
||||
|
||||
3. Optimized: The post-mission reward display screen in Gray Zone Exploration has been tweaked.
|
||||
|
||||
4. Optimized: The overall functional experience of the Proxy Battle system in Gray Zone Exploration has been improved.
|
||||
|
||||
5. Optimized: The Chip Enhancement system for Fire Support Units has been improved. The Chip Enhancement screen now has options to "Max-Enhance One Chip" and "Max-Enhance Multiple Chips".
|
||||
|
||||
6. Optimized: Data display for "Equipment" has been improved. A special equipment buff tab has been added for the equipment detail display screen.
|
||||
|
||||
7. Optimized: The Echelon Formation screen now gives the option to select multiple echelons at once. Also, certain Fire Support Units selection screens allow you to select multiple Fire Support Units at once.
|
||||
|
||||
8. Optimized: The maximum amount of Surplus EXP that can be held at one time has been increased. Kalina's speed of writing combat reports has also been increased.
|
||||
|
||||
9. Optimized: Alerts have been added for the addition of new Career Missions.
|
||||
|
||||
10. Optimized: Unit selection displays have been improved. The option to select units based on their Repair, Move Speed and other stats has also been added.
|
||||
|
||||
11. Optimized: The potential dropped items display for missions ahas been improved. It now has popups for unlock conditions and the layout has been improved.
|
||||
|
||||
12. Optimized: Planning Mode AP expenditures now display extra APs for echelons and vehicle fuel supply status.
|
||||
|
||||
13. Optimized: A problem where one could not drag or shrink unit CGs when inspecting them in the Unit Details screen.
|
||||
|
||||
14. Optimized: A problem where the rewards screen would be displayed multiple times after certain Ranking Mode stages were made permanently available in the campaign tab.
|
||||
</version_desc>
|
||||
</config>
|
||||
</servers>
|
|
@ -0,0 +1,25 @@
|
|||
namespace Elisa.GameServer.Services;
|
||||
|
||||
public class ProxyBackgroundService : BackgroundService
|
||||
{
|
||||
readonly ProxyControl proxyControl;
|
||||
|
||||
public ProxyBackgroundService(string forwardIpAddress)
|
||||
{
|
||||
proxyControl = new ProxyControl(forwardIpAddress);
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
proxyControl.Start();
|
||||
stoppingToken.Register(() => proxyControl.Stop());
|
||||
|
||||
while (!stoppingToken.IsCancellationRequested)
|
||||
await Task.Delay(1000, stoppingToken);
|
||||
}
|
||||
|
||||
public override async Task StopAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
await base.StopAsync(stoppingToken);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue