internal static void OnClientCommand(Message packet) { if (packet.get_read().get_unread() > Server.maxcommandpacketsize) { Debug.LogWarning((object)"Dropping client command due to size"); } else { string str = packet.get_read().String(); if (packet.connection == null || ((Connection)packet.connection).connected == null) { Debug.LogWarning((object)("Client without connection tried to run command: " + str)); } else { ConsoleSystem.Option server = ConsoleSystem.Option.get_Server(); ConsoleSystem.Option option = ((ConsoleSystem.Option) ref server).FromConnection((Connection)packet.connection); string strCommand = ConsoleSystem.Run(((ConsoleSystem.Option) ref option).Quiet(), str, (object[])Array.Empty <object>()); if (string.IsNullOrEmpty(strCommand)) { return; } ConsoleNetwork.SendClientReply((Connection)packet.connection, strCommand); } } }
internal static void OnClientCommand(Message packet) { if (packet.read.Unread > ConVar.Server.maxcommandpacketsize) { Debug.LogWarning("Dropping client command due to size"); return; } string str = packet.read.String(); if (packet.connection == null || !packet.connection.connected) { Debug.LogWarning(string.Concat("Client without connection tried to run command: ", str)); return; } ConsoleSystem.Option server = ConsoleSystem.Option.Server; server = server.FromConnection(packet.connection); string str1 = ConsoleSystem.Run(server.Quiet(), str, Array.Empty <object>()); if (!string.IsNullOrEmpty(str1)) { ConsoleNetwork.SendClientReply(packet.connection, str1); } }