diff --git a/FunGame.Console/FunGame.Console.csproj b/FunGame.Console/FunGame.Console.csproj
index 7097cf2..31bcbd3 100644
--- a/FunGame.Console/FunGame.Console.csproj
+++ b/FunGame.Console/FunGame.Console.csproj
@@ -9,7 +9,7 @@
Milimoe
FunGame
FunGame.Console
- images\logo.ico
+ logo.ico
..\bin\
FunGame
Milimoe.$(MSBuildProjectName.Replace(" ", "_"))
@@ -24,7 +24,7 @@
-
+
diff --git a/FunGame.Desktop/Images/logo.ico b/FunGame.Console/logo.ico
similarity index 100%
rename from FunGame.Desktop/Images/logo.ico
rename to FunGame.Console/logo.ico
diff --git a/FunGame.Core/Api/Utility/FactoryHelper.cs b/FunGame.Core/Api/Utility/Factory.cs
similarity index 93%
rename from FunGame.Core/Api/Utility/FactoryHelper.cs
rename to FunGame.Core/Api/Utility/Factory.cs
index 4faee88..f8642b0 100644
--- a/FunGame.Core/Api/Utility/FactoryHelper.cs
+++ b/FunGame.Core/Api/Utility/Factory.cs
@@ -8,8 +8,8 @@ using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Core.Api.Utility
{
- public class FactoryHelper
- {
+ public class Factory
+ {
///
/// 获取一个可能为NULL的实例
///
@@ -23,7 +23,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
if (objs is null || objs.Length == 0) return instance;
if (typeof(T) == typeof(Entity.User))
{
- instance = Factory.UserFactory.GetInstance("Mili");
+ instance = Api.Factory.UserFactory.GetInstance("Mili");
}
else if (typeof(T) == typeof(Skill))
{
@@ -48,7 +48,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
if (objs is null || objs.Length == 0) return instance;
if (typeof(T) == typeof(Entity.User))
{
- instance = Factory.UserFactory.GetInstance("Mili");
+ instance = Api.Factory.UserFactory.GetInstance("Mili");
}
else if (typeof(T) == typeof(Skill))
{
@@ -73,7 +73,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
if (objs is null || objs.Length == 0) return instance;
if (typeof(T) == typeof(Entity.User))
{
- instance = Factory.UserFactory.GetInstance("Mili");
+ instance = Api.Factory.UserFactory.GetInstance("Mili");
}
else if (typeof(T) == typeof(Skill))
{
diff --git a/FunGame.Core/Api/Utility/General.cs b/FunGame.Core/Api/Utility/General.cs
index 8e42294..ffafdda 100644
--- a/FunGame.Core/Api/Utility/General.cs
+++ b/FunGame.Core/Api/Utility/General.cs
@@ -156,7 +156,6 @@ namespace Milimoe.FunGame.Core.Api.Utility
DateTime now = DateTime.Now;
return type switch
{
- TimeType.General => now.ToString("yyyy-MM-dd HH:mm:ss"),
TimeType.DateOnly => now.Date.ToString(""),
TimeType.TimeOnly => now.ToString("T"),
TimeType.Year4 => now.Year.ToString(),
@@ -166,7 +165,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
TimeType.Hour => now.Hour.ToString(),
TimeType.Minute => now.Minute.ToString(),
TimeType.Second => now.Second.ToString(),
- _ => now.ToString("yyyy-MM-dd HH:mm:ss")
+ _ => now.ToString("yyyy/MM/dd HH:mm:ss")
};
}
diff --git a/FunGame.Core/Api/Utility/Implement.cs b/FunGame.Core/Api/Utility/Implement.cs
new file mode 100644
index 0000000..3b3c02f
--- /dev/null
+++ b/FunGame.Core/Api/Utility/Implement.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using Milimoe.FunGame.Core.Library.Constant;
+
+namespace Milimoe.FunGame.Core.Api.Utility
+{
+ ///
+ /// Interface的定义已经搬至:
+ /// Milimoe.FunGame.Core.Library.Constant 中的 &InterfaceType 和 &InterfaceSet
+ ///
+ public class Implement
+ {
+ ///
+ /// 获取FunGame.Implement.dll中接口的实现方法
+ ///
+ /// 接口代号
+ ///
+ private static Type? GetFunGameImplementType(System.Reflection.Assembly Assembly, InterfaceType Interface)
+ {
+ // 通过类名获取命名空间+类名称
+ string ClassName = GetImplementClassName(Interface);
+ List? Classes = null;
+ if (Assembly != null)
+ {
+ Classes = Assembly.GetTypes().Where(w =>
+ w.Namespace == "Milimoe.FunGame.Core.Implement" &&
+ w.Name.Contains(ClassName)
+ ).ToList();
+ if (Classes != null && Classes.Count > 0)
+ return Classes[0];
+ else return null;
+ }
+ else return null;
+ }
+
+ ///
+ /// 获取接口实现类类名
+ ///
+ /// 接口类型
+ ///
+ private static string GetImplementClassName(InterfaceType Interface)
+ {
+ return Interface switch
+ {
+ InterfaceType.IClient => InterfaceSet.Type.IClient,
+ InterfaceType.IServer => InterfaceSet.Type.IServer,
+ _ => ""
+ };
+ }
+
+ ///
+ /// 获取接口方法名
+ ///
+ /// 方法
+ ///
+ private static string GetImplementMethodName(InterfaceMethod Method)
+ {
+ return Method switch
+ {
+ InterfaceMethod.RemoteServerIP => InterfaceSet.Method.RemoteServerIP,
+ InterfaceMethod.DBConnection => InterfaceSet.Method.DBConnection,
+ InterfaceMethod.GetServerSettings => InterfaceSet.Method.GetServerSettings,
+ _ => ""
+ };
+ }
+
+ ///
+ /// 公开方法:获取FunGame.Implement.DLL中指定方法的返回值
+ ///
+ /// 接口代号
+ /// 方法代号
+ ///
+ public static object? GetFunGameImplValue(InterfaceType Interface, InterfaceMethod Method)
+ {
+ MethodInfo? MethodInfo;
+
+ Assembly? Assembly = System.Reflection.Assembly.LoadFile(ReflectionSet.EXEFolderPath + ReflectionSet.FUNGAME_IMPL + ".dll");
+ Type? Type = GetFunGameImplementType(Assembly, Interface); // 通过类名获取命名空间+类名称
+ string MethodName = GetImplementMethodName(Method); // 获取方法名
+
+ if (Assembly != null && Type != null) MethodInfo = Type.GetMethod(MethodName); // 从Type中查找方法名
+ else return null;
+
+ object? Instance = Assembly.CreateInstance(Type.Namespace + "." + Type.Name);
+ if (Instance != null && MethodInfo != null)
+ {
+ object? value = MethodInfo.Invoke(Instance, Array.Empty