Skip to content

Sm1g00l/Extended-Reforger-Presence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Rich Presence - Arma Reforger Mod

This mod enables Discord Rich Presence integration for Arma Reforger servers. It displays game information such as the server name, map, player count, and custom buttons in Discord.

⚠️ Important: External Companion App Required

Due to Enfusion engine sandbox restrictions, the game cannot directly communicate with Discord. This mod sends HTTP requests to a local companion application running on http://127.0.0.1:7453 that handles the actual Discord API integration.

You must develop or use an external companion application that:

  1. Listens on http://127.0.0.1:7453 with /endpoint/update
  2. Communicates with Discord's Rich Presence API automatically

How It Works

  1. Server loads Discord configuration from the mission header (SCR_MissionHeaderCampaign) either through json
  2. Server broadcasts config to all clients via RPC when they join
  3. Client receives config and starts sending presence updates every 60 seconds
  4. Companion App receives HTTP requests and updates Discord Rich Presence

Installation

For Server Administrators

  1. Add this mod to your server's mod list
  2. The mod automatically extends SCR_MissionHeaderCampaign and SCR_BaseGameModeComponent which hooks when a player has registered
  3. Configure Discord settings in your scenario's Mission Header via Workbench or json config file

Mission Header Configuration

In your scenario's Mission Header (via Workbench or .json config server file):

"missionHeader": {
    "m_sDiscordApplicationId": "YOUR_DISCORD_APP_ID",
    "m_sDiscordServerName": "Your Server Display Name",
    "m_sDiscordLargeImage": "your-asset-key",
    "m_sDiscordButton1Label": "Join Discord",
    "m_sDiscordButton1Url": "https://discord.gg/yourserver"
}

For Players

Players must run the companion application alongside Arma Reforger for Discord Rich Presence to work. The companion app must be running!

File Structure

scripts/Game/GameMode/
├── SCR_DiscordRPMissionHeader.c  - Modded SCR_MissionHeaderCampaign with Discord config attributes
├── SCR_DiscordRPComponent.c      - Modded SCR_BaseGameModeComponent with presence logic
├── DRP_PresenceData.c            - DTO classes for JSON serialization
└── DRP_RestCallback.c            - REST API callback handler

Configuration Options for Server Administrators

Attribute Description Default
m_sDiscordApplicationId Your Discord Application ID from Developer Portal 1439420693199716434
m_sDiscordServerName Display name shown as "state" in Discord Mission name
m_sDiscordLargeImage Asset key for large image (uploaded to Discord) south-america-servers
m_sDiscordButton1Label Button label (max 32 characters) Empty (no button)
m_sDiscordButton1Url Button URL (must be valid http/https) Empty

Technical Details

Network Architecture

  • Configuration is stored server-side in the Mission Header
  • Config is replicated to clients via RplRpc(RplChannel.Reliable, RplRcver.Broadcast)
  • Only clients send HTTP requests to the companion app (not the server and not to private servers)
  • Update interval: 60 seconds (DRP_UPDATE_INTERVAL_MS)

Data Sources

Where the mod retrieves data for Discord Rich Presence from within the game:

Data Source
Server Name ServerInfo.GetName()
Player Count PlayerManager.GetPlayerCount()
Max Players ServerInfo.GetPlayerLimit()
Map Name m_sDiscordServerName or MissionHeader.m_sName

Debugging

Debug output is printed to the game console (access via log file):

  • [DiscordRP] Client initialized successfully - REST context created
  • [DiscordRP] Received Discord config via RPC - Config received from server
  • [DiscordRP] POST http://127.0.0.1:7453/endpoint/update - Sending update
  • [DiscordRP] UPDATE request SUCCESS - Companion app responded
  • [DiscordRP] UPDATE request FAILED with error code: X - HTTP error

Common Issues

Issue Cause Solution
No presence update Companion app not running Start companion app before joining server, and check if it's waiting for Arma Reforger and displaying the port in CLI
"Waiting for config" in logs RPC not received yet Wait a few seconds, config should arrive. If not, check with server admin - something may be wrong with the server instance
HTTP error code Companion app issue Check companion app logs - there may be a bug in the engine that's throwing multiple requests at the same time

License

This mod is provided as-is for the Arma Reforger community so that everyone can help develop it or contribute to extend it beyond what we can do alone.

This project is licensed under the APL-SA (Arma Public License Share Alike). This means:

  • You can freely use, modify, and redistribute this mod
  • Attribution required - You must credit the original author
  • Non-commercial only - Cannot be used for commercial purposes
  • Arma games only - Cannot be adapted for other games
  • 🔄 Share Alike - Any modifications must be released under the same APL-SA license

See the license flowchart to understand which Bohemia Interactive license applies to your use case.

No warranty is provided. Use at your own risk.

© 2025 Sm1g00l

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages