Cooldude2606andClaude Opus 5.5 32831e7490 Add exp_discord_sync for Discord role sync (#526)
* Add exp_discord_sync to give linked players Discord roles

New controller plugin that maps clusterio roles to Discord roles and gives them to players linked through exp_discord_auth. The mapping is edited in a Discord Roles section on the role page, which needs the new exp_discord_sync.mapping.update permission. The guild's roles fill a dropdown, and typing a role ID still works when the bot can't list them.

Discord is reached with Node's fetch and WebSocket, no library. REST requests go one at a time and wait out 429 and exhausted rate limits. A minimal gateway connection with the Server Members intent gives roles on guild join. It identifies again instead of resuming, and every READY syncs all linked accounts, which covers startup and joins missed while disconnected. Without the intent the gateway is dropped and syncing carries on over REST.

Syncs run on link, unlink, clusterio role change, guild join, mapping change and connect. Only mapped Discord roles are ever added or removed.

exp_discord_auth may load after this plugin, so it is looked up and its hooks attached when the first sync runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Wait for exp_discord_auth with plugins.waitFor

Clusterio 2.1.2 loads plugins concurrently and lets them wait for each
other, so exp_discord_sync gets exp_discord_auth in its entrypoint and
attaches the link hooks there instead of looking it up on the first
sync. Without exp_discord_auth it logs an error and does not connect.

DiscordAuth.get() and its WeakMap had no other users and are removed,
the README shows waitFor instead. The sync tests load both plugins
through lib.PluginLoader with sync listed first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address review of exp_discord_sync

- DiscordRest and DiscordGateway are made in fromContext and passed to
  the constructor. Both read the token from config, and guildId is a
  getter over config, so the plugin has no nullable bot state.
- DiscordGateway is an EventEmitter and the plugin listens with bound
  methods (onGatewayReady, onGatewayDispatch, onGatewayFatalClose,
  onLinkChanged).
- Private members start with an underscore.
- DiscordGateway has an explicit state (stopped, connecting,
  identifying, ready, waiting) and _setState throws on a transition not
  in the table. Errors while handling a gateway message are logged so
  a failed assert can't take down the controller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:24:44 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2026-11-21 16:00:40 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2026-11-14 23:18:21 +00:00
2024-11-19 22:17:25 +00:00
2026-08-08 21:58:46 +01:00
2026-08-20 22:02:51 +00:00
2026-10-28 23:43:25 +00:00
2024-12-24 20:50:48 +00:00
2024-11-19 21:51:13 +00:00
2024-12-24 20:50:48 +00:00
2024-12-24 20:50:48 +00:00
2026-09-12 01:10:02 +01:00

logo
Release Downloads Star Fork Discord

ExpGaming Clusterio Repository

Explosive Gaming

Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games with similar themes. We are best known for our weekly reset Factorio server with a vanilla+ scenario where we add new features and mechanics that are balanced with base game progression. Although our servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our website, discord, or the public server list with the name ExpGaming.

Installation

This is a plugin collection for Clusterio which implements all our scenario features.

To use this plugin you must have a clusterio instance running, see here for clusterio installation instructions.

These plugins can then be installed via npm install or using npx clusteriocontroller plugin install. See our plugin list for all the plugins which are available.

Building from source

  1. Create a external_plugins directory within your clusterio instance.
  2. Clone this repository into that directory: git clone https://github.com/explosivegaming/ExpCluster
  3. Install the package dev dependencies: pnpm install (pnpm is recommended over npm)
  4. Add supported plugins will be loaded on next controller / host restart.

Plugins

Each plugin has a readme in its folder with its config, permissions and API.

Plugin Description
Scenario (@expcluster/scenario) The ExpGaming scenario. Adds the commands, guis and control modules, each feature configurable from the web interface.
Roles (@expcluster/roles) Mirrors clusterio roles into the game, and grants roles by online time.
Permission Groups (@expcluster/permission-groups) Syncs Factorio permission groups, and puts players in a group based on their roles.
Player Statistics (@expcluster/player-statistics) Counts statistics such as kills and machines built for each player, across every server.
Reports (@expcluster/reports) Lets players report each other in game or from the web interface, with optional Discord and JSON webhooks.
Server List (@expcluster/server-list) Shares the details of every instance with the others, for the server list in game.
Discord Auth (@expcluster/discord-auth) Log in to the web interface with Discord, and link Factorio accounts to a Discord account.
Discord Sync (@expcluster/discord-sync) Gives linked players the Discord roles mapped to their clusterio roles.
Auto Restart (@expcluster/auto-restart) Restarts hosts, and optionally the controller, that need a restart once nobody is playing on them.
Server UPS (@expcluster/server-ups) Shows the UPS the server is running at, toggled with /server-ups.
Commands (@expcluster/lib_commands) Lua library for commands with typed arguments, aliases and permission checks.
GUI (@expcluster/lib_gui) Lua library for defining guis and the toolbar.
Module Utilities (@expcluster/lib_util) Lua library with storage, tasks spread over ticks, selection tools and other helpers.

The last three are libraries the other plugins use. The scenario needs Roles, Reports, Server List, Player Statistics and the three libraries, and seeding its roles also needs Permission Groups.

Contributing

See Contributing for how to make pull requests and issues.

Details of the scenario can also be seen on Wiki.

For the locale, access to Translation.

translation status

Releases

Release* Release Name Factorio Version**
7.0.2 Clusterio Plugin (Release) 2.1.22
7.0 Clusterio Plugin (Beta) 2.1.7
6.4 Farewell Factorio 1.1 1.1.110
6.3 Feature Bundle 2: Electric Boogaloo 1.1.101
6.2 Mega Feature Bundle 1.1.32
6.1 External Data Overhaul 1.0.0
6.0 Gui / 0.18 Overhaul 0.18.17
5.10 Data Store Rewrite 0.17.71
5.9 Control Modules and Documentation 0.17.63
5.8 Home and Chat Bot 0.17.47
5.7 Warp System 0.17.47
5.6 Information Guis 0.17.44
5.5 Gui System 0.17.43
5.4 Admin Controls 0.17.32
5.3 Custom Roles 0.17.28
5.2 Quality of life 0.17.22
5.1 Permission Groups 0.17.13
5.0 0.17 Overhaul 0.17
4.0 Softmod Manager 0.16.51
3.0 0.16 Overhaul 0.16
2.0 Localization and clean up 0.15
1.0 Modulation 0.15
0.1 First Tracked Version 0.14

* Scenario patch releases have been omitted and can be found here.

** Factorio versions show the version they were made for, often the minimum requirement to run the scenario.

License

The Explosive Gaming codebase is licensed under the MIT

S
Description
No description provided
Readme MIT
16 MiB
0 Stars 1 Watchers 0 Forks
Languages
Lua 67.2%
TypeScript 21.9%
JavaScript 10.9%