StackOverflowException with custom commandSolved
When i try execute a command i made with a custom plugin it freezes the server and says in console
StackOverflowException: The requested operation caused a stack overflow.
Calling 'TeleportCommand' on 'Rustov v0.1.0' took 2907ms console

here is my code :
    [Description("Testing")]
    public class Rustov : CovalencePlugin
    {
        #region Main
        [Command("teleport")]
        private void TeleportCommand(IPlayer player, string command, string[] args)
        {
            server.Command("teleport", args);
        }


        #endregion


    }
}​
The Command attribute in CovalencePlugin allows it to be called from the server console as well as from client consoles/chat. So server.Command("teleport", args) is effectively recalling itself infinitely. Assuming you only want this to be called by players, you can perform an initial check with if (player.IsServer) return;.
thanks man
Locked automatically