Skip to content

Commit

Permalink
2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
FAXES authored Sep 17, 2020
1 parent a511d3d commit 2941ee7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Hate updating those ACE Permission white-lists? Well just use Discord! Now you can give thanks to this script, and @Illusivee’s. So keep white-lists easy and breezy. This script checks the connecting players Discord roles and checks whether they have the specified role.

**Documentation:**
- [Discord Whitelist Setup](https://docs.faxes.zone/docs/discord-whitelist-setup)
- [FAXES Documentation Site](https://docs.faxes.zone/docs)
- [FAXES ACE Permission Documentation](https://docs.faxes.zone/docs/aceperms)
- [Getting Your Steam Hexadecimal](https://docs.faxes.zone/docs/getting-your-steam-hex)
Expand Down
14 changes: 13 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@

/// Config Area ///

var whitelistRoles = [
var whitelistRoles = [ // Roles by ID that are whitelisted.
"333908428995035137"
]

var blacklistRoles = [ // Roles by Id that are blacklisted.
"333908428995035137"
]

var notWhitelistedMessage = "You're Not Whitelisted. This sever is whitelisted and requires access to join."
var noGuildMessage = "Guild Not Detected. It seems you're not in the guild for this community."
var blacklistMessage = "You're blacklisted from this server."
var debugMode = false

/// Code ///
Expand All @@ -30,6 +36,12 @@ on('playerConnecting', (name, setKickReason, deferrals) => {
}
setTimeout(() => {
if(identifierDiscord) {
exports['discordroles']['isRolePresent'](src, blacklistRoles, function(hasRole, roles) {
if(hasRole) {
deferrals.done(blacklistMessage);
if(debugMode) console.log(`^5[DiscordWhitelist]^7 '${name}' with ID '${identifierDiscord.replace('discord:', '')}' is blacklisted to join this server.`)
}
})
exports['discordroles']['isRolePresent'](src, whitelistRoles, function(hasRole, roles) {
if(!roles) {
deferrals.done(noGuildMessage)
Expand Down

0 comments on commit 2941ee7

Please sign in to comment.