Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Updated code for permission group rewards to use the correct calls and not be so bound to rocket's permission provider.
  • Loading branch information
Pustalorc committed Jan 20, 2018
1 parent 2eddb3d commit 0227e8b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions FeexRanks.cs
Expand Up @@ -9,6 +9,7 @@
using System.Linq;
using UnityEngine;
using Logger = Rocket.Core.Logging.Logger;
using Rocket.Core;

namespace Freenex.FeexRanks
{
Expand Down Expand Up @@ -243,17 +244,15 @@ private void KitReward(classLevel configLevel, UnturnedPlayer player)

private void PermissionGroupReward(classLevel configLevel, UnturnedPlayer player)
{
Rocket.Core.Permissions.RocketPermissionsManager a = Rocket.Core.R.Instance.GetComponent<Rocket.Core.Permissions.RocketPermissionsManager>();
try
{
a.GetGroup(configLevel.PermissionGroupName);
}
catch (Exception)
var a = R.Permissions.GetGroup(configLevel.PermissionGroupName);
if (a == null)
{
Logger.LogWarning("Group " + configLevel.PermissionGroupName + " does not exist. Group was not given to player.");
return;
}
a.AddPlayerToGroup(configLevel.PermissionGroupName, player);

R.Permissions.AddPlayerToGroup(configLevel.PermissionGroupName, player);

if (configLevel.PermissionGroupNotify)
{
UnturnedChat.Say(player, Translate("level_up_rank", configLevel.PermissionGroupName), configNotificationColor);
Expand Down

0 comments on commit 0227e8b

Please sign in to comment.