Build Controller

Discussion in 'Plugin Support' started by SPooCK, Dec 25, 2014.

  1. the same problem :
    Code:
    [Oxide] 3:18 PM [Error] LuaScriptException while calling OnItemDeployed:
    File: BuildControl.lua Line: 9 attempt to index local 'player' (a nil value):
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    please Update its a great plugin !
     
    Last edited by a moderator: Mar 1, 2015
  2. Any update on this ?
     
  3. Nope, The first error report was in Feb 17, 2015.
    The developer logged: Today at 10:31 AM
    And still no even a comment, I guess the developer discontinued it :(.
    I removed from my servers since is still generating errors and there is no new update to fix.
     
  4. such plugins need to be moved abandoned section for keep clean the forum
     
  5. Wulf

    Wulf Community Admin

    I'm looking into the error right now to see if I can figure it out. I'll post a fixed version if I do get it fixed.
    [DOUBLEPOST=1425457747][/DOUBLEPOST]Try the attached version below. I changed a good bit of it in terms of configuration of messages and such, but overall functionality is mainly the same. I didn't get any errors when testing it. The config name is buildcontroller.json.
     

    Attached Files:

    Last edited: Mar 4, 2015
  6. @Wulf

    Thank you very much :) you're awesome :)
    [DOUBLEPOST=1425519140,1425476678][/DOUBLEPOST]Its was working very nice until

    Code:
    [Oxide] 10:35 PM [Error] Failed to call hook 'OnItemDeployed' on plugin 'Build Controller'
    File: buildcontroller.lua Line: 10 attempt to index local 'player' (a nil value):
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
    :(
     
  7. Here i did not test, but is probably fixed ;)
     

    Attached Files:

  8. Thank you !! i'll test it on my server :) !!!! vlw aew :)
     
  9. Wulf

    Wulf Community Admin

    That change shouldn't make a difference. I use player.net.connection in numerous plugins. The problem isn't with the admin check, it's with the passing a valid player from OnItemDeployed.
     
  10. OK but that will stop the error anyways
     
  11. Wulf

    Wulf Community Admin

    What you added was the same as what was in there before though.
     
  12. I'm sorry, but was not.
    Before:
    Code:
        local authLevel = player.net.connection.authLevel
        if authLevel >= 2 then return true end
        return false
    
    After:
    Code:
      -- Check if player is valid
      if player ~= nil then
        -- Check if is connected
        if player:GetComponent("BaseNetworkable").net.connection ~= nil then
          -- Compare the Player's AuthLevel with the required AuthLevel, if it's higher or equal
          return player:GetComponent("BaseNetworkable").net.connection.authLevel >= 2
        end
      end  return false
    
    There is a huge difference, Sometimes rust fucks the connection, so if player disconnects in the middle of the process, or some weird stuff happens to it the player entity is returned fucked, so if you TEST first: if player is not null and his connection is not null then it test it.

    The issue here was the error itself as far as i know, And i always do the same on my scripts. ;)
     
  13. Wulf

    Wulf Community Admin

    The original, not mine. The only real difference would be the nil checks, which I guess would prevent the errors. The player connection shouldn't be nil though, else something isn't working properly.
     
  14. the block of rock build is not working :(
    [DOUBLEPOST=1426012307,1425948113][/DOUBLEPOST]yep! still getting erros:
    Code:
    [Oxide] 3:34 PM [Error] Failed to call hook 'OnEntityBuilt' on plugin 'Build Controller'
    File: buildcontroller.lua Line: 51 attempt to call method 'MoveNext' (a string value):
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    Reporting Performance Data system/server
    
    and is not blocking players from build in rocks!
    [DOUBLEPOST=1426265662][/DOUBLEPOST]My config!!!

    "Settings": {
    "BuildHeight": 20,
    "CupFoundation": "true",
    "UndergroundBuild": "false",
    "WaterBuild": "false",
    "RockBuild": "false",
    "BuildDepth": -3,
    "AdminException": "true"
    }


    yet players are able to build in rocks :( no solution at all ? i really need this :(

    Code:
    [Oxide] 5:07 PM [Error] Failed to call hook 'OnItemDeployed' on plugin 'Build Controller'
    File: buildcontroller.lua Line: 146 Object reference not set to an instance of an object:
      at Oxide.Rust.Libraries.Rust.SendChatMessage (.BasePlayer player, System.String name, System.String message, System.String userid) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
     
  15. Seeing this error in my logs...tough to say if it is going to be an issue.
    Code:
    [Oxide] 6:17 PM [Error] Failed to call hook 'OnItemDeployed' on plugin 'Build Controller'
    File: BuildControl.lua Line: 118 Object reference not set to an instance of an object:
      at Oxide.Rust.Libraries.Rust.SendChatMessage (.BasePlayer player, System.String name, System.String message, System.String userid) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
     
    Last edited by a moderator: Mar 26, 2015
  16. We need the ability to block also foundations. :) Any update on this?