Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit 5de1b4c

Browse files
committed
暂存
1 parent 1cfcfc0 commit 5de1b4c

25 files changed

+1146
-119
lines changed

src/DofGMTool/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private async void App_UnhandledException(object sender, Microsoft.UI.Xaml.Unhan
127127
Title = "错误!",
128128
Content = $" {e.Exception.Message}",
129129
CloseButtonText = "我知道了",
130-
XamlRoot = App.CurrentWindow.Content.XamlRoot//MainWindow.Content.XamlRoot
130+
XamlRoot = /*App.CurrentWindow.Content.XamlRoot//*/MainWindow.Content.XamlRoot
131131
};
132132

133133
await dialog.ShowAsync();

src/DofGMTool/Contracts/Services/ICharacterManagerService.cs

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace DofGMTool.Contracts.Services;
66
public interface ICharacterManagerService
77
{
88
/// <summary>
9-
/// 变更当前装备
9+
/// 更改当前装备
1010
/// </summary>
1111
/// <param name="newEquipId"></param>
1212
/// <param name="slotIndex"></param>
@@ -47,4 +47,96 @@ public interface ICharacterManagerService
4747
/// <param name="characNo"></param>
4848
/// <returns></returns>
4949
ObservableCollection<Equipments> GetCreature(int characNo);
50+
51+
/// <summary>
52+
/// 完成角色任务
53+
/// </summary>
54+
/// <param name="characNos"></param>
55+
/// <returns></returns>
56+
Task<int> ClearMission(List<int> characNos);
57+
58+
/// <summary>
59+
/// 完成角色任务
60+
/// </summary>
61+
/// <param name="characNo"></param>
62+
/// <returns></returns>
63+
Task<int> ClearMission(int characNo);
64+
65+
/// <summary>
66+
/// 开启辅助装备、魔法石装备槽位
67+
/// </summary>
68+
/// <param name="characNo"></param>
69+
/// <returns></returns>
70+
Task<int> ReleaseExtendsSlods(int characNo);
71+
72+
/// <summary>
73+
/// 开启辅助装备、魔法石装备槽位
74+
/// </summary>
75+
/// <param name="characNo"></param>
76+
/// <returns></returns>
77+
Task<int> ReleaseExtendsSlods(List<int> characNos);
78+
79+
/// <summary>
80+
/// 解除最大角色数限制
81+
/// </summary>
82+
/// <param name="accountId"></param>
83+
/// <returns></returns>
84+
Task<int> UnlimitedCharacSlods(int accountId);
85+
86+
/// <summary>
87+
/// 设置仓库容量Max
88+
/// </summary>
89+
/// <param name="characNo"></param>
90+
/// <returns></returns>
91+
Task<int> SetWarehouseMax(int characNo);
92+
93+
/// <summary>
94+
/// 设置账号金库Max
95+
/// </summary>
96+
/// <param name="accountId"></param>
97+
/// <returns></returns>
98+
Task<int> SetAccountWarehouseMax(int accountId);
99+
100+
/// <summary>
101+
/// 封禁账号
102+
/// </summary>
103+
/// <param name="accountId"></param>
104+
/// <returns></returns>
105+
Task<int> AccountBan(int accountId);
106+
107+
/// <summary>
108+
/// 账号解封
109+
/// </summary>
110+
/// <param name="accountId"></param>
111+
/// <returns></returns>
112+
Task<int> LiftAccountBan(int accountId);
113+
114+
/// <summary>
115+
/// 清空角色仓库
116+
/// </summary>
117+
/// <param name="characNo"></param>
118+
/// <returns></returns>
119+
Task<int> ClearRoleWarehouse(int characNo);
120+
121+
/// <summary>
122+
/// 背包满级
123+
/// </summary>
124+
/// <param name="characNo"></param>
125+
/// <returns></returns>
126+
Task<int> MaxInven(int characNo);
127+
128+
/// <summary>
129+
/// 清空背包
130+
/// </summary>
131+
/// <param name="characNo"></param>
132+
/// <returns></returns>
133+
Task<int> ClearInven(int characNo);
134+
135+
/// <summary>
136+
/// 角色背包无限负重
137+
/// </summary>
138+
/// <param name="characNo"></param>
139+
/// <returns></returns>
140+
Task<int> SetInvenWeightMax(int characNo);
141+
Task<int> ClearEquipSlots(int characNo);
50142
}

src/DofGMTool/Contracts/Services/IEquipSlotProcessor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using DofGMTool.Models;
2+
using System.Collections.ObjectModel;
23

34
namespace DofGMTool.Contracts.Services;
45
public interface IEquipSlotProcessor
@@ -10,4 +11,6 @@ public interface IEquipSlotProcessor
1011
List<byte[]> UpdateEquipSlotData(List<byte[]> equipSlots, int slotIndex, ulong newValue, int bitStartIndex, int bitLength);
1112
byte[] CompressBytes(byte[] sourceByte);
1213
byte[] CompressEquipSlots(List<byte[]> equipSlots);
14+
Task<List<EquipSlotModel>> GetEquipSlots(int characno);
15+
Task<bool> SetEquipSlots(int characno, ObservableCollection<EquipSlotModel> eData, bool isCover = true);
1316
}

src/DofGMTool/Contracts/Services/INavigationService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ bool CanGoBack
2020
bool NavigateTo(string pageKey, object? parameter = null, bool clearNavigation = false);
2121

2222
bool GoBack();
23+
Task<bool> NavigateToAsync(string pageKey, object? parameter = null, bool clearNavigation = false);
2324
}

src/DofGMTool/Contracts/Services/ISendMailService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public interface ISendMailService
1010
Task<ObservableCollection<EquipmentPartset>> GetEquipmentPartsetAsync(string query);
1111
Task<ObservableCollection<Equipments>> GetItemsList(MailType type, string? query = null);
1212
ObservableCollection<_Postal> GetPostals();
13-
string? GetRoleNameById(int characNo);
13+
Task<string> GetRoleNameById(int characNo);
1414
int SendMail(MailType type, MailModel mailModel, ObservableCollection<Equipments>? equipments = null);
1515
}

src/DofGMTool/DofGMTool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
2626
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
2727
<GenerateTestArtifacts>True</GenerateTestArtifacts>
28-
<AppxBundle>Auto</AppxBundle>
28+
<AppxBundle>Always</AppxBundle>
2929
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
3030
<AppInstallerUri>C:\Users\11156\source\repos\AppsPack</AppInstallerUri>
3131
<!--<RuntimeIdentifier>win-x64</RuntimeIdentifier>-->

src/DofGMTool/Helpers/NPKHelper.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,34 @@ public static void GetBitMaps(ObservableCollection<Equipments> equipments)
114114
}
115115
}
116116
}
117+
public static async Task GetBitMapsAsync(ObservableCollection<Equipments> equipments)
118+
{
119+
// 获取或创建存放图片的文件夹
120+
var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
121+
var imageFolder = await localFolder.CreateFolderAsync("ImagePacks", Windows.Storage.CreationCollisionOption.OpenIfExists);
122+
123+
foreach (var item in equipments)
124+
{
125+
try
126+
{
127+
// 异步获取图片文件而无需使用同步的 File.Exists
128+
var fileOrNull = await imageFolder.TryGetItemAsync($"{item.ItemId}.png") as Windows.Storage.StorageFile;
129+
if (fileOrNull != null)
130+
{
131+
var bitmap = new BitmapImage();
132+
using (var stream = await fileOrNull.OpenAsync(Windows.Storage.FileAccessMode.Read))
133+
{
134+
await bitmap.SetSourceAsync(stream);
135+
}
136+
item.BitMap = bitmap;
137+
}
138+
}
139+
catch (Exception ex)
140+
{
141+
// 可记录异常,或根据需要忽略错误
142+
}
143+
}
144+
}
117145
public static void SaveImagePacks2Path(string path)
118146
{
119147
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;

src/DofGMTool/Models/Entity/AccountCargo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace DofGMTool.Models;
55

6-
[JsonObject(MemberSerialization.OptIn), Table(Name = "account_cargo", DisableSyncStructure = true)]
6+
[JsonObject(MemberSerialization.OptIn), Table(Name = "account_cargo", DisableSyncStructure = false)]
77
public partial class AccountCargo
88
{
99

@@ -13,13 +13,13 @@ public partial class AccountCargo
1313
[JsonProperty, Column(Name = "capacity")]
1414
public byte Capacity { get; set; } = 0;
1515

16-
[JsonProperty, Column(Name = "cargo", DbType = "blob")]
17-
public byte[] Cargo { get; set; }
16+
[JsonProperty, Column(Name = "cargo", DbType = "blob",IsNullable =true)]
17+
public byte[]? Cargo { get; set; }
1818

1919
[JsonProperty, Column(Name = "money", DbType = "int(11) unsigned")]
2020
public uint Money { get; set; } = 0;
2121

22-
[JsonProperty, Column(Name = "occ_time", DbType = "datetime", InsertValueSql = "0000-00-00 00:00:00")]
22+
[JsonProperty, Column(Name = "occ_time", DbType = "datetime")]
2323
public DateTime OccTime { get; set; }
2424

2525
}

src/DofGMTool/Models/Entity/d_taiwan/MemberPunishInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public partial class MemberPunishInfo
1919
[JsonProperty, Column(Name = "apply_flag", DbType = "tinyint(4)")]
2020
public sbyte ApplyFlag { get; set; } = 0;
2121

22-
[JsonProperty, Column(Name = "end_time", DbType = "datetime", InsertValueSql = "0000-00-00 00:00:00")]
22+
[JsonProperty, Column(Name = "end_time", DbType = "datetime")]
2323
public DateTime EndTime { get; set; }
2424

25-
[JsonProperty, Column(Name = "occ_time", DbType = "datetime", InsertValueSql = "0000-00-00 00:00:00")]
25+
[JsonProperty, Column(Name = "occ_time", DbType = "datetime")]
2626
public DateTime OccTime { get; set; }
2727

2828
[JsonProperty, Column(Name = "punish_value")]
@@ -31,7 +31,7 @@ public partial class MemberPunishInfo
3131
[JsonProperty, Column(Name = "reason", StringLength = 100, IsNullable = false)]
3232
public string Reason { get; set; }
3333

34-
[JsonProperty, Column(Name = "start_time", DbType = "datetime", InsertValueSql = "0000-00-00 00:00:00")]
34+
[JsonProperty, Column(Name = "start_time", DbType = "datetime")]
3535
public DateTime StartTime { get; set; }
3636

3737
}

src/DofGMTool/Models/GlobalVariables.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ public static GlobalVariables Instance
2323
}
2424

2525
public CharacInfo? GlobalCurrentCharacInfo { get; set; }
26+
27+
public Accounts? Accounts { get; set; }
2628
}

0 commit comments

Comments
 (0)