archie426/Back

plugin is borked (rm4)

Closed this issue · 10 comments

hi, wanted to give your plugin a try. won't load, however:
image
didn't change the config, this happens on first boot

also there's no unload method which should be something like

        protected override void Unload()
        {
            UnturnedPlayerEvents.OnPlayerDead -= UnturnedPlayerEventsOnOnPlayerDead;
            Instance = null;
        }

I probably haven’t updated this to Nelson’s newer RM, will do soon

Should be fixed

hmm, won't build, CS0507

Ugh typical nelson changing shit, I forgot he hadn't only changed the name

Fixed

forgot to add
you have to also do it like this
public override void UnloadPlugin(PluginState state = PluginState.Unloaded)
in every plugin of yours :)

also it now compiles but won't load without errors in logs

[24.05.2020 18:15:05] [Info] [World] [Гл. Модератор] JaCKi [⌦JΔ¢Ҝł™]: "/back"
[24.05.2020 18:15:05] [Error] Exception has been thrown by the target of an invocation.
[24.05.2020 18:15:05] [Error]   at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at (wrapper dynamic-method) SDG.Unturned.SteamChannel.DMD<DMD<receive_Patch2>?1004926976::receive_Patch2>(SDG.Unturned.SteamChannel,Steamworks.CSteamID,byte[],int,int)
[24.05.2020 18:15:06] [Error] Value cannot be null.
Parameter name: collection
[24.05.2020 18:15:06] [Error]   at System.ThrowHelper.ThrowArgumentNullException (System.ExceptionArgument argument) [0x00006] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.Collections.Generic.List`1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] collection) [0x00003] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.Collections.Generic.List`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] collection) [0x00000] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at Rocket.API.IRocketPermissionsProviderExtensions.HasPermission (Rocket.API.IRocketPermissionsProvider rocketPermissionProvider, Rocket.API.IRocketPlayer player, Rocket.API.IRocketCommand command) [0x0001a] in <1ef0125c67a64c40ad79bd6ae336260d>:0 
  at Rocket.Unturned.Permissions.UnturnedPermissions.CheckPermissions (SDG.Unturned.SteamPlayer caller, System.String permission) [0x00053] in <2389433b4de64d7a936bca792e48c781>:0 
  at Rocket.Unturned.U+<>c.<bindDelegates>b__16_3 (SDG.Unturned.SteamPlayer player, System.String text, System.Boolean& shouldExecuteCommand, System.Boolean& shouldList) [0x00022] in <2389433b4de64d7a936bca792e48c781>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_SteamPlayer_string_bool&_bool&(SDG.Unturned.SteamPlayer,string,bool&,bool&)
  at SDG.Unturned.ChatManager.process (SDG.Unturned.SteamPlayer player, System.String cmd, System.Boolean fromUnityEvent) [0x0005f] in <552a1fa2dff648c2a994d098a8810480>:0 
  at SDG.Unturned.ChatManager.askChat (Steamworks.CSteamID steamID, System.Byte flags, System.String text) [0x001ed] in <552a1fa2dff648c2a994d098a8810480>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <e1319b7195c343e79b385cd3aa43f5dc>:0 

if I do
protected override void Load()
protected override void Unload()

LoadPlugin and UnloadPlugin, use an IDE