diff --git a/.gitignore b/.gitignore
index bcf2cce..b63da7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -363,4 +363,4 @@ MigrationBackup/
FodyWeavers.xsd
# FunGame Implement
-FunGame.Core/Implement/*.cs
\ No newline at end of file
+FunGame.Implement/Implement/*.cs
\ No newline at end of file
diff --git a/FunGame.Console/FunGame.Console.csproj b/FunGame.Console/FunGame.Console.csproj
new file mode 100644
index 0000000..d472074
--- /dev/null
+++ b/FunGame.Console/FunGame.Console.csproj
@@ -0,0 +1,29 @@
+
+
+
+ Exe
+ net6.0
+ enable
+ enable
+ Milimoe
+ Milimoe
+ FunGame
+ FunGame.Console
+ images\logo.ico
+ ..\bin\
+ FunGame
+
+
+
+ embedded
+
+
+
+ embedded
+
+
+
+
+
+
+
diff --git a/FunGame.Console/Main.cs b/FunGame.Console/Main.cs
new file mode 100644
index 0000000..0794a3d
--- /dev/null
+++ b/FunGame.Console/Main.cs
@@ -0,0 +1,2 @@
+Console.WriteLine("Hello, FunGame's Console!");
+Console.ReadKey();
diff --git a/FunGame.Console/images/logo.ico b/FunGame.Console/images/logo.ico
new file mode 100644
index 0000000..4082874
Binary files /dev/null and b/FunGame.Console/images/logo.ico differ
diff --git a/FunGame.Core.Api/Interface/Events.cs b/FunGame.Core.Api/Interface/Events.cs
deleted file mode 100644
index 5e16b94..0000000
--- a/FunGame.Core.Api/Interface/Events.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace FunGame.Core.Api.Interface
-{
- public interface FunGameEvent
- {
-
- }
-
- public interface BeforeConnectEvent : FunGameEvent
- {
-
- }
-
- public interface AfterConnectEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeDisconnectEvent : FunGameEvent
- {
-
- }
-
- public interface AfterDisconnectEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeLoginEvent : FunGameEvent
- {
-
- }
-
- public interface AfterLoginEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeLogoutEvent : FunGameEvent
- {
-
- }
-
- public interface AfterLogoutEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeRegEvent : FunGameEvent
- {
-
- }
-
- public interface AfterRegEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeIntoRoomEvent : FunGameEvent
- {
-
- }
-
- public interface AfterIntoRoomEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeSendTalkEvent : FunGameEvent
- {
-
- }
-
- public interface AfterSendTalkEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeCreateRoomEvent : FunGameEvent
- {
-
- }
-
- public interface AfterCreateRoomEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeQuitRoomEvent : FunGameEvent
- {
-
- }
-
- public interface AfterQuitRoomEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeChangeRoomSettingEvent : FunGameEvent
- {
-
- }
-
- public interface AfterChangeRoomSettingEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeStartMatchEvent : FunGameEvent
- {
-
- }
-
- public interface AfterStartMatchEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeStartGameEvent : FunGameEvent
- {
-
- }
-
- public interface AfterStartGameEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeChangeProfileEvent : FunGameEvent
- {
-
- }
-
- public interface AfterChangeProfileEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeChangeAccountSettingEvent : FunGameEvent
- {
-
- }
-
- public interface AfterChangeAccountSettingEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeOpenStockEvent : FunGameEvent
- {
-
- }
-
- public interface AfterOpenStockEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeSignInEvent : FunGameEvent
- {
-
- }
-
- public interface AfterSignInEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeOpenStoreEvent : FunGameEvent
- {
-
- }
-
- public interface AfterOpenStoreEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeBuyItemEvent : FunGameEvent
- {
-
- }
-
- public interface AfterBuyItemEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeShowRankingEvent : FunGameEvent
- {
-
- }
-
- public interface AfterShowRankingEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeUseItemEvent : FunGameEvent
- {
-
- }
-
- public interface AfterUseItemEvent : FunGameEvent
- {
-
- }
-
- public interface BeforeEndGameEvent : FunGameEvent
- {
-
- }
-
- public interface AfterEndGameEvent : FunGameEvent
- {
-
- }
-}
diff --git a/FunGame.Core.Api/Interface/Interface.cs b/FunGame.Core.Api/Interface/Interface.cs
deleted file mode 100644
index 573eec7..0000000
--- a/FunGame.Core.Api/Interface/Interface.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace FunGame.Core.Api.Interface
-{
- /**
- * 接口需要在FunGame.Core项目中Implement文件夹创建新的类实现
- * 参考:
- * using FunGame.Core.Interface;
-
- namespace FunGame.Core.Implement
- {
- public class ClientConnectInterfaceImpl : ClientConnectInterface
- {
- public string RemoteServerIP()
- {
- // 此处修改连接远程服务器IP
- string serverIP = "127.0.0.1";
- string serverPort = "22222";
- return serverIP + ":" + serverPort;
- }
- }
- }
- */
-
- public interface ClientConnectInterface
- {
- public string RemoteServerIP();
- }
-
- public interface ServerInterface
- {
-
- }
-}
diff --git a/FunGame.Core.Api/Util/Utility.cs b/FunGame.Core.Api/Util/Utility.cs
deleted file mode 100644
index 24a1bd3..0000000
--- a/FunGame.Core.Api/Util/Utility.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-using FunGame.Core.Api.Model.Enum;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-
-namespace FunGame.Core.Api.Util
-{
- #region 通用工具类
-
- ///
- /// 通用工具类,客户端和服务器端都可以直接调用的工具方法都可以写在这里
- ///
- public class Utility
- {
- ///
- /// 判断字符串是否是IP地址
- ///
- ///
- ///
- public static bool IsIP(string str)
- {
- //判断是否为IP
- return Regex.IsMatch(str, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
- }
-
- ///
- /// 判断字符串是否为邮箱地址
- ///
- ///
- ///
- public static bool IsEmail(string str)
- {
- //判断是否为Email
- return Regex.IsMatch(str, @"^(\w)+(\.\w)*@(\w)+((\.\w+)+)$");
- }
-
- ///
- /// 判断字符串是否是一个FunGame可接受的服务器地址
- ///
- ///
- ///
- public static ErrorType IsServerAddress(string str)
- {
- string[] strs = str.Split(':');
- string ip;
- int port;
- if (strs.Length < 2)
- {
- ip = strs[0];
- port = 22222;
- }
- else if (strs.Length < 3)
- {
- ip = strs[0];
- port = Convert.ToInt32(strs[1]);
- }
- else return ErrorType.WrongFormat;
- if (IsIP(ip) && port > 0 && port < 65536) return ErrorType.None;
- else if (!IsIP(ip) && port > 0 && port < 65536) return ErrorType.IsNotIP;
- else if (IsIP(ip) && (port <= 0 || port >= 65536)) return ErrorType.IsNotPort;
- else return ErrorType.WrongFormat;
- }
-
- ///
- /// 判断参数是否是一个FunGame可接受的服务器地址
- ///
- ///
- ///
- ///
- public static ErrorType IsServerAddress(string ip, int port)
- {
- if (IsIP(ip) && port > 0 && port < 65536) return ErrorType.None;
- else if (!IsIP(ip) && port > 0 && port < 65536) return ErrorType.IsNotIP;
- else if (IsIP(ip) && (port <= 0 || port >= 65536)) return ErrorType.IsNotPort;
- else return ErrorType.WrongFormat;
- }
- }
-
- #endregion
-
- #region 读写INI文件工具类
-
- public class INIHelper
- {
- /*
- * 声明API函数
- */
- [DllImport("kernel32", CharSet = CharSet.Unicode)]
- private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
- [DllImport("kernel32", CharSet = CharSet.Unicode)]
- private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
-
- ///
- /// 写入ini文件
- ///
- /// Section
- /// 键
- /// 值
- /// 文件名,缺省为FunGame.ini
- public static void WriteINI(string Section, string Key, string Value, string FileName = @"FunGame.ini")
- {
- WritePrivateProfileString(Section, Key, Value, System.Environment.CurrentDirectory.ToString() + @"\" + FileName);
- }
-
- ///
- /// 读取ini文件
- ///
- /// Section
- /// 键
- /// 文件名,缺省为FunGame.ini
- /// 读取到的值
- public static string ReadINI(string Section, string Key, string FileName = @"FunGame.ini")
- {
- StringBuilder str = new(256);
- _ = GetPrivateProfileString(Section, Key, "", str, 256, System.Environment.CurrentDirectory.ToString() + @"\" + FileName);
- return str.ToString();
- }
-
- ///
- /// 查询ini文件是否存在
- ///
- /// 文件名,缺省为FunGame.ini
- /// 是否存在
- public static bool ExistINIFile(string FileName = @"FunGame.ini")
- {
- return File.Exists(System.Environment.CurrentDirectory.ToString() + @"\" + FileName);
- }
-
- ///
- /// 初始化ini模板文件
- ///
- public static void Init(FunGameEnums.FunGame FunGameType)
- {
- switch(FunGameType)
- {
- case FunGameEnums.FunGame.FunGame_Core:
- case FunGameEnums.FunGame.FunGame_Core_Api:
- case FunGameEnums.FunGame.FunGame_Console:
- case FunGameEnums.FunGame.FunGame_Desktop:
- /**
- * Config
- */
- WriteINI("Config", "AutoConnect", "true");
- WriteINI("Config", "AutoLogin", "false");
- /**
- * Account
- */
- WriteINI("Account", "UserName", "");
- WriteINI("Account", "Password", "");
- WriteINI("Account", "AutoKey", "");
- break;
- case FunGameEnums.FunGame.FunGame_Server:
- /**
- * Server
- */
- WriteINI("Server", "Name", "FunGame Server");
- WriteINI("Server", "Password", "");
- WriteINI("Server", "Describe", "Just Another FunGame Server.");
- WriteINI("Server", "Notice", "This is the FunGame Server's Notice.");
- WriteINI("Server", "Key", "");
- WriteINI("Server", "Status", "1");
- /**
- * Socket
- */
- WriteINI("Socket", "Port", "22222");
- WriteINI("Socket", "MaxPlayer", "20");
- WriteINI("Socket", "MaxConnectFailed", "0");
- /**
- * MySQL
- */
- WriteINI("MySQL", "DBServer", "localhost");
- WriteINI("MySQL", "DBPort", "3306");
- WriteINI("MySQL", "DBName", "fungame");
- WriteINI("MySQL", "DBUser", "root");
- WriteINI("MySQL", "DBPassword", "pass");
- break;
- }
- }
- }
-
- #endregion
-
- #region 接口反射工具类
-
- ///
- /// 在FunGame.Core.Api中添加新接口和新实现时,需要:
- /// 在FunGame.Core.Api.Model.Enum.CommonEnums里同步添加InterfaceType、InterfaceMethod
- ///
- public class ReflectionHelper
- {
- /**
- * 定义需要反射的DLL
- */
- public const string FUNGAME_CORE = "FunGame.Core";
-
- /**
- * 无需二次修改的
- */
- public static string EXEDocPath = System.Environment.CurrentDirectory.ToString() + "\\"; // 程序目录
- public static string PluginDocPath = System.Environment.CurrentDirectory.ToString() + "\\plugins\\"; // 插件目录
-
- ////////////////////////////////////////////////////////////////////
- /////////////// * 下 面 是 工 具 类 实 现 * ////////////////
- ///////////////////////////////////////////////////////////////////
-
- /**
- * 定义反射变量
- */
- private Assembly? Assembly;
- private Type? Type;
- private MethodInfo? Method;
- private object? Instance;
-
- ///
- /// 获取FunGame.Core.dll中接口的实现方法
- ///
- /// 接口代号
- ///
- private Type? GetFunGameCoreImplement(int Interface)
- {
- // 通过类名获取获取命名空间+类名称
- string ClassName = EnumHelper.GetImplementClassName(Interface);
- List? Classes = null;
- if (Assembly != null)
- {
- Classes = Assembly.GetTypes().Where(w =>
- w.Namespace == "FunGame.Core.Implement" &&
- w.Name.Contains(ClassName)
- ).ToList();
- if (Classes != null && Classes.Count > 0)
- return Classes[0];
- else return null;
- }
- else return null;
- }
-
- ///
- /// 公开方法:获取FUNGAME.CORE.DLL中指定方法的返回值
- ///
- /// 接口代号
- /// 方法代号
- ///
- public object? GetFunGameCoreValue(int Interface, int Method)
- {
- Assembly = Assembly.LoadFile(EXEDocPath + @FUNGAME_CORE + ".dll");
- Type = GetFunGameCoreImplement(Interface); // 通过类名获取获取命名空间+类名称
- string MethodName = EnumHelper.GetImplementMethodName(Method); // 获取方法名
- if (Assembly != null && Type != null) this.Method = Type.GetMethod(MethodName); // 从Type中查找方法名
- else return null;
- Instance = Assembly.CreateInstance(Type.Namespace + "." + Type.Name);
- if (Instance != null && this.Method != null)
- {
- object? value = this.Method.Invoke(Instance, Array.Empty