Redis Communication Protocol
Overview
Section titled “Overview”BharatMC uses Redis Pub/Sub and Key-Value caching to link backend web apps, Discord bots, the Velocity proxy, and backend game instances.
Active Channels & Message Formats
Section titled “Active Channels & Message Formats”1. Store Commands Execution
Section titled “1. Store Commands Execution”- Channel:
bharatsync:commands - Direction: Web Store / API ➔ Game Servers
- Payload Structure:
{ "id": 1271, "server": "lifesteal", "player": "RoizPlayz", "command": "crate key give RoizPlayz vote 1", "require_online": true}2. Store Command Delivery Feedback
Section titled “2. Store Command Delivery Feedback”- Channel:
bharatsync:command_results - Direction: Game Servers ➔ Web Backend
- Payload Structure:
{ "id": 1271, "player": "RoizPlayz", "success": true, "timestamp": 1730210832000}Important: Once a command ID is processed by the game server, it sends a confirmation to
bharatsync:command_resultsand marks it in the in-memory cache to prevent infinite retry loops.
3. Player Network Login Notification
Section titled “3. Player Network Login Notification”- Channel:
bharatsync:player_login - Direction: Game Server ➔ Web API / Redis Queue
- Purpose: Triggers delivery of offline pending store purchases or votes as soon as the target user logs in.
4. Vote Event Sync
Section titled “4. Vote Event Sync”- Channel:
bharatmc:vote:event - Payload:
{ "player": "PlayerName", "service": "TopG", "timestamp": 1730210900000}Triggers in-game vote party counters, reminder decrements, and reward dispatch.