Commit Graph

414 Commits

Author SHA1 Message Date
SpudGunMan 6c078b4d17 Survey Says!
is this cool?
2025-10-07 22:39:08 -07:00
SpudGunMan 48a57e875f QuizMaster
let me know if this is cool
2025-10-07 17:48:22 -07:00
SpudGunMan 6c27b5d5de xoxo
enhance
2025-10-06 18:03:22 -07:00
SpudGunMan a31fa90942 Update system.py 2025-10-06 14:57:40 -07:00
SpudGunMan a9da8336cc enhance 2025-10-06 14:40:08 -07:00
Kelly 42e07d44e6 Merge pull request #198 from martinbogo/feature/tictactoe-game
Feature/tictactoe game
2025-10-06 14:11:23 -07:00
SpudGunMan ae1a3040b5 patches
dont need no stinking patches. thanks again.
2025-10-06 12:54:41 -07:00
Martin Bogomolni 84b6b48d60 feat: Add tic-tac-toe game with compact messaging
🎮 New Tic-Tac-Toe Game Features:
- Compact 3x3 board display using ASCII art
- Smart AI opponent with win/block/random strategy
- All messages under 200-character meshtastic limit (tested: 10-50 chars)
- Player vs Bot gameplay with X (player) vs O (bot)
- Win detection for rows, columns, and diagonals
- Tie game detection when board is full
- Game statistics tracking (games played, won)

🔧 Integration Features:
- Follows established game patterns from hangman/hamtest
- Added to restrictedCommands (DM-only like other games)
- Integrated with game tracker system for memory cleanup
- Added configuration option in config.template
- Automatic cleanup of stale game sessions

🎯 Game Mechanics:
- Players pick positions 1-9 corresponding to board layout
- Simple input parsing (extracts first digit from message)
- Graceful error handling for invalid moves
- 'end' command to quit game
- Automatic game cleanup on completion

📊 Message Examples:
- New game: 39 chars
- Game moves: 50 chars
- Win/lose: 40 chars
- Invalid move: 23 chars
- All well under 200-char limit

Tested: Complete game scenarios, AI behavior, message lengths
Follows: Existing game implementation patterns and memory management
2025-10-06 00:08:56 -07:00
Martin Bogomolni 9f3446b605 feat: Implement comprehensive memory management and stability improvements
🔧 Memory Management Enhancements:
- Add memory cleanup constants (MAX_CMD_HISTORY=1000, MAX_SEEN_NODES=500, MAX_MSG_HISTORY=100)
- Implement cleanup_memory() function to prevent unbounded list growth
- Add periodic cleanup every hour via watchdog process
- Clean up stale game tracker entries automatically
- Limit cmdHistory and msg_history sizes to prevent memory bloat

🚀 Async Task Management Improvements:
- Fix async task management in both mesh_bot.py and pong_bot.py
- Implement proper task cleanup and cancellation on shutdown
- Add task names for better debugging and monitoring
- Use asyncio.gather() with return_exceptions=True for better error handling
- Prevent task hanging and resource leaks

🛡️ Enhanced Resource Management:
- Improve exit_handler() with proper interface cleanup
- Add atexit.register() for automatic graceful shutdown
- Ensure all meshtastic interfaces are properly closed
- Save persistent data (BBS, email, SMS, game scores) on exit
- Perform final memory cleanup during shutdown

🔍 Better Exception Handling:
- Replace bare except: blocks with specific exception handling
- Add proper error logging throughout the codebase
- Improve BBS database operations with better error recovery
- Add try/catch blocks for file operations and imports

📈 System Stability Improvements:
- Prevent memory leaks from growing lists and dictionaries
- Add automatic cleanup of stale player tracking data
- Improve error recovery in watchdog and async loops
- Better handling of interface connection failures

These changes address critical memory management issues that could cause
the bot to consume increasing memory over time, eventually leading to
system instability. The improvements ensure long-term reliability and
better resource utilization.

Fixes: Memory leaks, async task hanging, resource cleanup issues
Improves: System stability, error handling, resource management
Tested: Code analysis and review completed
2025-10-05 23:45:40 -07:00
SpudGunMan 10add3147d Update system.py 2025-10-05 23:10:23 -07:00
SpudGunMan 4e074a309f Update system.py 2025-10-05 23:05:55 -07:00
SpudGunMan f394f58b9f paxCounter 2025-10-05 22:30:03 -07:00
SpudGunMan 5c54ce0b70 better waypoint data 2025-10-05 21:50:56 -07:00
SpudGunMan b4684f49ff Update system.py 2025-10-05 21:38:19 -07:00
SpudGunMan c6c1e9f637 refactor more consumeMetadata 2025-10-05 21:13:39 -07:00
SpudGunMan 0578c0b233 more enhancing metadata 2025-10-05 19:00:34 -07:00
SpudGunMan 98ccf8708f enhanceTelemetry
logging and handlers for telemetry
2025-10-05 17:47:19 -07:00
SpudGunMan 1a49a81cf5 load_bbsdb with 'api'
allows for ssh file synch?
2025-10-04 12:54:20 -07:00
SpudGunMan c51a4584ae enhance bbsAPI
switch for diskIO
2025-10-03 19:06:14 -07:00
SpudGunMan 13ee6d4fd6 enhance bbsDM
enable a new 'API' to inject into the pkl file for DM's also see https://github.com/SpudGunMan/meshing-around/commit/2d44faac98bb977d9b3b9f840ca4dfbec71af3dc
2025-10-03 19:02:15 -07:00
SpudGunMan c23564d8b5 Update system.py 2025-10-02 19:37:57 -07:00
SpudGunMan 2e8206d4ec x:ShellCommands
this x: is a direct shell access from DM, to enable it needs the enable_runShellCmd, allowXcmd, xcmdChannel set. Make sure your secure.
2025-10-02 18:58:27 -07:00
SpudGunMan 02322cdf91 cleanup
fixes per https://github.com/SpudGunMan/meshing-around/issues/192
2025-10-02 04:51:40 -07:00
SpudGunMan f9ab6a79d3 echo
echo command will just echo, off by default its handy for things like making a demo or node speak
2025-09-28 15:04:56 -07:00
SpudGunMan 47e0276f0c howtall
returns height of something you give a shadow by using sun angle
2025-09-26 19:23:12 -07:00
SpudGunMan aa051abbd4 better Logic for handler 2025-09-26 15:54:51 -07:00
SpudGunMan 8ba0c6f14c Update system.py 2025-09-26 15:47:51 -07:00
SpudGunMan adb6fa3b5a Update system.py 2025-09-26 15:36:49 -07:00
SpudGunMan a9254c9c79 addFav
Helper Script to Add Favorite to the bot node for admin and other use
2025-09-26 15:32:24 -07:00
SpudGunMan 99acaf28a1 Update system.py 2025-09-24 15:14:17 -07:00
SpudGunMan d9ab1b88c1 Update system.py 2025-09-24 15:10:26 -07:00
SpudGunMan ea47bf9329 bugfix parser
thanks again Iris!
2025-09-19 09:32:53 -07:00
Kelly a39f588f9f Merge pull request #188 from SpudGunMan/lab
Noisy Telemetry
lost work on location data
2025-09-17 11:52:50 -07:00
SpudGunMan 4e91801cb9 Update system.py
reset alerts
2025-09-17 10:55:30 -07:00
SpudGunMan 38d5006236 Update system.py 2025-09-16 17:24:55 -07:00
SpudGunMan 642738e3b6 noisyNodeLogging
telemetry logger idea
2025-09-16 17:09:47 -07:00
SpudGunMan d589d3e155 Update system.py 2025-09-11 18:00:42 -07:00
SpudGunMan e5d2ea4bcb Update system.py 2025-09-10 19:24:44 -07:00
SpudGunMan 2596d133fd Update system.py 2025-09-10 19:23:08 -07:00
SpudGunMan dcabfc0f50 Update system.py 2025-09-10 19:00:37 -07:00
SpudGunMan 2eca5f644a add aircraft lookup to highFlying info
@Cisien for the idea
2025-09-10 18:58:33 -07:00
SpudGunMan 3f90a7fc39 dedupe emergency alerts
double check we didnt already send the message here it could be duplicated elsewhere
2025-09-10 18:06:43 -07:00
sodoku f7f127590d fix: wrong variable use 2025-09-10 18:41:45 +02:00
SpudGunMan 19935d9f08 howfar
initial idea goofin to see if this works
2025-09-07 19:12:57 -07:00
SpudGunMan b276bbb40a rlist command in help 2025-08-31 19:47:59 -07:00
SpudGunMan 3df16b7626 Update system.py 2025-08-29 17:25:51 -07:00
SpudGunMan 8c01433d14 🚨fixes/enhancments
better multi network control of alerts and 🪫 alert to mesh
2025-08-27 12:10:38 -07:00
SpudGunMan 3b41e39ff5 Update system.py 2025-08-26 14:09:23 -07:00
SpudGunMan 50c3249edc explicitCmd
i think @NomDeTom mentioned this a long time ago and well .. here is a change to help the phases of the moon and tide.
2025-08-26 10:44:30 -07:00
SpudGunMan 9272218815 Update system.py
i declare
2025-08-17 20:05:41 -07:00