Commit Graph
5 Commits
Author SHA1 Message Date
nocode 87a8b8d104 feat(scheduler): add announcement scheduler with interval and cron support
Implement BladW.Announcement.RebuildSchedules() to manage scheduled announcements using two mechanisms:

1. Interval-based scheduling: Parse interval strings (e.g., "30m", "90s", "2h", "1d") and create repeating timers
2. Cron-based scheduling: Parse cron expressions (minute hour day month weekday) and execute on matching times

Features:
- ParseInterval() converts duration strings to seconds
- CompileCron() and CronMatches() handle cron expression parsing and matching
- Single consolidated timer monitors all cron entries with 20s tick to avoid duplicates
- Proper cleanup and hot-reload support via _timers tracking
- Validation with helpful warning messages for invalid configurations
2026-07-20 13:36:37 +02:00
nocode 783bef2438 feat(announcement): refactor announcement system with presets and improved text handling
- Add BladW namespace and module structure
- Implement LimitChars() function for UTF-8 safe string truncation
- Add Resolve() function to handle preset-based configuration merging
- Add Broadcast() function to centralize announcement distribution logic
- Update net.Receive handler to support preset system
- Add configurable announcement max length support
- Include announcement sound file registration
- Improve text validation and default values handling
2026-07-20 13:36:23 +02:00
nocode 8685d739f3 feat(bladw_announcement): add network strings for announcement system
Register three network strings for the announcement system:
- bladWOpenAnnouncementMenu: server to client for opening admin menu
- bladWSendAnnouncement: client admin to server for announcement request
- bladWShowAnnouncement: server to all clients for displaying announcements
2026-07-20 12:47:00 +02:00
nocode a476a2e017 feat(announcement): implement server-side announcement functions
Add server-side functionality for the announcement system:
- Add bladw_amenu console command to open admin announcement menu
- Add /bannonce and !bannonce chat commands for opening the menu
- Implement bladWSendAnnouncement net message handler to broadcast announcements
- Validate admin permissions and sanitize announcement content (title max 64 chars, text max 200 chars)
- Use default title "Annonce" if not provided
2026-07-20 12:46:46 +02:00
nocode 6cc464b145 feat(loader)!: implement glob pattern matching for module discovery
Replace simple prefix matching with full glob pattern support for discovering root folders.

Changes:
- Add EscapePattern() to escape Lua magic characters
- Add GlobToPattern() to convert glob patterns (e.g., "bladw_*") to Lua regex patterns
- Refactor FindRootFolders() to support:
  • Exact matches without wildcards (e.g., "bladw_announcement")
  • Glob patterns with * in prefix/suffix/middle positions
- Update default config root from "bladw_*" to "bladw_announcement"
- Improve documentation with usage examples
- Add new announcement module with client, server, and shared files
- Update rndx.lua library (formatting/whitespace changes)

BREAKING CHANGE: The root config now expects exact folder names or glob patterns instead of simple prefixes. Existing configs using "bladw_*" will still work but the matching behavior changes from prefix-only to glob-based pattern matching.
2026-07-01 16:00:44 +02:00