Requirements
- ShadowBot - Generates the link codes players use in game
- MySQL Database - The same database ShadowBot writes to
Features
- Discord to In-Game Linking - Ties a player's Discord account to their EOS ID with a single chat command
- Code Based Verification - The player claims a code ShadowBot issued them, so nothing has to be typed by an admin
- ShadowBot Integration - The bot hands out codes, the plugin redeems them, both sides share one database
- Styled Notifications - Every reply is an on-screen banner with its own text colour, background colour, size, duration, screen position and an optional copy to chat
- Per-Message Styling - All four replies are configured separately, so a successful link can be green while a failure is red
- Chat Fallback - If the notification mod isn't there, the reply drops back to normal chat so the player is never left guessing
- One Link Per Account - The database enforces one Discord account per EOS ID and one EOS ID per Discord account
- Commented Config - The config file supports
//comments, so you can leave notes right next to your settings
How It Works
- Player asks ShadowBot for a link code in your Discord link channel
- ShadowBot generates the code and stores it against their Discord account
- Player hops in game and runs the chat command with that code
- Plugin looks the code up, writes the link, and tells the player how it went
Example Usage
Pair it with SHOpenControl and unlinked players simply can't use drops, obelisks or transmitters, which shuts down map travel until they've linked. Once ShadowBot syncs the linked role back in game they get access automatically. Because every reply is styled separately, a player who fumbles their code sees an amber banner telling them to grab a fresh one from Discord, while a clean link flashes green.
Command
| Command | Description ||---------|-------------|
|
/ShadowLink <code> | Links your Discord account using the code ShadowBot gave you |
Configuration
Code:
// ShadowLink config - // comments are allowed.
{
"MySql": { // Shared with ShadowBot: it writes LinkCodes, this plugin reads them.
"host": "",
"username": "",
"password": "",
"database": "",
"port": 3306
},
// The four replies. Each is its own banner - omit any field and the built-in default is used.
// Colours: #RRGGBB or #RRGGBBAA. Position/Justification: Left | Center | Right.
"messages": {
"success": { // Link written away successfully.
"message": "Successfully linked your discord account to ark!",
"backgroundColor": "#000000CC", // #RRGGBBAA or #RRGGBB; AA omitted = opaque
"textColor": "#55FF55FF",
"textScale": 1.3,
"displaySeconds": 10.0, // how long the banner stays on screen
"textJustification": "Center", // Left | Center | Right only - no Top/Bottom
"screenPosition": "Center", // Left | Center | Right only - no Top/Bottom
"alsoSendToChat": true // mirror the banner into chat as well
},
"alreadyLinked": { // This player is already linked.
"message": "You are already linked to discord!",
"backgroundColor": "#000000CC",
"textColor": "#FFD700FF",
"textScale": 1.3,
"displaySeconds": 10.0,
"textJustification": "Center",
"screenPosition": "Center",
"alsoSendToChat": true
},
"codeNotFound": { // No code matched what the player typed.
"message": "Link code not found... Please get one from the link channel in our discord!",
"backgroundColor": "#000000CC",
"textColor": "#FFD700FF",
"textScale": 1.3,
"displaySeconds": 12.0,
"textJustification": "Center",
"screenPosition": "Center",
"alsoSendToChat": true
},
"failed": { // Code was found but the link couldn't be saved - usually that Discord account is already linked.
"message": "Failed to link your discord account. Please try again later.",
"backgroundColor": "#000000CC",
"textColor": "#FF5555FF",
"textScale": 1.3,
"displaySeconds": 12.0,
"textJustification": "Center",
"screenPosition": "Center",
"alsoSendToChat": true
}
}
}
Configuration Settings
| Setting | Description ||---------|-------------|
|
MySql | Connection details for the database you share with ShadowBot ||
messages | The four replies, each with its own text and banner style ||
success | Shown when the account is linked ||
alreadyLinked | Shown when that player already has a link ||
codeNotFound | Shown when the code doesn't match anything ||
failed | Shown when the code was found but the link couldn't be saved |
Message Styling
message- the text the player seestextColor/backgroundColor- hex,#RRGGBBor#RRGGBBAA(theAAis opacity)textScale- size of the textdisplaySeconds- how long the banner stays on screentextJustification/screenPosition-Left,CenterorRightalsoSendToChat- also drop the message into chat- Leave any field out and it falls back to the built-in default, so you only need to set what you actually want to change
Notes
- The styled banners use the free AsaApiUtils mod - make sure it is installed on your server. If it isn't, linking still works, the reply just arrives in chat instead of as a banner.
- The database must be the same one ShadowBot is using, otherwise the plugin will never find any codes
- Both tables are created automatically on first start, so there is nothing to import by hand
- A player can only hold one link at a time, and a Discord account can only be attached to one EOS ID - claiming a second code just returns the "already linked" reply
- To unlink someone, remove their row from the
DiscordLinkstable