The new Oxide build number 71 that was released earlier today brought a few small changes with it. The changes include a new hook, a small change to the timers and a new way off calling another plugin.
The new hook
The new hook that was added in this build is OnServerInitialized, this hook is pretty much self-explanatory and will trigger when the server has completely started and is ready to accept connections.
Timer ChangesCode:function PLUGIN:OnServerInitialized() Sky = global.TOD_Sky.get_Instance() end
When the callback function of a timer failed this would result in an endless looping timer constantly throwing the error on the timer interval, with some changes to the timer system the callback that now fails will throw an actual error message and the timer will be destroyed.
plugins.Find(string name)
This does exactly the same as it did for Oxide 1.x and allows you to return a plugin table to be able to use the functions from that plugin. It uses the filename of the plugin as parameter. When the plugin can't be found it returns nil.
Code:tp = plugins.Find("m-Teleportation") tp:TeleportToPosition( player, x, y, z )
Oxide b71 changes for plugin devs
Discussion in 'Rust Development' started by Mughisi, Dec 29, 2014.
-
you sure on server initialized works well?
cause i edited 3 of my plugins to match the onserverinitialized
and i get those errors on startup:
Code:[Oxide] 11:43 PM [Error] r-remover: A .NET exception occured in user-code 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 (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)[Oxide] 11:43 PM [Error] r-Zones: A .NET exception occured in user-code 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
just gives the error when the server starts. -
Wulf Community Admin
-
try this:
Code:nulVector3 = new(UnityEngine.Vector3._type,nil)
-
Wulf Community Admin
-
so either it's using:
new()
or creating a new variable
that is making the error -
-
Well to prévent that we used à timer.Once so the new would start after server initialized, but you broke the timer on start now ^^
-
Just use lua error handling (pcall), think I posted it in your zones plugin earlier today
-
pcall da fuck ^^?
-
http://www.lua.org/pil/8.4.html