diff --git a/Api/Utility/General.cs b/Api/Utility/General.cs
index bfe00fa..acca331 100644
--- a/Api/Utility/General.cs
+++ b/Api/Utility/General.cs
@@ -537,7 +537,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
///
///
///
- public static string GenerateRandomString(int length = 18)
+ public static string GenerateRandomString(int length = 32)
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+=-`~[]\\{}|;':\",./<>?";
byte[] data = RandomNumberGenerator.GetBytes(length);
diff --git a/Api/Utility/PluginConfig.cs b/Api/Utility/PluginConfig.cs
index c21bd3c..ff396e7 100644
--- a/Api/Utility/PluginConfig.cs
+++ b/Api/Utility/PluginConfig.cs
@@ -6,15 +6,20 @@ namespace Milimoe.FunGame.Core.Api.Utility
///
/// 简易的插件配置文件生成器
/// 仅支持部分基本类型(, , , , )及其数组(List<long>, List<double>, List<decimal>, List<string>, List<bool>和long[], double[], decimal[], string[], bool[])
- /// 文件会保存为:程序目录/configs//.json
+ /// 文件会保存为:程序目录/(通常是 configs)//.json
///
///
- /// 新建一个配置文件,文件会保存为:程序目录/configs//.json
+ /// 新建一个配置文件,文件会保存为:程序目录/(通常是 configs)//.json
///
///
///
public class PluginConfig(string plugin_name, string file_name) : Dictionary
{
+ ///
+ /// 配置文件存放的根目录
+ ///
+ public static string RootPath { get; set; } = "configs";
+
///
/// 插件的名称
///
@@ -105,7 +110,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
///
public void LoadConfig()
{
- string dpath = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/{PluginName}";
+ string dpath = $@"{Path.Combine(AppDomain.CurrentDomain.BaseDirectory, RootPath)}/{PluginName}";
string fpath = $@"{dpath}/{FileName}.json";
if (!Directory.Exists(dpath))
{
@@ -130,7 +135,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
public void SaveConfig()
{
string json = NetworkUtility.JsonSerialize((Dictionary)this);
- string dpath = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/{PluginName}";
+ string dpath = $@"{Path.Combine(AppDomain.CurrentDomain.BaseDirectory, RootPath)}/{PluginName}";
string fpath = $@"{dpath}/{FileName}.json";
if (!Directory.Exists(dpath))
{
diff --git a/Controller/ServerAddonController.cs b/Controller/ServerAddonController.cs
index 0cb3cb4..cadb1fa 100644
--- a/Controller/ServerAddonController.cs
+++ b/Controller/ServerAddonController.cs
@@ -115,6 +115,7 @@ namespace Milimoe.FunGame.Core.Controller
_sqlPolling = null;
}
_cts?.Dispose();
+ _cts = null;
}
}
}
diff --git a/Entity/Item/Item.cs b/Entity/Item/Item.cs
index d20aecb..20d1e47 100644
--- a/Entity/Item/Item.cs
+++ b/Entity/Item/Item.cs
@@ -322,6 +322,7 @@ namespace Milimoe.FunGame.Core.Entity
}
if (used)
{
+ EntityState = EntityState.Modified;
ReduceTimesAndRemove();
}
return result && used;
@@ -338,6 +339,7 @@ namespace Milimoe.FunGame.Core.Entity
bool result = OnItemUsed(args);
if (result)
{
+ EntityState = EntityState.Modified;
ReduceTimesAndRemove();
}
return result;
@@ -356,7 +358,7 @@ namespace Milimoe.FunGame.Core.Entity
if (RemainUseTimes < 0) RemainUseTimes = 0;
if (IsRemoveAfterUse && RemainUseTimes == 0)
{
- User.Inventory.Items.Remove(this);
+ EntityState = EntityState.Deleted;
}
}
}
diff --git a/Library/Constant/ConstantSet.cs b/Library/Constant/ConstantSet.cs
index 3807ff1..bb97b20 100644
--- a/Library/Constant/ConstantSet.cs
+++ b/Library/Constant/ConstantSet.cs
@@ -165,6 +165,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
public const string Inventory_Use = "Inventory::Use";
public const string Inventory_StoreSell = "Inventory::StoreSell";
public const string Inventory_MarketSell = "Inventory::MarketSell";
+ public const string Inventory_MarketDelist = "Inventory::MarketDelist";
public const string Inventory_UpdateMarketPrice = "Inventory::UpdateMarketPrice";
public const string Inventory_GetOffer = "Inventory::GetOffer";
public const string Inventory_MakeOffer = "Inventory::MakeOffer";
@@ -209,6 +210,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
DataRequestType.Inventory_Use => Inventory_Use,
DataRequestType.Inventory_StoreSell => Inventory_StoreSell,
DataRequestType.Inventory_MarketSell => Inventory_MarketSell,
+ DataRequestType.Inventory_MarketDelist => Inventory_MarketDelist,
DataRequestType.Inventory_UpdateMarketPrice => Inventory_UpdateMarketPrice,
DataRequestType.Inventory_GetOffer => Inventory_GetOffer,
DataRequestType.Inventory_MakeOffer => Inventory_MakeOffer,
diff --git a/Library/Constant/TypeEnum.cs b/Library/Constant/TypeEnum.cs
index 875a570..a76f67f 100644
--- a/Library/Constant/TypeEnum.cs
+++ b/Library/Constant/TypeEnum.cs
@@ -116,6 +116,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
Inventory_Use,
Inventory_StoreSell,
Inventory_MarketSell,
+ Inventory_MarketDelist,
Inventory_UpdateMarketPrice,
Inventory_GetOffer,
Inventory_MakeOffer,
diff --git a/Library/SQLScript/Entity/UserQuery.cs b/Library/SQLScript/Entity/UserQuery.cs
index 42e72b9..8e04dca 100644
--- a/Library/SQLScript/Entity/UserQuery.cs
+++ b/Library/SQLScript/Entity/UserQuery.cs
@@ -87,15 +87,27 @@ namespace Milimoe.FunGame.Core.Library.SQLScript.Entity
return $"{Command_Update} {TableName} {Command_Set} {Column_GameTime} = {Column_GameTime} + @GameTimeMinutes {Command_Where} {Column_Username} = @Username";
}
+ public static string Update_User(SQLHelper SQLHelper, string Username, string NickName, string Email, bool IsAdmin, bool IsOperator, bool IsEnable, string AutoKey)
+ {
+ SQLHelper.Parameters["@Username"] = Username;
+ SQLHelper.Parameters["@Nickname"] = NickName;
+ SQLHelper.Parameters["@Email"] = Email;
+ SQLHelper.Parameters["@IsAdmin"] = IsAdmin ? 1 : 0;
+ SQLHelper.Parameters["@IsOperator"] = IsOperator ? 1 : 0;
+ SQLHelper.Parameters["@IsEnable"] = IsEnable ? 1 : 0;
+ SQLHelper.Parameters["@AutoKey"] = AutoKey;
+ return $"{Command_Update} {TableName} {Command_Set} {Column_Nickname} = @Nickname, {Column_Email} = @Email, {Column_IsAdmin} = @IsAdmin, {Column_IsOperator} = @IsOperator, {Column_IsEnable} = @IsEnable, {Column_AutoKey} = @AutoKey WHERE {Column_Username} = @Username";
+ }
+
public static string Insert_Register(SQLHelper SQLHelper, string Username, string Password, string Email, string IP, string AutoKey = "")
{
- DateTime Now = DateTime.Now;
+ DateTime now = DateTime.Now;
SQLHelper.Parameters["@Username"] = Username;
SQLHelper.Parameters["@Nickname"] = Username;
SQLHelper.Parameters["@Password"] = Password;
SQLHelper.Parameters["@Email"] = Email;
- SQLHelper.Parameters["@RegTime"] = Now;
- SQLHelper.Parameters["@LastTime"] = Now;
+ SQLHelper.Parameters["@RegTime"] = now;
+ SQLHelper.Parameters["@LastTime"] = now;
SQLHelper.Parameters["@LastIP"] = IP;
SQLHelper.Parameters["@AutoKey"] = AutoKey;
return $"{Command_Insert} {Command_Into} {TableName} ({Column_Username}, {Column_Nickname}, {Column_Password}, {Column_Email}, {Column_RegTime}, {Column_LastTime}, {Column_LastIP}, {Column_AutoKey}) {Command_Values} (@Username, @Nickname, @Password, @Email, @RegTime, @LastTime, @LastIP, @AutoKey)";
diff --git a/Model/ActionQueue.cs b/Model/ActionQueue.cs
index e3a339b..bfee9cf 100644
--- a/Model/ActionQueue.cs
+++ b/Model/ActionQueue.cs
@@ -2486,7 +2486,10 @@ namespace Milimoe.FunGame.Core.Model
skill.GamingQueue = this;
skill.Character = character;
skill.Level = 1;
- LastRound.RoundRewards.Add(skill);
+ Skill record = skill.Copy();
+ record.Character = character;
+ record.Level = skill.Level;
+ LastRound.RoundRewards.Add(record);
WriteLine($"[ {character} ] 获得了回合奖励!{skill.Description}".Trim());
if (skill.IsActive)
{