diff --git a/FunGame.Core/Api/Utility/EnumHelper.cs b/FunGame.Core/Api/Utility/EnumHelper.cs
deleted file mode 100644
index 53e050d..0000000
--- a/FunGame.Core/Api/Utility/EnumHelper.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Milimoe.FunGame.Core.Library.Constant;
-
-namespace Milimoe.FunGame.Core.Api.Utility
-{
- public class EnumHelper
- {
- ///
- /// 获取实现类类名
- ///
- /// 接口代号
- ///
- public static string GetImplementClassName(int Interface)
- {
- foreach (string str in Enum.GetNames(typeof(InterfaceType)))
- {
- InterfaceType temp = (InterfaceType)Enum.Parse(typeof(InterfaceType), Interface.ToString(), true);
- if (temp.ToString() == str)
- return temp + "Impl";
- }
- return "";
- }
-
- ///
- /// 获取实现类的方法名
- ///
- /// 方法代号
- ///
- public static string GetImplementMethodName(int Method)
- {
- foreach (string str in Enum.GetNames(typeof(InterfaceMethod)))
- {
- InterfaceMethod temp = (InterfaceMethod)Enum.Parse(typeof(InterfaceMethod), Method.ToString(), true);
- if (temp.ToString() == str)
- return temp.ToString();
- }
- return "";
- }
-
- ///
- /// 获取Socket枚举名
- ///
- /// Socket枚举
- ///
- public static string GetSocketTypeName(int SocketType)
- {
- foreach (string str in Enum.GetNames(typeof(SocketMessageType)))
- {
- SocketMessageType temp = (SocketMessageType)Enum.Parse(typeof(SocketMessageType), SocketType.ToString(), true);
- if (temp.ToString() == str)
- return temp.ToString();
- }
- return "";
- }
- }
-}
diff --git a/FunGame.Core/Library/Common/Network/Socket.cs b/FunGame.Core/Library/Common/Network/Socket.cs
index 14da2ab..a160f15 100644
--- a/FunGame.Core/Library/Common/Network/Socket.cs
+++ b/FunGame.Core/Library/Common/Network/Socket.cs
@@ -67,7 +67,7 @@ namespace Milimoe.FunGame.Core.Library.Common.Network
{
object[] result = SocketManager.Receive();
if (result.Length != 2) throw new System.Exception("收到错误的返回信息。");
- if ((string)result[0] == SocketSet.HeartBeat)
+ if ((SocketMessageType)result[0] == SocketMessageType.HeartBeat)
{
if (WaitHeartBeatReply != null && !WaitHeartBeatReply.IsCompleted) WaitHeartBeatReply.Wait(1);
HeartBeatFaileds = 0;
diff --git a/FunGame.Core/Service/SocketManager.cs b/FunGame.Core/Service/SocketManager.cs
index 6ad909c..01b9726 100644
--- a/FunGame.Core/Service/SocketManager.cs
+++ b/FunGame.Core/Service/SocketManager.cs
@@ -168,7 +168,7 @@ namespace Milimoe.FunGame.Core.Service
Library.Common.Network.JsonObject? json = Library.Common.Network.JsonObject.GetObject(msg);
if (json != null)
{
- result[0] = GetTypeString(json.MessageType);
+ result[0] = json.MessageType;
result[1] = json.Parameters;
}
return result;
@@ -196,7 +196,7 @@ namespace Milimoe.FunGame.Core.Service
Library.Common.Network.JsonObject? json = Library.Common.Network.JsonObject.GetObject(msg);
if (json != null)
{
- result[0] = GetTypeString(json.MessageType);
+ result[0] = json.MessageType;
result[1] = json.Parameters;
}
return result;
diff --git a/FunGame.Desktop/Model/MainModel.cs b/FunGame.Desktop/Model/MainModel.cs
index 8bf2871..c25764d 100644
--- a/FunGame.Desktop/Model/MainModel.cs
+++ b/FunGame.Desktop/Model/MainModel.cs
@@ -208,7 +208,7 @@ namespace Milimoe.FunGame.Desktop.Model
{
return Socket.Receive();
}
- return new object[2] { SocketSet.Unknown, Array.Empty