Skip to content

OnClientCommand

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnClientCommand( Connection connection, string text )
{
    Puts( "OnClientCommand works!" );
}

Location

  • ConsoleNetwork::OnClientCommand(Network.Message packet)
csharp
//---
	if (packet.connection == null || !packet.connection.connected)
	{
		Debug.LogWarning("Client without connection tried to run command: " + text);
		return;
	}
	if (Interface.CallHook("OnClientCommand", packet.connection, text) != null)
	{
		return;
	}
	string text2 = ConsoleSystem.Run(ConsoleSystem.Option.Server.FromConnection(packet.connection).Quiet(), text, Array.Empty<object>());
	if (!string.IsNullOrEmpty(text2))
//---

Released under the MIT License.