Jump to content

Custom Perm Skills error when assigning skill tree perms

Closed 1.2.2

Zoreeno
Zoreeno

Posted

I guess the error i pasted was too long and code fling didn't like it. 

I ran into a bug when attempting to have a custom skill assign a permission from skill tree itself.  I'm trying to assign skilltree.Woodcutting to players when they learn a specific skill (to unhide that tree). When they learn the skill it throws a massive error (thousands upon thousands of lines) and then crashes my test server. I thought maybe i made a syntax error in the config file, but when i change the perm that the skill grants to a perm from an outside plugin, it works fine, it just seems to be skilltree.perm permissions that causes it. It's a stack overflow bug if that helps. 

 

Here is the first part of the error, i cannot post the entire thing it doesn't fit here. 

Failed to call hook 'OnUserPermissionGranted' on plugin 'SkillTree v1.2.2' (StackOverflowException: The requested operation caused a stack overflow.)
  at (wrapper managed-to-native) System.RuntimeTypeHandle.HasInstantiation(System.RuntimeType)
  at System.RuntimeType.get_IsGenericType () [0x00000] in <fb001e01371b4adca20013e0ac763896>:0      1kb/s in, 6kb/s out
  at System.RuntimeType.get_FullName () [0x00000] in <fb001e01371b4adca20013e0ac763896>:0
  at Oxide.Core.Plugins.HookCache.GetHookMethod (System.Object[] args, System.Int32 index, Oxide.Core.Plugins.HookCache& cache) [0x00055] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.HookCache.GetHookMethod (System.String hookName, System.Object[] args, Oxide.Core.Plugins.HookCache& cache) [0x00023] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.CSPlugin.FindHooks (System.String name, System.Object[] args) [0x00000] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00004] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.PluginManager.CallHook (System.String hook, System.Object[] args) [0x0003c] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.OxideMod.CallHook (System.String hookname, System.Object[] args) [0x0000b] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Interface.CallHook (System.String hook, System.Object[] args) [0x0000a] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Interface.Call (System.String hook, System.Object[] args) [0x00000] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Libraries.Permission.RevokeUserPermission (System.String playerId, System.String permission) [0x00091] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Plugins.SkillTree.HandlePerms (System.String id, System.String tree, System.String node, System.Int32 level) [0x0010e] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.UpdatePlayerData (System.UInt64 id) [0x00083] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.DoClear (BasePlayer player) [0x00000] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.UpdatePlayerPerms (System.String id) [0x00059] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.UpdatePlayerPerms (System.String id, System.String permName) [0x0003f] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.OnUserPermissionGranted (System.String id, System.String permName) [0x00000] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x02372] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <09575a60985045248bcb43b20faeeb99>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Plugins.PluginManager.CallHook (System.String hook, System.Object[] args) [0x0003c] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.OxideMod.CallHook (System.String hookname, System.Object[] args) [0x0000b] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Interface.CallHook (System.String hook, System.Object[] args) [0x0000a] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Interface.Call (System.String hook, System.Object[] args) [0x00000] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Core.Libraries.Permission.GrantUserPermission (System.String playerId, System.String permission, Oxide.Core.Plugins.Plugin owner) [0x000f0] in <bae5f1223fce49c493b01571c99dce02>:0
  at Oxide.Plugins.SkillTree.HandlePerms (System.String id, System.String tree, System.String node, System.Int32 level) [0x001a1] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.HandlePerms (BasePlayer player, System.String tree, System.String node, System.Int32 level) [0x00000] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.UpdateInstancedData (BasePlayer player) [0x00bd9] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.HandleNewConnection (BasePlayer player) [0x00012] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.UpdatePlayerPerms (System.String id) [0x00068] in <5bb5e5022bba4b45800fff1eed78bfcc>:0
  at Oxide.Plugins.SkillTree.UpdatePlayerPerms (System.String id, System.String permName) [0x0003f] in <5bb5e5022bba4b45800fff1eed78bfcc>:0

 

imthenewguy

Posted

Hmm that is odd. Paste me the section of the config responsible for it.

Zoreeno

Posted

Sure. If it's any help, I can change the perm skilltree.Woodcutting to skilltree.vip and it works fine. Maybe it's throwing the error because I have the skill tree UI open when learning the skill... and since the perm effects the UI (makes the woodcutting tree visible) it doesn't know how to handle it?  Just a guess. 

        "Advanced Gathering": {
          "enabled": true,
          "max_level": 1,
          "tier": 4,
          "value_per_buff": 1.0,
          "buff_info": {
            "Key": 69,
            "Value": 5
          },
          "icon_url": "https://i.ibb.co/QjKH7tw/advancedgather.png",
          "permissions": {
            "description": "<color=#db03cb>ULTIMATE:</color>Learning this skill will unlock the <color=#42f105>Advanced Gathering</color> Skill Tree for more Gathering Boosts",
            "perms": {
              "1": {
                "perms_list": {
                  "skilltree.Woodcutting": "Adv Gathering Access"
                }
              },
              "2": {
                "perms_list": {
                  "cooking.instant": "Instant Cooking",
                  "cooking.free": "Free Cooking"
                }
              }
            }
          }
        },

 

imthenewguy

Posted

Yeah I had a look at the code. It is not going to work for a number of reasons based on how player data is handled and perms are assigned/unassigned for that particular permission set (skilltree.<tree perm>)

Zoreeno

Posted

Gotcha. No worries. I'll think up another way for players to unlock the advanced trees I'm setting up. Thanks for checking on it though! 

imthenewguy

Posted

Changed Status from Pending to Closed

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.7k

Files Sold

Total number of files sold.

2.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.