Skip to content

Chebato/mod tools#2288

Open
CheBato wants to merge 28 commits intomainfrom
chebato/mod-tools
Open

Chebato/mod tools#2288
CheBato wants to merge 28 commits intomainfrom
chebato/mod-tools

Conversation

@CheBato
Copy link
Copy Markdown
Collaborator

@CheBato CheBato commented Mar 12, 2026

User Management allows moderators to search for players by username or ID, view their account details and moderation history, and apply actions: Mute (timed or permanent, preventing chat usage), Warning (logged note on the player's record), and Rename (forces a username change). Active actions can be cancelled, and all actions are tracked with timestamps, duration, and the issuing moderator.

Auto-cleanup: The ModActionCache extends TimedCache and refreshes once every 24 hours in production. On each refresh it re-fetches all active mod actions from DynamoDB. Any action whose expiresAt is in the past gets dropped from the in-memory cache, silently un-muting the user on their next refresh.

Testing the cache cleanup locally:

  1. Start the local DynamoDB docker container (docker compose up dynamodb)
  2. Run the seedAdmin script to activate yourself as a moderator
  3. Set REFRESH_INTERVAL_MINUTES=5 in modActionCache
  4. In the seedModAction script, set MY_USER_ID = <your_user_id> and EXPIRES_IN_MINUTES = 2, then run it
  5. [optional] Set the ENV variable on the BE DEBUG_MOD_ACTION_CACHE=true
  6. Start the server. The seeded mute will be active. After 2 minutes it expires, and the next cache refresh (within 1 min)
  7. cleans it up. Confirm on the Mod Page that the action shows as "Expired".

FE PR: SWU-Karabast/forceteki-client#654

CheBato added 8 commits March 1, 2026 21:55
- Setup the mod tool utilities in the BE. Shemas, interfaces, endpoints etc... still a work in progress.
- Almost finished with phase 1, need to take a look at the renaming.
- added Rename so it now correctly fixes.
- finished implementation time to cleanup for review.
…mod-tools

# Conflicts:
#	server/gamenode/GameServer.ts
#	server/utils/user/UserFactory.ts
- finished implementation time to cleanup for review.
CheBato added 2 commits March 14, 2026 07:38
for SWU-Karabast/forceteki-client#556

## Phase 1
- Added field in the DB
- Added Lobby support
Comment thread scripts/seedModAction.ts Outdated
Comment thread scripts/seedModAction.ts Outdated
Comment thread server/services/DynamoDBInterfaces.ts Outdated
Comment thread server/services/DynamoDBInterfaces.ts Outdated
Comment thread server/utils/ModActionCache.ts Outdated
Comment thread server/utils/ModActionService.ts Outdated
Comment thread server/utils/ModActionService.ts Outdated
Comment thread server/utils/ModActionService.ts Outdated
Comment thread server/gamenode/GameServer.ts Outdated
Comment thread server/gamenode/GameServer.ts Outdated
@AMMayberry1
Copy link
Copy Markdown
Collaborator

Reminder to clean out the legacy code for managing mutes via daysRemaining

@CheBato
Copy link
Copy Markdown
Collaborator Author

CheBato commented Mar 30, 2026

Reminder to clean out the legacy code for managing mutes via daysRemaining

Found the function and left a TODO there to remove it after 1 month of modActions merged in

@CheBato CheBato requested a review from VJubert as a code owner April 16, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants