I got this error, when i try kick player from server.
Its only happen if try kick, i have no idea why its happen. And no config file isnt null or corrupted.
You can found full source from Github,Code:[Oxide] 18:00 [Error] Failed to call hook 'cmdAK' on plugin 'Autokick v1.0.0' (InvalidOperationException: Collection was modified; enumeration operation may not execute.) [Oxide] 18:00 [Debug] at System.Collections.Generic.List`1+Enumerator[BasePlayer].VerifyState () [0x00000] in <filename unknown>:0 at System.Collections.Generic.List`1+Enumerator[BasePlayer].MoveNext () [0x00000] in <filename unknown>:0 at Oxide.Plugins.Autokick.Kicker () [0x00000] in <filename unknown>:0 at Oxide.Plugins.Autokick.cmdAK (.BasePlayer player, System.String command, System.String[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Autokick.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
GitHub - exel80/Autokick
[DOUBLEPOST=1473952516][/DOUBLEPOST]Solved!
Added .ToList() next to BasePlayer.activePlayerList.
Code:foreach (BasePlayer player in BasePlayer.activePlayerList.ToList())
Solved InvalidOperationException when iterating over BasePlayer.activePlayerList
Discussion in 'Rust Development' started by Exel80, Sep 15, 2016.
