mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 11:24:00 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c109c82a91 | ||
|
|
d214778af1 | ||
|
|
1fc300300f | ||
|
|
0e408c9dad | ||
|
|
7b6d1a3054 | ||
|
|
8415969ffe |
@@ -11,6 +11,8 @@ if (!argsMap.TryGetValue("--package", out var packagePath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
argsMap.TryGetValue("--pid", out var pidValue);
|
argsMap.TryGetValue("--pid", out var pidValue);
|
||||||
|
argsMap.TryGetValue("--resource-package", out var resourcePackagePath);
|
||||||
|
argsMap.TryGetValue("--resource-target", out var resourceTargetDirectory);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -23,6 +25,9 @@ try
|
|||||||
ZipFile.ExtractToDirectory(packagePath, stagingDirectory, overwriteFiles: true);
|
ZipFile.ExtractToDirectory(packagePath, stagingDirectory, overwriteFiles: true);
|
||||||
CopyDirectory(stagingDirectory, targetDirectory);
|
CopyDirectory(stagingDirectory, targetDirectory);
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(resourcePackagePath) && !string.IsNullOrWhiteSpace(resourceTargetDirectory))
|
||||||
|
UpdateResources(resourcePackagePath, resourceTargetDirectory);
|
||||||
|
|
||||||
Process.Start(new ProcessStartInfo
|
Process.Start(new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = restartExecutable,
|
FileName = restartExecutable,
|
||||||
@@ -88,3 +93,20 @@ static bool ShouldSkip(string relativePath)
|
|||||||
{
|
{
|
||||||
return relativePath.StartsWith("Config", StringComparison.OrdinalIgnoreCase);
|
return relativePath.StartsWith("Config", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void UpdateResources(string resourcePackagePath, string resourceTargetDirectory)
|
||||||
|
{
|
||||||
|
var resourceStagingDirectory = Path.Combine(Path.GetTempPath(), "MikuSB", "resource-staging", Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(resourceStagingDirectory);
|
||||||
|
|
||||||
|
ZipFile.ExtractToDirectory(resourcePackagePath, resourceStagingDirectory, overwriteFiles: true);
|
||||||
|
|
||||||
|
var extractedRoot = Directory.GetDirectories(resourceStagingDirectory).FirstOrDefault() ?? resourceStagingDirectory;
|
||||||
|
var excelOutputSource = Path.Combine(extractedRoot, "ExcelOutput");
|
||||||
|
if (!Directory.Exists(excelOutputSource))
|
||||||
|
throw new DirectoryNotFoundException($"ExcelOutput directory was not found in resource package: {excelOutputSource}");
|
||||||
|
|
||||||
|
var excelOutputTarget = Path.Combine(resourceTargetDirectory, "ExcelOutput");
|
||||||
|
Directory.CreateDirectory(excelOutputTarget);
|
||||||
|
CopyDirectory(excelOutputSource, excelOutputTarget);
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<CETCompat>false</CETCompat>
|
<CETCompat>false</CETCompat>
|
||||||
<RootNamespace>MikuSB.MikuSB</RootNamespace>
|
<RootNamespace>MikuSB.MikuSB</RootNamespace>
|
||||||
<AssemblyName>MikuSB</AssemblyName>
|
<AssemblyName>MikuSB</AssemblyName>
|
||||||
<ApplicationIcon>Source\Kiana.ico</ApplicationIcon>
|
<ApplicationIcon>Source\Snowbreak.ico</ApplicationIcon>
|
||||||
<SatelliteResourceLanguages>false</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>false</SatelliteResourceLanguages>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using MikuSB.GameServer.Server.CallGS;
|
|||||||
using MikuSB.GameServer.Server.Packet;
|
using MikuSB.GameServer.Server.Packet;
|
||||||
using MikuSB.Internationalization;
|
using MikuSB.Internationalization;
|
||||||
using MikuSB.MikuSB.Tool;
|
using MikuSB.MikuSB.Tool;
|
||||||
|
using MikuSB.MikuSB.Update;
|
||||||
using MikuSB.Proto;
|
using MikuSB.Proto;
|
||||||
using MikuSB.SdkServer;
|
using MikuSB.SdkServer;
|
||||||
using MikuSB.TcpSharp;
|
using MikuSB.TcpSharp;
|
||||||
@@ -146,6 +147,7 @@ public class LoaderManager : MikuSB
|
|||||||
// Load the game data
|
// Load the game data
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
await UpdateService.EnsureResourcesPresentAsync();
|
||||||
Logger.Info(I18NManager.Translate("Server.ServerInfo.LoadingItem", I18NManager.Translate("Word.GameData")));
|
Logger.Info(I18NManager.Translate("Server.ServerInfo.LoadingItem", I18NManager.Translate("Word.GameData")));
|
||||||
ResourceManager.LoadGameData();
|
ResourceManager.LoadGameData();
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 422 KiB |
BIN
MikuSB/Source/Snowbreak.ico
Normal file
BIN
MikuSB/Source/Snowbreak.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
@@ -1,6 +1,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
|
using System.IO.Compression;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using MikuSB.Util;
|
using MikuSB.Util;
|
||||||
@@ -12,10 +13,17 @@ public static class UpdateService
|
|||||||
private static readonly Logger Logger = new("Updater");
|
private static readonly Logger Logger = new("Updater");
|
||||||
private static readonly bool UpdateEnabled = true;
|
private static readonly bool UpdateEnabled = true;
|
||||||
private static readonly bool AskBeforeUpdate = true;
|
private static readonly bool AskBeforeUpdate = true;
|
||||||
private static readonly string RepositoryOwner = "DevilProMT";
|
private static readonly string RepositoryOwner = "MikuLeaks";
|
||||||
private static readonly string RepositoryName = "MikuSB";
|
private static readonly string RepositoryName = "MikuSB";
|
||||||
private static readonly string AssetName = "MikuSB-win-x64.zip";
|
private static readonly string AssetName = "MikuSB-win-x64.zip";
|
||||||
private static readonly int TimeoutSeconds = 5;
|
private static readonly int TimeoutSeconds = 5;
|
||||||
|
private static readonly string ResourceArchiveUrl =
|
||||||
|
"https://github.com/Kei-Luna/MikuSB-Resource/archive/refs/heads/main.zip";
|
||||||
|
private static readonly string[] RequiredResourceFiles =
|
||||||
|
[
|
||||||
|
"card.json",
|
||||||
|
"weapon.json"
|
||||||
|
];
|
||||||
|
|
||||||
public static async Task<bool> TryStartSelfUpdateAsync()
|
public static async Task<bool> TryStartSelfUpdateAsync()
|
||||||
{
|
{
|
||||||
@@ -72,6 +80,10 @@ public static class UpdateService
|
|||||||
Logger.Info($"Downloading update {release.TagName}.");
|
Logger.Info($"Downloading update {release.TagName}.");
|
||||||
await DownloadFileAsync(client, asset.DownloadUrl, packagePath, cts.Token);
|
await DownloadFileAsync(client, asset.DownloadUrl, packagePath, cts.Token);
|
||||||
|
|
||||||
|
var resourcePackagePath = Path.Combine(tempRoot, "MikuSB-Resource-main.zip");
|
||||||
|
Logger.Info("Downloading resource package.");
|
||||||
|
await DownloadFileAsync(client, ResourceArchiveUrl, resourcePackagePath, cts.Token);
|
||||||
|
|
||||||
var checksumAsset = release.Assets.FirstOrDefault(x =>
|
var checksumAsset = release.Assets.FirstOrDefault(x =>
|
||||||
string.Equals(x.Name, AssetName + ".sha256", StringComparison.OrdinalIgnoreCase));
|
string.Equals(x.Name, AssetName + ".sha256", StringComparison.OrdinalIgnoreCase));
|
||||||
if (checksumAsset != null)
|
if (checksumAsset != null)
|
||||||
@@ -90,7 +102,9 @@ public static class UpdateService
|
|||||||
ArgumentList =
|
ArgumentList =
|
||||||
{
|
{
|
||||||
"--package", packagePath,
|
"--package", packagePath,
|
||||||
|
"--resource-package", resourcePackagePath,
|
||||||
"--target", AppContext.BaseDirectory,
|
"--target", AppContext.BaseDirectory,
|
||||||
|
"--resource-target", Path.Combine(AppContext.BaseDirectory, ConfigManager.Config.Path.ResourcePath),
|
||||||
"--restart", Path.Combine(AppContext.BaseDirectory, "MikuSB.exe"),
|
"--restart", Path.Combine(AppContext.BaseDirectory, "MikuSB.exe"),
|
||||||
"--pid", Environment.ProcessId.ToString()
|
"--pid", Environment.ProcessId.ToString()
|
||||||
}
|
}
|
||||||
@@ -112,6 +126,15 @@ public static class UpdateService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async Task EnsureResourcesPresentAsync()
|
||||||
|
{
|
||||||
|
if (!AreRequiredResourcesPresent())
|
||||||
|
{
|
||||||
|
Logger.Warn("Required resources are missing. Downloading resource package.");
|
||||||
|
await DownloadAndInstallResourcesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static string StageUpdaterExecutable()
|
private static string StageUpdaterExecutable()
|
||||||
{
|
{
|
||||||
var sourceDirectory = AppContext.BaseDirectory;
|
var sourceDirectory = AppContext.BaseDirectory;
|
||||||
@@ -131,6 +154,45 @@ public static class UpdateService
|
|||||||
return stagedUpdaterPath;
|
return stagedUpdaterPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool AreRequiredResourcesPresent()
|
||||||
|
{
|
||||||
|
var excelOutputPath = Path.Combine(AppContext.BaseDirectory, ConfigManager.Config.Path.ResourcePath, "ExcelOutput");
|
||||||
|
if (!Directory.Exists(excelOutputPath))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return RequiredResourceFiles.All(fileName => File.Exists(Path.Combine(excelOutputPath, fileName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task DownloadAndInstallResourcesAsync()
|
||||||
|
{
|
||||||
|
using var client = CreateHttpClient();
|
||||||
|
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(Math.Max(1, TimeoutSeconds)));
|
||||||
|
var tempRoot = Path.Combine(Path.GetTempPath(), "MikuSB", "resources", Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(tempRoot);
|
||||||
|
|
||||||
|
var resourcePackagePath = Path.Combine(tempRoot, "MikuSB-Resource-main.zip");
|
||||||
|
await DownloadFileAsync(client, ResourceArchiveUrl, resourcePackagePath, cts.Token);
|
||||||
|
InstallResourcesFromArchive(resourcePackagePath,
|
||||||
|
Path.Combine(AppContext.BaseDirectory, ConfigManager.Config.Path.ResourcePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void InstallResourcesFromArchive(string resourcePackagePath, string resourceTargetDirectory)
|
||||||
|
{
|
||||||
|
var resourceStagingDirectory = Path.Combine(Path.GetTempPath(), "MikuSB", "resource-staging", Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(resourceStagingDirectory);
|
||||||
|
|
||||||
|
ZipFile.ExtractToDirectory(resourcePackagePath, resourceStagingDirectory, overwriteFiles: true);
|
||||||
|
|
||||||
|
var extractedRoot = Directory.GetDirectories(resourceStagingDirectory).FirstOrDefault() ?? resourceStagingDirectory;
|
||||||
|
var excelOutputSource = Path.Combine(extractedRoot, "ExcelOutput");
|
||||||
|
if (!Directory.Exists(excelOutputSource))
|
||||||
|
throw new DirectoryNotFoundException($"ExcelOutput directory was not found in resource package: {excelOutputSource}");
|
||||||
|
|
||||||
|
var excelOutputTarget = Path.Combine(resourceTargetDirectory, "ExcelOutput");
|
||||||
|
Directory.CreateDirectory(excelOutputTarget);
|
||||||
|
CopyDirectory(excelOutputSource, excelOutputTarget);
|
||||||
|
}
|
||||||
|
|
||||||
private static bool ConfirmUpdate(string latestVersion)
|
private static bool ConfirmUpdate(string latestVersion)
|
||||||
{
|
{
|
||||||
Console.Write($"New version found: {BuildVersion.Current} -> {latestVersion}. Update now? [Y/n]: ");
|
Console.Write($"New version found: {BuildVersion.Current} -> {latestVersion}. Update now? [Y/n]: ");
|
||||||
@@ -199,6 +261,23 @@ public static class UpdateService
|
|||||||
await source.CopyToAsync(destination, cancellationToken);
|
await source.CopyToAsync(destination, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void CopyDirectory(string sourceDirectory, string targetDirectory)
|
||||||
|
{
|
||||||
|
foreach (var directory in Directory.GetDirectories(sourceDirectory, "*", SearchOption.AllDirectories))
|
||||||
|
{
|
||||||
|
var relativePath = Path.GetRelativePath(sourceDirectory, directory);
|
||||||
|
Directory.CreateDirectory(Path.Combine(targetDirectory, relativePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var file in Directory.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories))
|
||||||
|
{
|
||||||
|
var relativePath = Path.GetRelativePath(sourceDirectory, file);
|
||||||
|
var destinationPath = Path.Combine(targetDirectory, relativePath);
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
|
||||||
|
File.Copy(file, destinationPath, overwrite: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void VerifySha256(string packagePath, string checksumPath)
|
private static void VerifySha256(string packagePath, string checksumPath)
|
||||||
{
|
{
|
||||||
var expected = File.ReadAllText(checksumPath).Split(' ', StringSplitOptions.RemoveEmptyEntries)[0].Trim();
|
var expected = File.ReadAllText(checksumPath).Split(' ', StringSplitOptions.RemoveEmptyEntries)[0].Trim();
|
||||||
|
|||||||
11020
Proto/Core.cs
Normal file
11020
Proto/Core.cs
Normal file
File diff suppressed because it is too large
Load Diff
302
Proto/Core.proto
302
Proto/Core.proto
@@ -1,302 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package Core;
|
|
||||||
|
|
||||||
option csharp_namespace = "MikuSB.Proto";
|
|
||||||
|
|
||||||
enum Sex {
|
|
||||||
MALE = 0;
|
|
||||||
FEMALE = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum PlayerCoreAttribute {
|
|
||||||
LEVEL = 0;
|
|
||||||
EXP = 1;
|
|
||||||
VIGOR = 2;
|
|
||||||
CHARGED = 3;
|
|
||||||
VIGOR_TIME = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum MailStat {
|
|
||||||
New = 0;
|
|
||||||
Readed = 1;
|
|
||||||
Geted = 2;
|
|
||||||
Removed = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum GlobalMailStat {
|
|
||||||
Default = 0;
|
|
||||||
Banned = 1;
|
|
||||||
Deleted = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum ChatType {
|
|
||||||
SYSTEM = 0;
|
|
||||||
WORLD = 1;
|
|
||||||
FRIEND = 2;
|
|
||||||
ONLINE = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Empty {
|
|
||||||
}
|
|
||||||
|
|
||||||
message SimpleBoolean {
|
|
||||||
bool data = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SimpleUint {
|
|
||||||
uint64 data = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SimpleString {
|
|
||||||
string data = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message IDArray {
|
|
||||||
repeated uint64 ids = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message StringArray {
|
|
||||||
repeated string list = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message PlayerProfileArray {
|
|
||||||
repeated PlayerProfile list = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ChannelOpt {
|
|
||||||
string channel = 1;
|
|
||||||
repeated string subchannels = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SimpleItem {
|
|
||||||
uint32 G = 1;
|
|
||||||
uint32 D = 2;
|
|
||||||
uint32 P = 3;
|
|
||||||
uint32 L = 4;
|
|
||||||
uint32 Count = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Enhance {
|
|
||||||
uint32 level = 1;
|
|
||||||
uint32 exp = 2;
|
|
||||||
uint32 break = 3;
|
|
||||||
uint32 evolue = 4;
|
|
||||||
uint32 trust = 5;
|
|
||||||
uint32 pro_level = 6;
|
|
||||||
repeated uint64 spines = 11;
|
|
||||||
repeated uint32 affixs = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Item {
|
|
||||||
uint64 id = 1;
|
|
||||||
uint64 template = 2;
|
|
||||||
uint32 count = 3;
|
|
||||||
uint32 flag = 4;
|
|
||||||
uint32 userdata = 5;
|
|
||||||
uint32 expiration = 6;
|
|
||||||
Enhance enhance = 7;
|
|
||||||
map<uint32, uint64> slots = 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Lineup {
|
|
||||||
uint32 index = 1;
|
|
||||||
string name = 2;
|
|
||||||
uint64 member1 = 3;
|
|
||||||
uint64 member2 = 4;
|
|
||||||
uint64 member3 = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Player {
|
|
||||||
uint64 pid = 1;
|
|
||||||
string account = 2;
|
|
||||||
string provider = 3;
|
|
||||||
string channel = 4;
|
|
||||||
string subchannel = 5;
|
|
||||||
string name = 11;
|
|
||||||
string sign = 12;
|
|
||||||
Sex sex = 13;
|
|
||||||
uint32 level = 14;
|
|
||||||
uint32 exp = 15;
|
|
||||||
uint32 vigor = 16;
|
|
||||||
map<string, int32> money = 17;
|
|
||||||
uint32 charged = 18;
|
|
||||||
uint32 create_time = 31;
|
|
||||||
uint32 last_login_time = 32;
|
|
||||||
uint32 last_vigor_time = 33;
|
|
||||||
uint64 item_id_alloc = 41;
|
|
||||||
repeated Item items = 42;
|
|
||||||
repeated Lineup solutions = 43;
|
|
||||||
map<uint32, uint32> attrs = 44;
|
|
||||||
map<uint32, string> str_attrs = 45;
|
|
||||||
repeated uint64 show_items = 46;
|
|
||||||
repeated uint32 show_attrs = 47;
|
|
||||||
map<uint64, FriendPieces> friend_pieces = 48;
|
|
||||||
uint64 last_pieces = 49;
|
|
||||||
map<uint64, PlayerMail> mail_box = 50;
|
|
||||||
uint32 last_global_mail_time = 51;
|
|
||||||
uint64 last_person_mid = 52;
|
|
||||||
repeated uint64 badges = 53;
|
|
||||||
map<string, PlayerOrder> order_box = 60;
|
|
||||||
repeated uint64 tags = 96;
|
|
||||||
uint64 serial = 97;
|
|
||||||
uint32 ban_type = 98;
|
|
||||||
uint32 ban_expr = 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
message FriendPieces {
|
|
||||||
uint64 index = 1;
|
|
||||||
uint64 pid = 2;
|
|
||||||
uint32 shape = 3;
|
|
||||||
uint32 expr = 4;
|
|
||||||
bool deleted = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message PlayerMail {
|
|
||||||
uint64 mid = 1;
|
|
||||||
MailStat stat = 2;
|
|
||||||
uint32 time = 3;
|
|
||||||
uint32 expiration = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Mail {
|
|
||||||
uint64 mid = 1;
|
|
||||||
string title = 2;
|
|
||||||
string message = 3;
|
|
||||||
repeated SimpleItem attachments = 4;
|
|
||||||
string sender = 5;
|
|
||||||
uint64 pid = 6;
|
|
||||||
uint32 time = 7;
|
|
||||||
uint32 expiration = 8;
|
|
||||||
uint32 life = 9;
|
|
||||||
MailStat stat = 10;
|
|
||||||
bool is_deleted = 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GlobalMail {
|
|
||||||
uint64 mid = 1;
|
|
||||||
string sender = 2;
|
|
||||||
string title = 3;
|
|
||||||
string message = 4;
|
|
||||||
repeated SimpleItem attachments = 5;
|
|
||||||
uint32 start_time = 6;
|
|
||||||
uint32 end_time = 7;
|
|
||||||
uint32 life = 8;
|
|
||||||
uint32 expiration = 9;
|
|
||||||
uint32 min_level = 10;
|
|
||||||
uint32 max_level = 12;
|
|
||||||
uint32 create_begin = 13;
|
|
||||||
uint32 create_end = 14;
|
|
||||||
repeated ChannelOpt channels = 15;
|
|
||||||
GlobalMailStat stat = 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Order {
|
|
||||||
string trade_no = 1;
|
|
||||||
string third_trade_no = 2;
|
|
||||||
uint64 pid = 3;
|
|
||||||
string product_id = 4;
|
|
||||||
uint32 product_quantity = 5;
|
|
||||||
uint32 total_price = 6;
|
|
||||||
uint32 paid_price = 7;
|
|
||||||
string finish_time = 8;
|
|
||||||
bool status = 9;
|
|
||||||
bool refund_status = 10;
|
|
||||||
string refund_time = 11;
|
|
||||||
string subchannel = 12;
|
|
||||||
string priceunit = 13;
|
|
||||||
bool supplement_status = 14;
|
|
||||||
string extendinfo = 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
message PlayerOrder {
|
|
||||||
string trade_no = 1;
|
|
||||||
string subchannel = 2;
|
|
||||||
uint32 done_time = 3;
|
|
||||||
uint32 refund_time = 4;
|
|
||||||
bool is_unreal = 5;
|
|
||||||
uint32 supplement = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message PlayerProfile {
|
|
||||||
uint64 pid = 1;
|
|
||||||
string account = 2;
|
|
||||||
uint32 create_time = 3;
|
|
||||||
string name = 4;
|
|
||||||
string sign = 5;
|
|
||||||
Sex sex = 6;
|
|
||||||
uint32 level = 7;
|
|
||||||
uint32 logout_time = 8;
|
|
||||||
uint32 friend_count = 9;
|
|
||||||
repeated Item show_items = 10;
|
|
||||||
repeated uint32 show_attrs = 11;
|
|
||||||
repeated Item badges = 12;
|
|
||||||
repeated uint64 tags = 13;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ClientProfile {
|
|
||||||
uint32 plat_id = 1;
|
|
||||||
string version = 2;
|
|
||||||
string os_version = 3;
|
|
||||||
string os_hardware = 4;
|
|
||||||
string telecom_oper = 5;
|
|
||||||
string network = 6;
|
|
||||||
uint32 screen_width = 7;
|
|
||||||
uint32 screen_height = 8;
|
|
||||||
float density = 9;
|
|
||||||
string cpu_profile = 10;
|
|
||||||
uint32 ram = 11;
|
|
||||||
string gl_render = 12;
|
|
||||||
string gl_version = 13;
|
|
||||||
string device_id = 14;
|
|
||||||
string resource_version = 15;
|
|
||||||
string language = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OnlinePlayer {
|
|
||||||
uint64 pid = 1;
|
|
||||||
string name = 2;
|
|
||||||
uint64 face = 3;
|
|
||||||
uint64 faceframe = 4;
|
|
||||||
uint32 level = 5;
|
|
||||||
Lineup lineup = 6;
|
|
||||||
repeated Item items = 7;
|
|
||||||
bool captain = 8;
|
|
||||||
uint32 stateflag = 9;
|
|
||||||
repeated uint32 girllovelevel = 10;
|
|
||||||
map<uint32, uint32> attrs = 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OnlineEndData {
|
|
||||||
uint64 pid = 1;
|
|
||||||
string infodata = 2;
|
|
||||||
uint32 status = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message AccountInfo {
|
|
||||||
string account = 1;
|
|
||||||
uint64 pid = 2;
|
|
||||||
uint32 new_guide = 3;
|
|
||||||
repeated uint32 error_info = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ChatMsg {
|
|
||||||
ChatType type = 1;
|
|
||||||
uint32 channel_id = 2;
|
|
||||||
uint64 sender = 3;
|
|
||||||
uint64 recver = 4;
|
|
||||||
uint32 time_stamp = 5;
|
|
||||||
uint64 emoji = 11;
|
|
||||||
string text = 12;
|
|
||||||
PlayerProfile profile = 21;
|
|
||||||
}
|
|
||||||
|
|
||||||
message CustomRoster {
|
|
||||||
uint64 pid = 1;
|
|
||||||
map<string, string> roster = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GlobalAttrs {
|
|
||||||
map<string, uint32> attrs = 1;
|
|
||||||
map<string, string> str_attrs = 2;
|
|
||||||
}
|
|
||||||
10814
Proto/SnowBreak.cs
Normal file
10814
Proto/SnowBreak.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,381 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package snowbreak;
|
|
||||||
|
|
||||||
import "Core.proto";
|
|
||||||
|
|
||||||
option csharp_namespace = "MikuSB.Proto";
|
|
||||||
|
|
||||||
enum PF {
|
|
||||||
NONE = 0;
|
|
||||||
REQ_LOGIN = 1;
|
|
||||||
RSP_LOGIN = 2;
|
|
||||||
REQ_RECONNECT = 3;
|
|
||||||
RSP_RECONNECT = 4;
|
|
||||||
REQ_RENAME = 5;
|
|
||||||
RSP_RENAME = 6;
|
|
||||||
REQ_CALLGS = 7;
|
|
||||||
RSP_CALLGS = 8;
|
|
||||||
REQ_USEITEM = 9;
|
|
||||||
RSP_USEITEM = 10;
|
|
||||||
REQ_READMAIL = 11;
|
|
||||||
RSP_READMAIL = 12;
|
|
||||||
REQ_MAIL_ATTACHMENT = 13;
|
|
||||||
RSP_MAIL_ATTACHMENT = 14;
|
|
||||||
REQ_DELMAIL = 15;
|
|
||||||
RSP_DELMAIL = 16;
|
|
||||||
REQ_SET_NEWGUIDE = 17;
|
|
||||||
RSP_SET_NEWGUIDE = 18;
|
|
||||||
REQ_ACCOUNTINFO = 19;
|
|
||||||
RSP_ACCOUNTINFO = 20;
|
|
||||||
REQ_RESIGN = 23;
|
|
||||||
RSP_RESIGN = 24;
|
|
||||||
REQ_RECORD = 25;
|
|
||||||
RSP_RECORD = 26;
|
|
||||||
REQ_ADD_FRIENDREQ = 27;
|
|
||||||
RSP_ADD_FRIENDREQ = 28;
|
|
||||||
REQ_AGREE_FRIENDREQ = 29;
|
|
||||||
RSP_AGREE_FRIENDREQ = 30;
|
|
||||||
REQ_REFUSE_FRIENDREQ = 31;
|
|
||||||
RSP_REFUSE_FRIENDREQ = 32;
|
|
||||||
REQ_REMOVE_FRIEND = 33;
|
|
||||||
RSP_REMOVE_FRIEND = 34;
|
|
||||||
REQ_GIVE_FRIENDVIGOR = 35;
|
|
||||||
RSP_GIVE_FRIENDVIGOR = 36;
|
|
||||||
REQ_RECV_FRIENDVIGOR = 37;
|
|
||||||
RSP_RECV_FRIENDVIGOR = 38;
|
|
||||||
REQ_PLAYER_RECOMMEND = 39;
|
|
||||||
RSP_PLAYER_RECOMMEND = 40;
|
|
||||||
REQ_ADD_BLOCKLIST = 41;
|
|
||||||
RSP_ADD_BLOCKLIST = 42;
|
|
||||||
REQ_DEL_BLOCKLIST = 43;
|
|
||||||
RSP_DEL_BLOCKLIST = 44;
|
|
||||||
REQ_FIND_PLAYER = 45;
|
|
||||||
RSP_FIND_PLAYER = 46;
|
|
||||||
REQ_PLAYER_PROFILE = 47;
|
|
||||||
RSP_PLAYER_PROFILE = 48;
|
|
||||||
REQ_GET_VERSION = 49;
|
|
||||||
RSP_GET_VERSION = 50;
|
|
||||||
REQ_RANKLIST = 51;
|
|
||||||
RSP_RANKLIST = 52;
|
|
||||||
REQ_RANK = 53;
|
|
||||||
RSP_RANK = 54;
|
|
||||||
REQ_BLOCK_FRIENDREQ = 55;
|
|
||||||
RSP_BLOCK_FRIENDREQ = 56;
|
|
||||||
REQ_WORD_FILTER = 57;
|
|
||||||
RSP_WORD_FILTER = 58;
|
|
||||||
REQ_SET_CUSTOMROSTER = 59;
|
|
||||||
RSP_SET_CUSTOMROSTER = 60;
|
|
||||||
REQ_GLOBALCOUNTER = 61;
|
|
||||||
RSP_GLOBALCOUNTER = 62;
|
|
||||||
REQ_MATCH = 301;
|
|
||||||
RSP_MATCH = 302;
|
|
||||||
REQ_ONLINE_ROOM = 303;
|
|
||||||
RSP_ONLINE_ROOM = 304;
|
|
||||||
REQ_ONLINE_ROOM_START = 305;
|
|
||||||
RSP_ONLINE_ROOM_START = 306;
|
|
||||||
REQ_ONLINE_ROOM_EXIT = 307;
|
|
||||||
RSP_ONLINE_ROOM_EXIT = 308;
|
|
||||||
REQ_ONLINE_ROOM_INVITE = 309;
|
|
||||||
RSP_ONLINE_ROOM_INVITE = 310;
|
|
||||||
REQ_ONLINE_ROOM_ACCEPT = 311;
|
|
||||||
RSP_ONLINE_ROOM_ACCEPT = 312;
|
|
||||||
REQ_ONLINE_ROOM_UPDATE = 313;
|
|
||||||
RSP_ONLINE_ROOM_UPDATE = 314;
|
|
||||||
REQ_ONLINE_ROOM_RECONNECT = 315;
|
|
||||||
RSP_ONLINE_ROOM_RECONNECT = 316;
|
|
||||||
REQ_ONLINE_ROOM_CHATACCEPT = 317;
|
|
||||||
RSP_ONLINE_ROOM_CHATACCEPT = 318;
|
|
||||||
REQ_ONLINE_ROOM_UPDATEMAP = 319;
|
|
||||||
RSP_ONLINE_ROOM_UPDATEMAP = 320;
|
|
||||||
REQ_CHANGE_WORLD_CHANNEL = 321;
|
|
||||||
RSP_CHANGE_WORLD_CHANNEL = 322;
|
|
||||||
REQ_WORLD_CHAT = 323;
|
|
||||||
RSP_WORLD_CHAT = 324;
|
|
||||||
REQ_FRIEND_CHAT = 325;
|
|
||||||
RSP_FRIEND_CHAT = 326;
|
|
||||||
REQ_ONLINE_CHAT = 327;
|
|
||||||
RSP_ONLINE_CHAT = 328;
|
|
||||||
REQ_ONLINE_RECRUIT = 329;
|
|
||||||
RSP_ONLINE_RECRUIT = 330;
|
|
||||||
NTF_LOG = 1001;
|
|
||||||
NTF_KICKOUT = 1002;
|
|
||||||
NTF_BROADCAST = 1003;
|
|
||||||
NTF_SYNCATTR = 1004;
|
|
||||||
NTF_SYNCLINEUP = 1005;
|
|
||||||
NTF_SYNC_NEW_MAIL = 1006;
|
|
||||||
NTF_SYNC_DEL_MAIL = 1007;
|
|
||||||
NTF_PLAYERMSG = 1008;
|
|
||||||
NTF_LOGOUT = 1009;
|
|
||||||
NTF_SCRIPT = 1010;
|
|
||||||
NTF_SETATTR = 1011;
|
|
||||||
NTF_SETSTRATTR = 1012;
|
|
||||||
NTF_ONLINE_START = 1013;
|
|
||||||
NTF_ONLINE_OVER = 1014;
|
|
||||||
NTF_READITEM = 1015;
|
|
||||||
NTF_UPDATE_FRIEND = 1016;
|
|
||||||
NTF_DEL_FRIEND = 1017;
|
|
||||||
NTF_FRIEND_REQ = 1018;
|
|
||||||
NTF_FRIEND_VIGOR = 1019;
|
|
||||||
NTF_BLACKLIST = 1020;
|
|
||||||
NTF_GLOBALATTRS = 1021;
|
|
||||||
NTF_ANTI_DATA = 1022;
|
|
||||||
NTF_BLOCK_FRIENDREQ = 1023;
|
|
||||||
NTF_CUSTOMROSTER = 1024;
|
|
||||||
NTF_ONLINE_ROOMINFO = 1031;
|
|
||||||
NTF_ONLINE_LOAD = 1032;
|
|
||||||
NTF_ONLINE_KICKOUT = 1033;
|
|
||||||
NTF_ONLINE_INVITE = 1034;
|
|
||||||
NTF_ONLINE_STATE = 1035;
|
|
||||||
NTF_WORLD_CHAT = 1041;
|
|
||||||
NTF_FRIEND_CHAT = 1042;
|
|
||||||
NTF_ONLINE_CHAT = 1043;
|
|
||||||
NTF_ONLINE_RECRUIT = 1044;
|
|
||||||
NTF_ONLINE_PLAYERCHEAT = 1045;
|
|
||||||
REQ_ROOM_START = 2001;
|
|
||||||
RSP_ROOM_START = 2002;
|
|
||||||
NTF_ROOM_READY = 2003;
|
|
||||||
NTF_ROOM_OVER = 2004;
|
|
||||||
NTF_STOP_ROOM = 2005;
|
|
||||||
NTF_ROOM_PLAYEREXIT = 2006;
|
|
||||||
NTF_ROOM_PLAYERCHEAT = 2007;
|
|
||||||
NTF_ROOM_PLAYERFINAL = 2008;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqLogin {
|
|
||||||
string provider = 1;
|
|
||||||
string token = 2;
|
|
||||||
Core.ClientProfile client_profile = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RspLogin {
|
|
||||||
string session_id = 1;
|
|
||||||
Core.Player data = 2;
|
|
||||||
bool need_rename = 3;
|
|
||||||
uint32 area_id = 4;
|
|
||||||
int32 time_zone = 5;
|
|
||||||
uint32 timestamp = 6;
|
|
||||||
int32 certification = 7;
|
|
||||||
map<string, uint32> global_attrs = 8;
|
|
||||||
uint32 world_channel = 9;
|
|
||||||
map<string, string> global_str_attrs = 10;
|
|
||||||
uint32 error_code = 98;
|
|
||||||
repeated uint32 error_info = 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqReconnect {
|
|
||||||
uint64 pid = 1;
|
|
||||||
string session_id = 2;
|
|
||||||
uint32 world_channel = 3;
|
|
||||||
string language = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RspReconnect {
|
|
||||||
string session_id = 1;
|
|
||||||
Core.Player data = 2;
|
|
||||||
bool need_rename = 3;
|
|
||||||
int32 time_zone = 4;
|
|
||||||
uint32 timestamp = 5;
|
|
||||||
uint32 world_channel = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqAccountInfo {
|
|
||||||
string provider = 1;
|
|
||||||
string token = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqCallGS {
|
|
||||||
string api = 1;
|
|
||||||
string param = 2;
|
|
||||||
uint32 clicknum = 3;
|
|
||||||
repeated string dependent_params = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqUseItem {
|
|
||||||
uint64 id = 1;
|
|
||||||
uint32 count = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqOnlineCreateRoom {
|
|
||||||
uint32 onlineid = 1;
|
|
||||||
uint32 lineup_index = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RspOnlineCreateRoom {
|
|
||||||
uint32 onlineid = 1;
|
|
||||||
uint32 lineup_index = 2;
|
|
||||||
uint64 roomid = 3;
|
|
||||||
repeated uint32 buffinfo = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqOnlineAccept {
|
|
||||||
uint64 otherid = 1;
|
|
||||||
uint32 onlineid = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqOnlineChatAccept {
|
|
||||||
uint64 otherid = 1;
|
|
||||||
uint32 onlineid = 2;
|
|
||||||
uint64 roomid = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqOnlineRecruit {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
uint32 online_id = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message FriendVigor {
|
|
||||||
uint64 pid = 1;
|
|
||||||
bool have_vigor = 2;
|
|
||||||
bool vigor_got = 3;
|
|
||||||
bool return_vigor = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message FriendVigorList {
|
|
||||||
repeated FriendVigor list = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RankList {
|
|
||||||
message ListItem {
|
|
||||||
string member_name = 1;
|
|
||||||
uint32 score = 2;
|
|
||||||
string info = 3;
|
|
||||||
}
|
|
||||||
string rank_name = 1;
|
|
||||||
repeated RankList.ListItem list = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RankInfo {
|
|
||||||
uint32 score = 1;
|
|
||||||
uint32 rank = 2;
|
|
||||||
uint32 sum = 3;
|
|
||||||
string info = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GlobalCounterInfo {
|
|
||||||
string counter_name = 1;
|
|
||||||
uint32 value = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfLog {
|
|
||||||
string action = 1;
|
|
||||||
string detail = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfBroadcast {
|
|
||||||
string msg = 1;
|
|
||||||
uint32 duration = 2;
|
|
||||||
uint32 start_time = 3;
|
|
||||||
uint32 end_time = 4;
|
|
||||||
bool clean = 5;
|
|
||||||
repeated Core.ChannelOpt channels = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfSyncPlayer {
|
|
||||||
string sign = 1;
|
|
||||||
map<uint32, uint32> core = 2;
|
|
||||||
map<uint32, uint32> custom = 3;
|
|
||||||
map<uint32, string> custom_str = 4;
|
|
||||||
repeated Core.Item items = 5;
|
|
||||||
repeated uint64 show_items = 6;
|
|
||||||
repeated uint32 show_attrs = 7;
|
|
||||||
map<string, int32> money = 8;
|
|
||||||
repeated Core.FriendPieces pieces = 9;
|
|
||||||
repeated uint64 badges = 10;
|
|
||||||
repeated uint64 tags = 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfSyncLineup {
|
|
||||||
Core.Lineup lineup = 1;
|
|
||||||
bool remove = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfCallScript {
|
|
||||||
string api = 1;
|
|
||||||
string arg = 2;
|
|
||||||
NtfSyncPlayer extra_sync = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfSetAttr {
|
|
||||||
uint32 gid = 1;
|
|
||||||
uint32 sid = 2;
|
|
||||||
uint32 val = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfSetStrAttr {
|
|
||||||
uint32 gid = 1;
|
|
||||||
uint32 sid = 2;
|
|
||||||
string val = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfOnlineStart {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
string room_addr = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfOnlineRoom {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
uint32 onlineid = 2;
|
|
||||||
repeated Core.OnlinePlayer players = 3;
|
|
||||||
bool bmatch = 4;
|
|
||||||
repeated uint32 buffinfo = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfOnlineInvite {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
uint32 onlineid = 2;
|
|
||||||
uint64 playerid = 3;
|
|
||||||
string name = 4;
|
|
||||||
uint64 face = 5;
|
|
||||||
uint64 faceframe = 6;
|
|
||||||
uint32 level = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfOnlineRecruit {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
uint32 online_id = 2;
|
|
||||||
Core.PlayerProfile sender_profile = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfOnlineState {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
uint32 onlineid = 2;
|
|
||||||
uint32 matchflag = 3;
|
|
||||||
repeated uint64 players = 4;
|
|
||||||
repeated uint32 stateflag = 5;
|
|
||||||
uint64 nowtime = 6;
|
|
||||||
uint64 levelid = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqRoomStart {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
bool is_reday = 2;
|
|
||||||
string error = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RspRoomStart {
|
|
||||||
repeated Core.OnlinePlayer players = 1;
|
|
||||||
repeated uint32 buffinfo = 2;
|
|
||||||
uint32 pollingweek = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfStopRoom {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
string reason = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfRoomOver {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
repeated Core.OnlineEndData playerinfo = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReqAntiData {
|
|
||||||
uint32 data_type = 1;
|
|
||||||
bytes mtpData = 2;
|
|
||||||
int32 plat_id = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NtfRoomPlayerCheat {
|
|
||||||
uint64 room_id = 1;
|
|
||||||
uint64 playerid = 2;
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,7 @@ Snowbreak: Containment Zone private server reimplementation written in C#.
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- .NET SDK 9.0
|
- [.NET SDK 9.0](https://dotnet.microsoft.com/ja-jp/download/dotnet/9.0)
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ English documentation is available in [README.md](README.md).
|
|||||||
|
|
||||||
## 要件
|
## 要件
|
||||||
|
|
||||||
- .NET SDK 9.0
|
- [.NET SDK 9.0](https://dotnet.microsoft.com/ja-jp/download/dotnet/9.0)
|
||||||
|
|
||||||
## 起動方法
|
## 起動方法
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v=0.3
|
v=0.6
|
||||||
Reference in New Issue
Block a user