mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-12 22:44:36 +01:00
implement basic gacha ( no droprates yet)
This commit is contained in:
@@ -34,6 +34,10 @@ public static class Data
|
||||
[LoadData("item_data_statistics.json", LoadDataType.ShareCfgData)]
|
||||
public static Dictionary<int, ItemDataStatistics> ItemDataStatistics { get; private set; } = null!;
|
||||
|
||||
[LoadData("activity_ship_create.json", LoadDataType.ShareCfg)]
|
||||
public static Dictionary<uint, ActivityShipCreate> ActivityShipCreate { get; private set; } = null!;
|
||||
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
foreach (var prop in typeof(Data).GetProperties().Where(x => x.GetCustomAttribute<LoadDataAttribute>() is not null))
|
||||
|
||||
23
BLHX.Server.Common/Data/Model/ActivityShipCreate.cs
Normal file
23
BLHX.Server.Common/Data/Model/ActivityShipCreate.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BLHX.Server.Common.Data {
|
||||
public class ActivityShipCreate {
|
||||
[JsonPropertyName("activity_id")]
|
||||
public uint ActivityId { get; set; }
|
||||
|
||||
[JsonPropertyName("create_id")]
|
||||
public uint CreateId { get; set; }
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public uint Id { get; set; }
|
||||
|
||||
[JsonPropertyName("pickup_list")]
|
||||
public uint[] PickupList { get; set; }
|
||||
|
||||
[JsonPropertyName("pickup_num")]
|
||||
public uint PickupNum { get; set; }
|
||||
|
||||
[JsonPropertyName("ratio_display")]
|
||||
public uint[] RatioDisplay { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
Cs10026 = 10026,
|
||||
Cs10100 = 10100,
|
||||
Cs10800 = 10800,
|
||||
Cs10992 = 10992,
|
||||
Cs10993 = 10993,
|
||||
Cs10994 = 10994,
|
||||
Cs10996 = 10996,
|
||||
|
||||
@@ -6,12 +6,10 @@
|
||||
|
||||
#region Designer generated code
|
||||
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
|
||||
namespace BLHX.Server.Common.Proto.p10
|
||||
{
|
||||
namespace BLHX.Server.Common.Proto.p10 {
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10001")]
|
||||
public partial class Cs10001 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10001 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -28,8 +26,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10020")]
|
||||
public partial class Cs10020 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10020 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -42,8 +39,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
|
||||
[global::ProtoBuf.ProtoMember(3, Name = @"arg2")]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public string Arg2
|
||||
{
|
||||
public string Arg2 {
|
||||
get => __pbn__Arg2 ?? "";
|
||||
set => __pbn__Arg2 = value;
|
||||
}
|
||||
@@ -53,8 +49,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
|
||||
[global::ProtoBuf.ProtoMember(4, Name = @"arg3")]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public string Arg3
|
||||
{
|
||||
public string Arg3 {
|
||||
get => __pbn__Arg3 ?? "";
|
||||
set => __pbn__Arg3 = value;
|
||||
}
|
||||
@@ -64,8 +59,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
|
||||
[global::ProtoBuf.ProtoMember(5, Name = @"arg4")]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public string Arg4
|
||||
{
|
||||
public string Arg4 {
|
||||
get => __pbn__Arg4 ?? "";
|
||||
set => __pbn__Arg4 = value;
|
||||
}
|
||||
@@ -77,8 +71,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
public string CheckKey { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(7, Name = @"device")]
|
||||
public uint Device
|
||||
{
|
||||
public uint Device {
|
||||
get => __pbn__Device.GetValueOrDefault();
|
||||
set => __pbn__Device = value;
|
||||
}
|
||||
@@ -89,8 +82,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10022")]
|
||||
public partial class Cs10022 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10022 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -116,8 +108,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10024")]
|
||||
public partial class Cs10024 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10024 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -134,8 +125,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10026")]
|
||||
public partial class Cs10026 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10026 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -146,8 +136,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10100")]
|
||||
public partial class Cs10100 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10100 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -158,8 +147,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10800")]
|
||||
public partial class Cs10800 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10800 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -172,9 +160,30 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10992")]
|
||||
public partial class Cs10992 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
|
||||
[global::ProtoBuf.ProtoMember(1, Name = @"track_type", IsRequired = true)]
|
||||
public uint TrackType { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(2, Name = @"event_id", IsRequired = true)]
|
||||
public uint EventId { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(3, Name = @"para1", IsRequired = true)]
|
||||
public string Para1 { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(4, Name = @"para2", IsRequired = true)]
|
||||
public string Para2 { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(5, Name = @"para3", IsRequired = true)]
|
||||
public string Para3 { get; set; }
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10993")]
|
||||
public partial class Cs10993 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10993 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -189,8 +198,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
public string ActionDes { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(4, Name = @"action_arg")]
|
||||
public uint ActionArg
|
||||
{
|
||||
public uint ActionArg {
|
||||
get => __pbn__ActionArg.GetValueOrDefault();
|
||||
set => __pbn__ActionArg = value;
|
||||
}
|
||||
@@ -201,8 +209,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10994")]
|
||||
public partial class Cs10994 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10994 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -213,8 +220,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"cs_10996")]
|
||||
public partial class Cs10996 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Cs10996 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -228,8 +234,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"noticeinfo")]
|
||||
public partial class Noticeinfo : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Noticeinfo : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -246,8 +251,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10002")]
|
||||
public partial class Sc10002 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10002 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -258,8 +262,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10021")]
|
||||
public partial class Sc10021 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10021 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -280,8 +283,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
public global::System.Collections.Generic.List<Noticeinfo> NoticeLists { get; set; } = new global::System.Collections.Generic.List<Noticeinfo>();
|
||||
|
||||
[global::ProtoBuf.ProtoMember(6, Name = @"device")]
|
||||
public uint Device
|
||||
{
|
||||
public uint Device {
|
||||
get => __pbn__Device.GetValueOrDefault();
|
||||
set => __pbn__Device = value;
|
||||
}
|
||||
@@ -295,8 +297,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10023")]
|
||||
public partial class Sc10023 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10023 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -311,8 +312,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
public string ServerTicket { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(4, Name = @"server_load")]
|
||||
public uint ServerLoad
|
||||
{
|
||||
public uint ServerLoad {
|
||||
get => __pbn__ServerLoad.GetValueOrDefault();
|
||||
set => __pbn__ServerLoad = value;
|
||||
}
|
||||
@@ -321,8 +321,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
private uint? __pbn__ServerLoad;
|
||||
|
||||
[global::ProtoBuf.ProtoMember(5, Name = @"db_load")]
|
||||
public uint DbLoad
|
||||
{
|
||||
public uint DbLoad {
|
||||
get => __pbn__DbLoad.GetValueOrDefault();
|
||||
set => __pbn__DbLoad = value;
|
||||
}
|
||||
@@ -333,8 +332,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10025")]
|
||||
public partial class Sc10025 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10025 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -348,8 +346,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10027")]
|
||||
public partial class Sc10027 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10027 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -363,8 +360,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10101")]
|
||||
public partial class Sc10101 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10101 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -375,8 +371,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10801")]
|
||||
public partial class Sc10801 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10801 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -395,8 +390,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
|
||||
[global::ProtoBuf.ProtoMember(5, Name = @"proxy_ip")]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public string ProxyIp
|
||||
{
|
||||
public string ProxyIp {
|
||||
get => __pbn__ProxyIp ?? "";
|
||||
set => __pbn__ProxyIp = value;
|
||||
}
|
||||
@@ -405,8 +399,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
private string __pbn__ProxyIp;
|
||||
|
||||
[global::ProtoBuf.ProtoMember(6, Name = @"proxy_port")]
|
||||
public uint ProxyPort
|
||||
{
|
||||
public uint ProxyPort {
|
||||
get => __pbn__ProxyPort.GetValueOrDefault();
|
||||
set => __pbn__ProxyPort = value;
|
||||
}
|
||||
@@ -426,8 +419,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10995")]
|
||||
public partial class Sc10995 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10995 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -438,8 +430,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10997")]
|
||||
public partial class Sc10997 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10997 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -468,8 +459,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10998")]
|
||||
public partial class Sc10998 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10998 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -483,8 +473,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"sc_10999")]
|
||||
public partial class Sc10999 : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Sc10999 : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -495,8 +484,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract(Name = @"serverinfo")]
|
||||
public partial class Serverinfo : global::ProtoBuf.IExtensible
|
||||
{
|
||||
public partial class Serverinfo : global::ProtoBuf.IExtensible {
|
||||
private global::ProtoBuf.IExtension __pbn__extensionData;
|
||||
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
|
||||
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
|
||||
@@ -517,8 +505,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
public string Name { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(6, Name = @"tag_state")]
|
||||
public uint TagState
|
||||
{
|
||||
public uint TagState {
|
||||
get => __pbn__TagState.GetValueOrDefault();
|
||||
set => __pbn__TagState = value;
|
||||
}
|
||||
@@ -527,8 +514,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
private uint? __pbn__TagState;
|
||||
|
||||
[global::ProtoBuf.ProtoMember(7, Name = @"sort")]
|
||||
public uint Sort
|
||||
{
|
||||
public uint Sort {
|
||||
get => __pbn__Sort.GetValueOrDefault();
|
||||
set => __pbn__Sort = value;
|
||||
}
|
||||
@@ -538,8 +524,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
|
||||
[global::ProtoBuf.ProtoMember(8, Name = @"proxy_ip")]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public string ProxyIp
|
||||
{
|
||||
public string ProxyIp {
|
||||
get => __pbn__ProxyIp ?? "";
|
||||
set => __pbn__ProxyIp = value;
|
||||
}
|
||||
@@ -548,8 +533,7 @@ namespace BLHX.Server.Common.Proto.p10
|
||||
private string __pbn__ProxyIp;
|
||||
|
||||
[global::ProtoBuf.ProtoMember(9, Name = @"proxy_port")]
|
||||
public uint ProxyPort
|
||||
{
|
||||
public uint ProxyPort {
|
||||
get => __pbn__ProxyPort.GetValueOrDefault();
|
||||
set => __pbn__ProxyPort = value;
|
||||
}
|
||||
|
||||
272
BLHX.Server.Common/Resources/ShareCfg/activity_ship_create.json
Normal file
272
BLHX.Server.Common/Resources/ShareCfg/activity_ship_create.json
Normal file
@@ -0,0 +1,272 @@
|
||||
{
|
||||
"1": {
|
||||
"activity_id": 30877,
|
||||
"create_id": 7,
|
||||
"id": 1,
|
||||
"pickup_list": [
|
||||
101031,
|
||||
101041,
|
||||
101061,
|
||||
101071,
|
||||
101091,
|
||||
101131,
|
||||
101141,
|
||||
101151,
|
||||
101171,
|
||||
101251,
|
||||
101351,
|
||||
101361,
|
||||
101371,
|
||||
101381,
|
||||
101391,
|
||||
101411,
|
||||
101421,
|
||||
101431,
|
||||
101441,
|
||||
101451,
|
||||
101461,
|
||||
101481,
|
||||
101491,
|
||||
102011,
|
||||
102021,
|
||||
102031,
|
||||
102041,
|
||||
102061,
|
||||
102071,
|
||||
102081,
|
||||
102131,
|
||||
102141,
|
||||
102151,
|
||||
102181,
|
||||
102191,
|
||||
102201,
|
||||
102231,
|
||||
102241,
|
||||
102251,
|
||||
102261,
|
||||
102271,
|
||||
201011,
|
||||
201021,
|
||||
201031,
|
||||
201061,
|
||||
201071,
|
||||
201081,
|
||||
201091,
|
||||
201101,
|
||||
201111,
|
||||
201161,
|
||||
201211,
|
||||
201241,
|
||||
201251,
|
||||
202011,
|
||||
202021,
|
||||
202031,
|
||||
202041,
|
||||
202071,
|
||||
202101,
|
||||
202121,
|
||||
202151,
|
||||
202181,
|
||||
202211,
|
||||
202221,
|
||||
202231,
|
||||
202261,
|
||||
202281,
|
||||
202291,
|
||||
202301,
|
||||
301011,
|
||||
301021,
|
||||
301051,
|
||||
301211,
|
||||
301231,
|
||||
301261,
|
||||
301301,
|
||||
301311,
|
||||
301321,
|
||||
301331,
|
||||
301351,
|
||||
301381,
|
||||
301541,
|
||||
301591,
|
||||
301601,
|
||||
301611,
|
||||
301621,
|
||||
301631,
|
||||
301641,
|
||||
301791,
|
||||
301811,
|
||||
301821,
|
||||
301831,
|
||||
301851,
|
||||
301861,
|
||||
302011,
|
||||
302041,
|
||||
302141,
|
||||
302211,
|
||||
401021,
|
||||
401191,
|
||||
401231,
|
||||
402011,
|
||||
402021,
|
||||
402031,
|
||||
502011,
|
||||
502041,
|
||||
502051,
|
||||
601031,
|
||||
701021,
|
||||
701041,
|
||||
701051,
|
||||
701061,
|
||||
702011,
|
||||
702021,
|
||||
702031,
|
||||
801021,
|
||||
801071,
|
||||
801081,
|
||||
802021,
|
||||
901011,
|
||||
901021,
|
||||
901031
|
||||
],
|
||||
"pickup_num": 2,
|
||||
"ratio_display": [
|
||||
250,
|
||||
250,
|
||||
250,
|
||||
200
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"activity_id": 30877,
|
||||
"create_id": 8,
|
||||
"id": 2,
|
||||
"pickup_list": [
|
||||
100021,
|
||||
101514,
|
||||
105174,
|
||||
107104,
|
||||
118024,
|
||||
199044,
|
||||
205134,
|
||||
207074,
|
||||
299044,
|
||||
299054,
|
||||
301294,
|
||||
303194,
|
||||
305104,
|
||||
307084,
|
||||
399044,
|
||||
399054,
|
||||
405034,
|
||||
405054,
|
||||
499024,
|
||||
499054,
|
||||
499094,
|
||||
718014,
|
||||
899034,
|
||||
900302,
|
||||
900314,
|
||||
900315,
|
||||
900351,
|
||||
900365,
|
||||
900377,
|
||||
900378,
|
||||
900379,
|
||||
900392,
|
||||
900404,
|
||||
900910,
|
||||
900911,
|
||||
900914,
|
||||
900919,
|
||||
900920,
|
||||
900923,
|
||||
900927,
|
||||
900928,
|
||||
900931
|
||||
],
|
||||
"pickup_num": 2,
|
||||
"ratio_display": [
|
||||
250,
|
||||
250,
|
||||
250,
|
||||
200
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"activity_id": 30877,
|
||||
"create_id": 6,
|
||||
"id": 3,
|
||||
"pickup_list": [
|
||||
103011,
|
||||
103031,
|
||||
103041,
|
||||
103051,
|
||||
103061,
|
||||
103071,
|
||||
106011,
|
||||
106021,
|
||||
107011,
|
||||
107021,
|
||||
107031,
|
||||
107041,
|
||||
107051,
|
||||
107061,
|
||||
107071,
|
||||
107091,
|
||||
107111,
|
||||
107381,
|
||||
108051,
|
||||
108071,
|
||||
112011,
|
||||
203011,
|
||||
203021,
|
||||
203031,
|
||||
203041,
|
||||
203051,
|
||||
203061,
|
||||
206011,
|
||||
206031,
|
||||
206041,
|
||||
207021,
|
||||
207031,
|
||||
207041,
|
||||
207051,
|
||||
306071,
|
||||
307071,
|
||||
307091,
|
||||
307101,
|
||||
307111,
|
||||
308011,
|
||||
308021,
|
||||
308031,
|
||||
308041,
|
||||
308051,
|
||||
308061,
|
||||
317011,
|
||||
407011,
|
||||
407021,
|
||||
408011,
|
||||
408021,
|
||||
408041,
|
||||
408051,
|
||||
408061,
|
||||
408071,
|
||||
408081,
|
||||
408091,
|
||||
506011,
|
||||
808011
|
||||
],
|
||||
"pickup_num": 2,
|
||||
"ratio_display": [
|
||||
250,
|
||||
250,
|
||||
250,
|
||||
200
|
||||
]
|
||||
},
|
||||
"all": [
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
public static class RNG
|
||||
{
|
||||
public enum Rarity {
|
||||
Normal = 2,
|
||||
Rare = 3,
|
||||
Elite = 4,
|
||||
SSR = 5,
|
||||
UR = 6,
|
||||
}
|
||||
|
||||
public static readonly SortedDictionary<int, float> ShipRarityRates = new()
|
||||
{
|
||||
{6, 1.2f}, // UR
|
||||
|
||||
@@ -3,6 +3,7 @@ using BLHX.Server.Common.Database;
|
||||
using BLHX.Server.Common.Proto.common;
|
||||
using BLHX.Server.Common.Utils;
|
||||
using BLHX.Server.Game.Handlers;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
namespace BLHX.Server.Game.Commands {
|
||||
[CommandHandler("ship", "Unlock a character or all characters", "ship unlock=all rarity=6")]
|
||||
@@ -33,6 +34,9 @@ namespace BLHX.Server.Game.Commands {
|
||||
|
||||
List<PlayerShip> all_ships = all_ship_ids.Select(ship_id => CreateShipFromId((uint)ship_id, connection.player.Uid)).Take(amount).ToList();
|
||||
|
||||
foreach (int id in all_ship_ids)
|
||||
Logger.c.Log(id + "");
|
||||
|
||||
all_ships.AddRange(GetDefaultShips(connection.player.Ships)); // add the defaults
|
||||
connection.player.Ships = all_ships;
|
||||
connection.SendSystemMsg($"Added {amount} ships!");
|
||||
|
||||
@@ -2,18 +2,15 @@
|
||||
using BLHX.Server.Common.Database;
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Data;
|
||||
using BLHX.Server.Common.Utils;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P10
|
||||
{
|
||||
namespace BLHX.Server.Game.Handlers {
|
||||
internal static class P10 {
|
||||
#region GateCommands
|
||||
[PacketHandler(Command.Cs10800)]
|
||||
static void VersionHandler(Connection connection, Packet packet)
|
||||
{
|
||||
static void VersionHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs10800>();
|
||||
connection.Send(new Sc10801()
|
||||
{
|
||||
connection.Send(new Sc10801() {
|
||||
GatewayIp = Config.Instance.Address,
|
||||
GatewayPort = Config.Instance.Port,
|
||||
Url = "http://" + Config.Instance.Address,
|
||||
@@ -37,14 +34,12 @@ namespace BLHX.Server.Game.Handlers
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs10020)]
|
||||
static void UserLoginHandler(Connection connection, Packet packet)
|
||||
{
|
||||
static void UserLoginHandler(Connection connection, Packet packet) {
|
||||
// Arg2 uid
|
||||
// Arg3 accessToken
|
||||
// CheckKey md5(Arg1 + salt)
|
||||
var req = packet.Decode<Cs10020>();
|
||||
connection.Send(new Sc10021()
|
||||
{
|
||||
connection.Send(new Sc10021() {
|
||||
Result = 0,
|
||||
AccountId = uint.Parse(req.Arg2),
|
||||
Serverlists = [
|
||||
@@ -65,14 +60,12 @@ namespace BLHX.Server.Game.Handlers
|
||||
#endregion
|
||||
|
||||
[PacketHandler(Command.Cs10022)]
|
||||
static void ServerLoginHandler(Connection connection, Packet packet)
|
||||
{
|
||||
static void ServerLoginHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs10022>();
|
||||
var rsp = new Sc10023();
|
||||
|
||||
var account = DBManager.AccountContext.Accounts.SingleOrDefault(x => x.Uid == req.AccountId);
|
||||
if (account is null || account.Token != req.ServerTicket)
|
||||
{
|
||||
if (account is null || account.Token != req.ServerTicket) {
|
||||
rsp.Result = 1;
|
||||
connection.Send(rsp);
|
||||
connection.EndProtocol();
|
||||
@@ -83,8 +76,7 @@ namespace BLHX.Server.Game.Handlers
|
||||
rsp.ServerTicket = req.ServerTicket;
|
||||
|
||||
var player = DBManager.PlayerContext.Players.SingleOrDefault(x => x.Token == req.ServerTicket);
|
||||
if (player is null)
|
||||
{
|
||||
if (player is null) {
|
||||
connection.Send(rsp);
|
||||
return;
|
||||
}
|
||||
@@ -96,12 +88,10 @@ namespace BLHX.Server.Game.Handlers
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs10024)]
|
||||
static void CreateNewPlayerHandler(Connection connection, Packet packet)
|
||||
{
|
||||
static void CreateNewPlayerHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs10024>();
|
||||
var rsp = new Sc10025();
|
||||
if (connection.player is not null)
|
||||
{
|
||||
if (connection.player is not null) {
|
||||
rsp.Result = 1011;
|
||||
connection.Send(rsp);
|
||||
return;
|
||||
@@ -114,10 +104,21 @@ namespace BLHX.Server.Game.Handlers
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs10100, IsNotifyHandler = true)]
|
||||
static void HeartbeatHandler(Connection connection, Packet packet)
|
||||
{
|
||||
static void HeartbeatHandler(Connection connection, Packet packet) {
|
||||
connection.Send(new Sc10101());
|
||||
connection.Tick();
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs10992)]
|
||||
static void LevelUpHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs10992>();
|
||||
|
||||
Logger.c.Log("TrackType: " + req.TrackType);
|
||||
Logger.c.Log("EventId: " + req.EventId);
|
||||
Logger.c.Log("Para1: " + req.Para1);
|
||||
Logger.c.Log("Para2: " + req.Para2);
|
||||
Logger.c.Log("Para3: " + req.Para3);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,13 @@ namespace BLHX.Server.Game.Handlers {
|
||||
connection.Send(new Sc11014());
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs11019, SaveDataAfterRun = true)]
|
||||
static void UpdateCommonFlagHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs11019>();
|
||||
|
||||
connection.Send(new Sc11020());
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs11601)]
|
||||
static void GetEmojiInfoHandler(Connection connection, Packet packet) {
|
||||
connection.Send(new Sc11602());
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
using BLHX.Server.Common.Proto.p12;
|
||||
using BLHX.Server.Common.Utils;
|
||||
using BLHX.Server.Common.Proto.common;
|
||||
using BLHX.Server.Common.Proto.p11;
|
||||
using BLHX.Server.Common.Data;
|
||||
using BLHX.Server.Common.Database;
|
||||
using BLHX.Server.Game.Managers;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers {
|
||||
internal static class P12 {
|
||||
@@ -28,29 +32,62 @@ namespace BLHX.Server.Game.Handlers {
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs12002, SaveDataAfterRun = true)]
|
||||
static void BuildHandler(Connection connection, Packet packet) {
|
||||
static void BuildShipHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs12002>();
|
||||
|
||||
Logger.c.Log("Id: " + req.Id);
|
||||
Logger.c.Log("Cost Type: " + req.Costtype);
|
||||
Logger.c.Log("Count: " + req.Count);
|
||||
|
||||
// Id: gacha banner id
|
||||
// Count: number of batch builds
|
||||
// cost type: 1 wisdom cube + 1500 coin for each gacha i guess?
|
||||
|
||||
// TODO: remove the resources used from player resources
|
||||
|
||||
if (!BuildManager.Instance.BatchBuildShip(req.Id, req.Count))
|
||||
Logger.c.Log("Build capacity is full or something went wrong");
|
||||
|
||||
connection.Send(new Sc12003() {
|
||||
BuildInfoes = [
|
||||
new Buildinfo() { BuildId = req.Id, FinishTime = 0, Time = 0 },
|
||||
]
|
||||
BuildInfoes = BuildManager.Instance.ToBuildInfoes()
|
||||
});
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs12008, SaveDataAfterRun = true)]
|
||||
static void FinishBuildHandler(Connection connection, Packet packet) {
|
||||
static void BuildShipImmediatelyHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs12008>();
|
||||
|
||||
connection.Send(new Sc12009() { PosLists = req.PosLists });
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs12043, SaveDataAfterRun = true)]
|
||||
static void GetShipHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs12043>();
|
||||
|
||||
// pos: position in build, Tid: banner id?
|
||||
connection.Send(new Sc12044() {
|
||||
infoLists = BuildManager.Instance.ToInfoLists()
|
||||
});
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs12025, SaveDataAfterRun = true)]
|
||||
static void GetShipAfterHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs12025>();
|
||||
|
||||
connection.Send(new Sc12026() {
|
||||
ShipLists = BuildManager.Instance.GetBuildResults(req.PosLists, connection.player.Uid)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs12045, SaveDataAfterRun = true)]
|
||||
static void GetShipConfirmHandler(Connection connection, Packet packet) {
|
||||
var req = packet.Decode<Cs12045>();
|
||||
|
||||
BuildManager.Instance.ClearBuilds();
|
||||
|
||||
connection.Send(new Sc12046());
|
||||
}
|
||||
}
|
||||
|
||||
static class P12ConnectionNotifyExtensions {
|
||||
@@ -76,7 +113,15 @@ namespace BLHX.Server.Game.Handlers {
|
||||
}
|
||||
|
||||
public static void NotifyBuildShipData(this Connection connection) {
|
||||
connection.Send(new Sc12024());
|
||||
Logger.c.Log("NotifyBuildShipData");
|
||||
|
||||
connection.Send(new Sc12024() {
|
||||
WorklistCount = 1,
|
||||
WorklistLists = BuildManager.Instance.ToBuildInfoes(),
|
||||
DrawCount1 = 1,
|
||||
DrawCount10 = 1,
|
||||
ExchangeCount = 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
149
BLHX.Server.Game/Managers/BuildManager.cs
Normal file
149
BLHX.Server.Game/Managers/BuildManager.cs
Normal file
@@ -0,0 +1,149 @@
|
||||
using BLHX.Server.Common.Proto.common;
|
||||
using System;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using BLHX.Server.Common.Data;
|
||||
using BLHX.Server.Common.Database;
|
||||
using BLHX.Server.Common.Utils;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace BLHX.Server.Game.Managers {
|
||||
|
||||
public class BuildManager {
|
||||
|
||||
private static BuildManager instance = null;
|
||||
private BuildManager() { }
|
||||
|
||||
public static BuildManager Instance {
|
||||
get {
|
||||
if (instance == null)
|
||||
instance = new BuildManager();
|
||||
|
||||
return instance;
|
||||
}
|
||||
set => instance = value;
|
||||
}
|
||||
|
||||
public uint BuildCapacity { get; set; } = 10;
|
||||
|
||||
public List<BuildData> BuildData { get; set; } = [];
|
||||
|
||||
public bool BuildShip(uint buildId) {
|
||||
DateTime time = DateTime.Now;
|
||||
DateTime finishTime = time.AddSeconds(10); // TODO: figure out which cfg is this stored at
|
||||
|
||||
if (BuildData.Count + 1 > BuildCapacity)
|
||||
return false;
|
||||
|
||||
BuildData.Add(new BuildData() {
|
||||
Pos = (uint)BuildData.Count + 1,
|
||||
Tid = 1, // no idea whats this
|
||||
BuildId = buildId,
|
||||
FinishTime = (uint)new DateTimeOffset(finishTime).ToUnixTimeSeconds(),
|
||||
Time = (uint)new DateTimeOffset(time).ToUnixTimeSeconds(),
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool BatchBuildShip(uint buildId, uint count) {
|
||||
if (BuildData.Count + count > BuildCapacity)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
BuildShip(buildId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<Shipinfo> GetBuildResults(List<uint> posList, uint playerUid) { // posList: build position list: so like 1, 2, 3, 4, 5
|
||||
List<Shipinfo> buildResults = new List<Shipinfo>();
|
||||
|
||||
foreach (uint buildPosId in posList) {
|
||||
BuildData buildData = BuildData[(int)buildPosId - 1];
|
||||
|
||||
Shipinfo receivedShip = CreateShipFromId(HandleGacha(buildData.BuildId), playerUid).ToProto();
|
||||
|
||||
buildResults.Add(receivedShip);
|
||||
}
|
||||
|
||||
return buildResults;
|
||||
}
|
||||
|
||||
public List<Shipinfo> GetAllBuildResults(uint playerUid) {
|
||||
List<uint> posListAll = new List<uint>();
|
||||
|
||||
for (int i = 1; i <= BuildCapacity; i++)
|
||||
posListAll.Add((uint)i);
|
||||
|
||||
return GetBuildResults(posListAll, playerUid);
|
||||
}
|
||||
|
||||
public uint HandleGacha(uint bannerId) { // for now i changed the entire pool of bannerId = 2 to URs
|
||||
uint[] characterPool = Data.ActivityShipCreate[bannerId].PickupList;
|
||||
|
||||
int resultRarity = RNG.NextShipRarity();
|
||||
// handle gacha rates here
|
||||
|
||||
return characterPool[RNG.Next(characterPool.Length)];
|
||||
}
|
||||
|
||||
// ayo who named these two :skull:
|
||||
public List<BLHX.Server.Common.Proto.p12.BuildInfo> ToInfoLists() {
|
||||
return BuildData.Select(data => new BLHX.Server.Common.Proto.p12.BuildInfo() { Pos = data.Pos, Tid = data.Tid }).ToList();
|
||||
}
|
||||
|
||||
// this one is not capitalized Build(i)nfo
|
||||
public List<BLHX.Server.Common.Proto.common.Buildinfo> ToBuildInfoes() {
|
||||
return BuildData.Select(data => new BLHX.Server.Common.Proto.common.Buildinfo() { BuildId = data.BuildId, FinishTime = data.FinishTime, Time = data.Time,}).ToList();
|
||||
}
|
||||
|
||||
public void ClearBuilds() {
|
||||
BuildData.Clear();
|
||||
}
|
||||
|
||||
public static ShipDataStatistics GetShipInfoFromId(uint shipId) {
|
||||
return Data.ShipDataStatistics[(int)shipId];
|
||||
}
|
||||
|
||||
public static PlayerShip CreateShipFromId(uint shipId, uint playerUid) {
|
||||
if (!Data.ShipDataTemplate.TryGetValue((int)shipId, out var shipTemplate))
|
||||
throw new InvalidDataException($"Ship template {shipId} not found!");
|
||||
|
||||
var ship = new PlayerShip() {
|
||||
TemplateId = shipId,
|
||||
Level = 1,
|
||||
EquipInfoLists = [
|
||||
new EquipskinInfo() { Id = shipTemplate.EquipId1 },
|
||||
new EquipskinInfo() { Id = shipTemplate.EquipId2 },
|
||||
new EquipskinInfo() { Id = shipTemplate.EquipId3 },
|
||||
new EquipskinInfo(),
|
||||
new EquipskinInfo(),
|
||||
],
|
||||
Energy = shipTemplate.Energy,
|
||||
SkillIdLists = shipTemplate.BuffList.Select(x => new Shipskill() { SkillId = x, SkillLv = 1 }).ToList(),
|
||||
Intimacy = 5000,
|
||||
|
||||
PlayerUid = playerUid
|
||||
};
|
||||
|
||||
return ship;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[PrimaryKey(nameof(Pos))]
|
||||
public class BuildData {
|
||||
[Key]
|
||||
public uint Pos { get; set; }
|
||||
|
||||
public uint Tid { get; set; }
|
||||
|
||||
public uint Time { get; set; }
|
||||
|
||||
public uint FinishTime { get; set; }
|
||||
|
||||
public uint BuildId { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user