Kappasaurus submitted a new resource:
Group Limits - Limits groups based on authorization.
Read more about this resource...
Group Limits
Limits groups based on authorization.
Total Downloads: 1,648 - First Release: Jun 5, 2017 - Last Update: Jun 30, 2017
- 5/5, 6 likes
-
Hey Kappa, thanks for the plugin!
Is there any chance you might be willing to implement Oxide | PushAPI support? As I don't have a means of running a Discord bot at the moment, and I'd love to be able to make better use of your plugin.
Also, I don't seem to be getting any sort of ingame notifications. I have admin permissions and also granted my own oxide group the notify permission, but still nothing. I see that people are authorizing over my set group limit as I see the Discord error in my console when they do it, but it doesnt send anything ingame.Last edited by a moderator: Jun 7, 2017 -
-
I don't have anything else that uses the Discord API so I am assuming that this error is being triggered by your plugin.
(12:45:08) | [Discord] Discord Api responded with 401: {"code": 0, "message": "401: Unauthorized"}
(12:45:08) | [Discord] Discord Api responded with 401: {"code": 0, "message": "401: Unauthorized"}
And this is how my config is setup.
{
"Discord notifications": true,
"Enforce limits": false,
"Group limit": 4,
"Notify players": false,
"Notify staff": true,
"Slack notifications": false
} -
I haven't had issues with Discord, however I'd recommend taking a look at this. RustPlugins/src/RustPlugins/Discord at master · seanbyrne88/RustPlugins · GitHub. As for the notifications, this is the block of code which notifies admins/people with the permission.
Code:if (notifyStaff) { foreach (var target in BasePlayer.activePlayerList.Where(x => HasPerm(player, "grouplimits.notify"))) PrintToChat(target, lang.GetMessage("Staff Message", this, target.UserIDString).Replace("{playerName}", player.displayName).Replace("{steamID}", player.UserIDString)); }
[DOUBLEPOST=1497125838][/DOUBLEPOST]So, this is likely the issue you're having. The exclude permission is grouplimits.exclude, admins are automatically excluded. This is what it looks like when I remove the admin check and don't have the exclude permission. Gyazo - 688f4347a0db2f0bd0444b4536c9138b.gifLast edited by a moderator: Jun 11, 2017 -
@Kappasaurus Any chance you could allow it to work with DiscordMessages for Rust | Oxide message function?
Thanks -
I got a Discord bot setup, and the messages send fine to my Discord server now. But neither myself, nor any admins get any notification ingame when somebody breaks the group limit, still only in Discord. And the other issue is that the plugin detects somebody breaking the auth limit, even if they are just failing on a code lock. Causes a ton of false positives when people are just trying to guess door codes.
-
-
Kappasaurus updated Group Limits with a new update entry:
1.0.1
-
Can I recommend adding
Code:On server | {ConVar.Server.hostname}
-
Kappasaurus updated Group Limits with a new update entry:
1.0.2
-
Kappasaurus updated Group Limits with a new update entry:
2.0.0
-
thanks for this plugin, it's perfect for my duo-max server. after this new update however, my logs are filled with:
logMessage
logMessage
logMessage
etc.
all good though, i just reverted back to 1.0.2 and i'll keep an eye on this - just posting here in case it's a problem with the plugin, and not just something i've done -
@Kappasaurus can you add sleeping bag counts as well?
This should get you started.
Code:List<ulong> GetDistinctSleepingBags(Vector3 position) // get each bag placed in a specific area and only return the distinct amount of bags (ignoring duplicates) { var colliders = Pool.GetList<Collider>(); Vis.Colliders(position, 25f, colliders, LayerMask.GetMask("Deployed"), QueryTriggerInteraction.Collide); var bags = colliders.Where(collider => collider.gameObject.ToBaseEntity().ShortPrefabName.Equals("sleepingbag_leather_deployed")).Select(collider => collider.gameObject.ToBaseEntity()).Cast<SleepingBag>(); var list = new List<ulong>(); foreach (var bag in bags) if (!list.Contains(bag.deployerUserID)) list.Add(bag.deployerUserID); Pool.FreeList<Collider>(ref colliders); return list; } object CanAssignBed(SleepingBag bag, BasePlayer player, ulong targetPlayerId) { var bagIds = GetDistinctSleepingBags(player.transform.position); if (bagIds.Count > 5 && !bagIds.Contains(targetPlayerId)) return false; return null; }
Last edited by a moderator: Jun 30, 2017 -
Kappasaurus updated Group Limits with a new update entry:
2.0.1
[DOUBLEPOST=1498844181][/DOUBLEPOST] -
I don't want more than X players being able to put sleeping bags down within the same compound. Obviously, this code doesn't do that, but it's one step closer to prevent players from bypassing the group limit.
GetDistinctSleepingBags gets all unique sleeping bag users within 25 meters of the bag being assigned. If it exceeds 5 (which should be Configuration.MaxPlayers) then the bag assign is rejected.
With some work, you could make this to where your group limit couldn't be bypassed with the exception of teleporting in. That could also be handled by using the canTeleport(BasePlayer player) and CanTeleport(BasePlayer player) hooks -
-
-
I have setup a discord bot and I don't get any errors but the Bot stays offline and never sends a message to my discord.
// Discord.json config:
{
"BotToken": "xxxxxxxxxxxxxxxxxx.clXqmLjLBpRiQlABGttqDbVxxxx",
"ChannelID": xxxx9453318155xxx
}
And yes, I have enabled notification to discord in the GroupLimits.json file. -