mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2026-06-04 19:42:11 +00:00
Compare commits
6 Commits
2.0.0-rc.0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5eb92408fc | ||
| e689a6d405 | |||
| 4b5c46a8fb | |||
| 8d176bc2d7 | |||
| aec0112358 | |||
|
|
a9a3242955 |
@ -76,6 +76,11 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
||||
/// </summary>
|
||||
public bool ClearParametersAfterExecute { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 最后一次执行命令时发生的异常
|
||||
/// </summary>
|
||||
public abstract Exception? LastException { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行现有命令(<see cref="Script"/>)
|
||||
/// </summary>
|
||||
|
||||
@ -58,7 +58,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
DateTime now = DateTime.Now;
|
||||
DateTime? upComingTime = StartTime?.AddHours(-16);
|
||||
|
||||
if (Predecessor != -1 && PredecessorStatus != ActivityState.Ended)
|
||||
if (Predecessor != -1 && PredecessorStatus != ActivityState.Ended && PredecessorStatus != ActivityState.ClaimPeriod)
|
||||
{
|
||||
// 如果有前置活动且前置活动未结束,则当前活动状态为未来
|
||||
newState = ActivityState.Future;
|
||||
@ -83,6 +83,11 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
newState = ActivityState.Ended;
|
||||
}
|
||||
|
||||
if (newState != ActivityState.Ended && Quests.All(q => q.Status == QuestState.Completed))
|
||||
{
|
||||
newState = ActivityState.ClaimPeriod;
|
||||
}
|
||||
|
||||
if (Status != newState)
|
||||
{
|
||||
Status = newState;
|
||||
@ -179,7 +184,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
|
||||
public string GetTimeString(bool full = true)
|
||||
{
|
||||
if (Predecessor != -1 && PredecessorStatus != ActivityState.Ended)
|
||||
if (Predecessor != -1 && PredecessorStatus != ActivityState.Ended && PredecessorStatus != ActivityState.ClaimPeriod)
|
||||
{
|
||||
return $"在前置活动结束后开启";
|
||||
}
|
||||
|
||||
@ -175,6 +175,16 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
/// </summary>
|
||||
public bool IsRemoveAfterUse { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许堆叠
|
||||
/// </summary>
|
||||
public bool Stackable { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 堆叠数量
|
||||
/// </summary>
|
||||
public int StackCount { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 物品所属的角色(只有装备物品,才需要设置)
|
||||
/// </summary>
|
||||
|
||||
@ -23,15 +23,14 @@
|
||||
<Description>FunGame.Core: A C#.NET library for turn-based games.</Description>
|
||||
<PackageTags>game;turn-based;server;framework;dotnet;csharp;gamedev</PackageTags>
|
||||
<PackageReleaseNotes>
|
||||
See github releases for details on the latest changes.
|
||||
We are excited to introduce the official version 2.0.0. See github releases for details on the latest changes.
|
||||
</PackageReleaseNotes>
|
||||
<RepositoryUrl>https://github.com/project-redbud/FunGame-Core</RepositoryUrl>
|
||||
<PackageProjectUrl>https://github.com/project-redbud</PackageProjectUrl>
|
||||
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
|
||||
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<VersionPrefix>2.0.0-rc</VersionPrefix>
|
||||
<VersionSuffix Condition="'$(VersionSuffix)' == ''">$([System.DateTime]::Now.ToString("MMdd"))</VersionSuffix>
|
||||
<VersionPrefix>2.0.0</VersionPrefix>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@ -17,6 +17,7 @@ namespace Milimoe.FunGame.Core.Interface.Base
|
||||
public long LastInsertId { get; }
|
||||
public DataSet DataSet { get; }
|
||||
public bool Success { get; }
|
||||
public Exception? LastException { get; }
|
||||
|
||||
public int Execute();
|
||||
public DataSet ExecuteDataSet();
|
||||
|
||||
@ -60,6 +60,13 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
||||
result.PredecessorStatus = (ActivityState)reader.GetInt32();
|
||||
result.UpdateState();
|
||||
break;
|
||||
case nameof(Activity.QuestsAwardedUsers):
|
||||
Dictionary<long, HashSet<long>> questAwardedUsers = NetworkUtility.JsonDeserialize<Dictionary<long, HashSet<long>>>(ref reader, options) ?? [];
|
||||
foreach (long key in questAwardedUsers.Keys)
|
||||
{
|
||||
result.QuestsAwardedUsers[key] = questAwardedUsers[key];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,6 +88,8 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
||||
JsonSerializer.Serialize(writer, value.Quests, options);
|
||||
writer.WriteNumber(nameof(Activity.Predecessor), value.Predecessor);
|
||||
writer.WriteNumber(nameof(Activity.PredecessorStatus), (int)value.PredecessorStatus);
|
||||
writer.WritePropertyName(nameof(Activity.QuestsAwardedUsers));
|
||||
JsonSerializer.Serialize(writer, value.QuestsAwardedUsers, options);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
||||
ActivityState.Future => "预告中",
|
||||
ActivityState.Upcoming => "即将开始",
|
||||
ActivityState.InProgress => "进行中",
|
||||
ActivityState.ClaimPeriod => "领奖中",
|
||||
_ => "已结束"
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
namespace Milimoe.FunGame.Core.Library.Constant
|
||||
using System.Reflection;
|
||||
|
||||
namespace Milimoe.FunGame.Core.Library.Constant
|
||||
{
|
||||
public class FunGameInfo
|
||||
{
|
||||
@ -27,22 +29,22 @@
|
||||
{
|
||||
get
|
||||
{
|
||||
string patch = FunGame_VersionPatch.StartsWith('.') ? FunGame_VersionPatch : $".{FunGame_VersionPatch}";
|
||||
return $"{FunGame_Version_Major}.{FunGame_Version_Minor}{patch}";
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
AssemblyInformationalVersionAttribute? informationalVersionAttribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
return informationalVersionAttribute?.InformationalVersion ?? $"{FunGame_Version_Major}.{FunGame_Version_Minor}{(FunGame_VersionPatch.StartsWith('.') ? FunGame_VersionPatch : $".{FunGame_VersionPatch}")}";
|
||||
}
|
||||
}
|
||||
|
||||
public const int FunGame_Version_Major = 2;
|
||||
public const int FunGame_Version_Minor = 0;
|
||||
public const string FunGame_VersionPatch = "0";
|
||||
|
||||
public const string FunGame_Core = "FunGame Core";
|
||||
public const string FunGame_Core_Api = "FunGame Core Api";
|
||||
public const string FunGame_Console = "FunGame Console";
|
||||
public const string FunGame_Desktop = "FunGame Desktop";
|
||||
public const string FunGame_Server = "FunGame Server Console";
|
||||
|
||||
public const int FunGame_Version_Major = 2;
|
||||
public const int FunGame_Version_Minor = 0;
|
||||
public const string FunGame_VersionPatch = "0-dev";
|
||||
public const string FunGame_Version_Build = "";
|
||||
|
||||
public const string FunGameCoreTitle = @" _____ _ _ _ _ ____ _ __ __ _____ ____ ___ ____ _____
|
||||
| ___| | | | \ | |/ ___| / \ | \/ | ____| / ___/ _ \| _ \| ____|
|
||||
| |_ | | | | \| | | _ / _ \ | |\/| | _| | | | | | | |_) | _|
|
||||
|
||||
@ -114,6 +114,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
||||
Future,
|
||||
Upcoming,
|
||||
InProgress,
|
||||
ClaimPeriod,
|
||||
Ended
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user