Commit Graph

28 Commits

Author SHA1 Message Date
ecv
37dd0259d2 Merge remote-tracking branch 'origin/claude/add-local-storage-muted-01MeqMQ9SBBLZrfcAEudhk92' into claude/add-local-storage-muted-01MeqMQ9SBBLZrfcAEudhk92 2025-11-24 08:23:23 +01:00
Claude
7d4b95f342 Improve serveradmin.xml error logging - show all attempted paths 2025-11-24 07:22:47 +00:00
ecv
04c450c193 Merge remote-tracking branch 'origin/claude/add-local-storage-muted-01MeqMQ9SBBLZrfcAEudhk92' into claude/add-local-storage-muted-01MeqMQ9SBBLZrfcAEudhk92
# Conflicts:
#	Harmony/BotCommandPatch.cs
#	ModInfo.xml
2025-11-24 08:06:07 +01:00
Claude
c4b8e4395c Add local storage for muted players and serveradmin.xml integration
**MuteStorage (JSON Persistence)**:
- Added persistent storage in CHRANIBotTNG/Data/muted_players.json
- Auto-loads muted players on mod init
- Auto-saves on mute/unmute operations
- Thread-safe file operations
- Simple JSON serialization without external dependencies

**AdminManager (serveradmin.xml Integration)**:
- Reads serveradmin.xml to load admin SteamIDs (permission_level < 1000)
- Auto-discovers serveradmin.xml location in common paths
- Caches admin list in memory for fast permission checks
- Supports /bot reload command to refresh admin list

**Updated Commands (Admin-only)**:
- /bot mute <player> - Now requires admin permission and persists
- /bot unmute <player> - Now requires admin permission and persists
- /bot mutelist - List all muted players (admin-only)
- /bot reload - Reload serveradmin.xml (admin-only)

**Build System**:
- Added System.Xml.dll and System.Xml.Linq.dll references

All features integrate seamlessly with existing codebase structure.
2025-11-24 07:04:40 +00:00
Claude
be794bcbe9 Add local storage for muted players and serveradmin.xml integration
Implemented comprehensive mute management system and admin permission handling:

**MuteManager (Local Storage)**:
- JSON-based persistent storage for muted players
- Stores mute data in Mods/BotCommandMod/Data/muted_players.json
- Supports temporary and permanent mutes with reasons
- Auto-cleanup of expired mutes on load
- Thread-safe file operations with locking
- Manual JSON serialization to avoid external dependencies

**AdminPermissionManager**:
- Reads serveradmin.xml to load admin users (permission_level < 1000)
- Auto-discovery of serveradmin.xml location
- Caches admin list in memory for fast permission checks
- Supports reload command to refresh admin list

**Chat Command System**:
- Harmony patch on ChatCommandManager.ProcessCommand
- Blocks chat/commands from muted players with informative messages
- New /bot commands for admins:
  - /bot mute <player> [minutes] [reason] - Mute a player
  - /bot unmute <player> - Unmute a player
  - /bot mutelist - List all muted players
  - /bot admins - Show all loaded admins
  - /bot reload - Reload serveradmin.xml

**Build System**:
- Added System.Xml.dll and System.Xml.Linq.dll references for XML parsing

All features are fully functional and ready for testing.
2025-11-24 06:40:26 +00:00
ecv
056ea86566 put the dll in a proper folder 2025-11-23 21:57:15 +01:00
Claude
c7b93dc0a8 Add mute/unmute functionality for chat
- /bot mute {id} - mutes player by EntityID, SteamID, or name
- /bot unmute {id} - unmutes player
- Muted players' messages blocked in-game but visible in telnet
- All /bot commands only visible in telnet
2025-11-23 20:34:29 +00:00
Claude
96d535633a Clear recipients instead of blocking - allow server logging 2025-11-23 19:54:53 +00:00
Claude
2aca59b25e Use Console.WriteLine instead of non-existent Log.Out 2025-11-23 19:53:50 +00:00
Claude
1217cc30be Use Log.Out to write chat message to telnet-visible server log 2025-11-23 19:50:39 +00:00
Claude
4641764819 Simplify patch signature - only use needed parameters 2025-11-23 19:45:10 +00:00
Claude
4a7fc2c3ec Implement ChatMessageServer patch with correct signature
Intercepts /bot messages and logs to console only
2025-11-23 19:39:06 +00:00
Claude
c92100329f Revert ModInfo.xml to original format 2025-11-23 19:36:47 +00:00
Claude
f12fc20b3e Add introspection to discover Chat methods and fix ModInfo V2 format 2025-11-23 19:27:09 +00:00
ecv
aa713a093a update damit claude mir nicht immer meinen mod-namen ruiniert. 2025-11-23 20:23:53 +01:00
Claude
41517582a7 Add reflection to discover available Chat methods 2025-11-23 19:20:52 +00:00
Claude
1ee6f45f70 Try ChatCommandManager.ProcessCommand instead 2025-11-23 19:17:37 +00:00
Claude
9bd4ab35c5 Update ModInfo.xml to V2 format for 7DTD 2.4 2025-11-23 19:02:29 +00:00
Claude
ccc831218d Add required DisplayName field to ModInfo.xml 2025-11-23 18:58:06 +00:00
Claude
e6ab02aa86 Fix ModInfo.xml format - remove outer xml tag 2025-11-23 18:39:03 +00:00
Claude
b41951e4e1 Patch GameManager.ChatMessage instead of ChatMessageServer
This should properly intercept and block /bot messages from appearing in chat
2025-11-23 18:18:23 +00:00
Claude
6e856a6216 Switch from mcs to csc compiler with nostdlib
Use Roslyn compiler (csc) instead of old mcs to avoid netstandard 2.1 conflicts
2025-11-23 17:51:27 +00:00
Claude
81781835be Use Console.WriteLine instead of Log.Out
Remove unnecessary empty patch class
2025-11-23 17:49:59 +00:00
Claude
618c3b6c35 Remove unnecessary assembly references from build script
Only reference game-specific DLLs, let Mono provide system libraries
2025-11-23 17:47:08 +00:00
Claude
8cdd933d35 Fix build script and API usage
- Add all required assembly references (mscorlib, netstandard, System.dll, System.Core.dll)
- Use GameManager.ChatMessageServer instead of NetPackageChat
- Use Log.Out (proper 7DTD API) instead of Debug.Log
2025-11-23 17:44:58 +00:00
Claude
79718c0acd Fix compilation errors - use correct 7DTD APIs
- Use NetPackageChat instead of non-existent ChatCommandManager
- Use Debug.Log instead of Log.Out
- Add UnityEngine namespace
2025-11-23 17:41:37 +00:00
Claude
8495249cb1 Add build script for command line compilation 2025-11-23 17:19:24 +00:00
Claude
d344ea0e1c Add basic bot command mod
- Intercepts chat messages starting with /bot
- Logs them to telnet only
- Prevents display in game chat
2025-11-23 17:15:09 +00:00