From 9818fecc372e0385a98ec25258f2a41f63e26d76 Mon Sep 17 00:00:00 2001 From: milimoe <110188673+milimoe@users.noreply.github.com> Date: Sun, 19 Nov 2023 02:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86-debug=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=A1=B9=EF=BC=8C=E6=AD=A4=E5=90=AF=E5=8A=A8=E9=A1=B9?= =?UTF-8?q?=E5=B0=86=E7=A6=81=E7=94=A8=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E5=BF=83=E8=B7=B3=E6=A3=80=E6=B5=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Common/Network/Socket.cs | 7 +++++-- Library/Constant/FunGameInfo.cs | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Library/Common/Network/Socket.cs b/Library/Common/Network/Socket.cs index aa6ff59..9d6b3e1 100644 --- a/Library/Common/Network/Socket.cs +++ b/Library/Common/Network/Socket.cs @@ -130,8 +130,11 @@ namespace Milimoe.FunGame.Core.Library.Common.Network private void StartSendingHeartBeat() { - _SendingHeartBeat = true; - SendingHeartBeatTask = Task.Factory.StartNew(SendHeartBeat); + if (!FunGameInfo.FunGame_DebugMode) + { + _SendingHeartBeat = true; + SendingHeartBeatTask = Task.Factory.StartNew(SendHeartBeat); + } } private void StopReceiving() diff --git a/Library/Constant/FunGameInfo.cs b/Library/Constant/FunGameInfo.cs index 34a25a1..0d7009b 100644 --- a/Library/Constant/FunGameInfo.cs +++ b/Library/Constant/FunGameInfo.cs @@ -13,6 +13,12 @@ public const string FunGame_CopyRight = @"©2023 Milimoe. 米粒的糖果屋"; + /// + /// 添加-debug启动项将开启DebugMode(仅适用于Desktop或Console) + /// 目前支持禁用心跳检测功能 + /// + public static bool FunGame_DebugMode { get; set; } = false; + private const string FunGame_Core = "FunGame Core"; private const string FunGame_Core_Api = "FunGame Core Api"; private const string FunGame_Console = "FunGame Console";