Initial commit, doesn't do a whole lot yet

This commit is contained in:
Kyle873 2024-05-25 00:43:43 -04:00
commit 1fb4231684
83 changed files with 1548462 additions and 0 deletions

63
.gitattributes vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

366
.gitignore vendored Normal file
View File

@ -0,0 +1,366 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# EF migration
efbundle.exe

25
Elisa.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34316.72
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elisa", "Elisa\Elisa.csproj", "{AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CE4FB4A4-9B1E-49D6-B57F-118A0EAB2EF8}
EndGlobalSection
EndGlobal

167
Elisa/Commands/Command.cs Normal file
View File

@ -0,0 +1,167 @@
using Serilog;
using System.Reflection;
namespace Elisa.Commands;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class CommandHandler(string name, string description, string example) : Attribute
{
public string Name = name;
public string Description = description;
public string Example = example;
}
[AttributeUsage(AttributeTargets.Property)]
public class ArgumentAttribute(string key) : Attribute
{
public string Key = key;
}
[Flags]
public enum CommandUsage
{
None = 0,
Console = 1,
User = 2
}
public abstract class Command
{
public virtual CommandUsage Usage
{
get
{
var usage = CommandUsage.None;
if (GetType().GetMethod(nameof(Execute), [typeof(Dictionary<string, string>), typeof(Connection)])?.DeclaringType == GetType())
usage |= CommandUsage.User;
if (GetType().GetMethod(nameof(Execute), [typeof(Dictionary<string, string>)])?.DeclaringType == GetType())
usage |= CommandUsage.Console;
return usage;
}
}
readonly Dictionary<string, PropertyInfo> argsProperties;
public Command()
{
argsProperties = GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
.Where(x => Attribute.IsDefined(x, typeof(ArgumentAttribute)))
.ToDictionary(x => ((ArgumentAttribute)Attribute.GetCustomAttribute(x, typeof(ArgumentAttribute))!).Key, StringComparer.OrdinalIgnoreCase);
}
public virtual void Execute(Dictionary<string, string> args)
{
foreach (var arg in args)
{
if (argsProperties.TryGetValue(arg.Key, out var prop))
prop.SetValue(this, arg.Value);
}
}
public virtual void Execute(Dictionary<string, string> args, Connection connection)
{
Execute(args);
}
public virtual void NotifySuccess(Connection connection)
{
// connection.SendSystemMsg($"{GetType().Name} success!");
}
protected T Parse<T>(string? value, T fallback = default!)
{
var tryParseMethod = typeof(T).GetMethod("TryParse", [typeof(string), typeof(T).MakeByRefType()]);
if (tryParseMethod != null)
{
var parameters = new object[] { value!, null! };
bool success = (bool)tryParseMethod.Invoke(null, parameters)!;
if (success)
return (T)parameters[1];
}
return fallback;
}
}
public static class CommandHandlerFactory
{
public static readonly List<Command> Commands = new List<Command>();
static readonly Dictionary<string, Action<Dictionary<string, string>>> commandFunctions;
static readonly Dictionary<string, Action<Dictionary<string, string>, Connection>> commandFunctionsUser;
private static readonly char[] separator = new[] { ' ' };
static CommandHandlerFactory()
{
commandFunctions = new Dictionary<string, Action<Dictionary<string, string>>>(StringComparer.OrdinalIgnoreCase);
commandFunctionsUser = new Dictionary<string, Action<Dictionary<string, string>, Connection>>(StringComparer.OrdinalIgnoreCase);
}
public static void RegisterCommands(Assembly assembly)
{
var commandTypes = assembly.GetTypes()
.Where(t => Attribute.IsDefined(t, typeof(CommandHandler)) && typeof(Command).IsAssignableFrom(t));
foreach (var commandType in commandTypes)
{
var commandAttribute = (CommandHandler?)Attribute.GetCustomAttribute(commandType, typeof(CommandHandler));
if (commandAttribute != null)
{
var commandInstance = (Command)Activator.CreateInstance(commandType)!;
if (commandInstance.Usage.HasFlag(CommandUsage.Console))
commandFunctions[commandAttribute.Name] = commandInstance.Execute;
if (commandInstance.Usage.HasFlag(CommandUsage.User))
commandFunctionsUser[commandAttribute.Name] = commandInstance.Execute;
Commands.Add(commandInstance);
}
}
Log.Information($"Registered {Commands.Count} commands");
}
public static void HandleCommand(string commandLine, Connection? connection = null)
{
var parts = commandLine.Split(separator, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 0)
return;
var arguments = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
for (var i = 1; i < parts.Length; i++)
{
var argParts = parts[i].Split('=', 2);
if (argParts.Length == 2)
arguments[argParts[0]] = argParts[1];
}
if (connection is not null)
{
if (!(commandFunctionsUser).TryGetValue(parts[0], out var command))
{
Log.Warning($"Unknown command: {parts[0]}");
return;
}
command(arguments, connection);
}
else
{
if (!(commandFunctions).TryGetValue(parts[0], out var command))
{
Log.Warning($"Unknown command: {parts[0]}");
return;
}
command(arguments);
}
}
}
// This is just a stub for now, probably won't even get used
public class Connection
{
}

View File

@ -0,0 +1,32 @@
using System.Reflection;
using System.Text;
namespace Elisa.Commands;
[CommandHandler("help", "Print out all commands with their description and example", "help")]
public class HelpCommand : Command
{
static readonly Dictionary<Type, CommandHandler?> commandAttributes = [];
public override void Execute(Dictionary<string, string> args)
{
base.Execute(args);
StringBuilder sb = new StringBuilder();
sb.AppendLine("Available Commands: ");
foreach (var command in CommandHandlerFactory.Commands.Where(x => x.Usage.HasFlag(CommandUsage.Console)))
{
if (!commandAttributes.TryGetValue(command.GetType(), out var attr))
{
attr = command.GetType().GetCustomAttribute(typeof(CommandHandler)) as CommandHandler;
commandAttributes[command.GetType()] = attr;
}
if (attr != null)
sb.AppendLine($" {attr.Name} - {attr.Description} (Example: {attr.Example})");
}
Console.Write(sb.ToString());
}
}

View File

@ -0,0 +1,36 @@
using Elisa.Utils;
using Serilog;
namespace Elisa.Commands;
[CommandHandler("test", "Command to test various functions", "test type=encrypt value=asdf")]
public class tESTcOMMAND : Command
{
[Argument("type")]
public string? Type { get; set; }
[Argument("value")]
public string? Value { get; set; }
public override void Execute(Dictionary<string, string> args)
{
base.Execute(args);
string output = string.Empty;
switch (Type.ToLower())
{
case "encrypt":
output = Crypto.Encrypt(Value, "test");
Console.WriteLine(output);
break;
case "decrypt":
output = Crypto.Decrypt(Value, "test");
Console.WriteLine(output);
break;
default:
Log.Error("Invalid test type");
break;
}
}
}

View File

@ -0,0 +1,18 @@
using Elisa.Commands;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Elisa.Controllers;
[ApiController]
[Route("/")]
public class CommandController : ControllerBase
{
[HttpGet("command")]
public IResult Command([FromQuery] string command)
{
CommandHandlerFactory.HandleCommand(command);
return Results.Text("Command executed");
}
}

View File

@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Elisa.Controllers;
[ApiController]
[Route("/Index")]
public class IndexController : ControllerBase
{
[HttpGet("version")]
public IResult Version([FromQuery] string req_id)
{
return Results.Json(new
{
now = "1716182820",
tomorrow_zero = "1716192000",
month_zero = 1714550400,
next_month_zero = 1717228800,
timezone = "PST8PDT",
data_version = "d630eea53a1b869fa4d7d1479a3d09e7",
client_version = "30400",
ab_version = "2024051417",
is_kick = "0",
weekday = 1,
authentication_url = $"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh"
});
}
}

31
Elisa/Data/JSON.cs Normal file
View File

@ -0,0 +1,31 @@
using System.Text.Json;
namespace Elisa.Data;
public static class JSON
{
public static JsonSerializerOptions serializerOptions = new() { IncludeFields = true, WriteIndented = true };
public static T Load<T>(string path, bool create = true) where T : new()
{
if (!File.Exists(path) && create)
{
T obj = new T();
Save(path, obj);
}
string text = File.ReadAllText(path);
return JsonSerializer.Deserialize<T>(text, serializerOptions) ?? new T();
}
public static void Save<T>(string path, T obj)
{
File.WriteAllText(path, JsonSerializer.Serialize(obj, serializerOptions));
}
public static string Stringify<T>(T obj)
{
return JsonSerializer.Serialize(obj, serializerOptions);
}
}

70
Elisa/Data/Table.cs Normal file
View File

@ -0,0 +1,70 @@
using Elisa.Data.Tables;
using Serilog;
using System.Collections;
using System.Reflection;
using System.Text.Json;
namespace Elisa.Data;
public enum LoadDataType
{
CatchData,
STC,
Text
}
[AttributeUsage(AttributeTargets.Property)]
public class LoadDataAttribute(string fileName, LoadDataType dataType) : Attribute
{
public LoadDataType DataType = dataType;
public string FileName = fileName;
}
public static class Table
{
[LoadData("gun_exp_info.json", LoadDataType.CatchData)]
public static List<gun_exp_info> gun_exp_info { get; private set; } = null!;
[LoadData("spot.json", LoadDataType.STC)]
public static List<spot> spot { get; private set; } = null!;
public static void Load()
{
foreach (PropertyInfo? prop in typeof(Table).GetProperties().Where(x => x.GetCustomAttribute<LoadDataAttribute>() is not null))
{
LoadDataAttribute attr = prop.GetCustomAttribute<LoadDataAttribute>()!;
switch (attr.DataType)
{
case LoadDataType.CatchData:
object? obj = typeof(JSON).GetMethod(nameof(JSON.Load))!.MakeGenericMethod(typeof(object)).Invoke(null, [Path.Combine(GetPath(attr.DataType), attr.FileName), false]);
JsonProperty entry = ((JsonElement)obj).EnumerateObject().First();
object? value = JsonSerializer.Deserialize(entry.Value.GetRawText(), prop.PropertyType, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
prop.SetValue(null, value);
Log.Information($"Loaded {(prop.GetValue(null) as IList)?.Count} entries from {prop.Name} catchdata table");
break;
case LoadDataType.STC:
prop.SetValue(null, typeof(JSON).GetMethod(nameof(JSON.Load))!.MakeGenericMethod(prop.PropertyType).Invoke(null, [Path.Combine(GetPath(attr.DataType), attr.FileName), false]));
Log.Information($"Loaded {(prop.GetValue(null) as IList)?.Count} entries from {prop.Name} stc table");
break;
case LoadDataType.Text:
// TODO: textdata is just a flat list of key-value pairs that are looked up from stc
break;
}
}
Log.Information("All data tables loaded");
}
public static string GetPath(LoadDataType type)
=> type switch
{
LoadDataType.CatchData => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources/catchdata/"),
LoadDataType.STC => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources/stc/"),
LoadDataType.Text => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources/text/table")
};
}
public abstract class Model
{
}

View File

@ -0,0 +1,7 @@
namespace Elisa.Data.Tables;
public class gun_exp_info : Model
{
public string lv;
public string exp;
}

31
Elisa/Data/Tables/STC.cs Normal file
View File

@ -0,0 +1,31 @@
namespace Elisa.Data.Tables;
public class spot : Model
{
public int id;
public int mission_id;
public int type;
public int special_eft;
public string route;
public int coordinator_x;
public int coordinator_y;
public int enemy_team_id;
public int ally_team_id;
public int belong;
public string random_get;
public int map_type;
public string curve_control;
public string active_cycle;
public string durability;
public string map_route;
public string map_code;
public string hostage_info;
public int building_id;
public string forbid_specialspot;
public int map_num;
public int package;
public string auto_teleport;
public string spot_effect;
public string access_type;
public string code;
}

View File

@ -0,0 +1 @@
namespace Elisa.Data.Tables;

38
Elisa/Elisa.csproj Normal file
View File

@ -0,0 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.1.0</Version>
<Company>Sangvis Ferri</Company>
<Authors></Authors>
<Title>Elisa</Title>
</PropertyGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\catchdata\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\stc\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\text\table\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<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>

23
Elisa/GameServer.cs Normal file
View File

@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
namespace Elisa;
public class GameServer
{
public static async Task Start()
{
WebApplicationBuilder builder = WebApplication.CreateBuilder(Environment.GetCommandLineArgs());
builder.Host.UseSerilog();
builder.Services.Configure<KestrelServerOptions>(op => op.AllowSynchronousIO = true);
builder.Services.AddControllers();
WebApplication app = builder.Build();
app.UseAuthorization();
app.UseSerilogRequestLogging();
app.MapControllers();
app.Run();
}
}

View File

@ -0,0 +1,28 @@
using Elisa.Models;
namespace Elisa.Messages;
public class GetAllBonusRequest
{
public int battlepass_id;
}
public class GetAllBonusResponse
{
public Dictionary<int, IndexPrize> extra_bonus;
public Dictionary<int, IndexPrize> free_bonus;
public Dictionary<int, IndexPrize> paid_bonus;
}
public class GetBonusRequest
{
public int battlepass_id;
public int param;
public int type;
}
public class GetBonusResponse
{
public Dictionary<int, IndexPrize> bonus;
}

12
Elisa/Messages/Chess.cs Normal file
View File

@ -0,0 +1,12 @@
namespace Elisa.Messages;
public class ChessGashaDrawRequest
{
public int draw_param;
}
public class ChessGashaDrawResponse
{
public int[] result;
public int ticket_cost;
}

52
Elisa/Messages/Chip.cs Normal file
View File

@ -0,0 +1,52 @@
using Elisa.Models;
namespace Elisa.Messages;
public class ChipEnhanceRequest
{
public long chip_with_user_id;
public long[] foods;
public long user_id;
}
public class ChipEnhanceResponse
{
public int ammo;
public int chip_add_exp;
public int mp;
public int mre;
public int part;
}
public class ChipRetireRequest
{
public long[] chips;
public long user_id;
}
public class ChipRetireResponse
{
public int ammo;
public int mp;
public int mre;
public int part;
}
public class FinishDataAnalysisResponse
{
public int cost_item16_num;
public Dictionary<int, DataAnalysisData> data;
}
public class StartDataAnalysisRequest
{
public int build_slot;
public int input_level;
public int number;
public int quick;
}
public class StartDataAnalysisResponse
{
public Dictionary<int, long> data;
}

View File

@ -0,0 +1,180 @@
using Elisa.Models;
namespace Elisa.Messages;
public class EquipDevelopMultiRequest
{
public int ammo;
public int build_heavy;
public int build_multi;
public int build_quick;
public int input_level;
public int mp;
public int mre;
public int part;
}
public class EquipDevelopMultiResponse
{
public List<EquipIds> equip_ids;
}
public class EquipDevelopRequest
{
public int ammo;
public int build_slot;
public int input_level;
public int mp;
public int mre;
public int part;
}
public class EquipDevelopResponse
{
public int equip_id;
public int fairy_id;
public int passive_skill;
public int quality_lv;
public int type;
}
public class EquipFinishAllDevelopRequest
{
public int is_cost_item3;
}
public class EquipFinishAllDevelopResponse
{
public int cost_item3_num;
public List<EquipAdd> equip_with_user_add_list;
public List<FairyAdd> fairy_with_user_add_list;
}
public class EquipFinishDevelopRequest
{
public int build_slot;
}
public class EquipFinishDevelopResponse
{
public Equip equip_with_user;
public long fairy_with_user;
}
public class EquipProduceDevelopRequest
{
public int[] build_slots;
public int if_quick;
public int recommended_formula_id;
}
public class EquipProduceDevelopResponse
{
public int equip_id;
public Equip equip_with_user;
public int slot;
}
public class FairyDevelopRequest
{
public int ammo;
public int build_heavy;
public int build_multi;
public int build_quick;
public int build_slot;
public int input_level;
public int mp;
public int mre;
public int part;
}
public class FairyDevelopResponse
{
public List<FairyDevdata> equip_ids;
public Fairy fairy_with_user;
}
public class FairyFinishAllDevelopRequest
{
public int if_quick;
}
public class FairyFinishAllDevelopResponse
{
public int cost_item3_num;
public List<Equip> equip_with_user_add_list;
public List<FairyAdd> fairy_with_user_add_list;
}
public class FairyFinishDevelopRequest
{
public int build_slot;
public int if_quick;
}
public class GunDevelopMultiRequest
{
public int ammo;
public int build_heavy;
public int build_multi;
public int build_quick;
public int build_slot;
public int input_level;
public int mp;
public int mre;
public int part;
}
public class GunDevelopMultiResponse
{
public List<GunIds> gun_ids;
}
public class GunDevelopRequest
{
public int ammo;
public int build_slot;
public int input_level;
public int mp;
public int mre;
public int part;
}
public class GunDevelopResponse
{
public int gun_id;
}
public class GunFinishAllDevelopResponse
{
public int cost_item3_num;
public List<Gun> gun_with_user_add_list;
}
public class GunFinishDevelopRequest
{
public int build_slot;
}
public class GunFinishDevelopResponse
{
public Gun gun_with_user_add;
}
public class GunWishDevelopRequest
{
public int[] build_slots;
public int event_id;
public int if_quick;
}
public class GunWishDevelopResponse
{
public List<GunDevelopResult> develop_result;
public GunWish wish_gun_with_user;
}
public class FairyFinishDevelopResponse
{
public long fairy_with_user;
}

135
Elisa/Messages/Dorm.cs Normal file
View File

@ -0,0 +1,135 @@
using Elisa.Models;
namespace Elisa.Messages;
public class ChangeSkinRequest
{
public long gun_with_user_id;
public int skin_id;
}
public class DecomposeRequest
{
public long[] ids;
}
public class DecomposeResponse
{
public Dictionary<int, int> gift_list;
}
public class GetBuildCoinRequest
{
public int dorm_id;
public long v_user_id;
}
public class GetBuildCoinResponse
{
public int build_coin;
public int remain_coin;
}
public class GiftToGunRequest
{
public long fairy_with_user_id;
public long gun_with_user_id;
public int item_id;
public int num;
}
public class GiftToGunResponse
{
public List<AllFavorupGun> all_favorup_gun;
public int gun_exp;
public long gun_with_user_id;
public int last_favor_recover_time;
public int skin_add_favor;
}
public class GiftToSangvisRequest
{
public int item_id;
public int num;
public long sangvis_with_user_id;
}
public class GiftToSangvisResponse
{
public int add_favor;
public List<AllFavorupGun> all_favorup_gun;
public List<AllFavorupSangvis> all_favorup_sangvis;
public int last_favor_recover_time;
public int sangvis_exp;
public long sangvis_with_user_id;
}
public class OpenRedRequest
{
public int id;
public int type;
}
public class OpenRedResponse
{
public List<RedPrize> list;
}
public class ReceiveFavorRequest
{
public int dorm_id;
public long gun_with_user_id;
public long user_id;
}
public class ReceiveFavorResponse
{
public int favor_click;
}
public class ReceiveSangvisFavorRequest
{
public int dorm_id;
public long sangvis_with_user_id;
public long user_id;
}
public class ReceiveSangvisFavorResponse
{
public int favor_click;
}
public class ShareResponse
{
public int prize_id;
}
public class SkinGashaDrawRequest
{
public int draw_type;
public int gasha_id;
public int type;
}
public class SkinGashaDrawResponse
{
public int exchange_tickets;
public List<DorFurniture> furniture;
}
public class SkinToGunRequest
{
public int gun_with_user_id;
public int item_id;
public int num;
}
public class SkinToGunResponse
{
public List<AllFavorupGun> all_favorup_gun;
public List<AllFavorupSangvis> all_favorup_sangvis;
public long dorm_with_user_id;
public int furniture_id;
public int last_favor_recover_time;
public int skin_add_favor;
}

View File

@ -0,0 +1,47 @@
namespace Elisa.Messages;
public class AdjustRequest
{
public long equip_with_user_id;
}
public class AdjustResponse
{
public int armor;
public int armor_piercing;
public int bullet_number_up;
public int critical_harm_rate;
public int critical_percent;
public int damage_amplify;
public int damage_reduction;
public int dodge;
public int hit;
public int night_view_percent;
public int pow;
public int rate;
public int shield;
public int speed;
}
public class EatEquipRequest
{
public int cost_item50_num;
public long equip_with_user_id;
public long[] food;
}
public class EatEquipResponse
{
public int cost_item50_num;
public int equip_add_exp;
}
public class UnequipRequest
{
public long[] equip_with_user_ids;
}
public class EquipRetireRequest
{
public long[] equips;
}

5
Elisa/Messages/Event.cs Normal file
View File

@ -0,0 +1,5 @@
namespace Elisa.Messages;
public class BikiniVoteResultResponse
{
}

View File

@ -0,0 +1,48 @@
using Elisa.Models;
namespace Elisa.Messages;
public class GetAdaptiveTeamResponse
{
public int end_time;
public int[] guns;
public int id;
public int[] pets;
public int start_time;
}
public class GetEventResponse
{
public List<ExploreAffair> event_list;
public int is_prize;
public int next_time;
}
public class GetExploreMailResponse
{
public GetResourceInMailQuickResponse @out;
public long[] get_list;
}
public class SetTeamRequest
{
public long[] guns;
public int is_auto;
public long[] pets;
public int time_type;
}
public class StartExploreResponse
{
public int area_id;
public int cancel_time;
public int draw_event_prize;
public int end_time;
public string[] gun_ids;
public int item_id;
public int next_time;
public int[] pet_ids;
public int start_time;
public int target_id;
public long user_id;
}

14
Elisa/Messages/Fairy.cs Normal file
View File

@ -0,0 +1,14 @@
namespace Elisa.Messages;
public class FairySkillUpgradeRequest
{
public long fairy_with_user_id;
public bool if_quick;
public int to_level;
public int upgrade_slot;
}
public class FairyRetireRequest
{
public long[] fairies;
}

1
Elisa/Messages/Favor.cs Normal file
View File

@ -0,0 +1 @@
namespace Elisa.Messages;

41
Elisa/Messages/Fetter.cs Normal file
View File

@ -0,0 +1,41 @@
namespace Elisa.Messages;
public class ReadStoryRequest
{
public int fetter_id;
public int fetter_story_id;
public int milestone;
public int org_bounty_id;
}
public class ReadStoryResponse
{
}
public class ReceiveAllOrgBountyRequest
{
public int department_id;
public int level;
}
public class ReceiveAllOrgBountyResponse
{
public int ammo;
public int bp_pay;
public string coins;
public int core;
public string equip_ids;
public string fairy_ids;
public string furniture;
public int gem;
public int[] get_org_bounty_ids;
public string gift;
public string gun_id;
public string item_ids;
public int mp;
public int mre;
public int part;
public string sangvis;
public string skin;
public int user_exp;
}

11
Elisa/Messages/Friend.cs Normal file
View File

@ -0,0 +1,11 @@
using Elisa.Models;
namespace Elisa.Messages;
public class TeamGunsResponse
{
public int borrow_team_today;
public Dictionary<long, List<Fairy>> fairy_with_friend_info;
public Dictionary<long, string> friend_team_effect_arr;
public FriendGuns gun_with_friend;
}

1
Elisa/Messages/Guide.cs Normal file
View File

@ -0,0 +1 @@
namespace Elisa.Messages;

58
Elisa/Messages/Gun.cs Normal file
View File

@ -0,0 +1,58 @@
namespace Elisa.Messages;
public class GunCombineGunRequest
{
public long[] combine;
public long gun_with_user_id;
}
public class GunEatGunRequest
{
public long[] food;
public long gun_with_user_id;
public int item9_num;
}
public class GunEquipRequest
{
public int equip_slot;
public long equip_with_user_id;
public long gun_with_user_id;
public int if_outfit;
}
public class GunFixFinishRequest
{
public int fix_slot;
}
public class GunFixGunsRequest
{
public Dictionary<long, int> fix_guns;
public int if_quick;
}
public class GunSkillUpgradeRequest
{
public long gun_with_user_id;
public int if_quick;
public int skill;
public int to_level;
public int upgrade_slot;
}
public class GunTeamGunRequest
{
public long gun_with_user_id;
public Dictionary<long, int> guns;
public int location;
public int team_id;
public Dictionary<int, long> team_set;
}
public class GunEatGunResponse
{
public int dodge;
public int hit;
public int pow;
public int rate;
}

44
Elisa/Messages/Home.cs Normal file
View File

@ -0,0 +1,44 @@
using Elisa.Models;
namespace Elisa.Messages;
public class ChangeAdjutantRequest
{
public int fairy_id;
public int gun_id;
public int is_sexy;
public int mod;
public int skin_id;
}
public class HomeRequest
{
public int ab_version;
public string data_version;
public int ignore_time;
public int start_id;
}
public class HomeResponse
{
public List<AllFavorupGun> all_favorup_gun;
public List<AllFavorupSangvis> all_favorup_sangvis;
public Dictionary<int, int> battlepass_pt_item;
public int build_coin_flag;
public Dictionary<int, int> career_quest_grade;
public Daily daily;
public List<FetterBounty> fetter_bounty_with_user;
public int gem;
public List<IndexMail> index_getmaillist;
public int is_bind;
public int kick;
public int last_favor_recover_time;
public int last_ssoc_change_time;
public int recover_ammo;
public int recover_mp;
public int recover_mre;
public int recover_part;
public int recover_ssoc;
public List<SquadDataDaily> squad_data_daily;
public Weekly weekly;
}

14
Elisa/Messages/Index.cs Normal file
View File

@ -0,0 +1,14 @@
using Elisa.Models;
namespace Elisa.Messages;
public class IndexRequest
{
}
public class IndexResponse
{
public Dictionary<int, int> battlepass_pt_item;
public List<Battlepass> battlepass_with_user;
public ChessInfo chess_info;
}

1
Elisa/Messages/Item.cs Normal file
View File

@ -0,0 +1 @@
namespace Elisa.Messages;

38
Elisa/Messages/Mail.cs Normal file
View File

@ -0,0 +1,38 @@
using Elisa.Models;
namespace Elisa.Messages;
public class GetResourceInMailQuickRequest
{
public bool furniture_data;
}
public class GetResourceInMailQuickResponse
{
public int ammo;
public string coins;
public int core;
public List<Equip> equips;
public List<Fairy> fairys;
public int gem;
public List<Gun> guns;
public string item_ids;
public int mp;
public int mre;
public int part;
public int user_exp;
public List<VehicleComponent> vehicle_component_list;
}
public class GetResourceInMailRequest
{
public long mail_with_user_id;
}
public class GetResourceInMailResponse
{
public List<CommanderUniform> commander_uniform;
public List<Equip> equips;
public List<Fairy> fairys;
public long gun_with_user_id;
public List<Gun> guns;
}

334
Elisa/Messages/Mission.cs Normal file
View File

@ -0,0 +1,334 @@
using Elisa.Models;
namespace Elisa.Messages;
public class AbortMissionResponse
{
public MissionLoseResult mission_lose_result;
}
public class AllyTeamAiRequest
{
public int ai_type;
public int ally_instance_id;
}
public class BattleFinishRequest
{
public int boss_hp;
public int current_time;
public List<GunLife> guns;
public bool if_enemy_die;
public long mvp;
public Dictionary<int, Dictionary<int, int[]>> sangvis_chip_skills;
public List<SangvisLife> sangvises;
public int spot_id;
public bool use_fairy_skill;
}
public class BattleFinishResponse
{
public Dictionary<int, AllyInstanceBetray> ally_instance_betray;
public Dictionary<int, AllyInstanceTransform> ally_instance_transform;
public List<Equip> battle_get_equip;
public List<Gun> battle_get_gun;
public List<BattleGetPrize> battle_get_prize;
public int battle_rank;
public Dictionary<int, BuildingInfo> building_info;
public Dictionary<int, int> change_belong;
public int fairy_exp;
public Dictionary<long, int> favor_change;
public int free_exp;
public List<GunExp2> gun_exp;
public List<GunLife2> gun_life;
public Dictionary<int, int> mission_control;
public MissionLoseResult mission_lose_result;
public MissionWinResult mission_win_result;
public List<SangvisBattleExp> sangvis_battle_exp;
public List<SangvisLife2> sangvis_life;
public SangvisTeamResource sangvis_team_resource;
public int seed;
public List<SpotActInfo> spot_act_info;
public Dictionary<int, SpotTransInfo> spot_trans;
public List<SquadExp> squad_exp;
public int user_exp;
}
public class BuildingSkillPerformRequest
{
public int building_spot_id;
public int trigger_person_spot;
public int trigger_type;
}
public class CombinationInfoRequest
{
public int mission_id;
}
public class CombinationInfoResponse
{
public string mission_combination_info;
public int mission_id;
public int user_id;
}
public class EventDrawRequest
{
}
public class EventDrawResponse
{
public Dictionary<int, ItemLimit> item_limit_with_user;
public MissionEvent mission_event;
public int tomorrow_unix;
}
public class FairySkillPerformRequest
{
public int fairy_spot;
public int fairy_team_id;
public int[] spot_id;
}
public class FinishAutomissionRequest
{
public int auto_mission_id;
}
public class FinishAutomissionResponse
{
public List<AddEquip> add_equip;
public List<AddFairyExp> add_fairy_exp;
public List<AddGun> add_gun;
public List<AddGunExp> add_gun_exp;
public int add_user_exp;
public Dictionary<long, int> favor_change;
public int free_exp;
public int success_number;
}
public class FriendTeamAiRequest
{
public int ai_type;
public int friend_team_id;
}
public class MissionResponse
{
public int all_friend_team_moved;
public List<AllyBattle> ally_battle;
public Dictionary<int, AllyInstanceBetray> ally_instance_betray;
public Dictionary<int, AllyInstanceInfo> ally_instance_info;
public Dictionary<int, AllyInstanceTransform> ally_instance_transform;
public List<AllyMove> ally_move;
public int ammo;
public int ap;
public List<Equip> battle_get_equip;
public List<Gun> battle_get_gun;
public List<BattleGetPrize> battle_get_prize;
public Dictionary<int, BuildingInfo> building_info;
public List<int> can_see_spots;
public Dictionary<int, int> change_belong;
public Dictionary<int, int> change_belong1;
public Dictionary<int, int> change_belong2;
public int coin1;
public int coin2;
public int coin3;
public DailyInfo daily_info;
public Dictionary<int, int> died_ally;
public Dictionary<int, int> died_ally_type;
public Dictionary<int, int> died_enemy;
public DiedThisSection died_this_section;
public int enemy_instance_id;
public Dictionary<int, EnemyInstanceInfo> enemy_instance_info;
public List<EnemyMove> enemy_move;
public int enemy_team_id;
public Dictionary<long, Equip> equips;
public Dictionary<int, Dictionary<int, FairySkillOnAlly>> fairy_skill_on_ally;
public Dictionary<int, Dictionary<int, FairySkillOnEnemy>> fairy_skill_on_enemy;
public Dictionary<int, Dictionary<int, FairySkillOnSpot>> fairy_skill_on_spot;
public Dictionary<int, Dictionary<int, FairySkillOnTeam>> fairy_skill_on_team;
public List<FairySkillPerform> fairy_skill_perform;
public FairySkillReturn fairy_skill_return;
public int friend_team_end_time;
public Fairy friend_team_fairy;
public int friend_team_id;
public int from_spot_id;
public List<GrowEnemy> grow_enemy;
public Dictionary<long, int> gun_life_after_rec;
public Dictionary<long, Gun> guns;
public string item;
public Dictionary<int, LifeChange> life_change;
public int loseammo;
public int losemre;
public Dictionary<int, int> mission_control;
public MissionLoseResult mission_lose_result;
public MissionWinResult mission_win_result;
public int mp;
public int mre;
public Dictionary<int, NewSpotChange> new_spot_change;
public List<NightAlly> night_ally;
public List<NightEnemy> night_enemy;
public List<NightSpot> night_spots;
public int part;
public List<SpotActInfo> spot_act_info;
public List<SpotTeleportResult> spot_teleport_result;
public Dictionary<int, SpotTransInfo> spot_trans;
public Dictionary<int, SquadInstanceInfo> squad_info;
public int squad_instance_id;
public Dictionary<int, AllyInstanceInfo> summon_ally;
public int to_spot_id;
public Dictionary<int, VehicleInfo> vehicle_info;
}
public class MyforceSkillPerformRequest
{
public int missino_buff_instnace_id;
public int person_spot;
public int source_type;
}
public class NoBattleAllyMeetRequest
{
public int[] appoint_spots;
}
public class QuickFixRequest
{
public long gun_with_user_id;
public long[] gun_with_user_ids;
public int sangvis_team_id;
public long sangvis_with_user_id;
public long[] sangvis_with_user_ids;
public int spot_id;
public int team_id;
public int vehicle_with_user_id;
}
public class QuickFixResponse
{
public int cost_item4;
public Dictionary<string, int> cost_rs;
public int fix_count;
public int type5_score;
}
public class ReinforceFriendTeamRequest
{
public long[] friend_gunids;
public long[] friend_sangvisids;
public int friend_team_id;
public int group_id;
public int spot_id;
}
public class ReinforceSangvisTeamRequest
{
public int sangvis_team_id;
public int spot_id;
}
public class ReinforceSquadRequest
{
public int spot_id;
public int squad_with_user_id;
}
public class ReinforceTeamRequest
{
public int spot_id;
public int team_id;
}
public class ReinforceVehicleRequest
{
public int spot_id;
public int vehicle_with_user_id;
}
public class SangvisSkillPerformRequest
{
public int mission_skill_config_id;
public int sangvis_spot;
public int[] spot_ids;
}
public class SaveHostageRequest
{
public int spot_id;
}
public class SimulationRequest
{
public int count;
public int m_id;
public int m_type;
}
public class SimulationResponse
{
public Dictionary<int, int> item;
public int recover_bp_and_item603;
}
public class SquadMoveRequest
{
public int from_spot_id;
public int move_type;
public int squad_id;
public int to_spot_id;
}
public class StartAutomissionRequest
{
public int auto_mission_id;
public int is_quick;
public int number;
public int[] team_ids;
}
public class StartMissionRequest
{
public long ally_id;
public int mission_id;
public List<SangvisSpot> sangvis_spots;
public List<Spot> spots;
public List<SquadSpot> squad_spots;
}
public class SupplyTeamRequest
{
public Dictionary<int, int> item_cost;
public int mission_id;
public int sangvis_team_id;
public int spot_id;
public int squad_instance_id;
public int target_id;
public int target_type;
public int team_id;
}
public class SupplyTeamResponse
{
public Dictionary<int, int> cost_item;
public int max_ammo;
public int max_mre;
public int supply_count;
public int type5_score;
}
public class TeamMoveRequest
{
public int from_spot_id;
public int move_type;
public int person_id;
public int person_type;
public int sangvis_team_id;
public int team_id;
public int to_spot_id;
}
public class WithdrawTeamRequest
{
public int spot_id;
}

View File

@ -0,0 +1,25 @@
namespace Elisa.Messages;
public class AbortOperationRequest
{
public int operation_id;
}
public class FinishOperationRequest
{
public int operation_id;
}
public class FinishOperationResponse
{
public int big_success;
public string item_id;
}
public class StartOperationRequest
{
public int exec_num;
public int max_level;
public int operation_id;
public int team_id;
}

View File

@ -0,0 +1,35 @@
using Elisa.Models;
namespace Elisa.Messages;
public class EstablishBuildFinishRequest
{
public int establish_type;
public string payway;
}
public class EstablishBuildRequest
{
public int establish_type;
public bool is_quick;
public int num;
public string payway;
public int special_report;
}
public class EstablishBuildResponse
{
public int build_coin;
public int build_num;
public object[] build_tmp_data;
public int exp;
public int gift_item_id;
public int is_spreport;
}
public class EstablishBuildFinishResponse
{
public List<OuthouseFurniture> furniture;
public string gift;
public string item_ids;
}

12
Elisa/Messages/Prize.cs Normal file
View File

@ -0,0 +1,12 @@
namespace Elisa.Messages;
public class GetEventPrizeRequest
{
public int event_id;
public int prize_index;
}
public class GetEventPrizeResponse
{
public GetResourceInMailQuickResponse package;
}

72
Elisa/Messages/Quest.cs Normal file
View File

@ -0,0 +1,72 @@
using Elisa.Models;
namespace Elisa.Messages;
public class AccomplishAllQuestsResponse
{
public Dictionary<int, int> battlepass_pt_item;
public AccomplishQuestList daily;
public List<IndexMail> mail_list;
public AccomplishQuestList weekly;
public int weekly_accumulation;
}
public class AccomplishDailyQuestRequest
{
public int daily_quest_id;
}
public class AccomplishDailyQuestResponse
{
public Dictionary<int, int> battlepass_pt_item;
public List<IndexMail> mail_list;
public int weekly_accumulation;
}
public class AccomplishWeeklyQuestRequest
{
public int weekly_quest_id;
}
public class AccomplishWeeklyQuestResponse
{
public Dictionary<int, int> battlepass_pt_item;
public List<IndexMail> mail_list;
public int weekly_accumulation;
}
public class DailyEventOptionRequest
{
public int option_id;
public int spot_id;
}
public class DailyIndexResponse
{
public List<DailyMapWithUserInfo> daily_map_with_user_info;
public Dictionary<int, int> daily_pt_item;
public DailyStatusWithUserInfo daily_status_with_user_info;
}
public class RefreshDailyQuestRequest
{
public int daily_quest_id;
}
public class RefreshDailyQuestResponse
{
public int[] daily_quest_list;
public int[] refresh_count;
}
public class RefreshWeeklyQuestRequest
{
public int weekly_quest_id;
}
public class RefreshWeeklyQuestResponse
{
public int locked_quest_list;
public int[] refresh_count;
public int[] weekly_quest_list;
}

22
Elisa/Messages/Rank.cs Normal file
View File

@ -0,0 +1,22 @@
using Elisa.Models;
namespace Elisa.Messages;
public class GetRankRequest
{
public int condition;
public int index;
public int length;
public int rank_id;
public string sub_type;
public int type;
}
public class GetRankResponse
{
public int count;
public int rank_count;
public List<RankUserInfo> rank_list;
public int refresh_time;
public RankUserInfo user_info;
}

135
Elisa/Messages/Sangvis.cs Normal file
View File

@ -0,0 +1,135 @@
using Elisa.Models;
namespace Elisa.Messages;
public class SangvisAdvanceRequest
{
public long sangvis_with_user_id;
}
public class SangvisDuplicateBattleFinishRequest
{
public int challenge_type;
public decimal duration;
public int if_win;
public int sangvis_duplicate_info_id;
public Dictionary<int, int> team;
}
public class SangvisDuplicateBattleFinishResponse
{
public int get_reward_id;
public int get_reward_num;
public int get_reward_type;
}
public class SangvisDuplicateIndexResponse
{
public SangvisItemRecover item_recover;
public Dictionary<int, SangvisDuplicateInfo> sangvis_duplicate_info;
}
public class SangvisFinishSkillRequest
{
public int if_quick;
public int upgrade_slot;
public long user_id;
}
public class SangvisFixFinishRequest
{
public int fix_slot;
public int if_quick;
}
public class SangvisFixRequest
{
public Dictionary<int, long> fix_sangvis_list;
public int if_quick;
}
public class SangvisGashaDrawRequest
{
public int draw_param;
public int draw_type;
public int gasha_id;
public int if_event;
}
public class SangvisGashaDrawResponse
{
public List<int> prize_info;
public SangvisGashaInfo sangvis_gasha_info;
public List<Sangvis> sangvis_info;
}
public class SangvisGashaRefreshRequest
{
public int gasha_id;
public int refresh_type;
}
public class SangvisGashaResponse
{
public List<ItemInfo> item_info;
public List<SangvisGashaInfo> sangvis_gasha_list;
}
public class SangvisPresetToTeamRequest
{
public int team_id;
public Dictionary<int, SangvisTeamSet> team_set;
}
public class SangvisResolutionRequest
{
public long[] sangvis_list;
public long sangvis_with_user_id;
}
public class SangvisRetireRequest
{
public long[] sangvises;
}
public class SangvisSetPositionRequest
{
public int[] positions;
public int team_id;
}
public class SangvisSetSignRequest
{
public long sangvis_with_user_id;
public int sign;
}
public class SangvisSkillUpgradeRequest
{
public int if_quick;
public long sangvis_with_user_id;
public int skill;
public int to_level;
public int upgrade_slot;
}
public class SangvisTeamSangvisRequest
{
public int team_id;
public Dictionary<int, SangvisTeamSet> team_set;
}
public class SangvisTransRequest
{
public bool if_trans_special;
public long sangvis_with_user_id_from;
public long sangvis_with_user_id_to;
}
public class SangvisEquipChipRequest
{
public int chip_id;
public int chip_slot;
public int if_outfit;
public long sangvis_with_user_id;
}

View File

@ -0,0 +1,8 @@
using Elisa.Models;
namespace Elisa.Messages;
public class GameSettingRequest
{
public Settings settings;
}

75
Elisa/Messages/Squad.cs Normal file
View File

@ -0,0 +1,75 @@
using Elisa.Models;
namespace Elisa.Messages;
public class AddSquadProgressRequest
{
public int data_num;
public int piece_num;
public int squad_id;
}
public class FinishExpTrainRequest
{
public int if_quick;
public int train_slot;
}
public class FinishSkillTrainRequest
{
public int skill_slot;
}
public class SquadAbortExpTrainRequest
{
public int train_slot;
}
public class SquadAbortExpTrainResponse
{
public int item_46;
public int item_506;
}
public class SquadUpSkillRequest
{
public bool if_quick;
public int skill;
public int skill_slot;
public long squad_with_user_id;
public int to_level;
}
public class SquadUpSkillResponse
{
public int end_time;
public int skill;
public int squad_skill_slot;
public long squad_with_user_id;
public long user_id;
}
public class StartExpTrainRequest
{
public int if_quick;
public int num;
public long squad_with_user_id;
public int train_slot;
}
public class StartExpTrainResponse
{
public int add_exp;
public string cost_item_info;
public int end_time;
public int num;
public int squad_train_slot;
public long squad_with_user_id;
public long user_id;
}
public class AddSquadProgressResponse
{
public int current_progress;
public SquadInfo squad_info;
}

25
Elisa/Messages/Theater.cs Normal file
View File

@ -0,0 +1,25 @@
using Elisa.Models;
namespace Elisa.Messages;
public class TheaterDataRequest
{
public int theater_event_id;
}
public class TheaterDataResponse
{
public List<TheaterAreaType2Log> theater_area_type2_log;
public List<TheaterConstructionInfo> theater_construction_info;
public TheaterEventLog theater_event_log;
public List<TheaterIncidentInfo> theater_incident_info;
public List<TheaterInfo> theater_info;
public int theater_progress_lowest;
}
public class TheaterVoteRequest
{
public int incident_id;
public int num;
public int selection_id;
}

1
Elisa/Messages/User.cs Normal file
View File

@ -0,0 +1 @@
namespace Elisa.Messages;

View File

@ -0,0 +1,8 @@
using Elisa.Models;
namespace Elisa.Messages;
public class VehicleUnlockResponse
{
public Vehicle vehicle_info;
}

View File

@ -0,0 +1 @@
namespace Elisa.Models;

14
Elisa/Models/Chess.cs Normal file
View File

@ -0,0 +1,14 @@
namespace Elisa.Models;
public class ChessInfo
{
public string acquired_bonus;
public int chess_score;
public int max_chess_score;
public int season_id;
public int ticket_cost;
public int ticket_daily_num;
public int ticket_daily_refresh_time;
public int tutorial;
public long user_id;
}

25
Elisa/Models/Chip.cs Normal file
View File

@ -0,0 +1,25 @@
namespace Elisa.Models;
// TODO: check
public class Chip
{
public int assist_damage;
public int assist_def_break;
public int assist_hit;
public int assist_reload;
public int atk_speed;
public int chip_exp;
public int chip_id;
public int chip_level;
public int color_id;
public int damage;
public int def;
public int grid_id;
public int hit;
public long id;
public int is_locked;
public string position;
public string shape_info;
public int squad_with_user_id;
public long user_id;
}

140
Elisa/Models/Development.cs Normal file
View File

@ -0,0 +1,140 @@
namespace Elisa.Models;
public class DataAnalysisAct
{
public int assist_damage;
public int assist_def_break;
public int assist_hit;
public int assist_reload;
public int atk_speed;
public int build_slot;
public int chip_id;
public int color_id;
public int damage;
public int def;
public int end_time;
public int grid_id;
public int hit;
public long id;
public int input_level;
public int piece;
public int piece_item_id;
public string shape_info;
public long user_id;
}
public class DataAnalysisData
{
public int change;
public Chip chip;
public int id;
public int piece;
}
public class DevelopAct
{
public int ammo;
public int build_slot;
public int core;
public int equip_id;
public int gun_id;
public long id;
public int input_level;
public int item1_num;
public int mp;
public int mre;
public int part;
public int start_time;
public long user_id;
}
public class DevelopEquipAct
{
public int ammo;
public int build_slot;
public int core;
public int equip_id;
public int fairy_id;
public int input_level;
public int item_num;
public int mp;
public int mre;
public int part;
public int passive_skill;
public int quality_lv;
public int start_time;
public int type;
public long user_id;
}
public class DevelopFairyAct
{
public int ammo;
public int build_slot;
public int core;
public int fairy_id;
public int input_level;
public int item_num;
public int mp;
public int mre;
public int part;
public int passive_skill;
public int quality_lv;
public int start_time;
public int type;
public long user_id;
}
public class FairyDevdata
{
public FairyDevDataInfo info;
public int slot;
}
public class FairyDevDataInfo
{
public int fairy_id;
public int passive_skill;
public int quality_lv;
public int type;
}
public class GunDevelopResult
{
public int gun_id;
public long gun_with_user_id;
public int slot;
public int wish_gun;
}
public class GunIds
{
public int id;
public int slot;
}
public class GunWish
{
public int wish_gun;
}
public class UpgradeAct
{
public int end_time;
public long fairy_with_user_id;
public long gun_with_user_id;
public long sangvis_with_user_id;
public int skill;
public int upgrade_slot;
}
public class UpgradeActInfo
{
public int end_time;
public long fairy_with_user_id;
public long gun_with_user_id;
public long sangvis_with_user_id;
public int skill;
public int upgrade_slot;
public long user_id;
}

7
Elisa/Models/Dorm.cs Normal file
View File

@ -0,0 +1,7 @@
namespace Elisa.Models;
public class DorFurniture
{
public long dorm_with_user_id;
public int id;
}

38
Elisa/Models/Equipment.cs Normal file
View File

@ -0,0 +1,38 @@
namespace Elisa.Models;
// TODO: check
public class Equip
{
public long id;
public long equip_with_user_id;
public long user_id;
public int group_id;
public long gun_with_user_id;
public int equip_id;
public int equip_level;
public int equip_exp;
public int adjust_count;
public string last_adjust;
public int is_locked;
}
public class EquipAdd
{
public int build_slot;
public int equip_id;
public Equip equip_with_user;
}
public class EquipIds
{
public EquipInfo info;
public int slot;
}
public class EquipInfo
{
public int type;
public int equip_id;
public int fairy_id;
public int passive_skill;
}

10
Elisa/Models/Event.cs Normal file
View File

@ -0,0 +1,10 @@
namespace Elisa.Models;
public class EventInfo
{
public string code;
public string condition;
public int end_time;
public int id;
public int start_time;
}

View File

@ -0,0 +1,38 @@
using Elisa.Messages;
namespace Elisa.Models;
public class ExploreAct
{
public int area_id;
public int cancel_time;
public int end_time;
public string[] gun_ids;
public int item_id;
public int[] pet_ids;
public int start_time;
public int target_id;
}
public class ExploreInfo
{
public int ammo;
public int end_time;
public GetResourceInMailQuickResponse ex_prize;
public int explore_time_type;
public int is_auto;
public int[] items_taken;
public List<ExploreAct> list;
public int mp;
public int mre;
public int next_explore_time;
public int next_time;
public int part;
public long[] pets;
}
public class ExploreAffair
{
public int affair_id;
public int affair_time;
}

44
Elisa/Models/Fairy.cs Normal file
View File

@ -0,0 +1,44 @@
namespace Elisa.Models;
// TODO: check
public class Fairy
{
public int equip_id;
public int fairy_exp;
public int fairy_id;
public int fairy_lv;
public long fairy_with_user_id;
public int group_id;
public long id;
public int mod;
public int passive_skill;
public int quality_exp;
public int quality_lv;
public int skill_lv;
public int skin;
public long user_id;
}
public class FairyAdd
{
public int build_slot;
public int fairy_id;
public long fairy_with_user_id;
}
public class FairyCollectInfo
{
public int fairy_id;
}
public class FairyInTheaterInfo
{
public long fairy_with_user_id;
public int team_id;
public long user_id;
}
public class FairySkin
{
public int skin_id;
}

31
Elisa/Models/Favor.cs Normal file
View File

@ -0,0 +1,31 @@
namespace Elisa.Models;
public class AllFavorupGun
{
public int favor_afteradd;
public long gun_with_user_id;
}
public class AllFavorupSangvis
{
public int favor_afteradd;
public long sangvis_with_user_id;
}
public class Gift
{
public int item_id;
public int number;
}
public class KalinaFavor
{
public int click_num;
public int click_time;
public int favor;
public int last_favor;
public int level;
public int send_mail_time;
public int skin;
public long user_id;
}

18
Elisa/Models/Fetter.cs Normal file
View File

@ -0,0 +1,18 @@
namespace Elisa.Models;
public class FetterBounty
{
public int fetter_bounty_id;
public int id;
public int is_received;
public int user_id;
public int value;
}
public class OrgBounty
{
public int get_time;
public int id;
public int org_bounty_id;
public int user_id;
}

56
Elisa/Models/Friend.cs Normal file
View File

@ -0,0 +1,56 @@
namespace Elisa.Models;
public class FriendAct
{
public List<Equip> friend_equips;
public List<Gun> friend_guns;
public Dictionary<string, FriendUnitLife> friend_sangvises_life;
public List<FriendTeamAi> friend_team_ai;
public List<Fairy> friend_team_fairy;
public Dictionary<long, Dictionary<long, Sangvis>> friend_team_sangvises;
public Dictionary<long, FriendTeamSangvisTeams> friend_team_sangvisteams;
public long[] friend_teams;
public Dictionary<string, FriendUnitLife> guns_life;
}
public class FriendGuns
{
public List<Gun> guns_with_friend_available;
public List<Sangvis> sangvis_with_friend_available;
}
public class FriendTeamAi
{
public int ai;
public long friend_team_id;
}
public class FriendTeamSangvisTeams
{
public int group_id;
public Dictionary<int, SangvisTeamSet> sangvis;
public long user_id;
}
public class FriendUnitLife
{
public long id;
public int life;
public long user_id;
}
public class ShareWithUser
{
public int last_time;
}
public class UserFriend
{
public int borrow_team_today;
public long f_userid;
public int headpic_id;
public int homebg_id;
public string intro;
public int lv;
public string name;
}

13
Elisa/Models/Guide.cs Normal file
View File

@ -0,0 +1,13 @@
namespace Elisa.Models;
public class Guide
{
public int[] course;
}
public class GuideInfo
{
public Guide guide;
public long id;
public long user_id;
}

44
Elisa/Models/Gun.cs Normal file
View File

@ -0,0 +1,44 @@
namespace Elisa.Models;
public class FixAct
{
public int fix_slot;
public long gun_with_user_id;
public long id;
public long sangvis_with_user_id;
public int start_time;
public long user_id;
}
// TODO: check
public class Gun
{
public int ammo;
public int build_slot;
public int can_click;
public int dodge;
public long equip1;
public long equip2;
public long equip3;
public long equip4;
public int favor;
public int favor_toplimit;
public int fix_end_time;
public int group_id;
public int gun_id;
public long gun_with_user_id;
public int hit;
public long id;
public int is_locked;
public int life;
public int mre;
public int pow;
public int rate;
public int skill1;
public int skill2;
public int skin;
public int soul_bond;
public int soul_bond_time;
public int special_effect;
public long user_id;
}

1
Elisa/Models/Home.cs Normal file
View File

@ -0,0 +1 @@
namespace Elisa.Models;

53
Elisa/Models/Index.cs Normal file
View File

@ -0,0 +1,53 @@
namespace Elisa.Models;
public class Index
{
public List<AutoMissionAct> auto_mission_act_info;
public Dictionary<long, Chip> chip_with_user_info;
public List<DataAnalysisAct> data_analysis_act_info;
public List<DevelopAct> develop_act_info;
public Dictionary<int, DevelopEquipAct> develop_equip_act_info;
public Dictionary<int, DevelopFairyAct> develop_fairy_act_info;
public int dorm_rest_friend_build_coin_count;
public Dictionary<long, Equip> equip_with_user_info;
public Dictionary<int, EventInfo> event_info;
public ExploreInfo explore_info;
public List<FairyCollectInfo> fairy_collect_info;
public List<FairyInTheaterInfo> fairy_in_theater_info;
public List<FairySkin> fairy_skin_with_user_info;
public Dictionary<long, Fairy> fairy_with_user_info;
public List<FixAct> fix_act_info;
public FriendAct friend_act_info;
public GameConfigInfo game_config_info;
public List<Gift> gift_with_user_info;
public List<GunInTheaterInfo> gun_in_theater_info;
public List<Gun> gun_with_user_info;
public List<Item> item_with_user_info;
public KalinaFavor kalina_with_user_info;
public MissionAct mission_act_info;
public MissionEvent mission_event_info;
public List<MissionWithUser> mission_with_user_info;
public List<OperationAct> operation_act_info;
public List<OrgBounty> org_bounty_with_user;
public List<OuthouseEstablish> outhouse_establish_info;
public List<SangvisChip> sangvis_chip_with_user_info;
public List<SangvisTeam> sangvis_team_with_user_info;
public List<Sangvis> sangvis_with_user_info;
public ShareWithUser share_with_user_info;
public Dictionary<int, Skin> skin_with_user_info;
public List<SpotActInfo> spot_act_info;
public List<SquadDataDaily> squad_data_daily;
public List<SquadInTheaterInfo> squad_in_theater_info;
public Dictionary<int, SquadSkillActInfo> squad_skill_act_info;
public Dictionary<int, SquadTrainActInfo> squad_train_act_info;
public Dictionary<long, Squad> squad_with_user_info;
public TheaterExerciseInfo theater_exercise_info;
public Dictionary<int, TheaterWithUser> theater_with_user_info;
public List<UpgradeActInfo> upgrade_act_info;
public UserFriend user_friend_info;
public UserGameSetting user_game_setting;
public UserInfo user_info;
public UserRecord user_record;
public Dictionary<long, VehicleComponent> vehicle_component_with_user_info;
public Dictionary<int, Vehicle> vehicle_with_user_info;
}

51
Elisa/Models/Item.cs Normal file
View File

@ -0,0 +1,51 @@
namespace Elisa.Models;
// TODO: check
public class CommanderUniform
{
public int[] color_get;
public int commander_uniform_id;
public int create_time;
public int get_color_num;
public long user_id;
}
public class Item
{
public long id;
public int item_id;
public int last_recover_time;
public int number;
}
public class ItemInfo
{
public int item_id;
public int item_num;
public int last_recover_time;
}
public class ItemLimit
{
public int daily_clear_time;
public int daily_get;
public int end_time;
public int event_get;
public int item_id;
public int user_id;
}
public class Resource
{
public int ammo;
public int mp;
public int mre;
public int part;
}
public class Skin
{
public int is_read;
public int skin_id;
public long user_id;
}

34
Elisa/Models/Mail.cs Normal file
View File

@ -0,0 +1,34 @@
namespace Elisa.Models;
public class IndexMail
{
public int ammo;
public int bp_pay;
public string chip;
public string code;
public string coins;
public string commander_uniform;
public string content;
public int core;
public int end_time;
public string equip_ids;
public string fairy_ids;
public string furniture;
public int gem;
public string gift;
public int gun_id;
public long id;
public int if_read;
public string item_ids;
public int mp;
public int mre;
public int part;
public string sangvis;
public int skin;
public int start_time;
public int sub_id;
public string title;
public int type;
public int user_exp;
public long user_id;
}

647
Elisa/Models/Mission.cs Normal file
View File

@ -0,0 +1,647 @@
namespace Elisa.Models;
public class Airbone
{
public int from_spot_id;
public int to_spot_id;
}
public class AirborneParent
{
public Airbone airbone;
public List<SpotTeleportResult> spot_teleport_result;
}
public class AllyBattle
{
public List<AllyInstanceInfo> ally_before_battle;
public int ally_boss_hp;
public decimal ally_enemy_hp_percent;
public int boss_hp;
public decimal enemy_hp_percent;
public int enemy_instance_id;
public int enemy_team_id;
public int spot_id;
public int survive_force;
public int win_ally_instance_id;
}
public class AllyInstanceBetray
{
public int ai;
public int ai_para;
public int ally_boss_hp;
public int ally_enemy;
public double ally_enemy_hp_percent;
public int ally_instance_id;
public int ally_type;
public int condition_type;
public int old_ally_type;
public int spot_id;
}
public class AllyInstanceInfo
{
public int ai;
public string ai_para;
public int ally_boss_hp;
public int ally_enemy;
public decimal ally_enemy_hp_percent;
public Dictionary<int, Gun> ally_guns;
public int ally_instance_id;
public int ally_team_id;
public int ally_type;
public int battleskill_switch;
public string betray_condition;
public int duration_end_turn;
public int move_turn;
public int no_battle_damage;
public MissionResource supply_resource;
public int target_type;
public Dictionary<int, TeamGunsLife> team_guns_life;
public MissionResource team_resource;
public Dictionary<int, TeamSangvisLife> team_sangvis_life;
public string transform_condition;
}
public class AllyInstanceTransform
{
public int ally_instance_id;
public int condition_type;
public string hostage_info;
public int spot_id;
public int transform_result;
}
public class AllyMove
{
public int ally_instance_id;
public int from_spot_id;
public int to_hostage_hp;
public int to_hostage_id;
public int to_spot_id;
}
public class AllyteamSummoner
{
public int ally_instance_id;
public AllyInstanceInfo ally_instance_info;
public int spot_id;
public List<SpotTeleportResult> spot_teleport_result;
}
public class AutoMissionAct
{
public int auto_mission_id;
public int end_time;
public long id;
public int number;
public string team_ids;
public long user_id;
}
public class BattleGetPrize
{
public long[] equips;
public long[] fairys;
public long[] furniture;
public long gun_with_user_id;
public int prize_id;
public RealPrizeInfo real_prize_info;
public long sangvis_with_user_id;
}
public class BuildingInfo
{
public int belong;
public int building_id;
public int defender;
public int spot;
}
public class DiedThisSection
{
public List<int> ally;
public List<int> enemy;
}
public class EnemyInstanceInfo
{
public int boss_hp;
public int enemy_ai;
public string enemy_ai_para;
public int enemy_birth_turn;
public decimal enemy_hp_percent;
public int enemy_team_id;
}
public class EnemyMove
{
public int enemy_ai;
public string enemy_ai_para;
public int from_spot_id;
public int hostage_hp;
public int hostage_id;
public int squad_instance_id;
public int to_spot_id;
}
public class FairyEffect
{
public int aim_spot;
public int aim_stc_id;
public int aim_type;
public int origin_key;
public int origin_spot;
public int origin_stc_id;
public int origin_type;
}
public class FairySkillOnAlly
{
public int ally;
public int battle_count;
public int buff_id;
public int building_spot_id;
public int fairy_team_id;
public int mission_skill_config_id;
public int squad_instance_id;
public int start_turn;
}
public class FairySkillOnEnemy
{
public int battle_count;
public int battle_finish_count;
public int buff_id;
public int building_spot_id;
public int enemy_instance_id;
public int fairy_team_id;
public int mission_skill_config_id;
public int person_move_count;
public int person_shift_count;
public int source_type;
public int source_value;
public int squad_instance_id;
public int start_turn;
}
public class FairySkillOnSpot
{
public int battle_count;
public int building_spot_id;
public int conflict_type;
public int[] detect_spots;
public int[] effect_spots;
public int engine_spot_id;
public int fairy_team_id;
public int mission_skill_config_id;
public int move_count;
public int priority;
public int source_type;
public int source_value;
public int special_spot_config_id;
public int squad_instance_id;
public int start_turn;
}
public class FairySkillOnTeam
{
public int battle_count;
public int battle_finish_count;
public int buff_id;
public int building_spot_id;
public int fairy_team_id;
public int mission_skill_config_id;
public int person_move_count;
public int person_shift_count;
public int source_type;
public int source_value;
public int squad_instance_id;
public int start_turn;
public int team_id;
}
public class FairySkillPerform
{
public int building_spot_id;
public int fairy_team_id;
public int mission_skill_config_id;
public int next_skill_cd_turn;
public int perform_spot_id;
public int source_type;
public int source_value;
public int squad_instance_id;
}
public class FairySkillReturn
{
public List<AirborneParent> airborne_2;
public List<AllyteamSummoner> allyteam_summoner;
public Dictionary<int, FairyEffect> fairy_effect;
public List<MissionHurt> mission_hurt;
}
public class FightEnvironmentSkillInfo
{
public int duration;
public long fight_environment_skill_id;
}
public class GrowEnemy
{
public int enemy_instance_id;
public int enemy_team_id;
public int spot_id;
}
public class GunExp
{
public int exp;
public long id;
}
public class GunExp2
{
public int exp;
public long gun_with_user_id;
}
public class GunLife
{
public long id;
public int life;
}
public class GunLife2
{
public long gun_with_user_id;
public int life;
}
public class GunsLife
{
public long gun_with_user_id;
public int life;
}
public class LifeChange
{
public double enemy_hp_percent;
}
public class MissionAct
{
public string accomplish_win_steps;
public string ally_instance_info;
public string allydie_this_turn;
public int ap;
public int battle_count;
public string building_info;
public int defend_line_start_turn;
public string died_ally;
public string died_ally_type;
public string died_enemy;
public string died_enemy_b;
public string died_this_section;
public int end_ally_instance_id;
public int end_enemy_instance_id;
public int end_mission_skill_perform_id;
public int end_skill_id;
public int end_squad_instance_id;
public string enemy_instance_info;
public int enemydie_num;
public int enemydie_num_killbyfriend;
public int enemydie_num_killbyhostage;
public string enemydie_this_turn;
public string enemydie_tigger_team_colour;
public string enter_assisttype_squads;
public string fairy_skill_on_ally;
public string fairy_skill_on_enemy;
public string fairy_skill_on_friend_sangvis;
public string fairy_skill_on_friend_team;
public string fairy_skill_on_sangvis;
public string fairy_skill_on_spot;
public string fairy_skill_on_squad;
public string fairy_skill_on_team;
public string fairy_skill_perform;
public string fight_environment_count;
public string fight_environment_group;
public int force1_battle_count;
public string friend_sangvises_life;
public string friend_team_fairy;
public string friend_team_sangvis_chips;
public string friend_team_sangvises;
public string friend_team_sangvisteams;
public string get_guns;
public int growenemy_with_enemydie;
public int growotherside_with_enemydie;
public string gun_average_level;
public int gundie_num;
public string gunid_gunlv;
public string hidden_spots;
public string join_editable_allys;
public string join_sangvis_teams;
public string join_teams;
public int last_battle_finish_time;
public string last_battle_info;
public string mica_log;
public string mission_control;
public string mission_control_trigger_spot_id;
public int mission_id;
public string mission_trigger_count;
public string mission_win_step_control_ids;
public int mysquad_die_num;
public int pass_missionevent;
public int reinforce_friend_team_num;
public string reinforce_sangvis_teams;
public string reinforce_squads;
public string reinforce_targets;
public string reinforce_teams;
public string reinforce_uneditable_allys;
public string sangvis_teams_info;
public int sangvisdie_num;
public int save_hostage;
public string special_skill_102_enemy;
public string special_skill_203_info;
public string spot;
public int spot_belong_remain_reset_count;
public string spot_trans_info;
public string spots_change;
public string squad_info;
public string target_moved_step;
public string team_effect;
public int turn;
public int turn_belong;
public int type5_score;
public long user_id;
public string vehicle_info;
}
public class MissionEvent
{
public int after_days;
public string draw_event_id;
public int end_time;
public int id;
public Dictionary<int, ItemLimit> item_limit_with_user;
public int mission_campaign;
public int start_time;
public int tomorrow_unix;
}
public class MissionHurt
{
public double ally_enemy_hp_percent;
public int ally_instance_id;
public int building_defender;
public int building_spot_id;
public double enemy_hp_percent;
public int enemy_instance_id;
public List<GunsLife> guns_life;
public int hostage_hp;
public int hostage_id;
public int hurt_id;
public int mission_skill_config_id;
public int spot_id;
public int squad_instance_id;
public int squad_life;
public int team_id;
}
public class MissionInfo
{
public int enemydie_num;
public int enemydie_num_killbyfriend;
public int gundie_num;
public int turn;
}
public class MissionLoseResult
{
public int enemydie_num;
public int enemydie_num_killbyfriend;
public int gundie_num;
public int mysquad_die_num;
public int sangvisdie_num;
public int turn;
public int type5_score;
}
public class MissionResource
{
public int ammo;
public int mre;
}
public class MissionWinResult
{
public List<GunExp> after_duplicate1_gun_exp;
public int free_exp;
public int gift_item200001_add;
public int medal4;
public MissionInfo mission_info;
public Dictionary<int, string> open;
public int rank;
public int recover_bp_and_item603;
public List<VehicleComponent> reward_component;
public List<Equip> reward_equip;
public List<Gun> reward_gun;
public List<Prize> reward_prize;
public int user_exp;
}
public class MissionWithUser
{
public int bestrank;
public int counter;
public int cycle_win_count;
public string drop_item_count;
public long id;
public int is_close;
public int is_drop_draw_event;
public int is_open;
public int mapped_win_counter;
public int medal1;
public int medal2;
public int medal4;
public int mission_id;
public double shortest_in_coinmission;
public int type5_score;
public long user_id;
public int win_counter;
}
public class NewSpotChange
{
public int can_use_count;
public int end_turn;
public int spot_id;
public int start_turn;
public int type;
public int use_count;
}
public class NightAlly
{
public int ally_instance_id;
public int ally_team_id;
public int from_spot_id;
public int hostage_hp;
public int hostage_id;
public int to_hostage_hp;
public int to_hostage_id;
public int to_spot_id;
}
public class NightEnemy
{
public int ally_instance_id;
public int[] ally_instance_ids;
public int boss_hp;
public int enemy_ai;
public string enemy_ai_para;
public int enemy_birth_turn;
public double enemy_hp_percent;
public int enemy_instance_id;
public int enemy_team_id;
public int from_spot_id;
public int hostage_hp;
public int hostage_id;
public int squad_instance_id;
public int[] squad_instance_ids;
public int to_spot_id;
}
public class NightSpot
{
public int belong;
public int seed;
public int spot_id;
}
public class SangvisBattleExp
{
public int exp;
public long sangvis_with_user_id;
}
public class SangvisLife
{
public long id;
public int life;
}
public class SangvisLife2
{
public int life;
public long sangvis_with_user_id;
}
public class SangvisSpot
{
public int sangvis_team_id;
public int spot_id;
}
public class SangvisTeamResource
{
public int ammo;
public int mre;
}
public class SangvisTeamsInfo
{
public int ally_instance_id;
public int battleskill_switch;
public int sangvis_team_id;
}
public class Spot
{
public int spot_id;
public int team_id;
}
public class SpotActInfo
{
public object ally_instance_ids;
public int belong;
public int boss_hp;
public int enemy_ai;
public string enemy_ai_para;
public int enemy_birth_turn;
public decimal enemy_hp_percent;
public int enemy_instance_id;
public int enemy_team_id;
public int fix_count;
public int hostage_hp;
public int hostage_id;
public int hostage_max_hp;
public int if_random;
public int reinforce_count;
public int sangvis_team_id;
public int seed;
public int spot_id;
public int[] squad_instance_ids;
public int supply_count;
public int team_id;
public int vehicle_with_user_id;
}
public class SpotTeleportResult
{
public int from_spot_id;
public int target_id;
public int target_type;
public int to_spot_id;
}
public class SpotTransInfo
{
public int belong;
public int[] route;
public int type;
}
public class SquadExp
{
public int exp;
public int life;
public int squad;
}
public class SquadInstanceInfo
{
public int against_force_life;
public int attack_next_turn;
public int battleskill_switch;
public int belong;
public int squad_id;
public int squad_instance_id;
}
public class SquadSpot
{
public int battleskill_switch;
public int spot_id;
public long squad_with_user_id;
}
public class TeamGunsLife
{
public long id;
public int life;
}
public class TeamSangvisLife
{
public long id;
public int life;
}
public class VehicleInfo
{
public int atk_building_next_turn;
public int battleskill_switch;
public int id;
}

11
Elisa/Models/Operation.cs Normal file
View File

@ -0,0 +1,11 @@
namespace Elisa.Models;
public class OperationAct
{
public int exec_num;
public long id;
public int operation_id;
public int start_time;
public int team_id;
public long user_id;
}

29
Elisa/Models/Outhouse.cs Normal file
View File

@ -0,0 +1,29 @@
namespace Elisa.Models;
public class OuthouseFurniture
{
public long dorm_with_user_id;
public int furniture_id;
}
public class OuthouseEstablish
{
public int build_get_time;
public int build_num;
public int build_starttime;
public int establish_id;
public int establish_lv;
public int establish_type;
public int furniture_id;
public string furniture_postion;
public string parameter_1;
public string parameter_2;
public string parameter_3;
public int room_id;
public int update_furniture_id;
public int upgrade_coin;
public string upgrade_condition;
public int upgrade_establish_id;
public int upgrade_starttime;
public int upgrade_time;
}

90
Elisa/Models/Prize.cs Normal file
View File

@ -0,0 +1,90 @@
namespace Elisa.Models;
public class AddEquip
{
public int equip_id;
public long id;
}
public class AddFairyExp
{
public int fairy_exp;
public long fairy_with_user_id;
}
public class AddGun
{
public int gun_id;
public long gun_with_user_id;
}
public class AddGunExp
{
public int gun_exp;
public int gun_life;
public long gun_with_user_id;
}
public class IndexPrize
{
public int ammo;
public string coins;
public int core;
public List<Equip> equips;
public List<Fairy> fairys;
public int gem;
public List<Gun> guns;
public string item_ids;
public int mp;
public int mre;
public int part;
public int user_exp;
}
public class Prize
{
public long[] equips;
public long[] fairys;
public long[] furniture;
public long gun_with_user_id;
public int prize_id;
public RealPrizeInfo real_prize_info;
public long sangvis_with_user_id;
}
public class RealPrizeInfo
{
public int ammo;
public int bp_pay;
public string chip;
public string coins;
public string commander_uniform;
public string content;
public int core;
public string equip_ids;
public string fairy_ids;
public string furniture;
public int gem;
public string gift;
public int gun_id;
public string icon;
public int id;
public string item_ids;
public int mp;
public int mre;
public string name;
public int part;
public string sangvis;
public int send_limit;
public int skin;
public int user_exp;
}
public class RedPrize
{
public long[] equips;
public long[] fairys;
public long gun_with_user_id;
public int prize_id;
public RealPrizeInfo real_prize_info;
}

169
Elisa/Models/Quest.cs Normal file
View File

@ -0,0 +1,169 @@
namespace Elisa.Models;
public class AccomplishQuestList
{
public int[] accomplish_quest_list;
}
public class Battlepass
{
public int battlepass_id;
public int extra_bonus;
public string free_bonus;
public int id;
public int is_expired;
public string paid_bonus;
public long user_id;
}
public class Daily
{
public string accomplish_quest_list;
public string daily_quest_list;
public int end_time;
public int id;
public Progress progress;
public string refresh_count;
public int user_id;
public class Progress
{
public int adjust_equip;
public int auto_battle;
public int battery_collect;
public int borrow_friend_team;
public int coin_mission;
public int complete_squad_daily;
public int develop_equip;
public int develop_gun;
public int eat;
public int eat_equip;
public int explore;
public int fix;
public int from_friend_build_coin;
public int gift;
public int heart_collect;
public int like;
public int mission;
public int operation;
public int recycle;
public int rescue;
public int s_win;
public int sangvis_daily_retrieval;
public int sangvis_exercise;
public int squad_data_analyse;
public int upgrade;
public int upgrade_dummy;
public int upgrade_equip;
public int upgrade_skill;
public int upgrade_value;
public int win_armor;
public int win_armorperson;
public int win_armorrobot;
public int win_boss;
public int win_normal;
public int win_person;
public int win_robot;
}
}
public class DailyInfo
{
public List<FightEnvironmentSkillInfo> fight_environment_skill_info;
public TicketInfo ticket_info;
}
public class DailyMapWithUserInfo
{
public string event_options;
public int id;
public string mission;
public int spot_id;
public int spot_num;
public int spot_type;
public int user_id;
}
public class DailyStatusWithUserInfo
{
public int difficulty;
public int ex_ticket;
public string fight_environment_skill;
public int id;
public int map_id;
public int prev_spot_id;
public int skill_incr_id;
public int spot_id;
public int total_boss_num;
public int total_complete_num;
public int total_spot_num;
public long user_id;
}
public class SquadDataDaily
{
public int count;
public string last_finish_time;
public int receive;
public int squad_id;
public string type;
public long user_id;
}
public class TicketInfo
{
public Resource rs;
}
public class Weekly
{
public string accomplish_quest_list;
public int end_time;
public int id;
public string locked_quest_list;
public Progress progress;
public string refresh_count;
public int user_id;
public int weekly_accumulation;
public string weekly_quest_list;
public class Progress
{
public int adjust_equip;
public int adjust_fairy;
public int auto_battle;
public int battery_collect;
public int chess;
public int coin_mission;
public int complete_squad_daily;
public int consume_aid;
public int develop_equip;
public int develop_gun;
public int eat;
public int eat_equip;
public int eat_fairy;
public int explore;
public int fix;
public int operation;
public int procurement;
public int retire_gun;
public int s_win;
public int sangvis_daily_retrieval;
public int sangvis_exercise;
public int sp_develop;
public int special_develop_equip;
public int special_develop_gun;
public int squad_data_analyse;
public int squad_eat_chip;
public int upgrade;
public int upgrade_skill;
public int win_armor;
public int win_armorperson;
public int win_armorrobot;
public int win_boss;
public int win_enemy;
public int win_normal;
public int win_person;
public int win_robot;
}
}

19
Elisa/Models/Rank.cs Normal file
View File

@ -0,0 +1,19 @@
namespace Elisa.Models;
public class RankUserInfo
{
public string commander_info;
public string headpic_id;
public int id;
public int last_time;
public string num;
public int rank;
public int rank_id;
public int score;
public int server_id;
public string server_name;
public int sum_pt;
public int user_id;
public int user_level;
public string user_name;
}

100
Elisa/Models/Sangvis.cs Normal file
View File

@ -0,0 +1,100 @@
namespace Elisa.Models;
// tODO: check
public class Sangvis
{
public int ammo_count;
public int can_click;
public int chip1;
public int chip2;
public int exp;
public int favor;
public int favor_toplimit;
public int is_locked;
public int level;
public int life;
public int location;
public int mre_count;
public int position;
public int sangvis_advance;
public int sangvis_id;
public int sangvis_is_special;
public int sangvis_resolution;
public int sangvis_resolution_level;
public int sangvis_shape_n;
public long sangvis_with_user_id;
public int sign;
public int skill_advance;
public int skill1;
public int skill2;
public int skill3;
public int skin;
public int soul_bond;
public int soul_bond_time;
public int special_effect;
public int team_id;
public long user_id;
}
public class SangvisChip
{
public int chip_id;
public int chip_slot;
public int dev_time;
public long sangvis_with_user_id;
public long user_id;
}
public class SangvisDuplicateInfo
{
public string award_item;
public int challenge_type;
public string default_team;
public int end_time;
public int enemy_team_id;
public string gun_in_allys;
public int id;
public int is_night;
public string item_cost;
public string map_code;
public int map_type;
public decimal pass_time;
public int sangvis_hiringteam_id;
public int start_time;
}
public class SangvisItemRecover
{
public int item_last_recover_time;
public int item_num;
}
public class SangvisTeam
{
public int ammo;
public int group_id;
public long id;
public Dictionary<int, SangvisTeamSet> info;
public int mre;
public int team_id;
public long user_id;
}
public class SangvisTeamSet
{
public int position;
public long sangvis_with_user_id;
}
public class SangvisGashaInfo
{
public int can_reset;
public string draw_type_count;
public string gasha_area;
public string gasha_content;
public int gasha_id;
public string gasha_reward;
public int id;
public int last_refresh_time;
public long user_id;
}

41
Elisa/Models/Settings.cs Normal file
View File

@ -0,0 +1,41 @@
namespace Elisa.Models;
public class GameConfigInfo
{
public string client_version;
public int equip_enhance_switch;
public int equip_rectify_switch;
public int res_table_switch;
public int share_global_switch;
public int soulbind_global_switch;
public int special_develop_switch;
public int trail_switch;
}
public class Settings
{
public bool autoFairySkill;
public bool autoLock;
public bool autoSupply;
public bool bulletTime;
public bool characterLive2dAlwaysLogin;
public int characterSkillPerformance;
public bool dormShowComment;
public bool endTurnConfirmation;
public bool gunBreakProtect;
public bool illusLike;
public bool playReplay;
public int sangvisSkillPerformance;
public bool showBackgroundLive2D;
public bool showBattleMessage;
public bool showCharacterLive2D;
public bool simplifyBattle;
public bool skillPerformance;
public bool vibrate;
}
public class UserGameSetting
{
public string settings;
public long uid;
}

73
Elisa/Models/Squad.cs Normal file
View File

@ -0,0 +1,73 @@
namespace Elisa.Models;
// TODO: check
public class Squad
{
public int advanced_level;
public int assist_damage;
public int assist_def_break;
public int assist_hit;
public int assist_reload;
public int atk_speed;
public int cur_def;
public int damage;
public int def;
public int hit;
public int id;
public int life;
public int rank;
public int skill1;
public int skill2;
public int skill3;
public int squad_exp;
public int squad_id;
public int squad_level;
public int user_id;
}
public class SquadSkillAct
{
public int end_time;
public int skill;
public int squad_skill_slot;
public long squad_with_user_id;
public long user_id;
}
public class SquadSkillActInfo
{
public int end_time;
public int skill;
public int squad_skill_slot;
public long squad_with_user_id;
public long user_id;
}
public class SquadTrainAct
{
public int add_exp;
public string cost_item_info;
public int end_time;
public int num;
public int squad_train_slot;
public long squad_with_user_id;
public long user_id;
}
public class SquadTrainActInfo
{
public int add_exp;
public string cost_item_info;
public int end_time;
public int num;
public int squad_train_slot;
public long squad_with_user_id;
public long user_id;
}
public class SquadInfo : Squad
{
public int current_adv_progress;
public int current_rank_progress;
public int rank_end_time;
}

131
Elisa/Models/Theater.cs Normal file
View File

@ -0,0 +1,131 @@
namespace Elisa.Models;
public class SquadInTheaterInfo
{
public long sangvis_with_user_id;
public int squad_no;
public long squad_with_user_id;
public long user_id;
}
public class TheaterAreaType2Log
{
public int best_pt;
public int theater_area_id;
public long user_id;
public int user_level;
public string user_name;
}
public class TheaterConstructionInfo
{
public int area_id;
public int construction_group_id;
public int init_pt;
public int lv;
public int pt;
public int theater_id;
public int user_pt;
}
public class TheaterEventLog
{
public int ap;
public int battle_pt;
public int construction_pt;
public int incident_pt;
public int last_withdraw_time;
public int sum_pt;
public int theater_event_id;
public long user_id;
public int user_level;
public string user_name;
}
public class TheaterExerciseInfo
{
public int battle_enemy_no;
public int battle_fairy;
public string battle_squads;
public int battle_team;
public string enemy_teams;
public int last_battle_finish_time;
public int theater_area_id;
public int theater_fairy_use_count;
public string theater_squads;
public string theater_squads_use_count;
public string theater_teams;
public long user_id;
}
public class TheaterIncidentInfo
{
public int incident_end_day;
public int incident_id;
public int incident_start_day;
public int num;
public List<TheaterResult> result;
public int selection_id;
public int status;
}
public class TheaterInfo
{
public string advantage_gun;
public int battle_pt;
public int is_open;
public int minus_pt;
public int theater_id;
}
public class TheaterResult
{
public int num;
public int selection_id;
}
public class TheaterTeamMember
{
public int id;
public int type;
}
public class TheaterTeamMemberWithPos : TheaterTeamMember
{
public int position;
}
public class TheaterTeams
{
public List<long> backup;
public List<long> backup_fairy;
public Dictionary<int, TheaterTeamMember> fairy;
public Dictionary<int, TheaterTeamMemberWithPos> guns;
public Dictionary<int, TheaterTeamMemberWithPos> sangvises;
public Dictionary<int, TheaterTeamMember> squads;
}
public class TheaterTeamsInfo
{
public int theater_area_id;
public string theater_teams;
public int user_id;
}
public class TheaterWithUser
{
public string battle_pt;
public int last_exercise_finish_time;
public int theater_id;
}
public class GunInTheaterInfo
{
public long gun_with_user_id;
public int life;
public int location;
public int position;
public long sangvis_with_user_id;
public int team_id;
public long user_id;
}

64
Elisa/Models/User.cs Normal file
View File

@ -0,0 +1,64 @@
namespace Elisa.Models;
public class UserInfo
{
public int ammo;
public int bp;
public int coin1;
public int coin2;
public int coin3;
public int core;
public string equip_collect;
public int experience;
public int gem;
public int gender;
public string gun_collect;
public int last_bp_recover_time;
public int last_favor_recover_time;
public int last_login_time;
public int last_monthlycard1_recover_time;
public int last_monthlycard2_recover_time;
public int last_recover_time;
public int last_ssoc_change_time;
public int lv;
public int max_build_slot;
public int max_equip_build_slot;
public int max_fairy;
public int max_fix_slot;
public int max_gun_preset;
public int max_sangvis;
public int max_upgrade_slot;
public int maxdorm;
public int maxequip;
public int maxgun;
public int maxteam;
public int mp;
public int mre;
public string name;
public int part;
public int reg_time;
public long user_id;
}
public class UserRecord
{
public string adjutant;
public string adjutant_fairy;
public string adjutant_multi;
public int attendance_type1_day;
public int attendance_type1_time;
public int attendance_type2_day;
public int attendance_type2_time;
public int buyammo_num;
public int buymp_num;
public int buymre_num;
public int buypart_num;
public int first_sangvis;
public int mission_campaign;
public string seven_attendance_days;
public int seven_spend_point;
public int seven_start_time;
public int seven_type;
public int special_mission_campaign;
public long user_id;
}

68
Elisa/Models/Vehicle.cs Normal file
View File

@ -0,0 +1,68 @@
namespace Elisa.Models;
public class Vehicle
{
public int ammo;
public int armor;
public int atk_speed;
public int basic_effect;
public string common_component;
public string component;
public string crew;
public int crit;
public int crit_dmg;
public int def_break;
public int dodge;
public int energy;
public int energy_bak;
public int exp;
public int H_armor_piercing;
public int heavy_damage;
public int hit;
public int hp;
public int id;
public int L_armor_piercing;
public int life;
public int light_damage;
public string locked_slots;
public int mre;
public int precision;
public int reload;
public int skin;
public string unlocked_nodes;
public long user_id;
public int vehicle_id;
}
public class VehicleComponent
{
public int armor;
public int atk_speed;
public int component_id;
public int crit_damage;
public int crit_rate;
public int def_break;
public int dodge;
public int energy;
public int energy_bak;
public int exp;
public int H_armor_piercing;
public int heavy_damage;
public int hit;
public long id;
public int is_locked;
public int L_armor_piercing;
public int level;
public int light_damage;
public int precision;
public int reload;
public string roll_1;
public string roll_2;
public string roll_3;
public string roll_4;
public string roll_5;
public string skill;
public int skin;
public string unlocked_att;
public long user_id;
}

62
Elisa/Program.cs Normal file
View File

@ -0,0 +1,62 @@
using Elisa.Commands;
using Elisa.Data;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
using System.Diagnostics;
using System.Reflection;
namespace Elisa;
internal static class Program
{
static IConfiguration config = null!;
public static void Main(string[] args)
{
SetupConfig();
SetupSerilog();
Log.Information($"Version {Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion}");
Log.Information($"Starting {Assembly.GetEntryAssembly()?.GetName().Name}...");
Stopwatch stopwatch = Stopwatch.StartNew();
{
CommandHandlerFactory.RegisterCommands(Assembly.GetExecutingAssembly());
Table.Load();
}
stopwatch.Stop();
Log.Information($"Done! loaded in {stopwatch.ElapsedMilliseconds}ms");
Task.Run(GameServer.Start).Wait();
}
private static void SetupConfig()
{
config = new ConfigurationBuilder()
.SetBasePath(Path.GetDirectoryName(AppContext.BaseDirectory)!)
.AddJsonFile("appsettings.json")
.Build();
}
static void SetupSerilog()
{
var logFilePath = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory)!, "Logs", "log.txt");
if (File.Exists(logFilePath))
{
string prevLogFilePath = Path.Combine(Path.GetDirectoryName(logFilePath)!, "log-prev.txt");
if (File.Exists(prevLogFilePath))
File.Delete(prevLogFilePath);
File.Move(logFilePath, prevLogFilePath);
}
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File(logFilePath, restrictedToMinimumLevel: LogEventLevel.Verbose, shared: true)
.ReadFrom.Configuration(config)
.CreateBootstrapLogger();
}
}

View File

@ -0,0 +1,484 @@
{
"gun_exp_info": [
{
"lv": "1",
"exp": "100"
},
{
"lv": "2",
"exp": "200"
},
{
"lv": "3",
"exp": "300"
},
{
"lv": "4",
"exp": "400"
},
{
"lv": "5",
"exp": "500"
},
{
"lv": "6",
"exp": "600"
},
{
"lv": "7",
"exp": "700"
},
{
"lv": "8",
"exp": "800"
},
{
"lv": "9",
"exp": "900"
},
{
"lv": "10",
"exp": "1000"
},
{
"lv": "11",
"exp": "1100"
},
{
"lv": "12",
"exp": "1200"
},
{
"lv": "13",
"exp": "1300"
},
{
"lv": "14",
"exp": "1400"
},
{
"lv": "15",
"exp": "1500"
},
{
"lv": "16",
"exp": "1600"
},
{
"lv": "17",
"exp": "1700"
},
{
"lv": "18",
"exp": "1800"
},
{
"lv": "19",
"exp": "1900"
},
{
"lv": "20",
"exp": "2000"
},
{
"lv": "21",
"exp": "2100"
},
{
"lv": "22",
"exp": "2200"
},
{
"lv": "23",
"exp": "2300"
},
{
"lv": "24",
"exp": "2400"
},
{
"lv": "25",
"exp": "2500"
},
{
"lv": "26",
"exp": "2600"
},
{
"lv": "27",
"exp": "2800"
},
{
"lv": "28",
"exp": "3100"
},
{
"lv": "29",
"exp": "3400"
},
{
"lv": "30",
"exp": "4200"
},
{
"lv": "31",
"exp": "4600"
},
{
"lv": "32",
"exp": "5000"
},
{
"lv": "33",
"exp": "5400"
},
{
"lv": "34",
"exp": "5800"
},
{
"lv": "35",
"exp": "6300"
},
{
"lv": "36",
"exp": "6700"
},
{
"lv": "37",
"exp": "7200"
},
{
"lv": "38",
"exp": "7700"
},
{
"lv": "39",
"exp": "8200"
},
{
"lv": "40",
"exp": "8800"
},
{
"lv": "41",
"exp": "9300"
},
{
"lv": "42",
"exp": "9900"
},
{
"lv": "43",
"exp": "10500"
},
{
"lv": "44",
"exp": "11100"
},
{
"lv": "45",
"exp": "11800"
},
{
"lv": "46",
"exp": "12500"
},
{
"lv": "47",
"exp": "13100"
},
{
"lv": "48",
"exp": "13900"
},
{
"lv": "49",
"exp": "14600"
},
{
"lv": "50",
"exp": "15400"
},
{
"lv": "51",
"exp": "16100"
},
{
"lv": "52",
"exp": "16900"
},
{
"lv": "53",
"exp": "17800"
},
{
"lv": "54",
"exp": "18600"
},
{
"lv": "55",
"exp": "19500"
},
{
"lv": "56",
"exp": "20400"
},
{
"lv": "57",
"exp": "21300"
},
{
"lv": "58",
"exp": "22300"
},
{
"lv": "59",
"exp": "23300"
},
{
"lv": "60",
"exp": "24300"
},
{
"lv": "61",
"exp": "25300"
},
{
"lv": "62",
"exp": "26300"
},
{
"lv": "63",
"exp": "27400"
},
{
"lv": "64",
"exp": "28500"
},
{
"lv": "65",
"exp": "29600"
},
{
"lv": "66",
"exp": "30800"
},
{
"lv": "67",
"exp": "32000"
},
{
"lv": "68",
"exp": "33200"
},
{
"lv": "69",
"exp": "34400"
},
{
"lv": "70",
"exp": "45100"
},
{
"lv": "71",
"exp": "46800"
},
{
"lv": "72",
"exp": "48600"
},
{
"lv": "73",
"exp": "50400"
},
{
"lv": "74",
"exp": "52200"
},
{
"lv": "75",
"exp": "54000"
},
{
"lv": "76",
"exp": "55900"
},
{
"lv": "77",
"exp": "57900"
},
{
"lv": "78",
"exp": "59800"
},
{
"lv": "79",
"exp": "61800"
},
{
"lv": "80",
"exp": "63900"
},
{
"lv": "81",
"exp": "66000"
},
{
"lv": "82",
"exp": "68100"
},
{
"lv": "83",
"exp": "70300"
},
{
"lv": "84",
"exp": "72600"
},
{
"lv": "85",
"exp": "74800"
},
{
"lv": "86",
"exp": "77100"
},
{
"lv": "87",
"exp": "79500"
},
{
"lv": "88",
"exp": "81900"
},
{
"lv": "89",
"exp": "84300"
},
{
"lv": "90",
"exp": "112600"
},
{
"lv": "91",
"exp": "116100"
},
{
"lv": "92",
"exp": "119500"
},
{
"lv": "93",
"exp": "123100"
},
{
"lv": "94",
"exp": "126700"
},
{
"lv": "95",
"exp": "130400"
},
{
"lv": "96",
"exp": "134100"
},
{
"lv": "97",
"exp": "137900"
},
{
"lv": "98",
"exp": "141800"
},
{
"lv": "99",
"exp": "145700"
},
{
"lv": "100",
"exp": "100000"
},
{
"lv": "101",
"exp": "120000"
},
{
"lv": "102",
"exp": "140000"
},
{
"lv": "103",
"exp": "160000"
},
{
"lv": "104",
"exp": "180000"
},
{
"lv": "105",
"exp": "200000"
},
{
"lv": "106",
"exp": "220000"
},
{
"lv": "107",
"exp": "240000"
},
{
"lv": "108",
"exp": "280000"
},
{
"lv": "109",
"exp": "360000"
},
{
"lv": "110",
"exp": "480000"
},
{
"lv": "111",
"exp": "640000"
},
{
"lv": "112",
"exp": "900000"
},
{
"lv": "113",
"exp": "1200000"
},
{
"lv": "114",
"exp": "1600000"
},
{
"lv": "115",
"exp": "2200000"
},
{
"lv": "116",
"exp": "3000000"
},
{
"lv": "117",
"exp": "4000000"
},
{
"lv": "118",
"exp": "5000000"
},
{
"lv": "119",
"exp": "6000000"
},
{
"lv": "120",
"exp": "0"
}
]
}

1543110
Elisa/Resources/stc/spot.json Normal file

File diff suppressed because it is too large Load Diff

253
Elisa/Utils/Crypto.cs Normal file
View File

@ -0,0 +1,253 @@
using ICSharpCode.SharpZipLib.GZip;
using System.IO.Compression;
using System.Security.Cryptography;
using System.Text;
namespace Elisa.Utils;
public static class Crypto
{
static DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
static MD5 md5 = System.Security.Cryptography.MD5.Create();
public static string Decrypt(string body, string key)
{
if (string.IsNullOrEmpty(body) || string.IsNullOrEmpty(key))
return string.Empty;
if (body.Length == 1 || body.StartsWith("error:") || (body.StartsWith("{") && body.EndsWith("}")))
return body;
try
{
string text = MD5(MD5(key).Substring(16));
string pwd = text + MD5(text);
if (body.StartsWith("#"))
{
body = body.Substring(1);
return GZipDecompress(RC4(ConvertFromBase64String(body), pwd).Skip(26).ToArray<byte>());
}
byte[] bytes = RC4(ConvertFromBase64String(body), pwd);
string @string = Encoding.UTF8.GetString(bytes);
return (@string.Length > 26) ? @string.Substring(26) : string.Empty;
}
catch
{
}
return string.Empty;
}
public static string Encrypt(string body, string key)
{
try
{
byte[] array = GZipCompress(Encoding.UTF8.GetBytes(body));
string text = MD5(key);
string s = MD5(text.Substring(0, 16));
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);
byte[] array2 = new byte[array.Length + 26];
Array.Copy(bytes, 0, array2, 0, bytes.Length);
Array.Copy(Encoding.UTF8.GetBytes(s2), 0, array2, 10, 16);
Array.Copy(array, 0, array2, 26, array.Length);
return "#" + Convert.ToBase64String(RC4(array2, pwd));
}
catch
{
}
return string.Empty;
}
public static byte[] ConvertFromBase64String(string input)
{
byte[] result = [];
try
{
result = Convert.FromBase64String(input);
}
catch
{
try
{
result = Convert.FromBase64String(input + "=");
}
catch
{
try
{
result = Convert.FromBase64String(input + "==");
}
catch
{
return result;
}
}
}
return result;
}
public static double GetCurrentSec()
{
return (DateTime.UtcNow - epoch).TotalSeconds;
}
public static string MD5(string input)
{
return MD5(Encoding.UTF8.GetBytes(input));
}
public static string MD5(byte[] input)
{
byte[] array = md5.ComputeHash(input);
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < array.Length; i++)
stringBuilder.Append(array[i].ToString("x2"));
return stringBuilder.ToString();
}
public static byte[] RC4(byte[] data, string pwd)
{
return RC4(data, Encoding.UTF8.GetBytes(pwd));
}
public static byte[] RC4(byte[] data, byte[] pwd)
{
int[] array = new int[256];
int[] array2 = new int[256];
byte[] array3 = new byte[data.Length];
int i;
int num;
for (i = 0; i < 256; i++)
{
array[i] = (int)pwd[i % pwd.Length];
array2[i] = i;
}
for (i = (num = 0); i < 256; i++)
{
int num2 = array2[i];
num = (num + array2[i] + array[i]) % 256;
array2[i] = array2[num];
array2[num] = num2;
}
int num3;
num = (num3 = (i = 0));
while (i < data.Length)
{
num3++;
num3 %= 256;
num += array2[num3];
num %= 256;
int num2 = array2[num3];
array2[num3] = array2[num];
array2[num] = num2;
int num4 = array2[(array2[num3] + array2[num]) % 256];
array3[i] = (byte)((int)data[i] ^ num4);
i++;
}
return array3;
}
public static byte[] GZipCompress(byte[] raw)
{
byte[] result;
using (MemoryStream memoryStream = new MemoryStream())
{
using GZipOutputStream gzipOutputStream = new GZipOutputStream(memoryStream);
gzipOutputStream.IsStreamOwner = false;
gzipOutputStream.Write(raw, 0, raw.Length);
gzipOutputStream.Flush();
gzipOutputStream.Finish();
result = memoryStream.ToArray();
}
return result;
}
public static string GZipDecompress(byte[] raw)
{
string result;
using (MemoryStream memoryStream = new MemoryStream(raw))
{
using Stream stream = new GZipInputStream(memoryStream);
using StreamReader streamReader = new StreamReader(stream, Encoding.UTF8);
result = streamReader.ReadToEnd();
}
return result;
}
public static string CompressText(string text)
{
byte[] bytes = Encoding.UTF8.GetBytes(text);
byte[]? inArray = null;
using (MemoryStream memoryStream = new MemoryStream())
{
using (GZipStream gzipStream = new GZipStream(memoryStream, CompressionMode.Compress))
{
gzipStream.Write(bytes, 0, bytes.Length);
}
inArray = memoryStream.ToArray();
}
return Convert.ToBase64String(inArray);
}
public static string DecompressText(string text)
{
string result = string.Empty;
using (MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(text)))
{
using (GZipStream gzipStream = new GZipStream(memoryStream, CompressionMode.Decompress))
{
using (StreamReader streamReader = new StreamReader(gzipStream))
{
result = streamReader.ReadToEnd();
}
}
}
return result;
}
public static string ConvertMD5(string input)
{
byte[] array = md5.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < array.Length; i++)
stringBuilder.Append(array[i].ToString("x2"));
return stringBuilder.ToString();
}
}

36
Elisa/Utils/RNG.cs Normal file
View File

@ -0,0 +1,36 @@
namespace Elisa.Utils;
public static class RNG
{
static readonly Random random = new Random((int)DateTime.Now.Ticks);
public static int Next(int min, int max)
=> random.Next(min, max);
public static int Next(int max)
=> random.Next(max);
public static float NextFloat(float min, float max)
{
double range = (double)max - min;
double sample = random.NextDouble();
double scaled = (sample * range) + min;
return (float)scaled;
}
public static float NextFloat(float max)
=> NextFloat(0f, max);
public static bool NextBool()
=> random.Next(2) == 0;
public static float NextRoll()
=> NextFloat(100f);
public static T NextFromList<T>(IList<T> list)
=> list[random.Next(list.Count)];
public static U NextFromDict<T, U>(IDictionary<T, U> dict)
=> dict.ElementAt(random.Next(dict.Count)).Value;
}

17
Elisa/Utils/Singleton.cs Normal file
View File

@ -0,0 +1,17 @@
namespace Elisa.Utils;
public abstract class Singleton<T> where T : new()
{
static T instance;
public static T Instance
{
get
{
if (instance == null)
instance = new T();
return instance;
}
set => instance = value;
}
}

19
Elisa/appsettings.json Normal file
View File

@ -0,0 +1,19 @@
{
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://0.0.0.0:80"
}
}
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
},
"AllowedHosts": "*"
}

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Elisa
A PoC server for a certain gun waifu game.