From b708cff0cd11809380d39584c39b451302131e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E5=82=91?= Date: Sat, 29 Oct 2022 22:21:25 +0800 Subject: [PATCH] Add Mail send to all warnning --- Source/GrasscutterTools/Forms/FormMain.cs | 5 +++++ .../Properties/Resources.Designer.cs | 20 +++++++++++++++++++ .../Properties/Resources.en-us.resx | 8 ++++++++ .../Properties/Resources.resx | 8 ++++++++ .../Properties/Resources.ru-ru.resx | 8 ++++++++ .../Properties/Resources.zh-TW.resx | 8 ++++++++ 6 files changed, 57 insertions(+) diff --git a/Source/GrasscutterTools/Forms/FormMain.cs b/Source/GrasscutterTools/Forms/FormMain.cs index c3bf0fe..b008a9c 100644 --- a/Source/GrasscutterTools/Forms/FormMain.cs +++ b/Source/GrasscutterTools/Forms/FormMain.cs @@ -1504,6 +1504,11 @@ namespace GrasscutterTools.Forms return; } + if (mail.SendToAll) + { + MessageBox.Show(Resources.MailSendToAllWarning, Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + var cmd = $"/sendMail {(mail.SendToAll ? "all" : mail.Recipient.ToString())} |" + $"/sendMail {mail.Title} |" + $"/sendMail {mail.Content.Replace("\r", "\\r").Replace("\n", "\\n")} |" + diff --git a/Source/GrasscutterTools/Properties/Resources.Designer.cs b/Source/GrasscutterTools/Properties/Resources.Designer.cs index 61ed47c..fc78c0a 100644 --- a/Source/GrasscutterTools/Properties/Resources.Designer.cs +++ b/Source/GrasscutterTools/Properties/Resources.Designer.cs @@ -739,6 +739,17 @@ namespace GrasscutterTools.Properties { } } + /// + /// 查找类似 将邮件发送给所有人在当前(v1.4.2)或更早版本可能导致服务器卡顿甚至耗尽资源而崩溃! + ///实测在4H8G机器中向3k+账号发送邮件导致服务端卡死,在32H80G中仅获取所有玩家(2k+)就耗时40秒。 + ///目前已经提交了改进建议,在优化完成之前,请谨慎使用向所有玩家发送邮件! 的本地化字符串。 + /// + internal static string MailSendToAllWarning { + get { + return ResourceManager.GetString("MailSendToAllWarning", resourceCulture); + } + } + /// /// 查找类似 // 普通怪物 ///20010101:草史莱姆 @@ -998,6 +1009,15 @@ namespace GrasscutterTools.Properties { } } + /// + /// 查找类似 警告 的本地化字符串。 + /// + internal static string Warning { + get { + return ResourceManager.GetString("Warning", resourceCulture); + } + } + /// /// 查找类似 11101:无锋剑 ///11201:银剑 diff --git a/Source/GrasscutterTools/Properties/Resources.en-us.resx b/Source/GrasscutterTools/Properties/Resources.en-us.resx index 94b2761..7fb6950 100644 --- a/Source/GrasscutterTools/Properties/Resources.en-us.resx +++ b/Source/GrasscutterTools/Properties/Resources.en-us.resx @@ -268,4 +268,12 @@ Do you want to check for updates? Selecting No will no longer remind you of this Input cannot be empty! + + 将邮件发送给所有人在当前(v1.4.2)或更早版本可能导致服务器卡顿甚至耗尽资源而崩溃! +实测在4H8G机器中向3k+账号发送邮件导致服务端卡死,在32H80G中仅获取所有玩家(2k+)就耗时40秒。 +目前已经提交了改进建议,在优化完成之前,请谨慎使用向所有玩家发送邮件! + + + Warning + \ No newline at end of file diff --git a/Source/GrasscutterTools/Properties/Resources.resx b/Source/GrasscutterTools/Properties/Resources.resx index 27f75c8..249319c 100644 --- a/Source/GrasscutterTools/Properties/Resources.resx +++ b/Source/GrasscutterTools/Properties/Resources.resx @@ -277,4 +277,12 @@ ..\Resources\zh-cn\Gadget.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + 将邮件发送给所有人在当前(v1.4.2)或更早版本可能导致服务器卡顿甚至耗尽资源而崩溃! +实测在4H8G机器中向3k+账号发送邮件导致服务端卡死,在32H80G中仅获取所有玩家(2k+)就耗时40秒。 +目前已经提交了改进建议,在优化完成之前,请谨慎使用向所有玩家发送邮件! + + + 警告 + \ No newline at end of file diff --git a/Source/GrasscutterTools/Properties/Resources.ru-ru.resx b/Source/GrasscutterTools/Properties/Resources.ru-ru.resx index 723b625..252c5ce 100644 --- a/Source/GrasscutterTools/Properties/Resources.ru-ru.resx +++ b/Source/GrasscutterTools/Properties/Resources.ru-ru.resx @@ -256,4 +256,12 @@ ..\Resources\WeaponColor.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + Отправка почты всем в текущей (v1.4.2) или более ранних версиях может привести к зависанию сервера или даже к нехватке ресурсов и сбою! +На самом деле было измерено, что отправка электронных писем на 3000+ учетных записей на машине 4H8G приводит к зависанию сервера, и для получения всех игроков (2000+) на машине 32H80G требуется 40 секунд. +Были отправлены предложения по улучшению, пожалуйста, будьте осторожны, чтобы отправить электронные письма всем игрокам, пока оптимизация не будет завершена! + + + Предупреждение + \ No newline at end of file diff --git a/Source/GrasscutterTools/Properties/Resources.zh-TW.resx b/Source/GrasscutterTools/Properties/Resources.zh-TW.resx index 4573532..2d0dcc1 100644 --- a/Source/GrasscutterTools/Properties/Resources.zh-TW.resx +++ b/Source/GrasscutterTools/Properties/Resources.zh-TW.resx @@ -262,4 +262,12 @@ 輸入不能為空! + + 將郵件發送給所有人在當前(v1.4.2)或更早版本可能導致服務器卡頓甚至耗盡資源而崩潰! +實測在4H8G機器中向3k+賬號發送郵件導致服務端卡死,在32H80G中僅獲取所有玩家(2k+)就耗時40秒。 +目前已經提交了改進建議,在優化完成之前,請謹慎使用向所有玩家發送郵件! + + + 警告 + \ No newline at end of file