From 909f07866681a60ae994a835c508412dd0e6c362 Mon Sep 17 00:00:00 2001 From: Mili Date: Wed, 28 Dec 2022 00:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0GetSocketTypeString=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Core/Library/Common/Network/ServerSocket.cs | 5 +++++ FunGame.Core/Library/Common/Network/Socket.cs | 5 +++++ FunGame.Core/Service/SocketManager.cs | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/FunGame.Core/Library/Common/Network/ServerSocket.cs b/FunGame.Core/Library/Common/Network/ServerSocket.cs index 9880ca2..706d277 100644 --- a/FunGame.Core/Library/Common/Network/ServerSocket.cs +++ b/FunGame.Core/Library/Common/Network/ServerSocket.cs @@ -89,5 +89,10 @@ namespace Milimoe.FunGame.Core.Library.Common.Network { throw new System.Exception("监听Socket不能用于接收信息。"); } + + public static string GetTypeString(SocketMessageType type) + { + return Socket.GetTypeString(type); + } } } diff --git a/FunGame.Core/Library/Common/Network/Socket.cs b/FunGame.Core/Library/Common/Network/Socket.cs index 67854ab..5090073 100644 --- a/FunGame.Core/Library/Common/Network/Socket.cs +++ b/FunGame.Core/Library/Common/Network/Socket.cs @@ -147,5 +147,10 @@ namespace Milimoe.FunGame.Core.Library.Common.Network if (HeartBeatFaileds++ >= 3) throw new System.Exception("ERROR:与服务器连接中断。"); } + + public static string GetTypeString(SocketMessageType type) + { + return SocketManager.GetTypeString(type); + } } } diff --git a/FunGame.Core/Service/SocketManager.cs b/FunGame.Core/Service/SocketManager.cs index cbe734f..37f5262 100644 --- a/FunGame.Core/Service/SocketManager.cs +++ b/FunGame.Core/Service/SocketManager.cs @@ -211,7 +211,7 @@ namespace Milimoe.FunGame.Core.Service /// /// 通信类型 /// 等效字符串 - private static string GetTypeString(SocketMessageType type) + internal static string GetTypeString(SocketMessageType type) { return type switch {