增加修炼功能
@@ -5,8 +5,10 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJwtHelper_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6b089d08a87d4ddd82371ae63e754ba05000_003Fe2_003F86047f24_003FJwtHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJwtHelper_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6b089d08a87d4ddd82371ae63e754ba05000_003Fe2_003F86047f24_003FJwtHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJwtSecurityTokenHandler_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003Ff9d3fc33fd2fba97d4e718534a67f1d3c61e492634cd51c4798ce5621f780f3_003FJwtSecurityTokenHandler_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJwtSecurityTokenHandler_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003Ff9d3fc33fd2fba97d4e718534a67f1d3c61e492634cd51c4798ce5621f780f3_003FJwtSecurityTokenHandler_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_00601_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F51505665371d472f8bdbc333fa4d888cf49938_003F0e_003F7279c963_003FList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_00601_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F51505665371d472f8bdbc333fa4d888cf49938_003F0e_003F7279c963_003FList_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANullable_00601_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F51505665371d472f8bdbc333fa4d888cf49938_003F58_003F4ed88c93_003FNullable_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APoAction_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8fb1d14dca1046e78e0684daa8bc3a1b7800_003Fb7_003F35e46383_003FPoAction_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APoAction_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8fb1d14dca1046e78e0684daa8bc3a1b7800_003Fb7_003F35e46383_003FPoAction_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARandomAssist_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa380d649d5b2495d9bfa0fa24f13662b6400_003F90_003F676312fd_003FRandomAssist_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARandomAssist_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa380d649d5b2495d9bfa0fa24f13662b6400_003F90_003F676312fd_003FRandomAssist_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARuntimeTypeHandle_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F51505665371d472f8bdbc333fa4d888cf49938_003Fa5_003Faf039d5f_003FRuntimeTypeHandle_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASqlSetup_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F72993acb059c49dcbba437a858c0b0942000_003F46_003F2e14505d_003FSqlSetup_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASqlSetup_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F72993acb059c49dcbba437a858c0b0942000_003F46_003F2e14505d_003FSqlSetup_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASqlSugarScopeProvider_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6c0f22f0a47643a3b2a40899acd2044c2e3a00_003Fc5_003F4738d33f_003FSqlSugarScopeProvider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASqlSugarScopeProvider_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6c0f22f0a47643a3b2a40899acd2044c2e3a00_003Fc5_003F4738d33f_003FSqlSugarScopeProvider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStringAssist_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa380d649d5b2495d9bfa0fa24f13662b6400_003Fee_003F90da4dea_003FStringAssist_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStringAssist_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa380d649d5b2495d9bfa0fa24f13662b6400_003Fee_003F90da4dea_003FStringAssist_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
|||||||
10
Service/Application.Domain.Entity/db/unit_user_load.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class unit_user_load
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public string userId { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Game")]
|
||||||
|
public class unit_user_drug
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// userId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string userId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// drug
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||||
|
public List<UserDrugModel> drug { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Game")]
|
||||||
|
public class unit_user_monster
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// umId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string umId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// userId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? userId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// areaCode
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? areaCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// mapId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? mapId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// monsterId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? monsterId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// monsterName
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? monsterName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// code
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// par
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? par { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// addTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? addTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// endTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? endTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,5 +47,17 @@ namespace Application.Domain.Entity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public int? copper { get; set; }
|
public int? copper { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 出售价格
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? sale { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// remark
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? remark { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Game")]
|
||||||
|
public class unit_user_state
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// usId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string usId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// userId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? userId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// goodsId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? goodsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// name
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 场景
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? scene { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tips
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? tips { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// attr
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||||
|
public List<AttrItem> attr { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// addTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? addTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// endTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? endTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Game")]
|
||||||
|
public class unit_user_stock
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// usId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string usId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// userId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? userId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// goodsId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? goodsId { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// type
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// code
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sign
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? sign { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// par
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string? par { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// endTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? endTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
113
Service/Application.Domain.Entity/logdb/db/game_fight_data.cs
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Log")]
|
||||||
|
public class game_fight_data
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fightId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string fightId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 作用区域
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? areaCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关联ID
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? keyId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 对方主ID
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? mainId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 战斗类型
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 场景
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? scene { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// mapId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? mapId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// userId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? userId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// state
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? state { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 胜利方
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? winUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 经验
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? exp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 铜贝
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? copper { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 宠物经验
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? petExp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 奖励
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string? award { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string? pars { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// addTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? addTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 战斗结束时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? okTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? endTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Service/Application.Domain.Entity/logdb/ot/game_broadcast.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class game_broadcast
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public int area { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public string userId { get; set; }
|
||||||
|
public string userNo { get; set; }
|
||||||
|
public string nick { get; set; }
|
||||||
|
public string msg { get; set; }
|
||||||
|
public long endTime { get; set; }
|
||||||
|
}
|
||||||
30
Service/Application.Domain.Entity/model/CheckTowerNeeds.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class CheckTowerNeeds
|
||||||
|
{
|
||||||
|
private bool _result;
|
||||||
|
|
||||||
|
public bool result
|
||||||
|
{ get { return this._result; } set { this._result = value; } }
|
||||||
|
|
||||||
|
private System.Int32 _isDeal;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 0不可交易1可交易
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 isDeal
|
||||||
|
{ get { return this._isDeal; } set { this._isDeal = value; } }
|
||||||
|
|
||||||
|
private System.Int32 _isGive;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 0不可交易1可交易
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 isGive
|
||||||
|
{ get { return this._isGive; } set { this._isGive = value; } }
|
||||||
|
|
||||||
|
private List<TowerNeeds> _Needs;
|
||||||
|
|
||||||
|
public List<TowerNeeds> Needs
|
||||||
|
{ get { return this._Needs; } set { this._Needs = value; } }
|
||||||
|
}
|
||||||
8
Service/Application.Domain.Entity/model/ChoiceGoods.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class ChoiceGoods
|
||||||
|
{
|
||||||
|
public int id { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public List<TowerGet> award { get; set; }
|
||||||
|
}
|
||||||
@@ -31,7 +31,6 @@ public class EquAwaken
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SqlSugar.SugarColumn(ColumnDataType = "varchar(max)", IsJson = true)]
|
|
||||||
public List<AttrItem> awaken
|
public List<AttrItem> awaken
|
||||||
{ get { return this._awaken; } set { this._awaken = value; } }
|
{ get { return this._awaken; } set { this._awaken = value; } }
|
||||||
}
|
}
|
||||||
36
Service/Application.Domain.Entity/model/EquAwakenData.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class EquAwakenData
|
||||||
|
{
|
||||||
|
private System.Int32 _lev;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 lev
|
||||||
|
{ get { return this._lev; } set { this._lev = value; } }
|
||||||
|
|
||||||
|
private System.Int32 _success;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 success
|
||||||
|
{ get { return this._success; } set { this._success = value; } }
|
||||||
|
|
||||||
|
private List<TowerNeed> _need;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<TowerNeed> need
|
||||||
|
{ get { return this._need; } set { this._need = value; } }
|
||||||
|
|
||||||
|
private List<AttrItem> _attr;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<AttrItem> attr
|
||||||
|
{ get { return this._attr; } set { this._attr = value; } }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class FightAwardModel
|
||||||
|
{
|
||||||
|
public string code { get; set; }
|
||||||
|
public object award { get; set; }
|
||||||
|
}
|
||||||
13
Service/Application.Domain.Entity/model/MapMonsterModel.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class MapMonsterModel
|
||||||
|
{
|
||||||
|
public string monterId { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 0地图怪物 1生成怪物
|
||||||
|
/// </summary>
|
||||||
|
public int type { get; set; }
|
||||||
|
|
||||||
|
public string sign { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class MonsterAwardModel
|
||||||
|
{
|
||||||
|
public string type { get; set; }
|
||||||
|
public RandomModel award { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class RandomDataBase
|
||||||
|
{
|
||||||
|
public double random { get; set; }
|
||||||
|
public object data { get; set; }
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ public class RandomData
|
|||||||
public string code { get; set; }
|
public string code { get; set; }
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
public string par { get; set; }
|
public string par { get; set; }
|
||||||
public long count { get; set; }
|
public int minCount { get; set; }
|
||||||
|
public int maxCount { get; set; }
|
||||||
public double chance { get; set; }
|
public double chance { get; set; }
|
||||||
}
|
}
|
||||||
@@ -26,20 +26,20 @@ public class TowerNeed
|
|||||||
public System.String parameter
|
public System.String parameter
|
||||||
{ get { return this._parameter; } set { this._parameter = value; } }
|
{ get { return this._parameter; } set { this._parameter = value; } }
|
||||||
|
|
||||||
private System.Int32 _count;
|
private long _count;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public System.Int32 count
|
public long count
|
||||||
{ get { return this._count; } set { this._count = value; } }
|
{ get { return this._count; } set { this._count = value; } }
|
||||||
|
|
||||||
private System.Int32 _retCount;
|
private long _retCount;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public System.Int32 retCount
|
public long retCount
|
||||||
{ get { return this._retCount; } set { this._retCount = value; } }
|
{ get { return this._retCount; } set { this._retCount = value; } }
|
||||||
|
|
||||||
private System.Int32 _isOp;
|
private System.Int32 _isOp;
|
||||||
@@ -57,4 +57,12 @@ public class TowerNeed
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public System.Int32 isAsk
|
public System.Int32 isAsk
|
||||||
{ get { return this._isAsk; } set { this._isAsk = value; } }
|
{ get { return this._isAsk; } set { this._isAsk = value; } }
|
||||||
|
|
||||||
|
private long _onCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long onCount
|
||||||
|
{ get { return this._onCount; } set { this._onCount = value; } }
|
||||||
}
|
}
|
||||||
111
Service/Application.Domain.Entity/model/TowerNeeds.cs
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class TowerNeeds
|
||||||
|
{
|
||||||
|
private System.Int32 _Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 Id
|
||||||
|
{
|
||||||
|
get { return this._Id; }
|
||||||
|
set { this._Id = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.String _code;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.String code
|
||||||
|
{
|
||||||
|
get { return this._code; }
|
||||||
|
set { this._code = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.String _name;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.String name
|
||||||
|
{
|
||||||
|
get { return this._name; }
|
||||||
|
set { this._name = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.String _parameter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.String parameter
|
||||||
|
{
|
||||||
|
get { return this._parameter; }
|
||||||
|
set { this._parameter = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private long _count;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long count
|
||||||
|
{
|
||||||
|
get { return this._count; }
|
||||||
|
set { this._count = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private long _retCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long retCount
|
||||||
|
{
|
||||||
|
get { return this._retCount; }
|
||||||
|
set { this._retCount = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Int32 _isOp;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 isOp
|
||||||
|
{
|
||||||
|
get { return this._isOp; }
|
||||||
|
set { this._isOp = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private System.Int32 _isAsk;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Int32 isAsk
|
||||||
|
{
|
||||||
|
get { return this._isAsk; }
|
||||||
|
set { this._isAsk = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private long _onCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long onCount
|
||||||
|
{
|
||||||
|
get { return this._onCount; }
|
||||||
|
set { this._onCount = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<TowerNeed> _NeedItem;
|
||||||
|
|
||||||
|
public List<TowerNeed> NeedItem
|
||||||
|
{
|
||||||
|
get { return this._NeedItem; }
|
||||||
|
set { this._NeedItem = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,11 +8,14 @@
|
|||||||
public int isCopy { get; set; }
|
public int isCopy { get; set; }
|
||||||
public string viceId { get; set; }
|
public string viceId { get; set; }
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
public int figState { get; set; }
|
|
||||||
public string sex { get; set; }
|
public string sex { get; set; }
|
||||||
public string code { get; set; }
|
public string code { get; set; }
|
||||||
public string remark { get; set; }
|
public string tips { get; set; }
|
||||||
public string TmImg { get; set; }
|
public decimal addExp { get; set; }
|
||||||
|
public decimal addGold { get; set; }
|
||||||
|
public decimal burst { get; set; }//爆率
|
||||||
|
public decimal luck { get; set; }//幸运
|
||||||
|
public int weight { get; set; }//负重
|
||||||
public int lev { get; set; }//等级
|
public int lev { get; set; }//等级
|
||||||
public int minAtk { get; set; }//最小攻击
|
public int minAtk { get; set; }//最小攻击
|
||||||
public int maxAtk { get; set; }//最大攻击
|
public int maxAtk { get; set; }//最大攻击
|
||||||
|
|||||||
10
Service/Application.Domain.Entity/model/UserDrugModel.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class UserDrugModel
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public int goodsId { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class UserEquAttrModel
|
||||||
|
{
|
||||||
|
public UserAttrModel equ { get; set; }
|
||||||
|
public List<AttrItem> attr { get; set; }
|
||||||
|
}
|
||||||
8
Service/Application.Domain.Entity/model/UserEquSuit.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class UserEquSuit
|
||||||
|
{
|
||||||
|
public string suitCode { get; set; }
|
||||||
|
public string suitName { get; set; }
|
||||||
|
public List<EquSuitAttr> SuitAttr { get; set; }
|
||||||
|
}
|
||||||
10
Service/Application.Domain.Entity/model/UserStateModel.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class UserStateModel
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public int time { get; set; }
|
||||||
|
public string scene { get; set; }
|
||||||
|
public string tips { get; set; }
|
||||||
|
public List<AttrItem> attr { get; set; }
|
||||||
|
}
|
||||||
27
Service/Application.Domain.Entity/resource/game/game_dic.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
|
public class game_dic
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// code
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sign
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string? sign { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// remark
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? remark { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,72 +4,78 @@ using System;
|
|||||||
namespace Application.Domain.Entity
|
namespace Application.Domain.Entity
|
||||||
{
|
{
|
||||||
[Tenant("Kg.SeaTime.Resource")]
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
public class game_ship
|
public class game_equ_attr
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// shipId
|
/// erId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
public int shipId { get; set; }
|
public string erId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// npc
|
/// equCode
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? equCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// minLev
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public int? npc { get; set; }
|
public int? minLev { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// shipName
|
/// maxLev
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? maxLev { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 权重
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? random { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 属性类型:Number 数值 float 百分比
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 50, IsNullable = true)]
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
public string shipName { get; set; }
|
public string? nt { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// img
|
/// 属性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 50, IsNullable = true)]
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
public string img { get; set; }
|
public string? code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// price
|
/// compute
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? compute { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// min_v
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 18, IsNullable = true)]
|
[SugarColumn(Length = 18, IsNullable = true)]
|
||||||
public decimal? price { get; set; }
|
public decimal? min_v { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// salePrice
|
/// max_v
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 18, IsNullable = true)]
|
[SugarColumn(Length = 18, IsNullable = true)]
|
||||||
public decimal? salePrice { get; set; }
|
public decimal? max_v { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// payType
|
/// tips
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 50, IsNullable = true)]
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
public string payType { get; set; }
|
public string? tips { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// weight
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsNullable = true)]
|
|
||||||
public int? weight { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// speed
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsNullable = true)]
|
|
||||||
public int? speed { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// neeGold
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsNullable = true)]
|
|
||||||
public int? neeGold { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// remark
|
/// remark
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 50, IsNullable = true)]
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
public string remark { get; set; }
|
public string? remark { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
|
public class game_equ_awaken
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 特性表
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string atId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 特性名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// levAttr
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||||
|
public List<EquAwakenData> levAttr { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 权重
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? random { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 可觉醒装备
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string? position { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
|
public class game_equ_make
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// mkId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string mkId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// goodsId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? goodsId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// equId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? equId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// equName
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? equName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// random
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? random { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否随机特性
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? rdAttr { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
|
public class game_equ_up
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// euId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true)]
|
||||||
|
public int euId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// onLev
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? onLev { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// maxLev
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? maxLev { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// okChance
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? okChance { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// needData
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||||
|
public List<TowerNeeds> needData { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
117
Service/Application.Domain.Entity/resource/game/game_monster.cs
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
|
public class game_monster
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// monsterId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string monsterId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// name
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 怪物应用区域
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lev
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? lev { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// exp
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? exp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// copper
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? copper { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// petExp
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public long? petExp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// minAtk
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? minAtk { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// maxAtk
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? maxAtk { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// defense
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? defense { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// agility
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? agility { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// blood
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 62, IsNullable = true)]
|
||||||
|
public decimal? blood { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 怪物属性
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||||
|
public List<AttrItem> attr { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 怪物技能
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string? skill { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// award
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 3000, IsNullable = true)]
|
||||||
|
public string? award { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 支持复制战斗0不支持 1支持
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? isCopy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 怪物说明
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用于后台操作标记,无其他作用
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 255, IsNullable = true)]
|
||||||
|
public string? markTips { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Application.Domain.Entity
|
||||||
|
{
|
||||||
|
[Tenant("Kg.SeaTime.Resource")]
|
||||||
|
public class game_monster_map
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// mmId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||||
|
public string mmId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// mapId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? mapId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// monsterId
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? monsterId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// monsterName
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
|
public string? monsterName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// addCount
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? addCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// chance
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? chance { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? sTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// eTime
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int? eTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
7
Service/Application.Domain.Entity/view/MakePaperView.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain.Entity;
|
||||||
|
|
||||||
|
public class MakePaperView
|
||||||
|
{
|
||||||
|
public game_goods goods { get; set; }
|
||||||
|
public long count { get; set; }
|
||||||
|
}
|
||||||
7
Service/Application.Domain/Cache/FightCache.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public class FightCache
|
||||||
|
{
|
||||||
|
public static string FightCacheKey = "GameFightCache:{0}";
|
||||||
|
public static string FightCacheKeys = "GameFightCache:{0}:{1}";
|
||||||
|
}
|
||||||
@@ -17,4 +17,5 @@ public static class GameConfig
|
|||||||
public const int GameAutoDrugGoodsId = 10001;//急救箱物品ID
|
public const int GameAutoDrugGoodsId = 10001;//急救箱物品ID
|
||||||
public const int GameToMapNeedCopper = 5;//传送每海里费用
|
public const int GameToMapNeedCopper = 5;//传送每海里费用
|
||||||
public const int TeamCacheTime = 300;//队伍缓存时间
|
public const int TeamCacheTime = 300;//队伍缓存时间
|
||||||
|
public const int GameEquApprGoods = 10001;//鉴定装备道具
|
||||||
}
|
}
|
||||||
@@ -21,5 +21,11 @@ public static class EquEnum
|
|||||||
Ornaments = 3, //佩戴
|
Ornaments = 3, //佩戴
|
||||||
Fashion = 1, //时装
|
Fashion = 1, //时装
|
||||||
Wing = 1, //羽翼
|
Wing = 1, //羽翼
|
||||||
|
Decorate = 5, //装饰
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SuitAttrNeedType
|
||||||
|
{
|
||||||
|
ON_EQU
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
7
Service/Application.Domain/Enum/FightEnum.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public static class FightEnum
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -55,6 +55,89 @@ public static class GameEnum
|
|||||||
RetBlood,
|
RetBlood,
|
||||||
RetMorale,
|
RetMorale,
|
||||||
RetVigour,
|
RetVigour,
|
||||||
|
RetEqu,
|
||||||
MapTo,
|
MapTo,
|
||||||
|
Store,
|
||||||
|
Make,
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum DicCode
|
||||||
|
{
|
||||||
|
Awaken,//觉醒配置
|
||||||
|
Quality,//洗练配置
|
||||||
|
}
|
||||||
|
public enum ComputeType
|
||||||
|
{
|
||||||
|
Plus,//加法计算
|
||||||
|
Ride,//乘法计算
|
||||||
|
Reduce,//减法计算
|
||||||
|
Except,//除法计算
|
||||||
|
}
|
||||||
|
public enum AttrCode
|
||||||
|
{
|
||||||
|
AddExp,//经验
|
||||||
|
AddGold,//金币
|
||||||
|
MinAtk,
|
||||||
|
MaxAtk,
|
||||||
|
Atk,//攻击
|
||||||
|
Blood,//体力
|
||||||
|
Defense,//防御
|
||||||
|
Agility,//敏捷
|
||||||
|
Morale,//士气
|
||||||
|
Burst,//爆率
|
||||||
|
InBlood,//吸血
|
||||||
|
Crit,//暴击
|
||||||
|
Dodge,//闪避
|
||||||
|
NoHarm,//免伤
|
||||||
|
Rebound,//反弹
|
||||||
|
Punish,//制裁
|
||||||
|
Slow,//迟缓
|
||||||
|
Poison,//中毒
|
||||||
|
PoisonLess,//抗毒攻
|
||||||
|
Curse,//诅咒
|
||||||
|
Weaken,//弱化
|
||||||
|
Deadly,//致命
|
||||||
|
DeadlyLess,//抗致命
|
||||||
|
Depressed,//消沉 沮丧
|
||||||
|
Breach,//突破
|
||||||
|
Del_Fashion,//卸时装
|
||||||
|
Atk_Next,//连击
|
||||||
|
ReboundLess,//抗反弹
|
||||||
|
Harm_Add,//额外伤害
|
||||||
|
PalsyAtk,//麻痹
|
||||||
|
PalsyAtkLess,//抗麻痹
|
||||||
|
CurseLess,//抗诅咒
|
||||||
|
WeakenLess,//抗弱化
|
||||||
|
DepressedLess,//抗消沉
|
||||||
|
BreachLess,//抗突破
|
||||||
|
Luck,//幸运
|
||||||
|
SlowLess,//抗迟缓
|
||||||
|
Depth,//潜水深度
|
||||||
|
Height,//升空高度
|
||||||
|
Weight//负重
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GameStockCode
|
||||||
|
{
|
||||||
|
Blood,
|
||||||
|
Durability,
|
||||||
|
|
||||||
|
}
|
||||||
|
public enum GameStockType
|
||||||
|
{
|
||||||
|
Number,//数值
|
||||||
|
Time,//时间
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum FightCode
|
||||||
|
{
|
||||||
|
PVP,//人物对战
|
||||||
|
PVE//NPC对战
|
||||||
|
}
|
||||||
|
public enum AreaCode
|
||||||
|
{
|
||||||
|
Own,//个人怪物
|
||||||
|
Public,//公共怪物
|
||||||
|
Team,//队伍怪物
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,19 @@ public static class GoodsEnum
|
|||||||
Card,//附魔卡片
|
Card,//附魔卡片
|
||||||
Mark,//圣痕
|
Mark,//圣痕
|
||||||
Pack,//宝箱
|
Pack,//宝箱
|
||||||
Practise,//修炼道具
|
ChoicePack,//选择宝箱
|
||||||
|
Weight,//负重
|
||||||
|
Exp,//经验
|
||||||
|
State,//状态物品
|
||||||
|
Ship,//船只
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum DrugCls
|
||||||
|
{
|
||||||
|
Blood,//普通体力药品
|
||||||
|
BloodStock,//体力储存药品
|
||||||
|
Vigour,//活力
|
||||||
|
Morale,//士气
|
||||||
|
LoadBuff,//消除负面状态
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,4 +8,12 @@ public static class MessageEnum
|
|||||||
Marry,//婚姻消息
|
Marry,//婚姻消息
|
||||||
Trade,//交易通知
|
Trade,//交易通知
|
||||||
}
|
}
|
||||||
|
public enum BroadcastCode
|
||||||
|
{
|
||||||
|
Gift,
|
||||||
|
System,
|
||||||
|
Award,
|
||||||
|
Remind,
|
||||||
|
Promote
|
||||||
|
}
|
||||||
}
|
}
|
||||||
11
Service/Application.Domain/Enum/MonsterEnum.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public static class MonsterEnum
|
||||||
|
{
|
||||||
|
public enum AwardCode
|
||||||
|
{
|
||||||
|
Default,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,20 +6,25 @@ public interface IGameEquService
|
|||||||
|
|
||||||
Task<game_equ> GetEquInfo(int equId);
|
Task<game_equ> GetEquInfo(int equId);
|
||||||
Task<game_equ_suit> GetEuqSuitInfo(string suitCode);
|
Task<game_equ_suit> GetEuqSuitInfo(string suitCode);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 用户装备
|
#region 用户装备
|
||||||
|
|
||||||
Task<List<unit_user_equ>> GetUserEquData(string userId, int type, string equName, int PageIndex, int PageSize,
|
Task<List<unit_user_equ>> GetUserEquData(string userId, int type, string equName, int PageIndex, int PageSize,
|
||||||
RefAsync<int> Total, bool isRemOn = false);
|
RefAsync<int> Total, bool isRemOn = false, bool isRemLock = false);
|
||||||
|
|
||||||
Task<List<unit_user_equ>> GetUserEquData(string userId, int equId);
|
Task<List<unit_user_equ>> GetUserEquData(string userId, int equId);
|
||||||
|
Task<List<unit_user_equ>> GetUserEquData(string userId, string code, List<string> noUeId);
|
||||||
Task<unit_user_equ> GetUserEquInfo(string ueId);
|
Task<unit_user_equ> GetUserEquInfo(string ueId);
|
||||||
Task<int> GetUserEquByEquIdCount(string userId, int equId);
|
Task<int> GetUserEquByEquIdCount(string userId, int equId);
|
||||||
Task<List<unit_user_equ>> GetUserEquByEquId(string userId, int equId);
|
Task<List<unit_user_equ>> GetUserEquByEquId(string userId, int equId);
|
||||||
Task<bool> AddUserEqu(string userId, int equId, int count, string remark);
|
Task<bool> AddUserEqu(string userId, int equId, int count, string remark);
|
||||||
|
Task<bool> AddUserEqu(unit_user_equ equData, string remark);
|
||||||
|
Task<unit_user_equ> AddUserEqu(string userId, int equId, bool rdAttr = false, string remark = "");
|
||||||
Task<bool> UpdateUserEquInfo(unit_user_equ equData, bool isAddLog = false, string code = "",
|
Task<bool> UpdateUserEquInfo(unit_user_equ equData, bool isAddLog = false, string code = "",
|
||||||
string remark = "");
|
string remark = "");
|
||||||
|
|
||||||
Task<bool> DeductUserEqu(string userId, List<unit_user_equ> equData, string remark);
|
Task<bool> DeductUserEqu(string userId, List<unit_user_equ> equData, string remark);
|
||||||
Task<bool> DeductUserEqu(string userId, int equId, int count, string remark);
|
Task<bool> DeductUserEqu(string userId, int equId, int count, string remark);
|
||||||
|
|
||||||
@@ -27,13 +32,36 @@ public interface IGameEquService
|
|||||||
bool isAddAttr = false);
|
bool isAddAttr = false);
|
||||||
|
|
||||||
Task<List<unit_user_equ>> GetUserOnEqu(string userId);
|
Task<List<unit_user_equ>> GetUserOnEqu(string userId);
|
||||||
|
Task<UserAttrModel> GetUserEquAttrModel(string userId);
|
||||||
Task<bool> EquOnOrDown(unit_user_equ data, int state);
|
Task<bool> EquOnOrDown(unit_user_equ data, int state);
|
||||||
|
Task<List<UserEquSuit>> GetUserEquSuit(string userId);
|
||||||
|
Task<List<AttrItem>> GetUserEquSuitAttrInfo(string userId);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 觉醒相关
|
||||||
|
|
||||||
|
Task<game_equ_awaken> GetEquAwakenInfo(string atId);
|
||||||
|
Task<game_equ_awaken> GetRandomOneAwakenByCode(string code);
|
||||||
|
Task<EquAwakenData> GetEquAwakenInfoByLev(string atId, int lev);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 洗练属性/词条
|
||||||
|
|
||||||
|
Task<List<AttrItem>> GetRandomEquAttr(string equCode, int lev);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 强化相关
|
||||||
|
|
||||||
|
Task<game_equ_up> GetUserEquUpData(int lev);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 辅助
|
#region 辅助
|
||||||
|
|
||||||
Task<int> GetUserEquWeightSum(string userId);
|
Task<int> GetUserEquWeightSum(string userId);
|
||||||
|
Task<game_equ_make> GetMakeEquByGoodsId(int goodsId);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public interface IGameFightService
|
||||||
|
{
|
||||||
|
#region 用户战斗索引
|
||||||
|
|
||||||
|
Task<List<string>> GetUserFight(string userId);
|
||||||
|
Task<bool> RemoveUserFight(string userId, string fightId);
|
||||||
|
#endregion
|
||||||
|
#region 战斗信息
|
||||||
|
Task<game_fight_data> GetFightInfo(string fightId);
|
||||||
|
Task<long> GetFightBlood(string keyId, long maxBlood);
|
||||||
|
Task SetFightBlood(string keyId, long blood);
|
||||||
|
Task AddFightHarm(string fightId, string userId, long harm);
|
||||||
|
Task<bool> AddFight(string fightId, string areaCode, string keyId, string mainId, string code,
|
||||||
|
string scene, string mapId,
|
||||||
|
string userId, long exp = 0, long copper = 0, long petExp = 0, string award = "", string pars = "");
|
||||||
|
|
||||||
|
Task<bool> SetFightWin(string fightId, string winUser);
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region 战斗相关
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -29,7 +29,11 @@ public interface IGameGoodsService
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 船只
|
#region 药品
|
||||||
Task<game_ship> GetShipInfo(int shipId);
|
|
||||||
|
Task<string> CheckUseDrug(string userId, int goodsId, string drugConfig, string scene = "");
|
||||||
|
Task<bool> UseDrug(string userId, int goodsId, string drugConfig, string scene = "");
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,7 @@ public interface IGameMapService
|
|||||||
#region 用户地图
|
#region 用户地图
|
||||||
|
|
||||||
Task<string> GetUserOnMapId(string userId);
|
Task<string> GetUserOnMapId(string userId);
|
||||||
|
Task<game_city_map> GetUserOnToMapInfo(string userId);
|
||||||
Task<unit_user_online> GetUserOnMap(string userId);
|
Task<unit_user_online> GetUserOnMap(string userId);
|
||||||
Task UpdateUserOnMap(string userId, string ip, string mapId);
|
Task UpdateUserOnMap(string userId, string ip, string mapId);
|
||||||
Task<bool> UpdateUserOnMap(unit_user_online data, string mapId);
|
Task<bool> UpdateUserOnMap(unit_user_online data, string mapId);
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public interface IGameMonsterService
|
||||||
|
{
|
||||||
|
#region 基础资源库
|
||||||
|
|
||||||
|
Task<game_monster> GetMonsterInfo(string monsterId);
|
||||||
|
#endregion
|
||||||
|
#region 地图怪物
|
||||||
|
|
||||||
|
Task<List<game_monster_map>> GetMonsterDataByMap(string mapId);
|
||||||
|
Task<game_monster_map> GetMapMonsterInfo(string mmId);
|
||||||
|
Task<bool> CreateMonsterToMap(string userId, string mapId, string areaCode, string monsterId,
|
||||||
|
int count = 1, int time = 0, string par = "");
|
||||||
|
|
||||||
|
Task<unit_user_monster> GetCreateMonsterInfo(string umId);
|
||||||
|
Task<List<MapMonsterModel>> GetMapMonster(string userId, string mapId, string teamId);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public interface IGameDicService
|
||||||
|
{
|
||||||
|
Task<game_dic> GetDicInfo(string code);
|
||||||
|
}
|
||||||
@@ -43,4 +43,11 @@ public interface IMessageService
|
|||||||
List<MsgEventBtn> btns = null, int days = 10);
|
List<MsgEventBtn> btns = null, int days = 10);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 广播消息
|
||||||
|
|
||||||
|
Task<List<game_broadcast>> GetBroadcastData(int area);
|
||||||
|
Task<bool> SendBroadcast(string userId, string code, string msg);
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -4,9 +4,10 @@ public interface IUnitUserAttrService
|
|||||||
{
|
{
|
||||||
#region 个人属性
|
#region 个人属性
|
||||||
|
|
||||||
Task<UserAttrModel> GetUserAttrModel(string userId);
|
Task<UserAttrModel> GetUserAttrModel(string userId, string scene = "Default");
|
||||||
Task<unit_user_attr> GetUserAttr(string userId);
|
Task<unit_user_attr> GetUserAttr(string userId);
|
||||||
Task<int> GetUserLev(string userId);
|
Task<int> GetUserLev(string userId);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 体力操作
|
#region 体力操作
|
||||||
@@ -29,6 +30,7 @@ public interface IUnitUserAttrService
|
|||||||
Task<bool> UpdateUserMorale(string userId, int op, int count);
|
Task<bool> UpdateUserMorale(string userId, int op, int count);
|
||||||
Task<bool> CheackRecoverMorale(string userId);
|
Task<bool> CheackRecoverMorale(string userId);
|
||||||
Task LockRecoverMorale(string userId);
|
Task LockRecoverMorale(string userId);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 活力
|
#region 活力
|
||||||
@@ -43,6 +45,42 @@ public interface IUnitUserAttrService
|
|||||||
|
|
||||||
Task<bool> UpdateOnLineTime(string userId, string code, int time);
|
Task<bool> UpdateOnLineTime(string userId, string code, int time);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 药品栏
|
||||||
|
|
||||||
|
Task<unit_user_drug> GetUserDrug(string userId);
|
||||||
|
Task<bool> UpdateUserDrug(unit_user_drug data);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BUFF状态
|
||||||
|
|
||||||
|
Task<List<unit_user_state>> GetUserStateData(string userId, string scene = "Default");
|
||||||
|
|
||||||
|
Task<bool> AddUserState(string userId, string groupId, string name, string scene, string tips,
|
||||||
|
List<AttrItem> attr, int time, int count = 1);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 游戏资源储备
|
||||||
|
|
||||||
|
Task<List<unit_user_stock>> GetUserStock(string userId, string code = "Default");
|
||||||
|
|
||||||
|
Task<bool> AddUserStock(string userId, string goodsId,string name, string type, string code, long sign,
|
||||||
|
string par = "",
|
||||||
|
int minute = 0);
|
||||||
|
|
||||||
|
Task<bool> UpdateUserStock(unit_user_stock data);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 负面状态
|
||||||
|
|
||||||
|
Task<List<unit_user_load>> GetUserLoadState(string userId);
|
||||||
|
Task<bool> AddUserLoadState(string userId, string name, string code);
|
||||||
|
Task<bool> RandomRemoveUserLoadState(string userId, int count);
|
||||||
|
Task RemoveUserLoadState(string userId);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ public interface IUnitUserWeight
|
|||||||
Task<bool> UpdateUserShipOnWeight(string userId, int op, int weight);
|
Task<bool> UpdateUserShipOnWeight(string userId, int op, int weight);
|
||||||
Task<bool> CheakUserShipWeight(string userId, int useWeight);
|
Task<bool> CheakUserShipWeight(string userId, int useWeight);
|
||||||
Task<bool> DeleteUserShip(string usId, string userId);
|
Task<bool> DeleteUserShip(string usId, string userId);
|
||||||
Task<bool> AddUserShip(string userId, string name, int goodsId, int speed, int weight);
|
Task<bool> AddUserShip(string userId, string name, int goodsId, int speed, int weight,int copper,long sale,string remark);
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
#region 用户装备
|
#region 用户装备
|
||||||
|
|
||||||
public async Task<List<unit_user_equ>> GetUserEquData(string userId, int type, string equName, int PageIndex,
|
public async Task<List<unit_user_equ>> GetUserEquData(string userId, int type, string equName, int PageIndex,
|
||||||
int PageSize, RefAsync<int> Total, bool isRemOn = false)
|
int PageSize, RefAsync<int> Total, bool isRemOn = false, bool isRemLock = false)
|
||||||
{
|
{
|
||||||
long onTime = TimeExtend.GetTimeStampSeconds;
|
long onTime = TimeExtend.GetTimeStampSeconds;
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||||
@@ -48,6 +48,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
.WhereIF(type == 1, it => it.isOn == 1)
|
.WhereIF(type == 1, it => it.isOn == 1)
|
||||||
.WhereIF(type == 3, it => it.isAppr == 0)
|
.WhereIF(type == 3, it => it.isAppr == 0)
|
||||||
.WhereIF(isRemOn, it => it.isOn == 0)
|
.WhereIF(isRemOn, it => it.isOn == 0)
|
||||||
|
.WhereIF(isRemLock, it => it.isLock == 0)
|
||||||
.WhereIF(!string.IsNullOrEmpty(equName),
|
.WhereIF(!string.IsNullOrEmpty(equName),
|
||||||
it => it.equName.Contains(equName) || it.unitEquName.Contains(equName))
|
it => it.equName.Contains(equName) || it.unitEquName.Contains(equName))
|
||||||
.OrderByDescending(it => it.lev)
|
.OrderByDescending(it => it.lev)
|
||||||
@@ -56,11 +57,18 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
|
|
||||||
public async Task<List<unit_user_equ>> GetUserEquData(string userId, int equId)
|
public async Task<List<unit_user_equ>> GetUserEquData(string userId, int equId)
|
||||||
{
|
{
|
||||||
long onTime = TimeExtend.GetTimeStampSeconds;
|
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||||
return await db.Queryable<unit_user_equ>().Where(it => it.userId == userId && it.equId == equId).ToListAsync();
|
return await db.Queryable<unit_user_equ>().Where(it => it.userId == userId && it.equId == equId).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<unit_user_equ>> GetUserEquData(string userId, string code, List<string> noUeId)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||||
|
return await db.Queryable<unit_user_equ>().Where(it => it.userId == userId && it.code == code)
|
||||||
|
.WhereIF(noUeId.Count > 0, it => !noUeId.Contains(it.ueId))
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<unit_user_equ> GetUserEquInfo(string ueId)
|
public async Task<unit_user_equ> GetUserEquInfo(string ueId)
|
||||||
{
|
{
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||||
@@ -173,6 +181,115 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddUserEqu(unit_user_equ equData, string remark)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||||
|
var result = await db.Insertable(equData).ExecuteCommandAsync() > 0;
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//添加日志
|
||||||
|
await AddEquLogs([equData], 1, remark, true);
|
||||||
|
//更新负重
|
||||||
|
int weightCount = Convert.ToInt32(equData.weight);
|
||||||
|
if (weightCount > 0)
|
||||||
|
{
|
||||||
|
var attrService = App.GetService<IUnitUserWeight>();
|
||||||
|
await attrService.UpdateUserWeight(equData.userId, 1, weightCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<unit_user_equ> AddUserEqu(string userId, int equId, bool rdAttr = false, string remark = "")
|
||||||
|
{
|
||||||
|
var equ = await GetEquInfo(equId);
|
||||||
|
if (equ == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
unit_user_equ ue = new unit_user_equ();
|
||||||
|
string ueId = StringAssist.NewGuid;
|
||||||
|
ue.ueId = ueId;
|
||||||
|
ue.userId = userId;
|
||||||
|
ue.owerId = userId;
|
||||||
|
ue.equId = equ.equId;
|
||||||
|
ue.equName = equ.equName;
|
||||||
|
ue.unitEquName = equ.equName;
|
||||||
|
ue.img = equ.img;
|
||||||
|
ue.sign = "";
|
||||||
|
ue.isAppr = 1;
|
||||||
|
if (equ.isAppr == 0)
|
||||||
|
{
|
||||||
|
ue.minAtk = equ.minAtk;
|
||||||
|
ue.maxAtk = equ.maxAtk;
|
||||||
|
ue.Defense = Convert.ToInt32(equ.defense);
|
||||||
|
ue.Agility = Convert.ToInt32(equ.agility);
|
||||||
|
ue.Morale = Convert.ToInt32(equ.morale);
|
||||||
|
ue.Blood = Convert.ToInt32(equ.blood);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ue.minAtk = RandomAssist.GetFormatedNumeric((int)equ.minAtk, (int)equ.maxAtk);
|
||||||
|
ue.maxAtk = RandomAssist.GetFormatedNumeric((int)equ.minAtk, (int)equ.maxAtk);
|
||||||
|
string[] def = equ.defense.Split('-');
|
||||||
|
ue.Defense = RandomAssist.GetFormatedNumeric(Convert.ToInt32(def[0]), Convert.ToInt32(def[1]));
|
||||||
|
string[] agi = equ.agility.Split('-');
|
||||||
|
ue.Agility = RandomAssist.GetFormatedNumeric(Convert.ToInt32(agi[0]), Convert.ToInt32(agi[1]));
|
||||||
|
string[] mor = equ.morale.Split('-');
|
||||||
|
ue.Morale = RandomAssist.GetFormatedNumeric(Convert.ToInt32(mor[0]), Convert.ToInt32(mor[1]));
|
||||||
|
string[] blo = equ.blood.Split('-');
|
||||||
|
ue.Blood = RandomAssist.GetFormatedNumeric(Convert.ToInt32(blo[0]), Convert.ToInt32(blo[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
ue.code = equ.code;
|
||||||
|
ue.suitCode = equ.suitCode;
|
||||||
|
ue.lev = equ.lev;
|
||||||
|
ue.durability = equ.durability;
|
||||||
|
ue.maxdurability = equ.durability;
|
||||||
|
ue.isIntensify = equ.isIntensify;
|
||||||
|
ue.intensifyLev = 0;
|
||||||
|
ue.isLock = 0;
|
||||||
|
ue.holeCount = equ.holeCount;
|
||||||
|
ue.sex = equ.sex;
|
||||||
|
ue.weight = equ.weight;
|
||||||
|
ue.sysPrice = equ.sysPrice;
|
||||||
|
ue.qualityAttr = new List<AttrItem>();
|
||||||
|
if (rdAttr == false)
|
||||||
|
{
|
||||||
|
ue.quality = equ.quality;
|
||||||
|
ue.qualityName = GameTool.GetEquQualityName((int)ue.quality);
|
||||||
|
ue.EquAttr = equ.equAttr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var randomAttr = await GetRandomEquAttr(equ.code, (int)equ.lev);
|
||||||
|
ue.quality = randomAttr.Count;
|
||||||
|
ue.qualityName = GameTool.GetEquQualityName((int)ue.quality);
|
||||||
|
ue.EquAttr = randomAttr;
|
||||||
|
}
|
||||||
|
|
||||||
|
ue.canEqualUp = equ.canEqualUp;
|
||||||
|
ue.isDeal = equ.isDeal;
|
||||||
|
ue.isGive = equ.isGive;
|
||||||
|
ue.opTime = 0;
|
||||||
|
ue.start = 0;
|
||||||
|
ue.EquMent = new EquMent();
|
||||||
|
ue.EquAwaken = new List<EquAwaken>();
|
||||||
|
ue.GemMent = new List<EquGem>();
|
||||||
|
ue.useEndTime = TimeExtend.GetTimeStampBySeconds(DateTime.Now.AddYears(20));
|
||||||
|
ue.isOn = 0;
|
||||||
|
if (await AddUserEqu(ue, remark))
|
||||||
|
{
|
||||||
|
return ue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<bool> UpdateUserEquInfo(unit_user_equ equData, bool isAddLog = false, string code = "",
|
public async Task<bool> UpdateUserEquInfo(unit_user_equ equData, bool isAddLog = false, string code = "",
|
||||||
string remark = "")
|
string remark = "")
|
||||||
{
|
{
|
||||||
@@ -184,6 +301,11 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
{
|
{
|
||||||
await AddEquLog(equData, code, remark);
|
await AddEquLog(equData, code, remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (equData.isOn == 1)
|
||||||
|
{
|
||||||
|
await ClearUserOnEqu(equData.userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -325,6 +447,52 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<UserAttrModel> GetUserEquAttrModel(string userId)
|
||||||
|
{
|
||||||
|
var key = string.Format(UserCache.BaseCacheKeys, "EquData", "UserOnEquAttr");
|
||||||
|
if (await redis.HExistsHashAsync(key, userId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<UserAttrModel>(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
long endTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
UserAttrModel result = new UserAttrModel();
|
||||||
|
var myEqu = await GetUserOnEqu(userId);
|
||||||
|
foreach (var equ in myEqu)
|
||||||
|
{
|
||||||
|
if (equ.durability > 0 || equ.useEndTime > endTime)
|
||||||
|
{
|
||||||
|
UserAttrModel equTemp = new UserAttrModel();
|
||||||
|
var equAttr = EquTool.GetUserEquByIntensify(equ);
|
||||||
|
equTemp.minAtk = (int)equAttr.minAtk;
|
||||||
|
equTemp.maxAtk = (int)equAttr.maxAtk;
|
||||||
|
equTemp.defense = (int)equAttr.Defense;
|
||||||
|
equTemp.agility = (int)equAttr.Agility;
|
||||||
|
equTemp.upBlood = (int)equAttr.Blood;
|
||||||
|
equTemp.upMorale = (int)equAttr.Morale;
|
||||||
|
List<AttrItem> equAttrData = EquTool.GetUserEquAttrData(equ);
|
||||||
|
equTemp = GameAttrTool.GetRoleAttrTempMerge(equTemp, equAttrData);
|
||||||
|
result = GameAttrTool.GetRoleAttrTempMerge(result, equTemp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await redis.AddHashAsync(key, userId, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ClearUserOnEqu(string userId)
|
||||||
|
{
|
||||||
|
var key = string.Format(UserCache.BaseCacheKeys, "EquData", "UserOnEqu");
|
||||||
|
await redis.DelHashAsync(key, userId);
|
||||||
|
key = string.Format(UserCache.BaseCacheKeys, "EquData", "UserOnEquAttr");
|
||||||
|
await redis.DelHashAsync(key, userId);
|
||||||
|
//清理套装缓存
|
||||||
|
key = string.Format(UserCache.BaseCacheKeys, "EquData:UserEquSuit", userId);
|
||||||
|
await redis.DelAsync(key);
|
||||||
|
key = string.Format(UserCache.BaseCacheKeys, "EquData:UserEquSuitAttr", userId);
|
||||||
|
await redis.DelAsync(key);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<bool> EquOnOrDown(unit_user_equ data, int state)
|
public async Task<bool> EquOnOrDown(unit_user_equ data, int state)
|
||||||
{
|
{
|
||||||
data.isOn = state;
|
data.isOn = state;
|
||||||
@@ -334,21 +502,292 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
var equInfo = await GetEquInfo((int)data.equId);
|
var equInfo = await GetEquInfo((int)data.equId);
|
||||||
if (equInfo.useTime > 0)
|
if (equInfo.useTime > 0)
|
||||||
{
|
{
|
||||||
data.useEndTime = TimeExtend.GetTimeStampBySeconds(DateTime.Now.AddDays((int)equInfo.useTime)) ;
|
data.useEndTime = TimeExtend.GetTimeStampBySeconds(DateTime.Now.AddDays((int)equInfo.useTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||||
bool result = await db.Updateable(data).ExecuteCommandAsync() > 0;
|
bool result = await db.Updateable(data).ExecuteCommandAsync() > 0;
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
await ClearUserOnEqu(data.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取个人套装
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<UserEquSuit>> GetUserEquSuit(string userId)
|
||||||
|
{
|
||||||
|
List<UserEquSuit> result = new List<UserEquSuit>();
|
||||||
|
long time = TimeExtend.GetTimeStampSeconds;
|
||||||
|
var key = string.Format(UserCache.BaseCacheKeys, "EquData:UserEquSuit", userId);
|
||||||
|
if (await redis.ExistsAsync(key))
|
||||||
|
{
|
||||||
|
result = await redis.GetAsync<List<UserEquSuit>>(key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<string> opSuit = new List<string>();
|
||||||
|
var onEquData = await GetUserOnEqu(userId);
|
||||||
|
string[] onEqu = onEquData.Select(it => it.equId.ToString()).ToArray();
|
||||||
|
onEquData = onEquData.FindAll(it => it.useEndTime > time && it.durability > 0);
|
||||||
|
foreach (var item in onEquData)
|
||||||
|
{
|
||||||
|
if (item.suitCode != "0" && !string.IsNullOrEmpty(item.suitCode))
|
||||||
|
{
|
||||||
|
if (!opSuit.Contains(item.suitCode))
|
||||||
|
{
|
||||||
|
opSuit.Add(item.suitCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var suit in opSuit)
|
||||||
|
{
|
||||||
|
UserEquSuit temp = new UserEquSuit();
|
||||||
|
var suitInfo = await GetEuqSuitInfo(suit);
|
||||||
|
if (suitInfo != null)
|
||||||
|
{
|
||||||
|
temp.suitCode = suitInfo.suitCode;
|
||||||
|
temp.suitName = suitInfo.suitName;
|
||||||
|
temp.SuitAttr = new List<EquSuitAttr>();
|
||||||
|
foreach (var item in suitInfo.attr)
|
||||||
|
{
|
||||||
|
if (item.NeedType == nameof(EquEnum.SuitAttrNeedType.ON_EQU))
|
||||||
|
{
|
||||||
|
bool same = item.NeedData.All(item => onEqu.Contains(item));
|
||||||
|
if (same)
|
||||||
|
{
|
||||||
|
temp.SuitAttr.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (temp.SuitAttr.Count > 0) //存在满足条件得属性
|
||||||
|
{
|
||||||
|
result.Add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await redis.SetAsync(key, result, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<AttrItem>> GetUserEquSuitAttrInfo(string userId)
|
||||||
|
{
|
||||||
|
List<AttrItem> result = new List<AttrItem>();
|
||||||
|
var key = string.Format(UserCache.BaseCacheKeys, "EquData:UserEquSuitAttr", userId);
|
||||||
|
if (await redis.ExistsAsync(key))
|
||||||
|
{
|
||||||
|
result = await redis.GetAsync<List<AttrItem>>(key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var suitData = await GetUserEquSuit(userId);
|
||||||
|
foreach (var item in suitData)
|
||||||
|
{
|
||||||
|
foreach (var attr in item.SuitAttr)
|
||||||
|
{
|
||||||
|
result.AddRange(attr.AttrItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await redis.SetAsync(key, result, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 觉醒
|
||||||
|
|
||||||
|
public async Task<game_equ_awaken> GetEquAwakenInfo(string atId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "EquData", "AwakenData");
|
||||||
|
var data = await redis.GetHashAsync<game_equ_awaken>(key, atId);
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_equ_awaken>();
|
||||||
|
data = await db.Queryable<game_equ_awaken>().Where(i => i.atId == atId).SingleAsync();
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
await redis.AddHashAsync(key, atId, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<game_equ_awaken> GetRandomOneAwakenByCode(string code)
|
||||||
|
{
|
||||||
|
game_equ_awaken attr = new game_equ_awaken();
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_equ_awaken>();
|
||||||
|
var list = await db.Queryable<game_equ_awaken>().Where(i => i.position.Contains(code)).ToListAsync();
|
||||||
|
if (list.Count == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<object> data = new List<object>();
|
||||||
|
List<ushort> weights = new List<ushort>();
|
||||||
|
List<object> result = new List<object>();
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
data.Add(item);
|
||||||
|
weights.Add(ushort.Parse(item.random.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
RandomAssist random = new RandomAssist(1);
|
||||||
|
|
||||||
|
result = random.ControllerRandomExtract(rand, data, weights);
|
||||||
|
if (result.Count > 0)
|
||||||
|
{
|
||||||
|
attr = result[0] as game_equ_awaken;
|
||||||
|
return attr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<EquAwakenData> GetEquAwakenInfoByLev(string atId, int lev)
|
||||||
|
{
|
||||||
|
var awakenInfo = await GetEquAwakenInfo(atId);
|
||||||
|
EquAwakenData awaken = new EquAwakenData();
|
||||||
|
foreach (var item in awakenInfo.levAttr)
|
||||||
|
{
|
||||||
|
if (item.lev == lev)
|
||||||
|
{
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 洗练属性/词条
|
||||||
|
|
||||||
|
private async Task<List<game_equ_attr>> GetEquAttrData(string erCode)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "EquData", "EquAttrData");
|
||||||
|
if (await redis.HExistsHashAsync(key, erCode))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<List<game_equ_attr>>(key, erCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_equ_attr>();
|
||||||
|
var data = await db.Queryable<game_equ_attr>().Where(it => it.equCode == erCode).ToListAsync();
|
||||||
|
await redis.AddHashAsync(key, erCode, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<AttrItem>> GetRandomEquAttr(string equCode, int lev)
|
||||||
|
{
|
||||||
|
//计算出的数量
|
||||||
|
List<RandomDataBase> numData = new List<RandomDataBase>()
|
||||||
|
{
|
||||||
|
new RandomDataBase() { random = 100, data = 1 },
|
||||||
|
new RandomDataBase() { random = 90, data = 2 },
|
||||||
|
new RandomDataBase() { random = 80, data = 3 },
|
||||||
|
new RandomDataBase() { random = 50, data = 4 },
|
||||||
|
new RandomDataBase() { random = 30, data = 5 },
|
||||||
|
new RandomDataBase() { random = 15, data = 6 },
|
||||||
|
new RandomDataBase() { random = 5, data = 7 },
|
||||||
|
};
|
||||||
|
var numR = GameBus.GetRandomByWeight(numData);
|
||||||
|
int onNum = Convert.ToInt32(numR.data);
|
||||||
|
var attrData = await GetEquAttrData(equCode);
|
||||||
|
attrData = attrData.FindAll(it => it.minLev <= lev && it.maxLev >= lev);
|
||||||
|
|
||||||
|
//开始随机拿属性权重
|
||||||
|
List<object> data = new List<object>();
|
||||||
|
List<ushort> weights = new List<ushort>();
|
||||||
|
List<object> attrResult = new List<object>();
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
foreach (var item in attrData)
|
||||||
|
{
|
||||||
|
data.Add(item);
|
||||||
|
weights.Add(ushort.Parse(item.random.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
RandomAssist random = new RandomAssist(onNum);
|
||||||
|
|
||||||
|
attrResult = random.ControllerRandomExtract(rand, data, weights);
|
||||||
|
List<AttrItem> result = new List<AttrItem>();
|
||||||
|
if (attrResult.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in attrResult)
|
||||||
|
{
|
||||||
|
var onAttr = item as game_equ_attr;
|
||||||
|
|
||||||
|
AttrItem temp = new AttrItem();
|
||||||
|
temp.code = onAttr.code;
|
||||||
|
temp.compute = onAttr.compute;
|
||||||
|
if (onAttr.nt == "Number")
|
||||||
|
{
|
||||||
|
int onMin = Convert.ToInt32(onAttr.min_v);
|
||||||
|
int onMax = Convert.ToInt32(onAttr.max_v);
|
||||||
|
int onPar = RandomAssist.GetFormatedNumeric(onMin, onMax + 1);
|
||||||
|
temp.parameter = onPar;
|
||||||
|
string onTip = temp.parameter.ToString().TrimEnd('0').TrimEnd('.');
|
||||||
|
temp.tip = string.Format(onAttr.tips, onTip);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int onMin = Convert.ToInt32(onAttr.min_v * 100);
|
||||||
|
int onMax = Convert.ToInt32(onAttr.max_v * 100);
|
||||||
|
int onPar = RandomAssist.GetFormatedNumeric(onMin, onMax + 1);
|
||||||
|
temp.parameter = Math.Round(Convert.ToDecimal(onPar / 100.000M), 2);
|
||||||
|
string onTip = (temp.parameter * 100).ToString().TrimEnd('0').TrimEnd('.');
|
||||||
|
temp.tip = string.Format(onAttr.tips, onTip);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.Add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 强化相关
|
||||||
|
|
||||||
|
public async Task<unit_user_equ> GetUserEquAttr(unit_user_equ equ)
|
||||||
|
{
|
||||||
|
return equ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<game_equ_up> GetUserEquUpData(int lev)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "EquData", "EquUpData");
|
||||||
|
var data = await redis.GetHashAsync<game_equ_up>(key, lev.ToString());
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_equ_up>();
|
||||||
|
data = await db.Queryable<game_equ_up>().Where(i => i.onLev <= lev && i.maxLev >= lev).FirstAsync();
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
await redis.AddHashAsync(key, lev.ToString(), data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -361,5 +800,43 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
return data.Sum(it => (int)it.weight);
|
return data.Sum(it => (int)it.weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<List<game_equ_make>> GetEquMakeData(int goodsId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "EquData", "EquUpData");
|
||||||
|
if (await redis.HExistsHashAsync(key, goodsId.ToString()))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<List<game_equ_make>>(key, goodsId.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_equ_make>();
|
||||||
|
var data = await db.Queryable<game_equ_make>().Where(it => it.goodsId == goodsId).ToListAsync();
|
||||||
|
await redis.AddHashAsync(key, goodsId.ToString(), data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<game_equ_make> GetMakeEquByGoodsId(int goodsId)
|
||||||
|
{
|
||||||
|
//构建随机数据
|
||||||
|
List<RandomDataBase> equBase = new List<RandomDataBase>();
|
||||||
|
var equData = await GetEquMakeData(goodsId);
|
||||||
|
foreach (var me in equData)
|
||||||
|
{
|
||||||
|
RandomDataBase temp = new RandomDataBase();
|
||||||
|
temp.random = (double)me.random;
|
||||||
|
temp.data = me;
|
||||||
|
equBase.Add(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
var makeEqu = GameBus.GetRandomByWeight(equBase);
|
||||||
|
if (makeEqu == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var onMakeEqu = makeEqu.data as game_equ_make;
|
||||||
|
|
||||||
|
return onMakeEqu;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGameFightService, ITransient
|
||||||
|
{
|
||||||
|
#region 用户战斗索引
|
||||||
|
|
||||||
|
public async Task<List<string>> GetUserFight(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(FightCache.FightCacheKey, "UserFight");
|
||||||
|
if (await redis.HExistsHashAsync(key, userId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<List<string>>(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> data = new List<string>();
|
||||||
|
await redis.AddHashAsync(key, userId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<bool> AddUserFight(string userId, string fightId)
|
||||||
|
{
|
||||||
|
var data = await GetUserFight(userId);
|
||||||
|
data.Add(fightId);
|
||||||
|
string key = string.Format(FightCache.FightCacheKey, "UserFight");
|
||||||
|
bool result = await redis.AddHashAsync(key, userId, data);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> RemoveUserFight(string userId, string fightId)
|
||||||
|
{
|
||||||
|
var data = await GetUserFight(userId);
|
||||||
|
data.Remove(fightId);
|
||||||
|
string key = string.Format(FightCache.FightCacheKey, "UserFight");
|
||||||
|
bool result = await redis.AddHashAsync(key, userId, data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 战斗信息
|
||||||
|
|
||||||
|
public async Task<game_fight_data> GetFightInfo(string fightId)
|
||||||
|
{
|
||||||
|
string key = string.Format(FightCache.FightCacheKeys, "FightData:Info", fightId);
|
||||||
|
if (await redis.ExistsAsync(key))
|
||||||
|
{
|
||||||
|
return await redis.GetAsync<game_fight_data>(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_fight_data>();
|
||||||
|
game_fight_data data = await db.Queryable<game_fight_data>().Where(it => it.fightId == fightId).SingleAsync();
|
||||||
|
await redis.SetAsync(key, data, 3600);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<long> GetFightBlood(string keyId, long maxBlood)
|
||||||
|
{
|
||||||
|
long blood = maxBlood;
|
||||||
|
string key = string.Format(FightCache.FightCacheKeys, "FightData:Blood", keyId);
|
||||||
|
if (await redis.ExistsAsync(key))
|
||||||
|
{
|
||||||
|
blood = await redis.GetAsync<long>(key);
|
||||||
|
blood = blood > maxBlood ? maxBlood : blood;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await SetFightBlood(keyId, blood);
|
||||||
|
}
|
||||||
|
|
||||||
|
return blood;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SetFightBlood(string keyId, long blood)
|
||||||
|
{
|
||||||
|
string key = string.Format(FightCache.FightCacheKeys, "FightData:Blood", keyId);
|
||||||
|
await redis.SetAsync(key, blood, 43200);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task AddFightHarm(string fightId,string userId, long harm)
|
||||||
|
{
|
||||||
|
string key = string.Format(FightCache.FightCacheKeys, "FightData:Harm", fightId);
|
||||||
|
if (await redis.HExistsHashAsync(key, userId))
|
||||||
|
{
|
||||||
|
long sum = await redis.GetHashAsync<long>(key, userId);
|
||||||
|
sum += harm;
|
||||||
|
await redis.AddHashAsync(key, userId, sum);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await redis.AddHashAsync(key, userId, harm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private async Task ClearFightInfoCache(string fightId, string keyId)
|
||||||
|
{
|
||||||
|
string key1 = string.Format(FightCache.FightCacheKeys, "FightData:Info", fightId);
|
||||||
|
string key2 = string.Format(FightCache.FightCacheKeys, "FightData:Blood", keyId);
|
||||||
|
await redis.DelAsync(key1, key2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddFight(string fightId, string areaCode, string keyId, string mainId, string code,
|
||||||
|
string scene, string mapId,
|
||||||
|
string userId, long exp = 0, long copper = 0, long petExp = 0, string award = "", string pars = "")
|
||||||
|
{
|
||||||
|
long addTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
long endTime = addTime + 24 * 60 * 60;
|
||||||
|
|
||||||
|
List<game_fight_data> fights = new List<game_fight_data>();
|
||||||
|
|
||||||
|
game_fight_data data = new game_fight_data()
|
||||||
|
{
|
||||||
|
fightId = fightId,
|
||||||
|
areaCode = areaCode,
|
||||||
|
keyId = keyId,
|
||||||
|
mainId = mainId,
|
||||||
|
code = code,
|
||||||
|
scene = scene,
|
||||||
|
mapId = mapId,
|
||||||
|
userId = userId,
|
||||||
|
state = 0,
|
||||||
|
winUser = "",
|
||||||
|
exp = exp,
|
||||||
|
copper = copper,
|
||||||
|
petExp = petExp,
|
||||||
|
award = award,
|
||||||
|
pars = pars,
|
||||||
|
addTime = addTime,
|
||||||
|
okTime = 0,
|
||||||
|
endTime = endTime
|
||||||
|
};
|
||||||
|
fights.Add(data);
|
||||||
|
if (code == nameof(GameEnum.FightCode.PVP))
|
||||||
|
{
|
||||||
|
fights.Add(new game_fight_data()
|
||||||
|
{
|
||||||
|
fightId = StringAssist.NewGuid,
|
||||||
|
areaCode = areaCode,
|
||||||
|
keyId = keyId,
|
||||||
|
mainId = userId,
|
||||||
|
code = code,
|
||||||
|
scene = scene,
|
||||||
|
mapId = mapId,
|
||||||
|
userId = mainId,
|
||||||
|
state = 0,
|
||||||
|
winUser = "",
|
||||||
|
exp = exp,
|
||||||
|
copper = copper,
|
||||||
|
petExp = petExp,
|
||||||
|
award = award,
|
||||||
|
pars = pars,
|
||||||
|
addTime = addTime,
|
||||||
|
okTime = 0,
|
||||||
|
endTime = endTime
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_fight_data>();
|
||||||
|
bool result = await db.Insertable(fights).ExecuteCommandAsync() > 0;
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
foreach (var item in fights)
|
||||||
|
{
|
||||||
|
await AddUserFight(item.userId, item.fightId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> SetFightWin(string fightId, string winUser)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
var data = await GetFightInfo(fightId);
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
long okTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
data.state = 1;
|
||||||
|
data.winUser = winUser;
|
||||||
|
data.okTime = okTime;
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_fight_data>();
|
||||||
|
result = await db.Updateable<game_fight_data>().SetColumns(it => it.state == 1)
|
||||||
|
.SetColumns(it => it.winUser == winUser)
|
||||||
|
.SetColumns(it => it.okTime == okTime)
|
||||||
|
.Where(it => it.fightId == fightId).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await ClearFightInfoCache(fightId, data.keyId);
|
||||||
|
//此处调用战斗结束相关
|
||||||
|
await HandleFight(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 战斗相关
|
||||||
|
|
||||||
|
private async Task HandleFight(game_fight_data data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Reflection.Metadata;
|
using System.Reflection.Metadata;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Application.Domain;
|
namespace Application.Domain;
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
|||||||
.OrderBy(it => it.count, OrderByType.Desc)
|
.OrderBy(it => it.count, OrderByType.Desc)
|
||||||
.ToPageListAsync(page, limit, total);
|
.ToPageListAsync(page, limit, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<unit_user_goods>> GetUserGoodsData(string userId, string code)
|
public async Task<List<unit_user_goods>> GetUserGoodsData(string userId, string code)
|
||||||
{
|
{
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_goods>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_goods>();
|
||||||
@@ -163,8 +165,6 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
|||||||
return await db.Insertable(bagLog).SplitTable().ExecuteCommandAsync() > 0;
|
return await db.Insertable(bagLog).SplitTable().ExecuteCommandAsync() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 辅助
|
#region 辅助
|
||||||
@@ -187,19 +187,142 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 船只
|
#region 药品
|
||||||
public async Task<game_ship> GetShipInfo(int shipId)
|
|
||||||
|
private async Task<long> GetUserDrugLockTime(string userId, int goodsId)
|
||||||
{
|
{
|
||||||
string key = string.Format(BaseCache.BaseCacheKey, "ShipData");
|
long result = 0;
|
||||||
var data = await redis.GetHashAsync<game_ship>(key, shipId.ToString());
|
string key = string.Format(UserCache.BaseCacheKey, "UserDrug", $"Lock:{userId}_{goodsId}");
|
||||||
if (data == null)
|
if (await redis.ExistsAsync(key))
|
||||||
{
|
{
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<game_ship>();
|
long end = await redis.GetAsync<long>(key);
|
||||||
data = await db.Queryable<game_ship>().Where(it => it.shipId == shipId).SingleAsync();
|
result = end - TimeExtend.GetTimeStampSeconds;
|
||||||
await redis.AddHashAsync(key, shipId.ToString(), data);
|
result = result < 0 ? 0 : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task AddUserDrugLockTime(string userId, int goodsId, int time)
|
||||||
|
{
|
||||||
|
if (time > 0)
|
||||||
|
{
|
||||||
|
long end = TimeExtend.GetTimeStampSeconds + time;
|
||||||
|
string key = string.Format(UserCache.BaseCacheKey, "UserDrug", $"Lock:{userId}_{goodsId}");
|
||||||
|
await redis.SetAsync(key, end, time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<int> GetUserDrugLockCount(string userId, int goodsId, string scene = "")
|
||||||
|
{
|
||||||
|
int result = 0;
|
||||||
|
if (!string.IsNullOrEmpty(scene))
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKey, "UserDrug", $"Count:{scene}:{userId}_{goodsId}");
|
||||||
|
if (await redis.ExistsAsync(key))
|
||||||
|
{
|
||||||
|
result = await redis.GetAsync<int>(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task AddUserDrugLockCount(string userId, int goodsId, string scene = "")
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(scene))
|
||||||
|
{
|
||||||
|
var count = await GetUserDrugLockCount(userId, goodsId, scene);
|
||||||
|
count += 1;
|
||||||
|
string key = string.Format(UserCache.BaseCacheKey, "UserDrug", $"Count:{scene}:{userId}_{goodsId}");
|
||||||
|
await redis.SetAsync(key, count, 43200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<string> CheckUseDrug(string userId, int goodsId, string drugConfig, string scene = "")
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
dynamic _drugConfig = JsonConvert.DeserializeObject<dynamic>(drugConfig);
|
||||||
|
if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.Blood))
|
||||||
|
{
|
||||||
|
//判断所定
|
||||||
|
long lockTime = await GetUserDrugLockTime(userId, goodsId);
|
||||||
|
if (lockTime > 0)
|
||||||
|
{
|
||||||
|
result = $"药品冷却中,{lockTime}秒后可使用!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.BloodStock))
|
||||||
|
{
|
||||||
|
if (_drugConfig.type == nameof(GameEnum.GameStockType.Number))
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(scene))
|
||||||
|
{
|
||||||
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
|
var userStock = await attrService.GetUserStock(userId);
|
||||||
|
if (userStock.Count(it => it.goodsId == goodsId.ToString()) > 0)
|
||||||
|
{
|
||||||
|
result = "您已经使用过该药品啦!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//要判断使用个数
|
||||||
|
if (_drugConfig.use > 0)
|
||||||
|
{
|
||||||
|
var count = await GetUserDrugLockCount(userId, goodsId, scene);
|
||||||
|
if (count >= _drugConfig.use)
|
||||||
|
{
|
||||||
|
result = $"当前最多可用{_drugConfig.use}个该物品!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UseDrug(string userId, int goodsId, string drugConfig, string scene = "")
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
|
dynamic _drugConfig = JsonConvert.DeserializeObject<dynamic>(drugConfig);
|
||||||
|
if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.Blood))
|
||||||
|
{
|
||||||
|
result = await attrService.UpdateUserBlood(userId, 1, Convert.ToInt32(_drugConfig.num), true);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await AddUserDrugLockTime(userId, goodsId, Convert.ToInt32(_drugConfig.time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.Morale))
|
||||||
|
{
|
||||||
|
result = await attrService.UpdateUserMorale(userId, 1, Convert.ToInt32(_drugConfig.num));
|
||||||
|
}
|
||||||
|
else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.Vigour))
|
||||||
|
{
|
||||||
|
result = await attrService.UpdateUserVigour(userId, 1, Convert.ToInt32(_drugConfig.num));
|
||||||
|
}
|
||||||
|
else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.LoadBuff))
|
||||||
|
{
|
||||||
|
result = await attrService.RandomRemoveUserLoadState(userId, Convert.ToInt32(_drugConfig.num));
|
||||||
|
}
|
||||||
|
else if (_drugConfig.cls == nameof(GoodsEnum.DrugCls.BloodStock))
|
||||||
|
{
|
||||||
|
result = await attrService.AddUserStock(userId, goodsId.ToString(), Convert.ToString(_drugConfig.name),Convert.ToString(_drugConfig.type),
|
||||||
|
Convert.ToString(_drugConfig.code),
|
||||||
|
Convert.ToInt64(_drugConfig.num), Convert.ToString(_drugConfig.par),
|
||||||
|
Convert.ToInt32(_drugConfig.minute));
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await AddUserDrugLockCount(userId, goodsId, scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -148,6 +148,12 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
return data.mapId;
|
return data.mapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<game_city_map> GetUserOnToMapInfo(string userId)
|
||||||
|
{
|
||||||
|
var onMap = await GetUserOnMapId(userId);
|
||||||
|
return await GetMapInfo(onMap);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<unit_user_online> GetUserOnMap(string userId)
|
public async Task<unit_user_online> GetUserOnMap(string userId)
|
||||||
{
|
{
|
||||||
string key = string.Format(UserCache.BaseCacheKey, "UserOnline");
|
string key = string.Format(UserCache.BaseCacheKey, "UserOnline");
|
||||||
@@ -832,7 +838,7 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
if (!string.IsNullOrEmpty(offSet))
|
if (!string.IsNullOrEmpty(offSet))
|
||||||
{
|
{
|
||||||
var offsetData = JsonConvert.DeserializeObject<TowerNeed>(offSet);
|
var offsetData = JsonConvert.DeserializeObject<TowerNeed>(offSet);
|
||||||
var chekResult = await GameBus.CheakNeed(userId, offsetData, "");
|
var chekResult = await GameBus.CheckNeed(userId, offsetData);
|
||||||
if (chekResult.result)
|
if (chekResult.result)
|
||||||
{
|
{
|
||||||
if (offsetData.isOp == 0)
|
if (offsetData.isOp == 0)
|
||||||
@@ -858,7 +864,7 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
|
|
||||||
public async Task<List<game_city_map_bus>> GetMapBus(string BusCode, int v, int l)
|
public async Task<List<game_city_map_bus>> GetMapBus(string BusCode, int v, int l)
|
||||||
{
|
{
|
||||||
string key = string.Format(BaseCache.BaseCacheKeys, "CITY_MAP_BUS", BusCode);
|
string key = string.Format(BaseCache.BaseCacheKeys, "CityMapBus", BusCode);
|
||||||
var data = await redis.GetAsync<List<game_city_map_bus>>(key);
|
var data = await redis.GetAsync<List<game_city_map_bus>>(key);
|
||||||
if (data == null)
|
if (data == null)
|
||||||
{
|
{
|
||||||
@@ -877,7 +883,7 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
|
|
||||||
public async Task<game_city_map_bus> GetMapBusInfo(int busId)
|
public async Task<game_city_map_bus> GetMapBusInfo(int busId)
|
||||||
{
|
{
|
||||||
string key = string.Format(BaseCache.BaseCacheKeys, "CITY_MAP_BUS", "BUS_INFO");
|
string key = string.Format(BaseCache.BaseCacheKeys, "CityMapBus", "BUS_INFO");
|
||||||
if (await redis.HExistsHashAsync(key, busId.ToString()))
|
if (await redis.HExistsHashAsync(key, busId.ToString()))
|
||||||
{
|
{
|
||||||
return await redis.GetHashAsync<game_city_map_bus>(key, busId.ToString());
|
return await redis.GetHashAsync<game_city_map_bus>(key, busId.ToString());
|
||||||
@@ -925,6 +931,7 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 地图资源
|
#region 地图资源
|
||||||
|
|
||||||
public async Task<game_city_map_res> GetMapResInfo(string resId)
|
public async Task<game_city_map_res> GetMapResInfo(string resId)
|
||||||
{
|
{
|
||||||
string key = string.Format(BaseCache.BaseCacheKeys, "CityData", "MapResInfo");
|
string key = string.Format(BaseCache.BaseCacheKeys, "CityData", "MapResInfo");
|
||||||
@@ -938,6 +945,7 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
|||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<game_city_map_res>> GetMapRes(string mapId)
|
public async Task<List<game_city_map_res>> GetMapRes(string mapId)
|
||||||
{
|
{
|
||||||
string key = string.Format(BaseCache.BaseCacheKeys, "CityData", "MapRes");
|
string key = string.Format(BaseCache.BaseCacheKeys, "CityData", "MapRes");
|
||||||
|
|||||||
@@ -0,0 +1,207 @@
|
|||||||
|
using Microsoft.VisualBasic.CompilerServices;
|
||||||
|
|
||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public class GameMonsterService(ISqlSugarClient DbClient, IRedisCache redis) : IGameMonsterService, ITransient
|
||||||
|
{
|
||||||
|
#region 基础资源库
|
||||||
|
|
||||||
|
public async Task<game_monster> GetMonsterInfo(string monsterId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "MonsterData", "MonsterInfo");
|
||||||
|
if (await redis.HExistsHashAsync(key, monsterId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<game_monster>(key, monsterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_monster>();
|
||||||
|
var data = await db.Queryable<game_monster>().Where(it => it.monsterId == monsterId).SingleAsync();
|
||||||
|
await redis.AddHashAsync(key, monsterId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 地图怪物
|
||||||
|
|
||||||
|
public async Task<List<game_monster_map>> GetMonsterDataByMap(string mapId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "MonsterData", "MonsterOnMap");
|
||||||
|
if (await redis.HExistsHashAsync(key, mapId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<List<game_monster_map>>(key, mapId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_monster_map>();
|
||||||
|
var data = await db.Queryable<game_monster_map>().Where(it => it.mapId == mapId).ToListAsync();
|
||||||
|
await redis.AddHashAsync(key, mapId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<game_monster_map> GetMapMonsterInfo(string mmId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "MonsterData", "MapMonsterInfo");
|
||||||
|
if (await redis.HExistsHashAsync(key, mmId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<game_monster_map>(key, mmId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_monster_map>();
|
||||||
|
var data = await db.Queryable<game_monster_map>().Where(it => it.mmId == mmId).SingleAsync();
|
||||||
|
await redis.AddHashAsync(key, mmId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> CreateMonsterToMap(string userId, string mapId, string areaCode, string monsterId,
|
||||||
|
int count = 1, int time = 0, string par = "")
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
var monsterInfo = await GetMonsterInfo(monsterId);
|
||||||
|
if (monsterInfo != null)
|
||||||
|
{
|
||||||
|
time = time <= 0 ? 7 * 24 * 60 : time;
|
||||||
|
long onTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
long endTime = onTime + time * 60;
|
||||||
|
List<unit_user_monster> data = new List<unit_user_monster>();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
data.Add(new unit_user_monster()
|
||||||
|
{
|
||||||
|
umId = StringAssist.NewGuid,
|
||||||
|
userId = userId,
|
||||||
|
areaCode = areaCode,
|
||||||
|
mapId = mapId,
|
||||||
|
monsterId = monsterId,
|
||||||
|
monsterName = monsterInfo.name,
|
||||||
|
code = monsterInfo.code,
|
||||||
|
par = par,
|
||||||
|
addTime = onTime,
|
||||||
|
endTime = endTime
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.Count > 0)
|
||||||
|
{
|
||||||
|
var createDb = DbClient.AsTenant().GetConnectionWithAttr<unit_user_monster>();
|
||||||
|
await createDb.Insertable(data).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await ClearCreateMonster(mapId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<List<unit_user_monster>> GetCreateMonsterByMapId(string mapId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "MonsterData", "CreateMonsterOnMap");
|
||||||
|
if (await redis.HExistsHashAsync(key, mapId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<List<unit_user_monster>>(key, mapId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_monster>();
|
||||||
|
var data = await db.Queryable<unit_user_monster>().Where(it => it.mapId == mapId).ToListAsync();
|
||||||
|
await redis.AddHashAsync(key, mapId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<unit_user_monster> GetCreateMonsterInfo(string umId)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_monster>();
|
||||||
|
var data = await db.Queryable<unit_user_monster>().Where(it => it.umId == umId).SingleAsync();
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ClearCreateMonster(string mapId)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKeys, "MonsterData", "CreateMonsterOnMap");
|
||||||
|
await redis.DelHashAsync(key, mapId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<MapMonsterModel>> GetMapMonster(string userId, string mapId, string teamId)
|
||||||
|
{
|
||||||
|
string userKey = await UserKeyTool.GetUserKey(userId);
|
||||||
|
List<MapMonsterModel> result = new List<MapMonsterModel>();
|
||||||
|
var mapMonster = await GetMonsterDataByMap(mapId);
|
||||||
|
if (mapMonster.Count > 0)
|
||||||
|
{
|
||||||
|
int random = 0; //此处需要判断用户状态中的几率
|
||||||
|
int onTime = TimeAssist.GetHourNum;
|
||||||
|
foreach (var item in mapMonster)
|
||||||
|
{
|
||||||
|
if (item.sTime < onTime && item.eTime > onTime)
|
||||||
|
{
|
||||||
|
if (RandomAssist.CheakRandom((int)item.chance + random))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < item.addCount; i++)
|
||||||
|
{
|
||||||
|
MapMonsterModel temp = new MapMonsterModel()
|
||||||
|
{
|
||||||
|
monterId = item.mmId,
|
||||||
|
name = item.monsterName,
|
||||||
|
type = 0,
|
||||||
|
sign = UserKeyTool.GetThickenDataByUserKey(userKey, "0", item.mmId)
|
||||||
|
};
|
||||||
|
result.Add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//此处追加个人生成怪物
|
||||||
|
List<unit_user_monster> createData = new List<unit_user_monster>();
|
||||||
|
var createMonster = await GetCreateMonsterByMapId(mapId);
|
||||||
|
if (createMonster.Count > 0)
|
||||||
|
{
|
||||||
|
long onTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
createMonster = createMonster.FindAll(it => it.endTime > onTime);
|
||||||
|
|
||||||
|
createData.AddRange(createMonster.FindAll(it =>
|
||||||
|
it.userId == userId || it.areaCode == nameof(GameEnum.AreaCode.Public)));
|
||||||
|
if (!string.IsNullOrEmpty(teamId) && teamId != "0")
|
||||||
|
{
|
||||||
|
var teamService = App.GetService<IGameTeamService>();
|
||||||
|
var teamMember = await teamService.GetTeamMember(teamId);
|
||||||
|
teamMember = teamMember.FindAll(it => it.userId != userId);
|
||||||
|
var onCreate = createMonster.FindAll(it =>
|
||||||
|
teamMember.Any(team =>
|
||||||
|
team.userId == it.userId && it.areaCode == nameof(GameEnum.AreaCode.Team)));
|
||||||
|
foreach (var item in onCreate)
|
||||||
|
{
|
||||||
|
if (createData.Any(it => it.umId == item.umId))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
createData.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (createData.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in createData)
|
||||||
|
{
|
||||||
|
MapMonsterModel temp = new MapMonsterModel()
|
||||||
|
{
|
||||||
|
monterId = item.umId,
|
||||||
|
name = item.monsterName,
|
||||||
|
type = 1,
|
||||||
|
sign = UserKeyTool.GetThickenDataByUserKey(userKey, "1", item.umId)
|
||||||
|
};
|
||||||
|
result.Add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public class GameDicService(ISqlSugarClient DbClient, IRedisCache redis) : IGameDicService, ITransient
|
||||||
|
{
|
||||||
|
public async Task<game_dic> GetDicInfo(string code)
|
||||||
|
{
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKey, "DicData");
|
||||||
|
if (await redis.HExistsHashAsync(key, code))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<game_dic>(key, code);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_dic>();
|
||||||
|
var data = await db.Queryable<game_dic>().Where(it => it.code == code).SingleAsync();
|
||||||
|
await redis.AddHashAsync(key, code, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -34,6 +34,7 @@ public class GameTeamService(ISqlSugarClient DbClient, IRedisCache redis) : IGam
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<game_team> GetTeamInfo(string teamId)
|
public async Task<game_team> GetTeamInfo(string teamId)
|
||||||
{
|
{
|
||||||
string key = string.Format(UserCache.BaseCacheKeys, "TeamData", "TeamData");
|
string key = string.Format(UserCache.BaseCacheKeys, "TeamData", "TeamData");
|
||||||
|
|||||||
@@ -311,8 +311,9 @@ public class MessageService(ISqlSugarClient DbClient, IRedisCache redis) : IMess
|
|||||||
return await db.Queryable<unit_user_message_event>().Where(it => it.state == 0 && it.token == token).AnyAsync();
|
return await db.Queryable<unit_user_message_event>().Where(it => it.state == 0 && it.token == token).AnyAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> SendEventMsg(string userId, string code, string name, string sign, string pars,string token,
|
public async Task<bool> SendEventMsg(string userId, string code, string name, string sign, string pars,
|
||||||
List<MsgEventBtn> btns=null, int days = 10)
|
string token,
|
||||||
|
List<MsgEventBtn> btns = null, int days = 10)
|
||||||
{
|
{
|
||||||
unit_user_message_event data = new unit_user_message_event();
|
unit_user_message_event data = new unit_user_message_event();
|
||||||
data.eventId = StringAssist.NewGuid;
|
data.eventId = StringAssist.NewGuid;
|
||||||
@@ -333,6 +334,7 @@ public class MessageService(ISqlSugarClient DbClient, IRedisCache redis) : IMess
|
|||||||
{
|
{
|
||||||
data.btns = btns;
|
data.btns = btns;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.addTime = DateTime.Now;
|
data.addTime = DateTime.Now;
|
||||||
data.endTime = TimeExtend.GetTimeStampBySeconds(DateTime.Now.AddDays(days));
|
data.endTime = TimeExtend.GetTimeStampBySeconds(DateTime.Now.AddDays(days));
|
||||||
data.token = token;
|
data.token = token;
|
||||||
@@ -347,4 +349,54 @@ public class MessageService(ISqlSugarClient DbClient, IRedisCache redis) : IMess
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 广播消息
|
||||||
|
|
||||||
|
public async Task<List<game_broadcast>> GetBroadcastData(int area)
|
||||||
|
{
|
||||||
|
List<game_broadcast> data = new List<game_broadcast>();
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKey, "GameBroadcast");
|
||||||
|
var result = await redis.GetHashAllAsync<game_broadcast>(key);
|
||||||
|
if (result.Count > 0)
|
||||||
|
{
|
||||||
|
data = result.Values.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
long time = TimeExtend.GetTimeStampSeconds;
|
||||||
|
data = data.FindAll(it => (it.area == area || it.area == 0) && it.endTime > time);
|
||||||
|
data = data.OrderByDescending(it => it.endTime).Take(2).ToList();
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> SendBroadcast(string userId, string code, string msg)
|
||||||
|
{
|
||||||
|
game_broadcast add = new game_broadcast();
|
||||||
|
add.Id = StringAssist.NewGuid;
|
||||||
|
add.userId = userId;
|
||||||
|
add.code = code;
|
||||||
|
add.msg = msg;
|
||||||
|
int area = 0;
|
||||||
|
if (add.userId == "0")
|
||||||
|
{
|
||||||
|
add.area = 0;
|
||||||
|
add.userNo = "0";
|
||||||
|
add.nick = "海精灵";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var userService = App.GetService<IUnitUserService>();
|
||||||
|
var userInfo = await userService.GetUserInfoByUserId(userId);
|
||||||
|
add.area = (int)userInfo.areaId;
|
||||||
|
add.userNo = userInfo.userNo;
|
||||||
|
add.nick = userInfo.nick;
|
||||||
|
area = add.area;
|
||||||
|
}
|
||||||
|
|
||||||
|
add.endTime = TimeExtend.GetTimeStampSeconds + 300;
|
||||||
|
string key = string.Format(BaseCache.BaseCacheKey, "GameBroadcast");
|
||||||
|
bool result = await redis.AddHashAsync(key, add.Id, add);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
{
|
{
|
||||||
#region 个人属性
|
#region 个人属性
|
||||||
|
|
||||||
public async Task<UserAttrModel> GetUserAttrModel(string userId)
|
public async Task<UserAttrModel> GetUserAttrModel(string userId, string scene = "Default")
|
||||||
{
|
{
|
||||||
UserAttrModel result = new UserAttrModel();
|
UserAttrModel result = new UserAttrModel();
|
||||||
result.id = userId;
|
result.id = userId;
|
||||||
@@ -24,11 +24,150 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
result.agility = (int)unitAttr.agility;
|
result.agility = (int)unitAttr.agility;
|
||||||
result.upBlood = (int)unitAttr.upBlood;
|
result.upBlood = (int)unitAttr.upBlood;
|
||||||
result.upMorale = (int)unitAttr.upMorale;
|
result.upMorale = (int)unitAttr.upMorale;
|
||||||
var bloodInfo = await GetUserBlood(userId);
|
|
||||||
result.blood = (int)bloodInfo.blood;
|
|
||||||
var moraleInfo = await GetUserMorale(userId);
|
|
||||||
result.morale = (int)moraleInfo.morale;
|
|
||||||
|
|
||||||
|
List<AttrItem> ExtendAttrData = new List<AttrItem>();
|
||||||
|
|
||||||
|
#region 构造基础加层体系
|
||||||
|
|
||||||
|
UserAttrModel temp = new UserAttrModel();
|
||||||
|
temp.minAtk = (int)unitAttr.minAtk;
|
||||||
|
temp.maxAtk = (int)unitAttr.maxAtk;
|
||||||
|
temp.defense = (int)unitAttr.defense;
|
||||||
|
temp.agility = (int)unitAttr.agility;
|
||||||
|
temp.upBlood = (int)unitAttr.upBlood;
|
||||||
|
temp.upMorale = (int)unitAttr.upMorale;
|
||||||
|
|
||||||
|
var equService = App.GetService<IGameEquService>();
|
||||||
|
var equTemp = await equService.GetUserEquAttrModel(userId);
|
||||||
|
temp = GameAttrTool.GetRoleAttrTempMerge(temp, equTemp);
|
||||||
|
//套装加层
|
||||||
|
var suitAttr = await equService.GetUserEquSuitAttrInfo(userId);
|
||||||
|
ExtendAttrData.AddRange(suitAttr);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 参数
|
||||||
|
|
||||||
|
int minAtk = 0;
|
||||||
|
int maxAtk = 0;
|
||||||
|
int Agility = 0;
|
||||||
|
int Defense = 0;
|
||||||
|
int upBlood = 0;
|
||||||
|
int upMorale = 0;
|
||||||
|
|
||||||
|
#endregion 参数
|
||||||
|
|
||||||
|
#region 队伍加层
|
||||||
|
|
||||||
|
var teamService = App.GetService<IGameTeamService>();
|
||||||
|
var MyTeam = await teamService.GetUserTeamInfo(userId);
|
||||||
|
if (MyTeam.state == 1)
|
||||||
|
{
|
||||||
|
int teamCount = MyTeam.user.Count(it => it.isOnline == 1);
|
||||||
|
if (teamCount > 0)
|
||||||
|
{
|
||||||
|
decimal teamAdd = 0.05m * teamCount;
|
||||||
|
teamAdd = teamAdd > 0.2m ? 0.2m : teamAdd;
|
||||||
|
minAtk += Convert.ToInt32(temp.minAtk * teamAdd);
|
||||||
|
maxAtk += Convert.ToInt32(temp.maxAtk * teamAdd);
|
||||||
|
Defense += Convert.ToInt32(temp.defense * teamAdd);
|
||||||
|
result.atkTips += $"(队+{Convert.ToInt32(teamAdd * 100)}%)";
|
||||||
|
result.defTips += $"(队+{Convert.ToInt32(teamAdd * 100)}%)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Buff加层
|
||||||
|
|
||||||
|
var MyState = await GetUserStateData(userId, scene);
|
||||||
|
if (MyState.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in MyState)
|
||||||
|
{
|
||||||
|
minAtk += Convert.ToInt32(GameAttrTool.GetAttrItemValue(GameEnum.AttrCode.Atk.ToString(), item.attr,
|
||||||
|
temp.minAtk));
|
||||||
|
maxAtk += Convert.ToInt32(GameAttrTool.GetAttrItemValue(GameEnum.AttrCode.Atk.ToString(), item.attr,
|
||||||
|
temp.maxAtk));
|
||||||
|
Defense += Convert.ToInt32(GameAttrTool.GetAttrItemValue(GameEnum.AttrCode.Defense.ToString(),
|
||||||
|
item.attr, temp.defense));
|
||||||
|
Agility += Convert.ToInt32(GameAttrTool.GetAttrItemValue(GameEnum.AttrCode.Agility.ToString(),
|
||||||
|
item.attr, temp.agility));
|
||||||
|
upBlood += Convert.ToInt32(GameAttrTool.GetAttrItemValue(GameEnum.AttrCode.Blood.ToString(), item.attr,
|
||||||
|
temp.upBlood));
|
||||||
|
upMorale += Convert.ToInt32(GameAttrTool.GetAttrItemValue(GameEnum.AttrCode.Morale.ToString(),
|
||||||
|
item.attr, temp.upMorale));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 加层处理
|
||||||
|
|
||||||
|
var otTemp = GameAttrTool.GetRoleAttrTemp(temp, ExtendAttrData);
|
||||||
|
result = GameAttrTool.GetRoleAttrTempMerge(result, otTemp); //加层其他
|
||||||
|
result = GameAttrTool.GetRoleAttrTempMerge(result, temp); //加层其他
|
||||||
|
|
||||||
|
result.minAtk += minAtk;
|
||||||
|
result.maxAtk += maxAtk;
|
||||||
|
result.defense += Defense;
|
||||||
|
result.agility += Agility;
|
||||||
|
result.upBlood += upBlood;
|
||||||
|
result.upMorale += upMorale;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 数据效验
|
||||||
|
|
||||||
|
var userBlood = await GetUserBlood(userId);
|
||||||
|
result.blood = (int)userBlood.blood;
|
||||||
|
|
||||||
|
//士气
|
||||||
|
var userMorale = await GetUserMorale(userId);
|
||||||
|
result.morale = (int)userMorale.morale;
|
||||||
|
|
||||||
|
//负面状态处理
|
||||||
|
var loadState = await GetUserLoadState(userId);
|
||||||
|
result = await GameAttrTool.CheckRoleLoadBuff(result, loadState);
|
||||||
|
result = await ReviseUserRoleAttr(result);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<UserAttrModel> ReviseUserRoleAttr(UserAttrModel result)
|
||||||
|
{
|
||||||
|
//处理上限数据
|
||||||
|
if (result.blood > result.upBlood)
|
||||||
|
{
|
||||||
|
result.blood = result.upBlood;
|
||||||
|
await UpdateUserBlood(result.id, 2, result.blood, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.morale > result.upMorale)
|
||||||
|
{
|
||||||
|
result.morale = result.upMorale;
|
||||||
|
await UpdateUserMorale(result.id, 2, Convert.ToInt32(result.morale));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.NoHarm > 0.8M) //免伤上限
|
||||||
|
{
|
||||||
|
result.NoHarm = 0.8M;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.Atk_Next > 0.3M) //连击上限
|
||||||
|
{
|
||||||
|
result.Atk_Next = 0.3M;
|
||||||
|
}
|
||||||
|
|
||||||
|
//评分
|
||||||
|
decimal _score = result.maxAtk + result.defense + result.agility + result.upBlood / 3.00M + result.upMorale;
|
||||||
|
result.score = Math.Round(_score, 2);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,6 +242,11 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
else if (op == 1)
|
else if (op == 1)
|
||||||
{
|
{
|
||||||
data.blood += count;
|
data.blood += count;
|
||||||
|
var myAttr = await GetUserAttrModel(userId);
|
||||||
|
if (myAttr != null)
|
||||||
|
{
|
||||||
|
data.blood = data.blood > myAttr.upBlood ? myAttr.upBlood : data.blood;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,9 +344,6 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
|
|
||||||
if (result && IsUpUserAttr)
|
if (result && IsUpUserAttr)
|
||||||
{
|
{
|
||||||
//增加负重
|
|
||||||
var wightService = App.GetService<IUnitUserWeight>();
|
|
||||||
await wightService.UpdateUserMaxWeight(userId, 1, GameConfig.UpLevAddWeight, 1, 0, "升级增加负重");
|
|
||||||
await ClearUserAttrCache(userId);
|
await ClearUserAttrCache(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,6 +375,8 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
if (op == 1)
|
if (op == 1)
|
||||||
{
|
{
|
||||||
data.morale += count;
|
data.morale += count;
|
||||||
|
var myAttr = await GetUserAttrModel(userId);
|
||||||
|
data.morale = data.morale > myAttr.upMorale ? myAttr.upMorale : data.morale;
|
||||||
}
|
}
|
||||||
else if (op == 2)
|
else if (op == 2)
|
||||||
{
|
{
|
||||||
@@ -260,10 +403,11 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
string key = string.Format(UserCache.BaseCacheKeys, "Recover:Morale", userId);
|
string key = string.Format(UserCache.BaseCacheKeys, "Recover:Morale", userId);
|
||||||
return await redis.ExistsAsync(key);
|
return await redis.ExistsAsync(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task LockRecoverMorale(string userId)
|
public async Task LockRecoverMorale(string userId)
|
||||||
{
|
{
|
||||||
string key = string.Format(UserCache.BaseCacheKeys, "Recover:Morale", userId);
|
string key = string.Format(UserCache.BaseCacheKeys, "Recover:Morale", userId);
|
||||||
await redis.SetAsync(key, DateTime.Now,TimeAssist.GetDateTimeYMD(1));
|
await redis.SetAsync(key, DateTime.Now, TimeAssist.GetDateTimeYMD(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion 士气
|
#endregion 士气
|
||||||
@@ -295,6 +439,13 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
|
|
||||||
public async Task<bool> UpdateUserVigour(string userId, int op, long count, string UpTime = "")
|
public async Task<bool> UpdateUserVigour(string userId, int op, long count, string UpTime = "")
|
||||||
{
|
{
|
||||||
|
if (op == 1)
|
||||||
|
{
|
||||||
|
var userVigour = await GetUserVigourInfo(userId);
|
||||||
|
long endVigour = (long)userVigour.upVitality - (long)userVigour.vitality;
|
||||||
|
count = endVigour > count ? count : endVigour;
|
||||||
|
}
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -350,6 +501,314 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 药品栏
|
||||||
|
|
||||||
|
public async Task<unit_user_drug> GetUserDrug(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "UserTool", "DrugColumn");
|
||||||
|
if (await redis.HExistsHashAsync(key, userId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<unit_user_drug>(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_drug>();
|
||||||
|
var data = await db.Queryable<unit_user_drug>().Where(it => it.userId == userId).SingleAsync();
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
data = new unit_user_drug();
|
||||||
|
data.userId = userId;
|
||||||
|
data.drug = new List<UserDrugModel>();
|
||||||
|
await db.Insertable(data).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
await redis.AddHashAsync(key, userId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateUserDrug(unit_user_drug data)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_drug>();
|
||||||
|
bool result = await db.Updateable<unit_user_drug>(data).ExecuteCommandAsync() > 0;
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await ClearUserDrug(data.userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ClearUserDrug(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "UserTool", "DrugColumn");
|
||||||
|
await redis.DelHashAsync(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BUFF状态
|
||||||
|
|
||||||
|
private async Task<List<unit_user_state>> GetUserStateData(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "State");
|
||||||
|
var data = await redis.GetHashAsync<List<unit_user_state>>(key, userId);
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
long endTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_state>();
|
||||||
|
data = await db.Queryable<unit_user_state>().Where(it => it.userId == userId && it.endTime > endTime)
|
||||||
|
.ToListAsync();
|
||||||
|
await redis.AddHashAsync(key, userId, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<unit_user_state>> GetUserStateData(string userId, string scene = "Default")
|
||||||
|
{
|
||||||
|
var data = await GetUserStateData(userId);
|
||||||
|
if (scene == "ALL")
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
data = data.FindAll(it => it.scene == "Default" || it.scene == scene);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddUserState(string userId, string groupId, string name, string scene, string tips,
|
||||||
|
List<AttrItem> attr, int time, int count = 1)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
long onTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
string usId = $"{userId}_{groupId}";
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_state>();
|
||||||
|
var usData = await db.Queryable<unit_user_state>().Where(it => it.usId == usId).SingleAsync();
|
||||||
|
if (usData == null)
|
||||||
|
{
|
||||||
|
usData = new unit_user_state();
|
||||||
|
usData.usId = usId;
|
||||||
|
usData.userId = userId;
|
||||||
|
usData.goodsId = groupId;
|
||||||
|
usData.name = name;
|
||||||
|
usData.scene = scene;
|
||||||
|
usData.tips = tips;
|
||||||
|
usData.attr = attr;
|
||||||
|
usData.addTime = onTime;
|
||||||
|
usData.endTime = onTime + (time * 60 * count);
|
||||||
|
result = await db.Insertable(usData).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (usData.endTime > onTime)
|
||||||
|
{
|
||||||
|
usData.endTime = usData.endTime + (time * 60 * count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usData.addTime = onTime;
|
||||||
|
usData.endTime = onTime + (time * 60 * count);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = await db.Updateable(usData).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await ClearUserState(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ClearUserState(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "State");
|
||||||
|
await redis.DelHashAsync(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 游戏资源储备
|
||||||
|
|
||||||
|
private async Task<List<unit_user_stock>> GetUserStock(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "Stock");
|
||||||
|
var data = await redis.GetHashAsync<List<unit_user_stock>>(key, userId);
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_stock>();
|
||||||
|
data = await db.Queryable<unit_user_stock>().Where(it => it.userId == userId).ToListAsync();
|
||||||
|
await redis.AddHashAsync(key, userId, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<unit_user_stock>> GetUserStock(string userId, string code = "Default")
|
||||||
|
{
|
||||||
|
var data = await GetUserStock(userId);
|
||||||
|
if (code != "Default")
|
||||||
|
{
|
||||||
|
data = data.FindAll(it => it.code == code);
|
||||||
|
}
|
||||||
|
|
||||||
|
long endTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
data = data.FindAll(it =>
|
||||||
|
((it.type == "Number" && it.sign > 0) || it.type != "Number") && it.endTime > endTime);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddUserStock(string userId, string goodsId, string name, string type, string code,
|
||||||
|
long sign,
|
||||||
|
string par = "",
|
||||||
|
int minute = 0)
|
||||||
|
{
|
||||||
|
if (minute == 0)
|
||||||
|
{
|
||||||
|
minute = 525600;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool result = false;
|
||||||
|
string usId = $"{userId}_{goodsId}";
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_stock>();
|
||||||
|
var usInfo = await db.Queryable<unit_user_stock>().Where(it => it.usId == usId).SingleAsync();
|
||||||
|
if (usInfo == null)
|
||||||
|
{
|
||||||
|
long endTime = TimeExtend.GetTimeStampSeconds + minute * 60;
|
||||||
|
unit_user_stock stock = new unit_user_stock()
|
||||||
|
{
|
||||||
|
usId = usId,
|
||||||
|
userId = userId,
|
||||||
|
goodsId = goodsId,
|
||||||
|
name = name,
|
||||||
|
type = type,
|
||||||
|
code = code,
|
||||||
|
sign = sign,
|
||||||
|
par = par,
|
||||||
|
endTime = endTime
|
||||||
|
};
|
||||||
|
result = await db.Insertable(stock).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (usInfo.type == nameof(GameEnum.GameStockType.Number))
|
||||||
|
{
|
||||||
|
usInfo.sign += sign;
|
||||||
|
usInfo.endTime = TimeExtend.GetTimeStampSeconds + minute * 60;
|
||||||
|
}
|
||||||
|
else if (usInfo.type == nameof(GameEnum.GameStockType.Time))
|
||||||
|
{
|
||||||
|
long onTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
if (usInfo.endTime > onTime)
|
||||||
|
{
|
||||||
|
usInfo.endTime = usInfo.endTime + (minute * 60);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usInfo.endTime = TimeExtend.GetTimeStampSeconds + (minute * 60);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result = await db.Updateable(usInfo).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await ClearUserStockCache(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ClearUserStockCache(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "Stock");
|
||||||
|
await redis.DelHashAsync(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateUserStock(unit_user_stock data)
|
||||||
|
{
|
||||||
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_stock>();
|
||||||
|
var result = await db.Updateable(data).ExecuteCommandAsync() > 0;
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
await ClearUserAttrCache(data.userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 负面状态
|
||||||
|
|
||||||
|
public async Task<List<unit_user_load>> GetUserLoadState(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "LoadState");
|
||||||
|
if (await redis.HExistsHashAsync(key, userId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<List<unit_user_load>>(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new List<unit_user_load>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddUserLoadState(string userId, string name, string code)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "LoadState");
|
||||||
|
var data = await GetUserLoadState(userId);
|
||||||
|
var onData = data.Find(it => it.code == code);
|
||||||
|
if (onData == null)
|
||||||
|
{
|
||||||
|
unit_user_load load = new unit_user_load()
|
||||||
|
{
|
||||||
|
id = $"{userId}_{code}",
|
||||||
|
userId = userId,
|
||||||
|
name = name,
|
||||||
|
code = code,
|
||||||
|
count = 1
|
||||||
|
};
|
||||||
|
data.Add(load);
|
||||||
|
result = await redis.AddHashAsync(key, userId, data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data.Remove(onData);
|
||||||
|
onData.count += 1;
|
||||||
|
result = await redis.AddHashAsync(key, userId, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> RandomRemoveUserLoadState(string userId, int count)
|
||||||
|
{
|
||||||
|
var data = await GetUserLoadState(userId);
|
||||||
|
int opCount = data.Count - count;
|
||||||
|
opCount = opCount < 0 ? 0 : opCount;
|
||||||
|
if (opCount > 0)
|
||||||
|
{
|
||||||
|
RandomAssist random = new RandomAssist(opCount);
|
||||||
|
var result = random.RandomExtract(data);
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "LoadState");
|
||||||
|
await redis.AddHashAsync(key, userId, result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await RemoveUserLoadState(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task RemoveUserLoadState(string userId)
|
||||||
|
{
|
||||||
|
string key = string.Format(UserCache.BaseCacheKeys, "AttrData", "LoadState");
|
||||||
|
await redis.DelHashAsync(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -268,9 +268,7 @@ public class UnitUserService(ISqlSugarClient DbClient, IRedisCache redis) : IUni
|
|||||||
|
|
||||||
if (result)//注册各项后处理
|
if (result)//注册各项后处理
|
||||||
{
|
{
|
||||||
//赠送初始负重
|
|
||||||
var weightService = App.GetService<IUnitUserWeight>();
|
|
||||||
await weightService.UpdateUserMaxWeight(userId, 1, 100, 1, 0, "初始负重");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -19,8 +19,12 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
|||||||
|
|
||||||
private async Task<int> GetUserMaxWeight(unit_user_weight data)
|
private async Task<int> GetUserMaxWeight(unit_user_weight data)
|
||||||
{
|
{
|
||||||
int result = (int)data.maxWeight;
|
int result = 100 + (int)data.maxWeight;
|
||||||
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
|
int myLev = await attrService.GetUserLev(data.userId);
|
||||||
|
result += myLev * GameConfig.UpLevAddWeight;
|
||||||
//其他属性加层
|
//其他属性加层
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,6 +123,7 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region 船只相关
|
#region 船只相关
|
||||||
|
|
||||||
public async Task<unit_user_ship> GetUserShipInfo(string usId)
|
public async Task<unit_user_ship> GetUserShipInfo(string usId)
|
||||||
{
|
{
|
||||||
string key = string.Format(UserCache.BaseCacheKeys, "UserShip", "Info");
|
string key = string.Format(UserCache.BaseCacheKeys, "UserShip", "Info");
|
||||||
@@ -132,6 +137,7 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
|||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<unit_user_ship>> GetUserShip(string userId)
|
public async Task<List<unit_user_ship>> GetUserShip(string userId)
|
||||||
{
|
{
|
||||||
string key = string.Format(UserCache.BaseCacheKeys, "WeightData", "Ship");
|
string key = string.Format(UserCache.BaseCacheKeys, "WeightData", "Ship");
|
||||||
@@ -198,7 +204,7 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> AddUserShip(string userId, string name, int goodsId, int speed, int weight)
|
public async Task<bool> AddUserShip(string userId, string name, int goodsId, int speed, int weight,int copper,long sale,string remark)
|
||||||
{
|
{
|
||||||
unit_user_ship ship = new unit_user_ship();
|
unit_user_ship ship = new unit_user_ship();
|
||||||
ship.usId = StringAssist.NewGuid;
|
ship.usId = StringAssist.NewGuid;
|
||||||
@@ -207,6 +213,9 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
|||||||
ship.name = name;
|
ship.name = name;
|
||||||
ship.speed = speed;
|
ship.speed = speed;
|
||||||
ship.weight = weight;
|
ship.weight = weight;
|
||||||
|
ship.copper = copper;
|
||||||
|
ship.sale = sale;
|
||||||
|
ship.remark = remark;
|
||||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_ship>();
|
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_ship>();
|
||||||
bool result = await db.Insertable(ship).ExecuteCommandAsync() > 0;
|
bool result = await db.Insertable(ship).ExecuteCommandAsync() > 0;
|
||||||
if (result)
|
if (result)
|
||||||
|
|||||||
166
Service/Application.Domain/Tool/Base/EquTool.cs
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public class EquTool
|
||||||
|
{
|
||||||
|
public static unit_user_equ GetUserEquByIntensify(unit_user_equ equ)
|
||||||
|
{
|
||||||
|
//强化
|
||||||
|
equ = GetIntensifyAttr(equ);
|
||||||
|
List<AttrItem> AttrData = GetUserEquAttrData(equ);
|
||||||
|
equ.minAtk += Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.Atk), AttrData, (decimal)equ.minAtk));
|
||||||
|
equ.minAtk +=
|
||||||
|
Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.MinAtk), AttrData, (decimal)equ.minAtk));
|
||||||
|
equ.maxAtk += Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.Atk), AttrData, (decimal)equ.maxAtk));
|
||||||
|
equ.maxAtk +=
|
||||||
|
Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.MaxAtk), AttrData, (decimal)equ.minAtk));
|
||||||
|
equ.Blood += Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.Blood), AttrData, (decimal)equ.Blood));
|
||||||
|
equ.Defense +=
|
||||||
|
Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.Defense), AttrData, (decimal)equ.Defense));
|
||||||
|
equ.Agility +=
|
||||||
|
Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.Agility), AttrData, (decimal)equ.Agility));
|
||||||
|
equ.Morale +=
|
||||||
|
Convert.ToInt32(GameAttrTool.GetAttrItemValue(nameof(GameEnum.AttrCode.Morale), AttrData, (decimal)equ.Morale));
|
||||||
|
return equ;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static unit_user_equ GetIntensifyAttr(unit_user_equ equ)
|
||||||
|
{
|
||||||
|
equ.minAtk = GetIntensifyAttrBase(equ.minAtk, equ.intensifyLev);
|
||||||
|
equ.maxAtk = GetIntensifyAttrBase(equ.maxAtk, equ.intensifyLev);
|
||||||
|
equ.Blood = GetIntensifyAttrBase(equ.Blood, equ.intensifyLev);
|
||||||
|
equ.Defense = GetIntensifyAttrBase(equ.Defense, equ.intensifyLev);
|
||||||
|
equ.Agility = GetIntensifyAttrBase(equ.Agility, equ.intensifyLev);
|
||||||
|
|
||||||
|
return equ;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int GetIntensifyAttrBase(int? onV, int? lev)
|
||||||
|
{
|
||||||
|
if (onV < 1)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int onAttr = Convert.ToInt32(onV);
|
||||||
|
int onLev = Convert.ToInt32(lev); //当前强化等级
|
||||||
|
if (onLev < 1)
|
||||||
|
{
|
||||||
|
return onAttr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int result = onLev * 3;
|
||||||
|
result = result > 57 ? 57 : result;
|
||||||
|
|
||||||
|
if (onLev > 19)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 19;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
result += addLev * 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 29)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 29;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
result += addLev * 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 39)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 39;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
result += addLev * 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 49)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 49;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
result += addLev * 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 59)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 59;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
result += addLev * 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 69)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 69;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
int unitAdd = Convert.ToInt32(onAttr * 0.05);
|
||||||
|
unitAdd = unitAdd < 30 ? 30 : unitAdd;
|
||||||
|
result += addLev * unitAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 79)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 79;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
int unitAdd = Convert.ToInt32(onAttr * 0.1);
|
||||||
|
unitAdd = unitAdd < 35 ? 35 : unitAdd;
|
||||||
|
result += addLev * unitAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 89)
|
||||||
|
{
|
||||||
|
int addLev = onLev - 89;
|
||||||
|
addLev = addLev > 10 ? 10 : addLev;
|
||||||
|
int unitAdd = Convert.ToInt32(onAttr * 0.15);
|
||||||
|
unitAdd = unitAdd < 40 ? 40 : unitAdd;
|
||||||
|
result += addLev * unitAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onLev > 99)
|
||||||
|
{
|
||||||
|
int unitAdd = Convert.ToInt32(onAttr * 0.35);
|
||||||
|
unitAdd = unitAdd < 100 ? 100 : unitAdd;
|
||||||
|
result += unitAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Convert.ToInt32(result + onAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<AttrItem> GetUserEquAttrData(unit_user_equ equ)
|
||||||
|
{
|
||||||
|
List<AttrItem> AttrData = new List<AttrItem>();
|
||||||
|
//装备本身特性
|
||||||
|
AttrData.AddRange(equ.EquAttr);
|
||||||
|
|
||||||
|
//宝石
|
||||||
|
if (equ.GemMent.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in equ.GemMent)
|
||||||
|
{
|
||||||
|
AttrData.AddRange(item.gemItem.GemAttr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//附魔
|
||||||
|
if (equ.EquMent != null)
|
||||||
|
{
|
||||||
|
if (equ.EquMent.EquAttr != null)
|
||||||
|
{
|
||||||
|
AttrData.AddRange(equ.EquMent.EquAttr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//觉醒
|
||||||
|
if (equ.EquAwaken != null)
|
||||||
|
{
|
||||||
|
foreach (var item in equ.EquAwaken)
|
||||||
|
{
|
||||||
|
if (item.awaken != null)
|
||||||
|
{
|
||||||
|
AttrData.AddRange(item.awaken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AttrData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
239
Service/Application.Domain/Tool/Base/GameAttrTool.cs
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
|
||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public class GameAttrTool
|
||||||
|
{
|
||||||
|
public static UserAttrModel GetRoleAttrTemp(UserAttrModel temp, List<AttrItem> attrData)
|
||||||
|
{
|
||||||
|
UserAttrModel result = new UserAttrModel();
|
||||||
|
result.minAtk =
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Atk.ToString(), attrData, temp.minAtk));
|
||||||
|
result.maxAtk =
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Atk.ToString(), attrData, temp.maxAtk));
|
||||||
|
result.defense =
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Defense.ToString(), attrData, temp.defense));
|
||||||
|
result.agility =
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Agility.ToString(), attrData, temp.agility));
|
||||||
|
result.upBlood =
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Blood.ToString(), attrData, temp.upBlood));
|
||||||
|
result.upMorale =
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Morale.ToString(), attrData, temp.upMorale));
|
||||||
|
result.InBlood = GetAttrItemValue(GameEnum.AttrCode.InBlood.ToString(), attrData, temp.InBlood);
|
||||||
|
result.Crit = GetAttrItemValue(GameEnum.AttrCode.Crit.ToString(), attrData, temp.Crit);
|
||||||
|
result.NoHarm = GetAttrItemValue(GameEnum.AttrCode.NoHarm.ToString(), attrData, temp.NoHarm);
|
||||||
|
result.Dodge = GetAttrItemValue(GameEnum.AttrCode.Dodge.ToString(), attrData, temp.Dodge);
|
||||||
|
result.Rebound = GetAttrItemValue(GameEnum.AttrCode.Rebound.ToString(), attrData, temp.Rebound);
|
||||||
|
result.ReboundLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.ReboundLess.ToString(), attrData, temp.ReboundLess);
|
||||||
|
result.Punish = GetAttrItemValue(GameEnum.AttrCode.Punish.ToString(), attrData, temp.Punish);
|
||||||
|
result.Slow = GetAttrItemValue(GameEnum.AttrCode.Slow.ToString(), attrData, temp.Slow);
|
||||||
|
result.SlowLess = GetAttrItemValue(GameEnum.AttrCode.SlowLess.ToString(), attrData, temp.SlowLess);
|
||||||
|
result.Poison = GetAttrItemValue(GameEnum.AttrCode.Poison.ToString(), attrData, temp.Poison);
|
||||||
|
result.PoisonLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.PoisonLess.ToString(), attrData, temp.PoisonLess);
|
||||||
|
result.Curse = GetAttrItemValue(GameEnum.AttrCode.Curse.ToString(), attrData, temp.Curse);
|
||||||
|
result.CurseLess = GetAttrItemValue(GameEnum.AttrCode.CurseLess.ToString(), attrData, temp.CurseLess);
|
||||||
|
result.Weaken = GetAttrItemValue(GameEnum.AttrCode.Weaken.ToString(), attrData, temp.Weaken);
|
||||||
|
result.WeakenLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.WeakenLess.ToString(), attrData, temp.WeakenLess);
|
||||||
|
result.Deadly = GetAttrItemValue(GameEnum.AttrCode.Deadly.ToString(), attrData, temp.Deadly);
|
||||||
|
result.DeadlyLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.DeadlyLess.ToString(), attrData, temp.DeadlyLess);
|
||||||
|
result.Depressed = GetAttrItemValue(GameEnum.AttrCode.Depressed.ToString(), attrData, temp.Depressed);
|
||||||
|
result.DepressedLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.DepressedLess.ToString(), attrData, temp.DepressedLess);
|
||||||
|
result.Breach = GetAttrItemValue(GameEnum.AttrCode.Breach.ToString(), attrData, temp.Breach);
|
||||||
|
result.BreachLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.BreachLess.ToString(), attrData, temp.BreachLess);
|
||||||
|
result.Del_Fashion =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.Del_Fashion.ToString(), attrData, temp.Del_Fashion);
|
||||||
|
result.Atk_Next = GetAttrItemValue(GameEnum.AttrCode.Atk_Next.ToString(), attrData, temp.Atk_Next);
|
||||||
|
result.Harm_Add = GetAttrItemValue(GameEnum.AttrCode.Harm_Add.ToString(), attrData, temp.Harm_Add);
|
||||||
|
result.PalsyAtk = GetAttrItemValue(GameEnum.AttrCode.PalsyAtk.ToString(), attrData, temp.PalsyAtk);
|
||||||
|
result.PalsyAtkLess =
|
||||||
|
GetAttrItemValue(GameEnum.AttrCode.PalsyAtkLess.ToString(), attrData, temp.PalsyAtk);
|
||||||
|
|
||||||
|
result.addExp =
|
||||||
|
GetAttrItemValue(nameof(GameEnum.AttrCode.AddExp), attrData, temp.addExp);
|
||||||
|
result.addGold =
|
||||||
|
GetAttrItemValue(nameof(GameEnum.AttrCode.AddGold), attrData, temp.addGold);
|
||||||
|
result.burst =
|
||||||
|
GetAttrItemValue(nameof(GameEnum.AttrCode.Burst), attrData, temp.burst);
|
||||||
|
result.luck =
|
||||||
|
GetAttrItemValue(nameof(GameEnum.AttrCode.Luck), attrData, temp.luck);
|
||||||
|
result.weight = Convert.ToInt32(GetAttrItemValue(nameof(GameEnum.AttrCode.Weight), attrData, temp.weight));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserAttrModel GetRoleAttrTempMerge(UserAttrModel result, List<AttrItem> attrData)
|
||||||
|
{
|
||||||
|
result.minAtk +=
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Atk.ToString(), attrData, result.minAtk));
|
||||||
|
result.maxAtk +=
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Atk.ToString(), attrData, result.maxAtk));
|
||||||
|
result.defense +=
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Defense.ToString(), attrData, result.defense));
|
||||||
|
result.agility +=
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Agility.ToString(), attrData, result.agility));
|
||||||
|
result.upBlood +=
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Blood.ToString(), attrData, result.upBlood));
|
||||||
|
result.upMorale +=
|
||||||
|
Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Morale.ToString(), attrData, result.upMorale));
|
||||||
|
result.InBlood += GetAttrItemValue(GameEnum.AttrCode.InBlood.ToString(), attrData, 0);
|
||||||
|
result.Crit += GetAttrItemValue(GameEnum.AttrCode.Crit.ToString(), attrData, 0);
|
||||||
|
result.NoHarm += GetAttrItemValue(GameEnum.AttrCode.NoHarm.ToString(), attrData, 0);
|
||||||
|
result.Dodge += GetAttrItemValue(GameEnum.AttrCode.Dodge.ToString(), attrData, 0);
|
||||||
|
result.Rebound += GetAttrItemValue(GameEnum.AttrCode.Rebound.ToString(), attrData, 0);
|
||||||
|
result.ReboundLess += GetAttrItemValue(GameEnum.AttrCode.ReboundLess.ToString(), attrData, 0);
|
||||||
|
result.Punish += GetAttrItemValue(GameEnum.AttrCode.Punish.ToString(), attrData, 0);
|
||||||
|
result.Slow += GetAttrItemValue(GameEnum.AttrCode.Slow.ToString(), attrData, 0);
|
||||||
|
result.SlowLess += GetAttrItemValue(GameEnum.AttrCode.SlowLess.ToString(), attrData, 0);
|
||||||
|
result.Poison += GetAttrItemValue(GameEnum.AttrCode.Poison.ToString(), attrData, 0);
|
||||||
|
result.PoisonLess += GetAttrItemValue(GameEnum.AttrCode.PoisonLess.ToString(), attrData, 0);
|
||||||
|
result.Curse += GetAttrItemValue(GameEnum.AttrCode.Curse.ToString(), attrData, 0);
|
||||||
|
result.CurseLess += GetAttrItemValue(GameEnum.AttrCode.CurseLess.ToString(), attrData, 0);
|
||||||
|
result.Weaken += GetAttrItemValue(GameEnum.AttrCode.Weaken.ToString(), attrData, 0);
|
||||||
|
result.WeakenLess += GetAttrItemValue(GameEnum.AttrCode.WeakenLess.ToString(), attrData, 0);
|
||||||
|
result.Deadly += GetAttrItemValue(GameEnum.AttrCode.Deadly.ToString(), attrData, 0);
|
||||||
|
result.DeadlyLess += GetAttrItemValue(GameEnum.AttrCode.DeadlyLess.ToString(), attrData, 0);
|
||||||
|
result.Depressed += GetAttrItemValue(GameEnum.AttrCode.Depressed.ToString(), attrData, 0);
|
||||||
|
result.DepressedLess += GetAttrItemValue(GameEnum.AttrCode.DepressedLess.ToString(), attrData, 0);
|
||||||
|
result.Breach += GetAttrItemValue(GameEnum.AttrCode.Breach.ToString(), attrData, 0);
|
||||||
|
result.BreachLess += GetAttrItemValue(GameEnum.AttrCode.BreachLess.ToString(), attrData, 0);
|
||||||
|
result.Del_Fashion += GetAttrItemValue(GameEnum.AttrCode.Del_Fashion.ToString(), attrData, 0);
|
||||||
|
result.Atk_Next += GetAttrItemValue(GameEnum.AttrCode.Atk_Next.ToString(), attrData, 0);
|
||||||
|
result.Harm_Add += GetAttrItemValue(GameEnum.AttrCode.Harm_Add.ToString(), attrData, 0);
|
||||||
|
result.PalsyAtk += GetAttrItemValue(GameEnum.AttrCode.PalsyAtk.ToString(), attrData, 0);
|
||||||
|
result.PalsyAtkLess += GetAttrItemValue(GameEnum.AttrCode.PalsyAtkLess.ToString(), attrData, 0);
|
||||||
|
|
||||||
|
result.addExp += GetAttrItemValue(GameEnum.AttrCode.AddExp.ToString(), attrData, 0);
|
||||||
|
result.addGold += GetAttrItemValue(GameEnum.AttrCode.AddGold.ToString(), attrData, 0);
|
||||||
|
result.burst += GetAttrItemValue(GameEnum.AttrCode.Burst.ToString(), attrData, 0);
|
||||||
|
result.luck += GetAttrItemValue(GameEnum.AttrCode.Luck.ToString(), attrData, 0);
|
||||||
|
result.weight += Convert.ToInt32(GetAttrItemValue(GameEnum.AttrCode.Weight.ToString(), attrData, 0)) ;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserAttrModel GetRoleAttrTempMerge(UserAttrModel main, UserAttrModel vice)
|
||||||
|
{
|
||||||
|
main.minAtk += vice.minAtk;
|
||||||
|
main.maxAtk += vice.maxAtk;
|
||||||
|
main.defense += vice.defense;
|
||||||
|
main.agility += vice.agility;
|
||||||
|
main.upBlood += vice.upBlood;
|
||||||
|
main.upMorale += vice.upMorale;
|
||||||
|
main.InBlood += vice.InBlood;
|
||||||
|
main.Crit += vice.Crit;
|
||||||
|
main.NoHarm += vice.NoHarm;
|
||||||
|
main.Dodge += vice.Dodge;
|
||||||
|
main.Rebound += vice.Rebound;
|
||||||
|
main.ReboundLess += vice.ReboundLess;
|
||||||
|
main.Punish += vice.Punish;
|
||||||
|
main.Slow += vice.Slow;
|
||||||
|
main.Poison += vice.Poison;
|
||||||
|
main.PoisonLess += vice.PoisonLess;
|
||||||
|
main.Curse += vice.Curse;
|
||||||
|
main.CurseLess += vice.CurseLess;
|
||||||
|
main.Weaken += vice.Weaken;
|
||||||
|
main.WeakenLess += vice.WeakenLess;
|
||||||
|
main.Deadly += vice.Deadly;
|
||||||
|
main.DeadlyLess += vice.DeadlyLess;
|
||||||
|
main.Depressed += vice.Depressed;
|
||||||
|
main.DepressedLess += vice.DepressedLess;
|
||||||
|
main.Breach += vice.Breach;
|
||||||
|
main.BreachLess += vice.BreachLess;
|
||||||
|
main.Del_Fashion += vice.Del_Fashion;
|
||||||
|
main.Atk_Next += vice.Atk_Next;
|
||||||
|
main.Harm_Add += vice.Harm_Add;
|
||||||
|
main.PalsyAtk += vice.PalsyAtk;
|
||||||
|
main.PalsyAtkLess += vice.PalsyAtkLess;
|
||||||
|
|
||||||
|
main.addExp += vice.addExp;
|
||||||
|
main.addGold += vice.addGold;
|
||||||
|
main.burst += vice.burst;
|
||||||
|
main.luck += vice.luck;
|
||||||
|
main.weight += vice.weight;
|
||||||
|
return main;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static decimal GetAttrItemValue(string attrCode, List<AttrItem> AttrData, decimal unit)
|
||||||
|
{
|
||||||
|
decimal result = 0.00M;
|
||||||
|
foreach (var item in AttrData)
|
||||||
|
{
|
||||||
|
if (attrCode == item.code)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(item.compute))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.compute == nameof(GameEnum.ComputeType.Ride))
|
||||||
|
{
|
||||||
|
result += unit * Convert.ToDecimal(item.parameter);
|
||||||
|
}
|
||||||
|
else if (item.compute == nameof(GameEnum.ComputeType.Plus))
|
||||||
|
{
|
||||||
|
result += Convert.ToDecimal(item.parameter);
|
||||||
|
}
|
||||||
|
else if (item.compute == nameof(GameEnum.ComputeType.Reduce))
|
||||||
|
{
|
||||||
|
result = unit - Convert.ToDecimal(item.parameter);
|
||||||
|
}
|
||||||
|
else if (item.compute == nameof(GameEnum.ComputeType.Except))
|
||||||
|
{
|
||||||
|
result = unit / Convert.ToDecimal(item.parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<UserAttrModel> CheckRoleLoadBuff(UserAttrModel temp, List<unit_user_load> loadBuff)
|
||||||
|
{
|
||||||
|
foreach (var item in loadBuff)
|
||||||
|
{
|
||||||
|
if (item.code == nameof(GameEnum.AttrCode.Slow))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.05M;
|
||||||
|
temp.agility = Convert.ToInt32(temp.agility * (1.0M - radio));
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.AttrCode.Poison))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.08M;
|
||||||
|
temp.upBlood = Convert.ToInt32(temp.upBlood * (1.0M - radio));
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.AttrCode.Curse))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.08M;
|
||||||
|
temp.minAtk = Convert.ToInt32(temp.minAtk * (1.0M - radio));
|
||||||
|
temp.maxAtk = Convert.ToInt32(temp.maxAtk * (1.0M - radio));
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.AttrCode.Weaken))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.02M;
|
||||||
|
temp.Crit = temp.Crit - radio;
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.AttrCode.Depressed))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.07M;
|
||||||
|
temp.upMorale = Convert.ToInt32(temp.upMorale * (1.0M - radio));
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.AttrCode.Breach))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.04M;
|
||||||
|
temp.defense = Convert.ToInt32(temp.defense * (1.0M - radio));
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.AttrCode.PalsyAtk))
|
||||||
|
{
|
||||||
|
decimal radio = item.count * 0.1M;
|
||||||
|
temp.Atk_Next -= radio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Application.Domain;
|
namespace Application.Domain;
|
||||||
|
|
||||||
public class GameBus
|
public static class GameBus
|
||||||
{
|
{
|
||||||
#region 物品资源操作
|
#region 物品资源操作
|
||||||
|
|
||||||
@@ -64,6 +64,11 @@ public class GameBus
|
|||||||
isok = await accService.UpdateUserAcc(userId, operate, nameof(AccEnum.AccType.teach), count,
|
isok = await accService.UpdateUserAcc(userId, operate, nameof(AccEnum.AccType.teach), count,
|
||||||
nameof(AccEnum.Name.其他), remark);
|
nameof(AccEnum.Name.其他), remark);
|
||||||
}
|
}
|
||||||
|
else if (goodsType.Equals(nameof(GameEnum.PropCode.map)))
|
||||||
|
{
|
||||||
|
var mapService = App.GetService<IGameMapService>();
|
||||||
|
isok = await mapService.AddUserCityMap(userId, Convert.ToInt32(parameter));
|
||||||
|
}
|
||||||
|
|
||||||
return isok;
|
return isok;
|
||||||
}
|
}
|
||||||
@@ -96,20 +101,24 @@ public class GameBus
|
|||||||
|
|
||||||
#region 验证
|
#region 验证
|
||||||
|
|
||||||
public static async Task<CheckTowerNeed> CheakNeed(string userId, TowerNeed item, string sid, int count = 1)
|
public static async Task<CheckTowerNeed> CheckNeed(string userId, TowerNeed item, int count = 1)
|
||||||
{
|
{
|
||||||
CheckTowerNeed result = new CheckTowerNeed();
|
CheckTowerNeed result = new CheckTowerNeed();
|
||||||
|
result.Needs = new List<TowerNeed>();
|
||||||
bool isok = true;
|
bool isok = true;
|
||||||
int isDeal = 1;
|
int isDeal = 1;
|
||||||
int isGive = 1;
|
int isGive = 1;
|
||||||
|
item.isAsk = 1;
|
||||||
if (item.code == nameof(GameEnum.PropCode.Equ))
|
if (item.code == nameof(GameEnum.PropCode.Equ))
|
||||||
{
|
{
|
||||||
var equService = App.GetService<IGameEquService>();
|
var equService = App.GetService<IGameEquService>();
|
||||||
int MyCount = await equService.GetUserEquByEquIdCount(userId, Convert.ToInt32(item.parameter));
|
int MyCount = await equService.GetUserEquByEquIdCount(userId, Convert.ToInt32(item.parameter));
|
||||||
int neecCount = item.count * count;
|
long needCount = item.count * count;
|
||||||
if (MyCount < neecCount)
|
item.count = needCount;
|
||||||
|
item.onCount = MyCount;
|
||||||
|
if (MyCount < needCount)
|
||||||
{
|
{
|
||||||
|
item.isAsk = 0;
|
||||||
isok = false;
|
isok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,29 +141,38 @@ public class GameBus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int needCount = item.count * count;
|
long needCount = item.count * count;
|
||||||
|
item.count = needCount;
|
||||||
|
item.onCount = MyCount;
|
||||||
if (MyCount < needCount)
|
if (MyCount < needCount)
|
||||||
{
|
{
|
||||||
isok = false;
|
isok = false;
|
||||||
|
item.isAsk = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (item.code == nameof(GameEnum.PropCode.copper))
|
else if (item.code == nameof(GameEnum.PropCode.copper))
|
||||||
{
|
{
|
||||||
var accService = App.GetService<IUnitUserAccService>();
|
var accService = App.GetService<IUnitUserAccService>();
|
||||||
var MyAcc = await accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
|
var MyAcc = await accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
|
||||||
decimal needAcc = item.count * count;
|
long needAcc = item.count * count;
|
||||||
|
item.count = needAcc;
|
||||||
|
item.onCount = MyAcc;
|
||||||
if (MyAcc < needAcc)
|
if (MyAcc < needAcc)
|
||||||
{
|
{
|
||||||
isok = false;
|
isok = false;
|
||||||
|
item.isAsk = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (item.code == nameof(GameEnum.PropCode.gold))
|
else if (item.code == nameof(GameEnum.PropCode.gold))
|
||||||
{
|
{
|
||||||
var accService = App.GetService<IUnitUserAccService>();
|
var accService = App.GetService<IUnitUserAccService>();
|
||||||
var MyAcc = await accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.gold));
|
var MyAcc = await accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.gold));
|
||||||
decimal needAcc = item.count * count;
|
long needAcc = item.count * count;
|
||||||
|
item.count = needAcc;
|
||||||
|
item.onCount = MyAcc;
|
||||||
if (MyAcc < needAcc)
|
if (MyAcc < needAcc)
|
||||||
{
|
{
|
||||||
|
item.isAsk = 0;
|
||||||
isok = false;
|
isok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,9 +180,12 @@ public class GameBus
|
|||||||
{
|
{
|
||||||
var attrService = App.GetService<IUnitUserAttrService>();
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
var MyAcc = await attrService.GetUserVigourInfo(userId);
|
var MyAcc = await attrService.GetUserVigourInfo(userId);
|
||||||
decimal neecAcc = item.count * count;
|
long needAcc = item.count * count;
|
||||||
if (MyAcc.vitality < neecAcc)
|
item.count = needAcc;
|
||||||
|
item.onCount = (long)MyAcc.vitality;
|
||||||
|
if (MyAcc.vitality < needAcc)
|
||||||
{
|
{
|
||||||
|
item.isAsk = 0;
|
||||||
isok = false;
|
isok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,6 +193,8 @@ public class GameBus
|
|||||||
{
|
{
|
||||||
var attrService = App.GetService<IUnitUserAttrService>();
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
var MyLev = await attrService.GetUserLev(userId);
|
var MyLev = await attrService.GetUserLev(userId);
|
||||||
|
item.count = item.count;
|
||||||
|
item.onCount = MyLev;
|
||||||
if (MyLev < item.count)
|
if (MyLev < item.count)
|
||||||
{
|
{
|
||||||
isok = false;
|
isok = false;
|
||||||
@@ -181,18 +204,20 @@ public class GameBus
|
|||||||
result.result = isok;
|
result.result = isok;
|
||||||
result.isDeal = isDeal;
|
result.isDeal = isDeal;
|
||||||
result.isGive = isGive;
|
result.isGive = isGive;
|
||||||
|
result.Needs.Add(item);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<CheckTowerNeed> CheakNeed(string userId, List<TowerNeed> needs, string sid, int count = 1)
|
public static async Task<CheckTowerNeed> CheckNeed(string userId, List<TowerNeed> needs, int count = 1)
|
||||||
{
|
{
|
||||||
CheckTowerNeed result = new CheckTowerNeed();
|
CheckTowerNeed result = new CheckTowerNeed();
|
||||||
|
result.Needs = new List<TowerNeed>();
|
||||||
bool isok = true;
|
bool isok = true;
|
||||||
int isDeal = 1;
|
int isDeal = 1;
|
||||||
int isGive = 1;
|
int isGive = 1;
|
||||||
foreach (var item in needs)
|
foreach (var item in needs)
|
||||||
{
|
{
|
||||||
var cheakResult = await CheakNeed(userId, item, sid, count);
|
var cheakResult = await CheckNeed(userId, item, count);
|
||||||
if (isok)
|
if (isok)
|
||||||
{
|
{
|
||||||
isok = cheakResult.result;
|
isok = cheakResult.result;
|
||||||
@@ -208,7 +233,117 @@ public class GameBus
|
|||||||
isGive = 0;
|
isGive = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.isAsk = cheakResult.result ? 1 : 0;
|
result.Needs.AddRange(cheakResult.Needs);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.result = isok;
|
||||||
|
result.isDeal = isDeal;
|
||||||
|
result.isGive = isGive;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<CheckTowerNeeds> CheckNeeds(string userId, List<TowerNeeds> needs, int count = 1)
|
||||||
|
{
|
||||||
|
CheckTowerNeeds result = new CheckTowerNeeds();
|
||||||
|
bool isok = true;
|
||||||
|
int isDeal = 1;
|
||||||
|
int isGive = 1;
|
||||||
|
result.Needs = new List<TowerNeeds>();
|
||||||
|
foreach (var item in needs)
|
||||||
|
{
|
||||||
|
item.isAsk = 1;
|
||||||
|
if (item.code == nameof(GameEnum.PropCode.Equ))
|
||||||
|
{
|
||||||
|
var equService = App.GetService<IGameEquService>();
|
||||||
|
int MyCount = await equService.GetUserEquByEquIdCount(userId, Convert.ToInt32(item.parameter));
|
||||||
|
long needCount = item.count * count;
|
||||||
|
item.count = needCount;
|
||||||
|
item.onCount = MyCount;
|
||||||
|
if (MyCount < needCount)
|
||||||
|
{
|
||||||
|
item.isAsk = 0;
|
||||||
|
isok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.PropCode.Goods))
|
||||||
|
{
|
||||||
|
int MyCount = 0;
|
||||||
|
var goodsService = App.GetService<IGameGoodsService>();
|
||||||
|
var goodsInfo = await goodsService.GetUserGoodsInfo(userId, Convert.ToInt32(item.parameter));
|
||||||
|
if (goodsInfo != null)
|
||||||
|
{
|
||||||
|
MyCount = (int)goodsInfo.count;
|
||||||
|
if (goodsInfo.isDeal == 0)
|
||||||
|
{
|
||||||
|
isDeal = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goodsInfo.isGive == 0)
|
||||||
|
{
|
||||||
|
isGive = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long needCount = item.count * count;
|
||||||
|
item.count = needCount;
|
||||||
|
item.onCount = MyCount;
|
||||||
|
if (MyCount < needCount)
|
||||||
|
{
|
||||||
|
isok = false;
|
||||||
|
item.isAsk = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.PropCode.copper))
|
||||||
|
{
|
||||||
|
var accService = App.GetService<IUnitUserAccService>();
|
||||||
|
var MyAcc = await accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
|
||||||
|
long needAcc = item.count * count;
|
||||||
|
item.count = needAcc;
|
||||||
|
item.onCount = MyAcc;
|
||||||
|
if (MyAcc < needAcc)
|
||||||
|
{
|
||||||
|
isok = false;
|
||||||
|
item.isAsk = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.PropCode.gold))
|
||||||
|
{
|
||||||
|
var accService = App.GetService<IUnitUserAccService>();
|
||||||
|
var MyAcc = await accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.gold));
|
||||||
|
long needAcc = item.count * count;
|
||||||
|
item.count = needAcc;
|
||||||
|
item.onCount = MyAcc;
|
||||||
|
if (MyAcc < needAcc)
|
||||||
|
{
|
||||||
|
item.isAsk = 0;
|
||||||
|
isok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.PropCode.vigour)) //活力
|
||||||
|
{
|
||||||
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
|
var MyAcc = await attrService.GetUserVigourInfo(userId);
|
||||||
|
long needAcc = item.count * count;
|
||||||
|
item.count = needAcc;
|
||||||
|
item.onCount = (long)MyAcc.vitality;
|
||||||
|
if (MyAcc.vitality < needAcc)
|
||||||
|
{
|
||||||
|
item.isAsk = 0;
|
||||||
|
isok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.code == nameof(GameEnum.PropCode.lev))
|
||||||
|
{
|
||||||
|
var attrService = App.GetService<IUnitUserAttrService>();
|
||||||
|
var MyLev = await attrService.GetUserLev(userId);
|
||||||
|
item.count = item.count;
|
||||||
|
item.onCount = MyLev;
|
||||||
|
if (MyLev < item.count)
|
||||||
|
{
|
||||||
|
isok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result.Needs.Add(item);
|
result.Needs.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +357,30 @@ public class GameBus
|
|||||||
|
|
||||||
#region 概率
|
#region 概率
|
||||||
|
|
||||||
public static List<TowerGet> GetRandomGoods(RandomModel random, int count = 1, int luck = 0)
|
public static RandomDataBase GetRandomByWeight(List<RandomDataBase> data)
|
||||||
|
{
|
||||||
|
var _randomInstance = new Random();
|
||||||
|
if (data.Count == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
double totalWeight = data.Sum(it => it.random);
|
||||||
|
int rnd = _randomInstance.Next(Convert.ToInt32(totalWeight) + 1);
|
||||||
|
double current = 0;
|
||||||
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
current += item.random;
|
||||||
|
if (rnd < current)
|
||||||
|
{
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<TowerGet> GetRandomGoods(RandomModel random, int count = 1, decimal luck = 0)
|
||||||
{
|
{
|
||||||
List<TowerGet> result = new List<TowerGet>();
|
List<TowerGet> result = new List<TowerGet>();
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
@@ -240,9 +398,9 @@ public class GameBus
|
|||||||
foreach (var item in timeAward)
|
foreach (var item in timeAward)
|
||||||
{
|
{
|
||||||
var onAward = result.FindIndex(it => it.code == item.code && it.parameter == item.par);
|
var onAward = result.FindIndex(it => it.code == item.code && it.parameter == item.par);
|
||||||
if(onAward>-1)
|
if (onAward > -1)
|
||||||
{
|
{
|
||||||
result[onAward].count += item.count;
|
result[onAward].count += RandomAssist.GetFormatedNumeric(item.minCount, item.maxCount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -251,30 +409,31 @@ public class GameBus
|
|||||||
code = item.code,
|
code = item.code,
|
||||||
name = item.name,
|
name = item.name,
|
||||||
parameter = item.par,
|
parameter = item.par,
|
||||||
count = item.count
|
count = RandomAssist.GetFormatedNumeric(item.minCount, item.maxCount)
|
||||||
};
|
};
|
||||||
result.Add(add);
|
result.Add(add);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<RandomData> RandomHandleByWeight(RandomModel random, int luck = 0)
|
private static List<RandomData> RandomHandleByWeight(RandomModel random, decimal luck = 0)
|
||||||
{
|
{
|
||||||
var _randomInstance = new Random();
|
var _randomInstance = new Random();
|
||||||
List<RandomData> result = new List<RandomData>();
|
List<RandomData> result = new List<RandomData>();
|
||||||
int empty = random.empty - luck;
|
int empty = random.empty - Convert.ToInt32(luck * 100);
|
||||||
if (_randomInstance.Next(0, 100) < empty)
|
if (_randomInstance.Next(0, 100) < empty)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (random.data.Count == 0)
|
if (random.data.Count == 0)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
double totalWeight = random.data.Sum(it => it.chance);
|
double totalWeight = random.data.Sum(it => it.chance);
|
||||||
int rnd = _randomInstance.Next(Convert.ToInt32(totalWeight) + 1);
|
int rnd = _randomInstance.Next(Convert.ToInt32(totalWeight) + 1);
|
||||||
double current = 0;
|
double current = 0;
|
||||||
@@ -290,15 +449,17 @@ public class GameBus
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
private static List<RandomData> RandomHandleByChance(RandomModel random, int luck = 0)
|
|
||||||
|
private static List<RandomData> RandomHandleByChance(RandomModel random, decimal luck = 0)
|
||||||
{
|
{
|
||||||
var _randomInstance = new Random();
|
var _randomInstance = new Random();
|
||||||
List<RandomData> result = new List<RandomData>();
|
List<RandomData> result = new List<RandomData>();
|
||||||
int empty = random.empty - luck;
|
int empty = random.empty;
|
||||||
if (_randomInstance.Next(0, 100) < empty)
|
if (_randomInstance.Next(0, 100) < empty)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (random.data.Count == 0)
|
if (random.data.Count == 0)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
@@ -307,12 +468,13 @@ public class GameBus
|
|||||||
foreach (var item in random.data)
|
foreach (var item in random.data)
|
||||||
{
|
{
|
||||||
double rnd = _randomInstance.NextDouble();
|
double rnd = _randomInstance.NextDouble();
|
||||||
double okChance = item.chance / 100;
|
double okChance = (item.chance / 100) * (1.0 + Convert.ToDouble(luck));
|
||||||
if (rnd < okChance)
|
if (rnd < okChance)
|
||||||
{
|
{
|
||||||
result.Add(item);
|
result.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,40 @@ public class GameTool
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetEquQualityName(int count)
|
||||||
|
{
|
||||||
|
string result = "白";
|
||||||
|
switch (count)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
result = "红";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
result = "橙";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
result = "黄";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
result = "绿";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
result = "青";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
result = "粉";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
result = "紫";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
result = "金";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#region 距离计算
|
#region 距离计算
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
47
Service/Application.Domain/Tool/Base/UserKeyTool.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
namespace Application.Domain;
|
||||||
|
|
||||||
|
public static class UserKeyTool
|
||||||
|
{
|
||||||
|
public static async Task<string> GetThickenData(string userId, params string[] data)
|
||||||
|
{
|
||||||
|
string key = await GetUserKey(userId);
|
||||||
|
return GetThickenDataByUserKey(key, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetThickenDataByUserKey(string key, params string[] data)
|
||||||
|
{
|
||||||
|
string _data = string.Join("", data);
|
||||||
|
return EncryptAssist.Md5Encryption($"{key}_{_data}").ToLower();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static async Task<bool> CheckUserThickenData(string userId, string sign, params string[] data)
|
||||||
|
{
|
||||||
|
string key = await GetUserKey(userId);
|
||||||
|
string _sign = GetThickenDataByUserKey(key, data);
|
||||||
|
await ResetUserKey(userId);
|
||||||
|
return sign.ToLower() == _sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<string> GetUserKey(string userId)
|
||||||
|
{
|
||||||
|
var key = string.Format(UserCache.BaseCacheKey, "UserKey");
|
||||||
|
var redis = App.GetService<IRedisCache>();
|
||||||
|
if (await redis.HExistsHashAsync(key, userId))
|
||||||
|
{
|
||||||
|
return await redis.GetHashAsync<string>(key, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
string data = StringAssist.RandomString(12);
|
||||||
|
await redis.AddHashAsync(key, userId, data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task ResetUserKey(string userId)
|
||||||
|
{
|
||||||
|
string data = StringAssist.RandomString(12);
|
||||||
|
var key = string.Format(UserCache.BaseCacheKey, "UserKey");
|
||||||
|
var redis = App.GetService<IRedisCache>();
|
||||||
|
await redis.AddHashAsync(key, userId, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -281,6 +281,34 @@ namespace Application.Web.Controllers.Login
|
|||||||
{ token = token, refToken = userInfo.token, userId = userInfo.userId });
|
{ token = token, refToken = userInfo.token, userId = userInfo.userId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IPoAction> RefreshTokenByBook([FromBody] RefreshTokenParms parms)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(parms.refToken))
|
||||||
|
{
|
||||||
|
return PoAction.Message("刷新失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
string Key = App.Configuration["JwtTokenOptions:SecurityKey"].ToString();
|
||||||
|
string Issuer = App.Configuration["JwtTokenOptions:Issuer"].ToString();
|
||||||
|
string Audience = App.Configuration["JwtTokenOptions:Audience"].ToString();
|
||||||
|
|
||||||
|
var userInfo = await _userService.GetUserInfoByToken(parms.refToken);
|
||||||
|
if (userInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("刷新失败,用户不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, object> loadData = new Dictionary<string, object>();
|
||||||
|
loadData.Add("userId", userInfo.userId);
|
||||||
|
loadData.Add("accId", userInfo.accId);
|
||||||
|
loadData.Add("areaId", userInfo.areaId);
|
||||||
|
string token = JwtHelper.CreateToken(Key, Issuer, Audience, loadData, TokenConfig.TokenTime);
|
||||||
|
|
||||||
|
return PoAction.Ok(new
|
||||||
|
{ token = token, refToken = userInfo.token, userId = userInfo.userId });
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 注册角色信息
|
/// 注册角色信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -21,9 +21,13 @@ public class MapController : ControllerBase
|
|||||||
private readonly IGameSkillService _skillService;
|
private readonly IGameSkillService _skillService;
|
||||||
private readonly IGameGoodsService _goodsService;
|
private readonly IGameGoodsService _goodsService;
|
||||||
private readonly IGameTeamService _teamService;
|
private readonly IGameTeamService _teamService;
|
||||||
|
private readonly IGameMonsterService _monsterService;
|
||||||
|
private readonly IGameFightService _fightService;
|
||||||
|
|
||||||
public MapController(IUnitUserService userService, IGameMapService mapService, IGameChatService chatService,
|
public MapController(IUnitUserService userService, IGameMapService mapService, IGameChatService chatService,
|
||||||
IUnitUserAttrService attrService, IMessageService messageService, IUnitUserWeight weightService,
|
IUnitUserAttrService attrService, IMessageService messageService, IUnitUserWeight weightService,
|
||||||
IUnitUserAccService accService, IGameSkillService skillService,IGameGoodsService goodsService,IGameTeamService teamService)
|
IUnitUserAccService accService, IGameSkillService skillService, IGameGoodsService goodsService,
|
||||||
|
IGameTeamService teamService, IGameMonsterService monsterService,IGameFightService fightService)
|
||||||
{
|
{
|
||||||
_userService = userService;
|
_userService = userService;
|
||||||
_mapService = mapService;
|
_mapService = mapService;
|
||||||
@@ -35,6 +39,8 @@ public class MapController : ControllerBase
|
|||||||
_skillService = skillService;
|
_skillService = skillService;
|
||||||
_goodsService = goodsService;
|
_goodsService = goodsService;
|
||||||
_teamService = teamService;
|
_teamService = teamService;
|
||||||
|
_monsterService = monsterService;
|
||||||
|
_fightService = fightService;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 地图相关
|
#region 地图相关
|
||||||
@@ -90,13 +96,16 @@ public class MapController : ControllerBase
|
|||||||
|
|
||||||
//公聊信息
|
//公聊信息
|
||||||
var myTeam = await _teamService.GetUserTeamData(userId);
|
var myTeam = await _teamService.GetUserTeamData(userId);
|
||||||
string teamId =myTeam.teamId ;
|
string teamId = myTeam.teamId;
|
||||||
string groupId = "";
|
string groupId = "";
|
||||||
var chatData = await _chatService.GetChatTop(userId, area, 2, teamId, groupId);
|
var chatData = await _chatService.GetChatTop(userId, area, 2, teamId, groupId);
|
||||||
|
|
||||||
|
|
||||||
var npcData = await _mapService.GetMapNpc(mapInfo.mapId); //NPC信息
|
var npcData = await _mapService.GetMapNpc(mapInfo.mapId); //NPC信息
|
||||||
npcData = npcData.FindAll(it => GameTool.AreaVerify(StateHelper.areaId, it.areaId));
|
npcData = npcData.FindAll(it => GameTool.AreaVerify(StateHelper.areaId, it.areaId));
|
||||||
|
|
||||||
|
//获取怪物
|
||||||
|
var monsterData = await _monsterService.GetMapMonster(userId, mapInfo.mapId, teamId);
|
||||||
var nearUser =
|
var nearUser =
|
||||||
await _mapService.GetMapUser(mapInfo.mapId, area, (int)mapInfo.lookArea, [userId],
|
await _mapService.GetMapUser(mapInfo.mapId, area, (int)mapInfo.lookArea, [userId],
|
||||||
3); //获取附近的人
|
3); //获取附近的人
|
||||||
@@ -132,6 +141,10 @@ public class MapController : ControllerBase
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var broadcast = await _messageService.GetBroadcastData(area);
|
||||||
|
|
||||||
|
var userFight = await _fightService.GetUserFight(userId);
|
||||||
|
string fightId = userFight.Count > 0 ? userFight[0] : "";
|
||||||
|
|
||||||
object ret = new
|
object ret = new
|
||||||
{
|
{
|
||||||
@@ -143,7 +156,10 @@ public class MapController : ControllerBase
|
|||||||
nearUser,
|
nearUser,
|
||||||
noReadMsg = noReadMsg[3],
|
noReadMsg = noReadMsg[3],
|
||||||
business,
|
business,
|
||||||
mapRes
|
mapRes,
|
||||||
|
broadcast,
|
||||||
|
monster = monsterData,
|
||||||
|
fightId
|
||||||
};
|
};
|
||||||
|
|
||||||
return PoAction.Ok(ret);
|
return PoAction.Ok(ret);
|
||||||
@@ -684,7 +700,6 @@ public class MapController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
var myVigour = await _attrService.GetUserVigourInfo(userId);
|
var myVigour = await _attrService.GetUserVigourInfo(userId);
|
||||||
Console.WriteLine($"{myVigour.vitality }-{resInfo.needVigour}");
|
|
||||||
if (myVigour.vitality < resInfo.needVigour)
|
if (myVigour.vitality < resInfo.needVigour)
|
||||||
{
|
{
|
||||||
return PoAction.Message("活力不足!");
|
return PoAction.Message("活力不足!");
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ public class StoreController : ControllerBase
|
|||||||
return PoAction.Message("Npc不存在!");
|
return PoAction.Message("Npc不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Store)))
|
||||||
|
{
|
||||||
|
return PoAction.Message("业务不可用!");
|
||||||
|
}
|
||||||
|
|
||||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||||
if (npcInfo.mapId != onMap)
|
if (npcInfo.mapId != onMap)
|
||||||
{
|
{
|
||||||
@@ -85,6 +90,11 @@ public class StoreController : ControllerBase
|
|||||||
return PoAction.Message("Npc不存在!");
|
return PoAction.Message("Npc不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Store)))
|
||||||
|
{
|
||||||
|
return PoAction.Message("业务不可用!");
|
||||||
|
}
|
||||||
|
|
||||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||||
if (npcInfo.mapId != onMap)
|
if (npcInfo.mapId != onMap)
|
||||||
{
|
{
|
||||||
@@ -158,6 +168,11 @@ public class StoreController : ControllerBase
|
|||||||
return PoAction.Message("Npc不存在!");
|
return PoAction.Message("Npc不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Store)))
|
||||||
|
{
|
||||||
|
return PoAction.Message("业务不可用!");
|
||||||
|
}
|
||||||
|
|
||||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||||
if (npcInfo.mapId != onMap)
|
if (npcInfo.mapId != onMap)
|
||||||
{
|
{
|
||||||
@@ -168,25 +183,25 @@ public class StoreController : ControllerBase
|
|||||||
|
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
{
|
{
|
||||||
var data = await _equService.GetUserEquData(userId, 0, query, page, 10, total, true);
|
var data = await _equService.GetUserEquData(userId, 0, query, page, 10, total, true, true);
|
||||||
return PoAction.Ok(new { data, total.Value });
|
return PoAction.Ok(new { data, total = total.Value });
|
||||||
}
|
}
|
||||||
else if (type == 1)
|
else if (type == 1)
|
||||||
{
|
{
|
||||||
List<string> code = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
List<string> code = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
||||||
var data = await _goodsService.GetUserGoodsData(userId, code, new List<string>(), query, page, 10, total);
|
var data = await _goodsService.GetUserGoodsData(userId, code, new List<string>(), query, page, 10, total);
|
||||||
return PoAction.Ok(new { data, total.Value });
|
return PoAction.Ok(new { data, total = total.Value });
|
||||||
}
|
}
|
||||||
else if (type == 2)
|
else if (type == 2)
|
||||||
{
|
{
|
||||||
List<string> code = new List<string>();
|
List<string> code = new List<string>();
|
||||||
List<string> noCode = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
List<string> noCode = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
||||||
var data = await _goodsService.GetUserGoodsData(userId, code, noCode, query, page, 10, total);
|
var data = await _goodsService.GetUserGoodsData(userId, code, noCode, query, page, 10, total);
|
||||||
return PoAction.Ok(new { data, total.Value });
|
return PoAction.Ok(new { data, total = total.Value });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return PoAction.Ok(new { data = new List<string>(), total.Value });
|
return PoAction.Ok(new { data = new List<string>(), total = total.Value });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +233,7 @@ public class StoreController : ControllerBase
|
|||||||
return PoAction.Message("Npc不存在!");
|
return PoAction.Message("Npc不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parms.type == 0)//装备
|
if (parms.type == 0) //装备
|
||||||
{
|
{
|
||||||
var equInfo = await _equService.GetUserEquInfo(parms.id);
|
var equInfo = await _equService.GetUserEquInfo(parms.id);
|
||||||
if (equInfo == null)
|
if (equInfo == null)
|
||||||
|
|||||||
134
Service/Application.Web/Controllers/Pub/BusinessController.cs
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Application.Web.Controllers.Pub;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 业务操作接口
|
||||||
|
/// </summary>
|
||||||
|
[Route("[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
[Authorize]
|
||||||
|
public class BusinessController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IGameMapService _mapService;
|
||||||
|
private readonly IGameEquService _equService;
|
||||||
|
private readonly IGameGoodsService _goodsService;
|
||||||
|
|
||||||
|
public BusinessController(IGameEquService equService, IGameGoodsService goodsService, IGameMapService mapService)
|
||||||
|
{
|
||||||
|
_equService = equService;
|
||||||
|
_goodsService = goodsService;
|
||||||
|
_mapService = mapService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取打造图纸
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetEquPaper()
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var data = await _goodsService.GetUserGoodsData(userId, nameof(GoodsEnum.Code.Paper));
|
||||||
|
List<MakePaperView> result = new List<MakePaperView>();
|
||||||
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
MakePaperView temp = new MakePaperView();
|
||||||
|
temp.goods = await _goodsService.GetGoodsInfo((int)item.goodsId);
|
||||||
|
temp.count = (long)item.count;
|
||||||
|
result.Add(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打造装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="npcId"></param>
|
||||||
|
/// <param name="goodsId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> HandleEquPaper(int npcId, int goodsId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
|
||||||
|
#region NPC验证
|
||||||
|
|
||||||
|
var npcInfo = await _mapService.GetNpcInfo(npcId);
|
||||||
|
if (npcInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (npcInfo.status != 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.Make)))
|
||||||
|
{
|
||||||
|
return PoAction.Message("业务不可用!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||||
|
if (npcInfo.mapId != onMap)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
var myGoods = await _goodsService.GetUserGoodsInfo(userId, goodsId);
|
||||||
|
if (myGoods == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("暂无图纸!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myGoods.count < 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("暂无图纸!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myGoods.code != nameof(GoodsEnum.Code.Paper))
|
||||||
|
{
|
||||||
|
return PoAction.Message("非图纸材料,无法打造!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string needstr = await _goodsService.GetGoodsContent(goodsId);
|
||||||
|
var needs = JsonConvert.DeserializeObject<List<TowerNeed>>(needstr);
|
||||||
|
var check = await GameBus.CheckNeed(userId, needs);
|
||||||
|
if (check.result)
|
||||||
|
{
|
||||||
|
if (await GameBus.UpdateBag(userId, 0, needs, "装备打造"))
|
||||||
|
{
|
||||||
|
var onEqu = await _equService.GetMakeEquByGoodsId(goodsId);
|
||||||
|
if (onEqu == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("打造失败,请联系客服!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//发放装备
|
||||||
|
bool isRd = onEqu.rdAttr != 0;
|
||||||
|
var getEqu = await _equService.AddUserEqu(userId, (int)onEqu.equId, isRd, "打造装备");
|
||||||
|
if (getEqu != null)
|
||||||
|
{
|
||||||
|
return PoAction.Ok(getEqu.ueId, $"打造成功,获得装备[{onEqu.equName}]");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("打造失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("打造失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("材料不足!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Application.Web.Controllers.Pub;
|
namespace Application.Web.Controllers.Pub;
|
||||||
|
|
||||||
@@ -13,12 +14,19 @@ public class EquController : ControllerBase
|
|||||||
private readonly IGameEquService _equService;
|
private readonly IGameEquService _equService;
|
||||||
private readonly IUnitUserAttrService _attrService;
|
private readonly IUnitUserAttrService _attrService;
|
||||||
private readonly IUnitUserService _userService;
|
private readonly IUnitUserService _userService;
|
||||||
|
private readonly IGameDicService _dicService;
|
||||||
|
private readonly IMessageService _messageService;
|
||||||
|
private readonly IGameGoodsService _goodsService;
|
||||||
|
|
||||||
public EquController(IGameEquService equService, IUnitUserAttrService attrService, IUnitUserService userService)
|
public EquController(IGameEquService equService, IUnitUserAttrService attrService, IUnitUserService userService,
|
||||||
|
IGameDicService dicService, IMessageService messageService, IGameGoodsService goodsService)
|
||||||
{
|
{
|
||||||
_equService = equService;
|
_equService = equService;
|
||||||
_attrService = attrService;
|
_attrService = attrService;
|
||||||
_userService = userService;
|
_userService = userService;
|
||||||
|
_dicService = dicService;
|
||||||
|
_messageService = messageService;
|
||||||
|
_goodsService = goodsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -66,6 +74,7 @@ public class EquController : ControllerBase
|
|||||||
suit = await _equService.GetEuqSuitInfo(ueInfo.suitCode);
|
suit = await _equService.GetEuqSuitInfo(ueInfo.suitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ueInfo = EquTool.GetUserEquByIntensify(ueInfo);
|
||||||
user = await UserModelTool.GetUserView(ueInfo.owerId);
|
user = await UserModelTool.GetUserView(ueInfo.owerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,12 +118,6 @@ public class EquController : ControllerBase
|
|||||||
return PoAction.Message("装备不存在!");
|
return PoAction.Message("装备不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (equInfo.isAppr == 0)
|
|
||||||
{
|
|
||||||
return PoAction.Message("装备未鉴定!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
equInfo.isLock = equInfo.isLock == 0 ? 1 : 0;
|
equInfo.isLock = equInfo.isLock == 0 ? 1 : 0;
|
||||||
|
|
||||||
bool result = await _equService.UpdateUserEquInfo(equInfo);
|
bool result = await _equService.UpdateUserEquInfo(equInfo);
|
||||||
@@ -138,7 +141,73 @@ public class EquController : ControllerBase
|
|||||||
{
|
{
|
||||||
string userId = StateHelper.userId;
|
string userId = StateHelper.userId;
|
||||||
var data = await _equService.GetUserOnEqu(userId);
|
var data = await _equService.GetUserOnEqu(userId);
|
||||||
return PoAction.Ok(data);
|
var suit = await _equService.GetUserEquSuit(userId);
|
||||||
|
return PoAction.Ok(new { data, suit });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 鉴定装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ueId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> ApprEqu(string ueId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||||
|
if (equInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isAppr == 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var resEqu = await _equService.GetEquInfo((int)equInfo.equId);
|
||||||
|
if (resEqu.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备数据异常,联系客服!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var myGoods = await _goodsService.GetUserGoodsCount(userId, GameConfig.GameEquApprGoods);
|
||||||
|
if (myGoods < 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("暂无装备鉴定符!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await _goodsService.UpdateUserGoods(userId, 0, GameConfig.GameEquApprGoods, 1, "鉴定装备"))
|
||||||
|
{
|
||||||
|
equInfo.minAtk = RandomAssist.GetFormatedNumeric((int)resEqu.minAtk, (int)resEqu.maxAtk);
|
||||||
|
equInfo.maxAtk = RandomAssist.GetFormatedNumeric((int)equInfo.minAtk, (int)resEqu.maxAtk);
|
||||||
|
string[] def = resEqu.defense.Split('-');
|
||||||
|
equInfo.Defense = RandomAssist.GetFormatedNumeric(Convert.ToInt32(def[0]), Convert.ToInt32(def[1]));
|
||||||
|
string[] agi = resEqu.agility.Split('-');
|
||||||
|
equInfo.Agility = RandomAssist.GetFormatedNumeric(Convert.ToInt32(agi[0]), Convert.ToInt32(agi[1]));
|
||||||
|
string[] mor = resEqu.morale.Split('-');
|
||||||
|
equInfo.Morale = RandomAssist.GetFormatedNumeric(Convert.ToInt32(mor[0]), Convert.ToInt32(mor[1]));
|
||||||
|
string[] blo = resEqu.blood.Split('-');
|
||||||
|
equInfo.Blood = RandomAssist.GetFormatedNumeric(Convert.ToInt32(blo[0]), Convert.ToInt32(blo[1]));
|
||||||
|
equInfo.isAppr = 1;
|
||||||
|
if (await _equService.UpdateUserEquInfo(equInfo))
|
||||||
|
{
|
||||||
|
return PoAction.Ok(true, "装备鉴定成功!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("鉴定失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("鉴定失败,请稍后尝试!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -200,6 +269,7 @@ public class EquController : ControllerBase
|
|||||||
return PoAction.Message($"该装备最多穿戴{equInfo.canEqualUp}件!");
|
return PoAction.Message($"该装备最多穿戴{equInfo.canEqualUp}件!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isOk = true;
|
bool isOk = true;
|
||||||
if (string.IsNullOrEmpty(de))
|
if (string.IsNullOrEmpty(de))
|
||||||
{
|
{
|
||||||
@@ -222,6 +292,7 @@ public class EquController : ControllerBase
|
|||||||
{
|
{
|
||||||
return PoAction.Message("装备未穿戴!");
|
return PoAction.Message("装备未穿戴!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DownOnEqu.code != equInfo.code)
|
if (DownOnEqu.code != equInfo.code)
|
||||||
{
|
{
|
||||||
return PoAction.Message("装备部位不一致!");
|
return PoAction.Message("装备部位不一致!");
|
||||||
@@ -261,5 +332,594 @@ public class EquController : ControllerBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取可穿戴装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetCanOnEqu(int type)
|
||||||
|
{
|
||||||
|
string code = nameof(EquEnum.EquPlace.Hold);
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
code = nameof(EquEnum.EquPlace.Hold);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
code = nameof(EquEnum.EquPlace.Vice);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
code = nameof(EquEnum.EquPlace.Head);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
code = nameof(EquEnum.EquPlace.Wear);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
code = nameof(EquEnum.EquPlace.Waist);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
code = nameof(EquEnum.EquPlace.Foot);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
code = nameof(EquEnum.EquPlace.Ornaments);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
code = nameof(EquEnum.EquPlace.Fashion);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
code = nameof(EquEnum.EquPlace.Wing);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
code = nameof(EquEnum.EquPlace.Decorate);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var userOnEqu = await _equService.GetUserOnEqu(userId);
|
||||||
|
var NoEqu = userOnEqu.FindAll(it => it.code == code).Select(it => it.ueId).ToList();
|
||||||
|
var CanEqu = await _equService.GetUserEquData(userId, code, NoEqu);
|
||||||
|
long onTime = TimeExtend.GetTimeStampSeconds;
|
||||||
|
CanEqu = CanEqu.FindAll(it => it.isAppr == 1 && it.useEndTime > onTime);
|
||||||
|
CanEqu = CanEqu.OrderByDescending(it => it.lev).ToList();
|
||||||
|
return PoAction.Ok(CanEqu);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取激活套装属性
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="suitCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetUserOnSuitInfo(string suitCode)
|
||||||
|
{
|
||||||
|
var userId = StateHelper.userId;
|
||||||
|
var onSuit = await _equService.GetUserEquSuit(userId);
|
||||||
|
var suit = onSuit.Find(it => it.suitCode == suitCode);
|
||||||
|
if (suit == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("套装不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = await _equService.GetEuqSuitInfo(suitCode);
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("套装不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(new { data, suit });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取装备觉醒所需
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ue"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetEquAwakenInfo(string ue)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equData = await _equService.GetUserEquInfo(ue);
|
||||||
|
if (equData == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equData.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equData.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equData.useEndTime < TimeExtend.GetTimeStampSeconds)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckTowerNeed result = new CheckTowerNeed();
|
||||||
|
if (equData.EquAwaken.Count == 0)
|
||||||
|
{
|
||||||
|
var dicConfig = await _dicService.GetDicInfo(nameof(GameEnum.DicCode.Awaken));
|
||||||
|
List<TowerNeed> need = JsonConvert.DeserializeObject<List<TowerNeed>>(dicConfig.sign);
|
||||||
|
result = await GameBus.CheckNeed(userId, need);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var upAwaken =
|
||||||
|
await _equService.GetEquAwakenInfoByLev(equData.EquAwaken[0].atId, equData.EquAwaken[0].lev + 1);
|
||||||
|
if (upAwaken == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("觉醒已达到上限!");
|
||||||
|
}
|
||||||
|
|
||||||
|
result = await GameBus.CheckNeed(userId, upAwaken.need);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 觉醒装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ue"></param>
|
||||||
|
/// <param name="type">0重置,1正常觉醒</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> HandleEquAwaken(string ue, int type)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equData = await _equService.GetUserEquInfo(ue);
|
||||||
|
if (equData == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equData.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equData.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equData.useEndTime < TimeExtend.GetTimeStampSeconds)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
EquAwakenData onAwaken = new EquAwakenData();
|
||||||
|
game_equ_awaken newAwaken = new game_equ_awaken();
|
||||||
|
CheckTowerNeed result = new CheckTowerNeed();
|
||||||
|
if (type == 0) //重置
|
||||||
|
{
|
||||||
|
newAwaken = await _equService.GetRandomOneAwakenByCode(equData.code);
|
||||||
|
if (newAwaken == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("该部件装备不可觉醒!");
|
||||||
|
}
|
||||||
|
|
||||||
|
onAwaken = newAwaken.levAttr.Find(it => it.lev == 1);
|
||||||
|
var dicConfig = await _dicService.GetDicInfo(nameof(GameEnum.DicCode.Awaken));
|
||||||
|
List<TowerNeed> need = JsonConvert.DeserializeObject<List<TowerNeed>>(dicConfig.sign);
|
||||||
|
result = await GameBus.CheckNeed(userId, need);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (equData.EquAwaken.Count == 0)
|
||||||
|
{
|
||||||
|
newAwaken = await _equService.GetRandomOneAwakenByCode(equData.code);
|
||||||
|
if (newAwaken == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("该部件装备不可觉醒!");
|
||||||
|
}
|
||||||
|
|
||||||
|
onAwaken = newAwaken.levAttr.Find(it => it.lev == 1);
|
||||||
|
var dicConfig = await _dicService.GetDicInfo(nameof(GameEnum.DicCode.Awaken));
|
||||||
|
List<TowerNeed> need = JsonConvert.DeserializeObject<List<TowerNeed>>(dicConfig.sign);
|
||||||
|
result = await GameBus.CheckNeed(userId, need);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var upAwaken =
|
||||||
|
await _equService.GetEquAwakenInfoByLev(equData.EquAwaken[0].atId, equData.EquAwaken[0].lev + 1);
|
||||||
|
if (upAwaken == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("觉醒已达到上限!");
|
||||||
|
}
|
||||||
|
|
||||||
|
newAwaken = await _equService.GetEquAwakenInfo(equData.EquAwaken[0].atId);
|
||||||
|
onAwaken = upAwaken;
|
||||||
|
result = await GameBus.CheckNeed(userId, upAwaken.need);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.result == false)
|
||||||
|
{
|
||||||
|
return PoAction.Message("不满足觉醒条件!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await GameBus.UpdateBag(userId, 0, result.Needs, "觉醒装备"))
|
||||||
|
{
|
||||||
|
if (RandomAssist.CheakRandom(onAwaken.success))
|
||||||
|
{
|
||||||
|
EquAwaken awaken = new EquAwaken();
|
||||||
|
awaken.atId = newAwaken.atId;
|
||||||
|
awaken.name = newAwaken.name;
|
||||||
|
awaken.lev = onAwaken.lev;
|
||||||
|
awaken.awaken = onAwaken.attr;
|
||||||
|
equData.EquAwaken = [awaken];
|
||||||
|
if (await _equService.UpdateUserEquInfo(equData, true, "觉醒", "装备觉醒"))
|
||||||
|
{
|
||||||
|
string msg = $"[{equData.equName}]装备的特性【{awaken.name}】升至{awaken.lev}级!";
|
||||||
|
await _messageService.SendBroadcast(userId, nameof(MessageEnum.BroadcastCode.Promote), msg);
|
||||||
|
//此处为觉醒成功,返回相关数据
|
||||||
|
var nextAwaken =
|
||||||
|
await _equService.GetEquAwakenInfoByLev(equData.EquAwaken[0].atId,
|
||||||
|
equData.EquAwaken[0].lev + 1);
|
||||||
|
var nextResult = new CheckTowerNeed()
|
||||||
|
{
|
||||||
|
result = false,
|
||||||
|
Needs = new List<TowerNeed>()
|
||||||
|
};
|
||||||
|
if (nextAwaken != null)
|
||||||
|
{
|
||||||
|
nextResult = await GameBus.CheckNeed(userId, nextAwaken.need);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(new { state = 1, awaken = equData.EquAwaken, result = nextResult }, "觉醒成功!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("觉醒异常,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//此处为觉醒成功,返回相关数据
|
||||||
|
var nextAwaken =
|
||||||
|
await _equService.GetEquAwakenInfoByLev(equData.EquAwaken[0].atId,
|
||||||
|
equData.EquAwaken[0].lev + 1);
|
||||||
|
var nextResult = new CheckTowerNeed()
|
||||||
|
{
|
||||||
|
result = false,
|
||||||
|
Needs = new List<TowerNeed>()
|
||||||
|
};
|
||||||
|
if (nextAwaken != null)
|
||||||
|
{
|
||||||
|
nextResult = await GameBus.CheckNeed(userId, nextAwaken.need);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(new { state = 0, awaken = equData.EquAwaken, result = nextResult }, "觉醒失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("觉醒异常,请稍后尝试!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取强化信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ueId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetEquUpInfo(string ueId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||||
|
if (equInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
long time = TimeExtend.GetTimeStampSeconds;
|
||||||
|
if (equInfo.useEndTime < time)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isIntensify == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不可强化!");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isMax = false;
|
||||||
|
int upLev = (int)equInfo.intensifyLev + 1;
|
||||||
|
var needs = await _equService.GetUserEquUpData(upLev);
|
||||||
|
if (needs == null)
|
||||||
|
{
|
||||||
|
isMax = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckTowerNeeds result = new CheckTowerNeeds();
|
||||||
|
result.result = false;
|
||||||
|
result.Needs = new List<TowerNeeds>();
|
||||||
|
if (!isMax)
|
||||||
|
{
|
||||||
|
result = await GameBus.CheckNeeds(userId, needs.needData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(new
|
||||||
|
{
|
||||||
|
equData = equInfo,
|
||||||
|
isMax,
|
||||||
|
result
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 强化装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parms"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IPoAction> HandleEquUp([FromBody] EquUpParms parms)
|
||||||
|
{
|
||||||
|
string ueId = parms.ueId;
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||||
|
if (equInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
long time = TimeExtend.GetTimeStampSeconds;
|
||||||
|
if (equInfo.useEndTime < time)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isIntensify == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不可强化!");
|
||||||
|
}
|
||||||
|
|
||||||
|
int upLev = (int)equInfo.intensifyLev + 1;
|
||||||
|
var needs = await _equService.GetUserEquUpData(upLev);
|
||||||
|
if (needs == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("已达到最大强化等级!");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TowerNeeds> reqNeeds = JsonConvert.DeserializeObject<List<TowerNeeds>>(parms.needs);
|
||||||
|
//验证材料
|
||||||
|
foreach (var item in needs.needData)
|
||||||
|
{
|
||||||
|
var onNeed = reqNeeds.Find(it => it.Id == item.Id);
|
||||||
|
if (item.NeedItem.Any(it => it.code == onNeed.code && it.parameter == onNeed.parameter) == false &&
|
||||||
|
item.code != onNeed.code && item.parameter != onNeed.parameter)
|
||||||
|
{
|
||||||
|
return PoAction.Message("材料错误!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = await GameBus.CheckNeeds(userId, reqNeeds);
|
||||||
|
if (result.result == false)
|
||||||
|
{
|
||||||
|
return PoAction.Message("材料不足!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await GameBus.UpdateBag(userId, 0, reqNeeds, $"强化装备:{ueId}"))
|
||||||
|
{
|
||||||
|
CheckTowerNeeds nexResult = new CheckTowerNeeds();
|
||||||
|
nexResult.result = false;
|
||||||
|
nexResult.Needs = new List<TowerNeeds>();
|
||||||
|
bool isMax = false;
|
||||||
|
int state = 0;
|
||||||
|
int okNum = (int)needs.okChance;
|
||||||
|
if (RandomAssist.CheakRandom(okNum))
|
||||||
|
{
|
||||||
|
state = 1;
|
||||||
|
equInfo.intensifyLev = upLev;
|
||||||
|
equInfo.isDeal = result.isDeal;
|
||||||
|
equInfo.isGive = result.isGive;
|
||||||
|
if (await _equService.UpdateUserEquInfo(equInfo, true, "强化", "强化装备") == false)
|
||||||
|
{
|
||||||
|
return PoAction.Message("强化异常,请联系客服!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var nextNeeds = await _equService.GetUserEquUpData((int)equInfo.intensifyLev + 1);
|
||||||
|
if (nextNeeds == null)
|
||||||
|
{
|
||||||
|
isMax = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var nexts = nextNeeds.euId == needs.euId ? reqNeeds : nextNeeds.needData;
|
||||||
|
nexResult = await GameBus.CheckNeeds(userId, nexts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.intensifyLev >= 60)
|
||||||
|
{
|
||||||
|
string msg = $"[{equInfo.equName}]装备强化至{equInfo.intensifyLev}级!";
|
||||||
|
await _messageService.SendBroadcast(userId, nameof(MessageEnum.BroadcastCode.Promote), msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else //执行材料返还
|
||||||
|
{
|
||||||
|
List<TowerGet> retProp = new List<TowerGet>();
|
||||||
|
foreach (var item in reqNeeds)
|
||||||
|
{
|
||||||
|
if (item.retCount > 0 && item.isOp == 1)
|
||||||
|
{
|
||||||
|
TowerGet temp = new TowerGet()
|
||||||
|
{
|
||||||
|
code = item.code,
|
||||||
|
name = item.name,
|
||||||
|
parameter = item.parameter,
|
||||||
|
count = item.retCount
|
||||||
|
};
|
||||||
|
retProp.Add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retProp.Count > 0)
|
||||||
|
{
|
||||||
|
await GameBus.UpdateBag(userId, 1, retProp, "强化失败,返还");
|
||||||
|
}
|
||||||
|
|
||||||
|
nexResult = await GameBus.CheckNeeds(userId, reqNeeds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return PoAction.Ok(new
|
||||||
|
{
|
||||||
|
state,
|
||||||
|
equData = equInfo,
|
||||||
|
isMax,
|
||||||
|
result = nexResult
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("强化错误,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取洗练装备属性
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ueId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetEquQualityInfo(string ueId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||||
|
if (equInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
long time = TimeExtend.GetTimeStampSeconds;
|
||||||
|
if (equInfo.useEndTime < time)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> CanOp = new List<string>()
|
||||||
|
{ "Hold", "Vice", "Head", "Wear", "Waist", "Foot", "Ornaments" };
|
||||||
|
if (!CanOp.Contains(equInfo.code))
|
||||||
|
{
|
||||||
|
return PoAction.Message("该部件不可洗练!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var dicConfig = await _dicService.GetDicInfo(nameof(GameEnum.DicCode.Quality));
|
||||||
|
List<TowerNeed> need = JsonConvert.DeserializeObject<List<TowerNeed>>(dicConfig.sign);
|
||||||
|
CheckTowerNeed result = await GameBus.CheckNeed(userId, need);
|
||||||
|
|
||||||
|
return PoAction.Ok(new
|
||||||
|
{
|
||||||
|
equData = equInfo,
|
||||||
|
result
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 洗练装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ueId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> HandleEquQuality(string ueId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||||
|
if (equInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isAppr == 0)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
long time = TimeExtend.GetTimeStampSeconds;
|
||||||
|
if (equInfo.useEndTime < time)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> CanOp = new List<string>()
|
||||||
|
{ "Hold", "Vice", "Head", "Wear", "Waist", "Foot", "Ornaments" };
|
||||||
|
if (!CanOp.Contains(equInfo.code))
|
||||||
|
{
|
||||||
|
return PoAction.Message("该部件不可洗练!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var dicConfig = await _dicService.GetDicInfo(nameof(GameEnum.DicCode.Quality));
|
||||||
|
List<TowerNeed> need = JsonConvert.DeserializeObject<List<TowerNeed>>(dicConfig.sign);
|
||||||
|
CheckTowerNeed result = await GameBus.CheckNeed(userId, need);
|
||||||
|
if (result.result)
|
||||||
|
{
|
||||||
|
if (await GameBus.UpdateBag(userId, 0, need, "洗练装备"))
|
||||||
|
{
|
||||||
|
var attr = await _equService.GetRandomEquAttr(equInfo.code, (int)equInfo.lev);
|
||||||
|
equInfo.quality = attr.Count;
|
||||||
|
equInfo.qualityName = GameTool.GetEquQualityName(attr.Count);
|
||||||
|
equInfo.EquAttr = attr;
|
||||||
|
if (await _equService.UpdateUserEquInfo(equInfo, true, "洗练装备", "洗练装备"))
|
||||||
|
{
|
||||||
|
return PoAction.Ok(true, "洗练成功!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("洗练失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("洗练失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("洗练失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
107
Service/Application.Web/Controllers/Pub/FightController.cs
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Application.Web.Controllers.Pub;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 战斗接口
|
||||||
|
/// </summary>
|
||||||
|
[Route("[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
[Authorize]
|
||||||
|
public class FightController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IGameFightService _fightService;
|
||||||
|
private readonly IGameMonsterService _monsterService;
|
||||||
|
private readonly IUnitUserAttrService _attrService;
|
||||||
|
private readonly IGameMapService _mapService;
|
||||||
|
|
||||||
|
public FightController(IGameFightService fightService, IGameMonsterService monsterService,
|
||||||
|
IUnitUserAttrService attrService, IGameMapService mapService)
|
||||||
|
{
|
||||||
|
_fightService = fightService;
|
||||||
|
_monsterService = monsterService;
|
||||||
|
_attrService = attrService;
|
||||||
|
_mapService = mapService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加怪物战斗
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parms"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IPoAction> FightMonster([FromBody] FightMonsterParms parms)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
if (await UserKeyTool.CheckUserThickenData(userId, parms.sign, parms.type.ToString(), parms.monsterId) == false)
|
||||||
|
{
|
||||||
|
return PoAction.Message("怪物不存在!", -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var mapInfo = await _mapService.GetUserOnToMapInfo(userId);
|
||||||
|
|
||||||
|
//添加怪物战斗
|
||||||
|
string fightId = StringAssist.NewGuid;
|
||||||
|
string areaCode = nameof(GameEnum.AreaCode.Own);
|
||||||
|
string keyId = fightId;
|
||||||
|
string mainId = string.Empty;
|
||||||
|
string code = nameof(GameEnum.FightCode.PVE);
|
||||||
|
string scene = mapInfo.code;
|
||||||
|
string mapId = mapInfo.mapId;
|
||||||
|
long exp = 0;
|
||||||
|
long copper = 0;
|
||||||
|
long petExp = 0;
|
||||||
|
string award = string.Empty;
|
||||||
|
string pars = "";
|
||||||
|
if (parms.type == 0)
|
||||||
|
{
|
||||||
|
var monster = await _monsterService.GetMapMonsterInfo(parms.monsterId);
|
||||||
|
mainId = monster.monsterId;
|
||||||
|
pars = JsonConvert.SerializeObject(new { type = "Default" });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var monster = await _monsterService.GetCreateMonsterInfo(parms.monsterId);
|
||||||
|
keyId = monster.umId;
|
||||||
|
mainId = monster.monsterId;
|
||||||
|
areaCode = monster.areaCode;
|
||||||
|
pars = JsonConvert.SerializeObject(new { type = "Create", code = monster.code, par = monster.par });
|
||||||
|
}
|
||||||
|
var monsterInfo = await _monsterService.GetMonsterInfo(mainId);
|
||||||
|
if (monsterInfo != null)
|
||||||
|
{
|
||||||
|
var userAttr = await _attrService.GetUserAttrModel(userId, scene);
|
||||||
|
//处理奖励和资源
|
||||||
|
exp = Convert.ToInt64(monsterInfo.exp * (1.0m + userAttr.addExp)) ;
|
||||||
|
copper = Convert.ToInt64(monsterInfo.copper * (1.0m + userAttr.addGold));
|
||||||
|
petExp = (long)monsterInfo.petExp;
|
||||||
|
if (!string.IsNullOrEmpty(monsterInfo.award))//生成奖励
|
||||||
|
{
|
||||||
|
var awardModel = JsonConvert.DeserializeObject<MonsterAwardModel>(monsterInfo.award);
|
||||||
|
if (awardModel.type == nameof(MonsterEnum.AwardCode.Default))
|
||||||
|
{
|
||||||
|
var getAward = GameBus.GetRandomGoods(awardModel.award, 1,userAttr.burst);
|
||||||
|
award = JsonConvert.SerializeObject(new FightAwardModel() { code = "Default", award = getAward });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool result = await _fightService.AddFight(fightId, areaCode, keyId, mainId, code, scene, mapId, userId, exp,
|
||||||
|
copper, petExp, award, pars);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
return PoAction.Ok(fightId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("战斗生成错误!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IPoAction> Fight([FromBody] FightParms parms)
|
||||||
|
{
|
||||||
|
return PoAction.Ok(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Application.Web.Controllers.Pub;
|
namespace Application.Web.Controllers.Pub;
|
||||||
|
|
||||||
@@ -11,10 +12,17 @@ namespace Application.Web.Controllers.Pub;
|
|||||||
public class GoodsController : ControllerBase
|
public class GoodsController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IGameGoodsService _goodsService;
|
private readonly IGameGoodsService _goodsService;
|
||||||
|
private readonly IUnitUserAttrService _attrService;
|
||||||
|
private readonly IMessageService _messageService;
|
||||||
|
private readonly IUnitUserWeight _weightService;
|
||||||
|
|
||||||
public GoodsController(IGameGoodsService goodsService)
|
public GoodsController(IGameGoodsService goodsService, IUnitUserAttrService attrService,
|
||||||
|
IMessageService messageService, IUnitUserWeight weightService)
|
||||||
{
|
{
|
||||||
_goodsService = goodsService;
|
_goodsService = goodsService;
|
||||||
|
_attrService = attrService;
|
||||||
|
_messageService = messageService;
|
||||||
|
_weightService = weightService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -33,7 +41,205 @@ public class GoodsController : ControllerBase
|
|||||||
|
|
||||||
string userId = StateHelper.userId;
|
string userId = StateHelper.userId;
|
||||||
int count = await _goodsService.GetUserGoodsCount(userId, goodsId);
|
int count = await _goodsService.GetUserGoodsCount(userId, goodsId);
|
||||||
|
int UseState = 0;
|
||||||
|
string[] ShowViewNum = ["Pack", "Weight", "State"]; //显示带数量窗口
|
||||||
|
string[] ShowView = ["Ship","Drug"]; //显示只能使用1个的窗口
|
||||||
|
if (ShowViewNum.Any(it => it == goodsInfo.code))
|
||||||
|
{
|
||||||
|
UseState = 1;
|
||||||
|
}
|
||||||
|
else if (ShowView.Any(it => it == goodsInfo.code))
|
||||||
|
{
|
||||||
|
UseState = 2;
|
||||||
|
}
|
||||||
|
else if (goodsInfo.code == nameof(GoodsEnum.Code.ChoicePack))
|
||||||
|
{
|
||||||
|
UseState = 3;
|
||||||
|
}
|
||||||
|
|
||||||
return PoAction.Ok(new { goods = goodsInfo, count });
|
return PoAction.Ok(new { goods = goodsInfo, count, use = UseState });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 使用物品
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="goodsId"></param>
|
||||||
|
/// <param name="count"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> UseGoods(int goodsId, int count)
|
||||||
|
{
|
||||||
|
count = count < 1 ? 1 : count;
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var goodsInfo = await _goodsService.GetGoodsInfo(goodsId);
|
||||||
|
if (goodsInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("物品不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var MyGoods = await _goodsService.GetUserGoodsCount(userId, goodsId);
|
||||||
|
if (MyGoods < count)
|
||||||
|
{
|
||||||
|
return PoAction.Message("物品不足!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var myLev = await _attrService.GetUserLev(userId);
|
||||||
|
if (myLev < (int)goodsInfo.lev)
|
||||||
|
{
|
||||||
|
return PoAction.Message($"该物品{goodsInfo.lev}级才可使用!");
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 必要判定
|
||||||
|
|
||||||
|
if (goodsInfo.code == nameof(GoodsEnum.Code.Ship))
|
||||||
|
{
|
||||||
|
var myShip = await _weightService.GetUserShip(userId);
|
||||||
|
if (myShip.Count >= 5)
|
||||||
|
{
|
||||||
|
return PoAction.Message($"每人最多拥有5个船只,您已达到上限!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goodsInfo.code == nameof(GoodsEnum.Code.Drug))
|
||||||
|
{
|
||||||
|
var ck = await _goodsService.CheckUseDrug(userId, goodsId, goodsInfo.content);
|
||||||
|
if (!string.IsNullOrEmpty(ck))
|
||||||
|
{
|
||||||
|
return PoAction.Message(ck);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
if (await _goodsService.UpdateUserGoods(userId, 0, goodsId, count, "使用物品"))
|
||||||
|
{
|
||||||
|
string message = "";
|
||||||
|
if (goodsInfo.code == nameof(GoodsEnum.Code.Pack)) //使用礼包
|
||||||
|
{
|
||||||
|
var park = JsonConvert.DeserializeObject<RandomModel>(goodsInfo.content);
|
||||||
|
var award = GameBus.GetRandomGoods(park, count);
|
||||||
|
if (award.Count > 0)
|
||||||
|
{
|
||||||
|
message = $"打开[{goodsInfo.goodsName}]×{count},获得:";
|
||||||
|
foreach (var item in award)
|
||||||
|
{
|
||||||
|
message += $"{item.name}+{item.count},";
|
||||||
|
}
|
||||||
|
|
||||||
|
message = message.TrimEnd(',');
|
||||||
|
await GameBus.UpdateBag(userId, 1, award, $"打开礼包:{goodsInfo.goodsName}×{count}获得");
|
||||||
|
|
||||||
|
await _messageService.SendBroadcast(userId, nameof(MessageEnum.BroadcastCode.Award), message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message = "空空如也,什么也没有得到!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (goodsInfo.code == nameof(GoodsEnum.Code.Weight))
|
||||||
|
{
|
||||||
|
int unitWeight = Convert.ToInt32(goodsInfo.content);
|
||||||
|
await _weightService.UpdateUserMaxWeight(userId, 1, unitWeight, count, goodsInfo.goodsId,
|
||||||
|
goodsInfo.goodsName);
|
||||||
|
message = $"使用[{goodsInfo.goodsName}]×{count},负重+{unitWeight * count}";
|
||||||
|
}
|
||||||
|
else if (goodsInfo.code == nameof(GoodsEnum.Code.State))
|
||||||
|
{
|
||||||
|
UserStateModel stateConfig = JsonConvert.DeserializeObject<UserStateModel>(goodsInfo.content);
|
||||||
|
await _attrService.AddUserState(userId, goodsInfo.goodsId.ToString(), stateConfig.name,
|
||||||
|
stateConfig.scene, stateConfig.tips, stateConfig.attr, stateConfig.time, count);
|
||||||
|
message = $"使用[{goodsInfo.goodsName}]×{count},状态时间+{stateConfig.time * count}分钟";
|
||||||
|
}
|
||||||
|
else if (goodsInfo.code == nameof(GoodsEnum.Code.Ship))
|
||||||
|
{
|
||||||
|
dynamic shipInfo = JsonConvert.DeserializeObject<dynamic>(goodsInfo.content);
|
||||||
|
string name = shipInfo.name;
|
||||||
|
int speed = shipInfo.speed;
|
||||||
|
int weight = shipInfo.weight;
|
||||||
|
int copper = shipInfo.copper;
|
||||||
|
long sale = shipInfo.sale;
|
||||||
|
string remark = shipInfo.remark;
|
||||||
|
|
||||||
|
await _weightService.AddUserShip(userId, name, goodsId, speed, weight, copper, sale, remark);
|
||||||
|
message = $"使用[{goodsInfo.goodsName}],获得{name}+1";
|
||||||
|
}
|
||||||
|
if (goodsInfo.code == nameof(GoodsEnum.Code.Drug))
|
||||||
|
{
|
||||||
|
message = "使用成功!";
|
||||||
|
await _goodsService.UseDrug(userId, goodsId, goodsInfo.content);
|
||||||
|
}
|
||||||
|
return PoAction.Ok(true, message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("使用失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 使用选择物品礼包
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="goodsId"></param>
|
||||||
|
/// <param name="count"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> UseChoiceGoods(int goodsId, int num)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var goodsInfo = await _goodsService.GetGoodsInfo(goodsId);
|
||||||
|
if (goodsInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("物品不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var MyGoods = await _goodsService.GetUserGoodsCount(userId, goodsId);
|
||||||
|
if (MyGoods < 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("物品不足!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var myLev = await _attrService.GetUserLev(userId);
|
||||||
|
if (myLev < (int)goodsInfo.lev)
|
||||||
|
{
|
||||||
|
return PoAction.Message($"该物品{goodsInfo.lev}级才可使用!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goodsInfo.code != nameof(GoodsEnum.Code.ChoicePack))
|
||||||
|
{
|
||||||
|
return PoAction.Message("无法使用该物品!");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChoiceGoods> choiceGoods = JsonConvert.DeserializeObject<List<ChoiceGoods>>(goodsInfo.content);
|
||||||
|
var onAward = choiceGoods.Find(it => it.id == num);
|
||||||
|
if (onAward == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("物品中不包含该选择!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (await _goodsService.UpdateUserGoods(userId, 0, goodsId, 1, "使用物品"))
|
||||||
|
{
|
||||||
|
if (await GameBus.UpdateBag(userId, 1, onAward.award, "打开礼包获取"))
|
||||||
|
{
|
||||||
|
string message = $"打开[{goodsInfo.goodsName}],获得:";
|
||||||
|
foreach (var item in onAward.award)
|
||||||
|
{
|
||||||
|
message += $"{item.name}+{item.count},";
|
||||||
|
}
|
||||||
|
|
||||||
|
message = message.TrimEnd(',');
|
||||||
|
|
||||||
|
await _messageService.SendBroadcast(userId, nameof(MessageEnum.BroadcastCode.Award), message);
|
||||||
|
return PoAction.Ok(true, message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("使用失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("使用失败,请稍后尝试!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,11 @@ namespace Application.Web.Controllers.Pub
|
|||||||
account = await _accountService.GetAccInfoByToken(sid);
|
account = await _accountService.GetAccInfoByToken(sid);
|
||||||
if (account != null)
|
if (account != null)
|
||||||
{
|
{
|
||||||
|
account.pwd = "";
|
||||||
|
account.npwd = "";
|
||||||
|
account.token = "";
|
||||||
|
account.openId = "";
|
||||||
|
|
||||||
isOnline = true;
|
isOnline = true;
|
||||||
userData = await _userService.GetUserDataByAccId(account.accId);
|
userData = await _userService.GetUserDataByAccId(account.accId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,15 @@ public class RecoverController : ControllerBase
|
|||||||
{
|
{
|
||||||
private readonly IUnitUserAttrService _attrService;
|
private readonly IUnitUserAttrService _attrService;
|
||||||
private readonly IGameMapService _mapService;
|
private readonly IGameMapService _mapService;
|
||||||
|
private readonly IUnitUserAccService _accService;
|
||||||
|
private readonly IGameEquService _equService;
|
||||||
|
|
||||||
public RecoverController(IUnitUserAttrService attrService, IGameMapService mapService)
|
public RecoverController(IUnitUserAttrService attrService, IGameMapService mapService,IUnitUserAccService accService,IGameEquService equService)
|
||||||
{
|
{
|
||||||
_attrService = attrService;
|
_attrService = attrService;
|
||||||
_mapService = mapService;
|
_mapService = mapService;
|
||||||
|
_accService = accService;
|
||||||
|
_equService = equService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -179,6 +183,194 @@ public class RecoverController : ControllerBase
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var data = await _attrService.GetUserVigourInfo(userId);
|
||||||
|
string time = TimeAssist.GetDateTimeYMDString(0);
|
||||||
|
if (data.upTime == time)
|
||||||
|
{
|
||||||
|
return PoAction.Message("今天已恢复过活力啦!");
|
||||||
|
}
|
||||||
|
if (data.vitality >= data.upVitality)
|
||||||
|
{
|
||||||
|
return PoAction.Message("活力满满,无需恢复!");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool result = await _attrService.UpdateUserVigour(userId, 2, (long)data.upVitality,time);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
return PoAction.Ok(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取恢复耐久的装备
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="npcId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetUserRecoverEqu(int npcId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
|
||||||
|
#region NPC验证
|
||||||
|
|
||||||
|
var npcInfo = await _mapService.GetNpcInfo(npcId);
|
||||||
|
if (npcInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (npcInfo.status != 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.RetEqu)))
|
||||||
|
{
|
||||||
|
return PoAction.Message("业务不可用!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||||
|
if (npcInfo.mapId != onMap)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
int need = 0;
|
||||||
|
var data = await _equService.GetUserOnEqu(userId);
|
||||||
|
var needData = data.FindAll(it =>
|
||||||
|
it.isAppr == 1 && it.durability < it.maxdurability && it.useEndTime > TimeExtend.GetTimeStampSeconds);
|
||||||
|
need = needData.Sum(it => (int)it.maxdurability - (int)it.durability);
|
||||||
|
return PoAction.Ok(new { data, need });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 恢复装备耐久
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="npcId"></param>
|
||||||
|
/// <param name="ueId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> RecoverEqu(int npcId,string? ueId)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
|
||||||
|
#region NPC验证
|
||||||
|
|
||||||
|
var npcInfo = await _mapService.GetNpcInfo(npcId);
|
||||||
|
if (npcInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (npcInfo.status != 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.RetEqu)))
|
||||||
|
{
|
||||||
|
return PoAction.Message("业务不可用!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||||
|
if (npcInfo.mapId != onMap)
|
||||||
|
{
|
||||||
|
return PoAction.Message("Npc不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(ueId))
|
||||||
|
{
|
||||||
|
var myEqu = await _equService.GetUserOnEqu(userId);
|
||||||
|
myEqu = myEqu.FindAll(it =>
|
||||||
|
it.isAppr == 1 && it.durability < it.maxdurability && it.useEndTime > TimeExtend.GetTimeStampSeconds);
|
||||||
|
int need = myEqu.Sum(it => (int)it.maxdurability - (int)it.durability);
|
||||||
|
if (need < 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("耐久已满,无需恢复!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var myAcc = await _accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
|
||||||
|
if (need > myAcc)
|
||||||
|
{
|
||||||
|
return PoAction.Message("铜贝不足!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await _accService.UpdateUserCopper(userId, 0, need, "修复装备"))
|
||||||
|
{
|
||||||
|
foreach (var item in myEqu)
|
||||||
|
{
|
||||||
|
item.durability = item.maxdurability;
|
||||||
|
await _equService.UpdateUserEquInfo(item);
|
||||||
|
}
|
||||||
|
return PoAction.Ok(true, $"恢复成功,花费{need}铜贝!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||||
|
if (equInfo == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.userId != userId)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.isAppr != 1)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备未鉴定!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.useEndTime < TimeExtend.GetTimeStampSeconds)
|
||||||
|
{
|
||||||
|
return PoAction.Message("装备已过期!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equInfo.durability >= equInfo.maxdurability)
|
||||||
|
{
|
||||||
|
return PoAction.Message("耐久已满,无需恢复!");
|
||||||
|
}
|
||||||
|
|
||||||
|
int need = (int)equInfo.maxdurability - (int)equInfo.durability;
|
||||||
|
var myAcc = await _accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
|
||||||
|
if (need > myAcc)
|
||||||
|
{
|
||||||
|
return PoAction.Message("铜贝不足!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await _accService.UpdateUserCopper(userId, 0, need, "修复装备"))
|
||||||
|
{
|
||||||
|
equInfo.durability = equInfo.maxdurability;
|
||||||
|
if (await _equService.UpdateUserEquInfo(equInfo))
|
||||||
|
{
|
||||||
|
return PoAction.Ok(true, $"恢复成功,花费{need}铜贝!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var data = await _attrService.GetUserVigourInfo(userId);
|
var data = await _attrService.GetUserVigourInfo(userId);
|
||||||
string time = TimeAssist.GetDateTimeYMDString(0);
|
string time = TimeAssist.GetDateTimeYMDString(0);
|
||||||
if (data.upTime == time)
|
if (data.upTime == time)
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ namespace Application.Web.Controllers.Pub
|
|||||||
[Authorize]
|
[Authorize]
|
||||||
public class ShipController : ControllerBase
|
public class ShipController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IUnitUserWeight weightService;
|
private readonly IUnitUserWeight _weightService;
|
||||||
private readonly IGameGoodsService goodsService;
|
private readonly IUnitUserAccService _accService;
|
||||||
private readonly IUnitUserAccService accService;
|
|
||||||
public ShipController(IUnitUserWeight _weightService, IGameGoodsService _goodsService, IUnitUserAccService _accService)
|
public ShipController(IUnitUserWeight weightService,
|
||||||
|
IUnitUserAccService accService)
|
||||||
{
|
{
|
||||||
accService = _accService;
|
_accService = accService;
|
||||||
goodsService = _goodsService;
|
_weightService = weightService;
|
||||||
weightService = _weightService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -28,27 +28,11 @@ namespace Application.Web.Controllers.Pub
|
|||||||
public async Task<IPoAction> GetUserShip()
|
public async Task<IPoAction> GetUserShip()
|
||||||
{
|
{
|
||||||
string userId = StateHelper.userId;
|
string userId = StateHelper.userId;
|
||||||
var data = await weightService.GetUserShip(userId);
|
var data = await _weightService.GetUserShip(userId);
|
||||||
//个人负重
|
//个人负重
|
||||||
var weightInfo = await weightService.GetUserWeightInfo(userId);
|
var weightInfo = await _weightService.GetUserWeightInfo(userId);
|
||||||
return PoAction.Ok(new { data, weightInfo });
|
var maxShipWeight = await _weightService.GetUserShipMaxWeight(userId);
|
||||||
}
|
return PoAction.Ok(new { data, onShip = weightInfo.shipOnWeight, maxShip = maxShipWeight });
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取船只详情
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="shipId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<IPoAction> GetShipInfo(int shipId)
|
|
||||||
{
|
|
||||||
var data = await goodsService.GetShipInfo(shipId);
|
|
||||||
if (data == null)
|
|
||||||
{
|
|
||||||
return PoAction.Message("船只详情不存在!");
|
|
||||||
}
|
|
||||||
|
|
||||||
return PoAction.Ok(new { data });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -57,46 +41,25 @@ namespace Application.Web.Controllers.Pub
|
|||||||
/// <param name="usId"></param>
|
/// <param name="usId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IPoAction> BuyShip([FromBody] BuyShipParms parms)
|
public async Task<IPoAction> SaleShip([FromBody] BuyShipParms parms)
|
||||||
{
|
{
|
||||||
var userShip = await weightService.GetUserShipInfo(parms.usId);
|
var userShip = await _weightService.GetUserShipInfo(parms.usId);
|
||||||
if (userShip == null)
|
if (userShip == null)
|
||||||
{
|
{
|
||||||
return PoAction.Message("船只不存在!");
|
return PoAction.Message("船只不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
string userId = StateHelper.userId;
|
string userId = StateHelper.userId;
|
||||||
if (userShip.userId != userId)
|
if (userShip.userId != userId)
|
||||||
{
|
{
|
||||||
return PoAction.Message("船只不存在!");
|
return PoAction.Message("船只不存在!");
|
||||||
}
|
}
|
||||||
var shipInfo = await goodsService.GetShipInfo((int)userShip.goodsId);
|
|
||||||
if (shipInfo == null)
|
if (await _weightService.DeleteUserShip(userShip.usId, userId))
|
||||||
{
|
{
|
||||||
return PoAction.Message("船只信息不存在!");
|
if (await _accService.UpdateUserCopper(userId, 1, Convert.ToInt64(userShip.sale), "出售船只获得!"))
|
||||||
}
|
|
||||||
if (await weightService.DeleteUserShip(userShip.usId, userId))
|
|
||||||
{
|
{
|
||||||
if (shipInfo.payType == AccEnum.AccType.copper.ToString())
|
return PoAction.Ok(new { price = userShip.sale });
|
||||||
{
|
|
||||||
if (await accService.UpdateUserCopper(userId, 1, Convert.ToInt64(shipInfo.salePrice), "出售船只获得!"))
|
|
||||||
{
|
|
||||||
return PoAction.Ok(new { price = shipInfo.salePrice });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return PoAction.Message("出售失败!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (shipInfo.payType == AccEnum.AccType.gold.ToString())
|
|
||||||
{
|
|
||||||
if (await accService.UpdateUserAcc(userId, 1, AccEnum.AccType.gold.ToString(), Convert.ToInt64(shipInfo.salePrice)))
|
|
||||||
{
|
|
||||||
return PoAction.Ok(new { price = shipInfo.salePrice });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return PoAction.Message("出售失败!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public class BagController : ControllerBase
|
|||||||
public async Task<IPoAction> GetUserBagData()
|
public async Task<IPoAction> GetUserBagData()
|
||||||
{
|
{
|
||||||
string userId = StateHelper.userId;
|
string userId = StateHelper.userId;
|
||||||
|
|
||||||
var accInfo = await _accService.GetUserAccInfo(userId);
|
var accInfo = await _accService.GetUserAccInfo(userId);
|
||||||
long gold = (long)accInfo.gold;
|
long gold = (long)accInfo.gold;
|
||||||
long cowry = (long)accInfo.cowry;
|
long cowry = (long)accInfo.cowry;
|
||||||
@@ -76,13 +75,13 @@ public class BagController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
var data = await _equService.GetUserEquData(userId, _t, query, page, 10, total);
|
var data = await _equService.GetUserEquData(userId, _t, query, page, 10, total);
|
||||||
return PoAction.Ok(new { data, total.Value });
|
return PoAction.Ok(new { data, total = total.Value});
|
||||||
}
|
}
|
||||||
else if (type == 1)
|
else if (type == 1)
|
||||||
{
|
{
|
||||||
List<string> code = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
List<string> code = new List<string>() { nameof(GoodsEnum.Code.Drug) };
|
||||||
var data = await _goodsService.GetUserGoodsData(userId, code, new List<string>(), query, page, 10, total);
|
var data = await _goodsService.GetUserGoodsData(userId, code, new List<string>(), query, page, 10, total);
|
||||||
return PoAction.Ok(new { data, total.Value });
|
return PoAction.Ok(new { data, total = total.Value });
|
||||||
}
|
}
|
||||||
else if (type == 2)
|
else if (type == 2)
|
||||||
{
|
{
|
||||||
@@ -101,6 +100,7 @@ public class BagController : ControllerBase
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
code.Add(nameof(GoodsEnum.Code.Pack));
|
code.Add(nameof(GoodsEnum.Code.Pack));
|
||||||
|
code.Add(nameof(GoodsEnum.Code.ChoicePack));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
code.Add(nameof(GoodsEnum.Code.Mak));
|
code.Add(nameof(GoodsEnum.Code.Mak));
|
||||||
@@ -120,11 +120,35 @@ public class BagController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
var data = await _goodsService.GetUserGoodsData(userId, code, noCode, query, page, 10, total);
|
var data = await _goodsService.GetUserGoodsData(userId, code, noCode, query, page, 10, total);
|
||||||
return PoAction.Ok(new { data, total.Value });
|
return PoAction.Ok(new { data, total = total.Value });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return PoAction.Ok(new { data = new List<string>(), total.Value });
|
return PoAction.Ok(new { data = new List<string>(), total = total.Value });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 验证用户道具
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parms"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IPoAction> CheckUserProp([FromBody] CheckUserPropParms parms)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
parms.count = parms.count < 1 ? 1 : parms.count;
|
||||||
|
if (parms.type == 0)
|
||||||
|
{
|
||||||
|
List<TowerNeed> needs = JsonConvert.DeserializeObject<List<TowerNeed>>(parms.needs);
|
||||||
|
var result = await GameBus.CheckNeed(userId, needs, parms.count);
|
||||||
|
return PoAction.Ok(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<TowerNeeds> needs = JsonConvert.DeserializeObject<List<TowerNeeds>>(parms.needs);
|
||||||
|
var result = await GameBus.CheckNeeds(userId, needs, parms.count);
|
||||||
|
return PoAction.Ok(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,9 +17,12 @@ public class UserController : ControllerBase
|
|||||||
private readonly IGameChatService _chatService;
|
private readonly IGameChatService _chatService;
|
||||||
private readonly IGameSkillService _skillService;
|
private readonly IGameSkillService _skillService;
|
||||||
private readonly IGameTeamService _teamService;
|
private readonly IGameTeamService _teamService;
|
||||||
|
private readonly IGameEquService _equService;
|
||||||
|
|
||||||
public UserController(IUnitUserService userService, IUnitUserAttrService attrService,
|
public UserController(IUnitUserService userService, IUnitUserAttrService attrService,
|
||||||
IUnitUserAccService accService, IGameMapService mapService, IUnitUserRelationService relationService,
|
IUnitUserAccService accService, IGameMapService mapService, IUnitUserRelationService relationService,
|
||||||
IGameGoodsService goodsService, IGameChatService chatService,IGameSkillService skillService,IGameTeamService teamService)
|
IGameGoodsService goodsService, IGameChatService chatService, IGameSkillService skillService,
|
||||||
|
IGameTeamService teamService, IGameEquService equService)
|
||||||
{
|
{
|
||||||
_userService = userService;
|
_userService = userService;
|
||||||
_attrService = attrService;
|
_attrService = attrService;
|
||||||
@@ -30,6 +33,7 @@ public class UserController : ControllerBase
|
|||||||
_chatService = chatService;
|
_chatService = chatService;
|
||||||
_skillService = skillService;
|
_skillService = skillService;
|
||||||
_teamService = teamService;
|
_teamService = teamService;
|
||||||
|
_equService = equService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -50,7 +54,10 @@ public class UserController : ControllerBase
|
|||||||
var vigourInfo = await _attrService.GetUserVigourInfo(userId);
|
var vigourInfo = await _attrService.GetUserVigourInfo(userId);
|
||||||
var accInfo = await _accService.GetUserAccInfo(userId);
|
var accInfo = await _accService.GetUserAccInfo(userId);
|
||||||
object acc = new { accInfo.gold, accInfo.cowry, accInfo.teach, accInfo.renown };
|
object acc = new { accInfo.gold, accInfo.cowry, accInfo.teach, accInfo.renown };
|
||||||
object result = new { user, attr = attrInfo, exp, vigourInfo.vitality, acc };
|
|
||||||
|
var buff = await _attrService.GetUserStateData(userId, "ALL");
|
||||||
|
var stock = await _attrService.GetUserStock(userId);
|
||||||
|
object result = new { user, attr = attrInfo, exp, vigourInfo.vitality, acc, buff, stock };
|
||||||
return PoAction.Ok(result);
|
return PoAction.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +170,13 @@ public class UserController : ControllerBase
|
|||||||
bool isFriend = await _relationService.CheckIsFriend(userId, userInfo.userId);
|
bool isFriend = await _relationService.CheckIsFriend(userId, userInfo.userId);
|
||||||
bool isEnemy = await _relationService.CheckUserEnemy(userId, userInfo.userId);
|
bool isEnemy = await _relationService.CheckUserEnemy(userId, userInfo.userId);
|
||||||
var team = await _teamService.GetUserTeamInfo(userInfo.userId);
|
var team = await _teamService.GetUserTeamInfo(userInfo.userId);
|
||||||
object result = new { user, attr = new { attrInfo.lev }, acc, isOnline, onMapName, isFriend, isEnemy ,team};
|
|
||||||
|
var equ = await _equService.GetUserOnEqu(userInfo.userId);
|
||||||
|
var suit = await _equService.GetUserEquSuit(userInfo.userId);
|
||||||
|
object result = new
|
||||||
|
{
|
||||||
|
user, attr = new { attrInfo.lev }, acc, isOnline, onMapName, isFriend, isEnemy, team, equ, suit
|
||||||
|
};
|
||||||
return PoAction.Ok(result);
|
return PoAction.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,10 +303,128 @@ public class UserController : ControllerBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IPoAction>GetUserSkill()
|
public async Task<IPoAction> GetUserSkill()
|
||||||
{
|
{
|
||||||
var userId = StateHelper.userId;
|
var userId = StateHelper.userId;
|
||||||
var data = await _skillService.GetUserSkill(userId);
|
var data = await _skillService.GetUserSkill(userId);
|
||||||
return PoAction.Ok(data);
|
return PoAction.Ok(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取个人药品栏
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> GetUserDrugColumn()
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var data = await _attrService.GetUserDrug(userId);
|
||||||
|
return PoAction.Ok(data.drug);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 移除药品栏药品
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> RemoverUserDrug(string id)
|
||||||
|
{
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var data = await _attrService.GetUserDrug(userId);
|
||||||
|
var onDrug = data.drug.Find(it => it.id == id);
|
||||||
|
if (onDrug == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("药品栏无此药品!");
|
||||||
|
}
|
||||||
|
|
||||||
|
data.drug.Remove(onDrug);
|
||||||
|
if (await _attrService.UpdateUserDrug(data))
|
||||||
|
{
|
||||||
|
if (onDrug.count > 0)
|
||||||
|
{
|
||||||
|
await _goodsService.UpdateUserGoods(userId, 1, onDrug.goodsId, onDrug.count, "药品栏移除,退回背包");
|
||||||
|
}
|
||||||
|
|
||||||
|
return PoAction.Ok(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("移除失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加到药品栏
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="goodsId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IPoAction> AddUserDrug(int goodsId, int count)
|
||||||
|
{
|
||||||
|
count = count < 1 ? 1 : count;
|
||||||
|
count = count > 999 ? 999 : count;
|
||||||
|
string userId = StateHelper.userId;
|
||||||
|
var myGoods = await _goodsService.GetUserGoodsInfo(userId, goodsId);
|
||||||
|
if (myGoods == null)
|
||||||
|
{
|
||||||
|
return PoAction.Message("暂无该物品!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myGoods.count < count)
|
||||||
|
{
|
||||||
|
return PoAction.Message("物品数量不足!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myGoods.code != nameof(GoodsEnum.Code.Drug))
|
||||||
|
{
|
||||||
|
return PoAction.Message("该物品无法置放到药品栏!");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isAdd = false;
|
||||||
|
var myDrug = await _attrService.GetUserDrug(userId);
|
||||||
|
var onDrug = myDrug.drug.Find(it => it.goodsId == goodsId);
|
||||||
|
if (onDrug == null)
|
||||||
|
{
|
||||||
|
if (myDrug.drug.Count >= 5)
|
||||||
|
{
|
||||||
|
return PoAction.Message("药品栏最多添加5个药品!");
|
||||||
|
}
|
||||||
|
|
||||||
|
isAdd = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await _goodsService.UpdateUserGoods(userId, 0, goodsId, count, "放置到药品栏"))
|
||||||
|
{
|
||||||
|
if (isAdd)
|
||||||
|
{
|
||||||
|
UserDrugModel temp = new UserDrugModel();
|
||||||
|
temp.id = StringAssist.NewGuid;
|
||||||
|
temp.goodsId = goodsId;
|
||||||
|
temp.name = myGoods.goodsName;
|
||||||
|
temp.code = "Blood";
|
||||||
|
temp.count = count;
|
||||||
|
myDrug.drug.Add(temp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myDrug.drug.Remove(onDrug);
|
||||||
|
onDrug.count += count;
|
||||||
|
myDrug.drug.Add(onDrug);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await _attrService.UpdateUserDrug(myDrug))
|
||||||
|
{
|
||||||
|
return PoAction.Ok(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("添加失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PoAction.Message("添加失败,请稍后尝试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -14,4 +14,3 @@ global using Microsoft.AspNetCore.Mvc;
|
|||||||
global using Application.Web;
|
global using Application.Web;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Application.Web;
|
||||||
|
|
||||||
|
public class EquUpParms
|
||||||
|
{
|
||||||
|
public string ueId { get; set; }
|
||||||
|
public string needs { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Application.Web;
|
||||||
|
|
||||||
|
public class FightMonsterParms
|
||||||
|
{
|
||||||
|
public int type { get; set; }
|
||||||
|
public string monsterId { get; set; }
|
||||||
|
public string sign { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Application.Web;
|
||||||
|
|
||||||
|
public class FightParms
|
||||||
|
{
|
||||||
|
public string fightId { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Application.Web;
|
||||||
|
|
||||||
|
public class CheckUserPropParms
|
||||||
|
{
|
||||||
|
public int type { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public string needs { get; set; }
|
||||||
|
}
|
||||||
129
Web/package-lock.json
generated
@@ -1856,9 +1856,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1876,9 +1873,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1896,9 +1890,6 @@
|
|||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1916,9 +1907,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1936,9 +1924,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1956,9 +1941,6 @@
|
|||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1976,9 +1958,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -1996,9 +1975,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2220,9 +2196,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2240,9 +2213,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2260,9 +2230,6 @@
|
|||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2280,9 +2247,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2300,9 +2264,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2320,9 +2281,6 @@
|
|||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2340,9 +2298,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2360,9 +2315,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2594,9 +2546,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2614,9 +2563,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2634,9 +2580,6 @@
|
|||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2654,9 +2597,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2674,9 +2614,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2694,9 +2631,6 @@
|
|||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2714,9 +2648,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2734,9 +2665,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2959,9 +2887,6 @@
|
|||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -2983,9 +2908,6 @@
|
|||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3007,9 +2929,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3031,9 +2950,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3055,9 +2971,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3079,9 +2992,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3572,9 +3482,6 @@
|
|||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3589,9 +3496,6 @@
|
|||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3606,9 +3510,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3623,9 +3524,6 @@
|
|||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3640,9 +3538,6 @@
|
|||||||
"loong64"
|
"loong64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3657,9 +3552,6 @@
|
|||||||
"loong64"
|
"loong64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3674,9 +3566,6 @@
|
|||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3691,9 +3580,6 @@
|
|||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3708,9 +3594,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3725,9 +3608,6 @@
|
|||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3742,9 +3622,6 @@
|
|||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3759,9 +3636,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3776,9 +3650,6 @@
|
|||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|||||||
BIN
Web/public/images/broad/award.gif
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
Web/public/images/broad/gift.gif
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
Web/public/images/broad/hot1.gif
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Web/public/images/broad/promote.gif
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
Web/public/images/broad/remind.gif
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Web/public/images/broad/system.gif
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Web/public/images/equ/gw.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Web/public/images/equ/hm.gif
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Web/public/images/equ/l.gif
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
Web/public/images/equ/ly.gif
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
Web/public/images/equ/ms.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Web/public/images/equ/r.gif
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
Web/public/images/equ/sy.png
Normal file
|
After Width: | Height: | Size: 770 B |
BIN
Web/public/images/equ/tq.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Web/public/images/equ/ty.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Web/public/images/equ/zx.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |