Feature: Add "Ban IP" to log message context menu in main dialog
- Add "Ban IP" menu item to the log message list (m_CList_Message) right-click context menu, allowing users to extract IPv4 addresses from selected log entries and add them directly to the IP blacklist - Reuses ExtractFirstIPFromMessage() from the previous commit for dependency-free IPv4 parsing with per-segment 0-255 validation - Checks against whitelist before banning (whitelisted IPs cannot be banned) and skips IPs already in blacklist with clear feedback - Immediately persists via THIS_CFG.SetStr to the config ini file; IPBlacklist singleton takes effect instantly — subsequent connections from banned IPs are rejected in IOCPServer::OnAccept() which already calls IsIPBlacklisted() on every new connection - Menu item is grayed out when no log entry is selected - Sync en_US / zh_TW language files with new translation strings Co-Authored-By: DeepSeek V4 Pro
This commit is contained in:
@@ -992,6 +992,7 @@
|
||||
#define ID_MSGLOG_COPY 33043
|
||||
#define ID_MSGLOG_SEARCH 33078
|
||||
#define ID_MSGLOG_LOGIN_NOTIFY 33079
|
||||
#define ID_MSGLOG_BAN_IP 33080
|
||||
#define ID_WEB_REMOTE_CONTROL 33044
|
||||
#define ID_TOOL_PLUGIN_SETTINGS 33045
|
||||
#define ID_33046 33046
|
||||
@@ -1033,7 +1034,7 @@
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 398
|
||||
#define _APS_NEXT_COMMAND_VALUE 33080
|
||||
#define _APS_NEXT_COMMAND_VALUE 33081
|
||||
#define _APS_NEXT_CONTROL_VALUE 2542
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user