コード例 #1
0
ファイル: AdminCommand.cs プロジェクト: SevenMod/SevenMod
 /// <summary>
 /// Print the usage of the command to a client.
 /// </summary>
 /// <param name="client">The <see cref="SMClient"/> object representing the client.</param>
 /// <param name="usage">The parameter string for the command.</param>
 /// <param name="args">The format arguments for <paramref name="usage"/>.</param>
 public void PrintUsage(SMClient client, string usage, params object[] args)
 {
     if (ChatHook.ShouldReplyToChat(client?.ClientInfo))
     {
         ChatHelper.SendTo(client.ClientInfo, "[\u200BSM] {0:t}: /{1:s} {2:s}", "Usage", this.Command, Language.GetString(usage, client.ClientInfo, args));
     }
     else
     {
         SdtdConsole.Instance.Output(Language.GetString("[SM] {0:t}: sm {1:s} {2:s}", client?.ClientInfo, "Usage", this.Command, Language.GetString(usage, client?.ClientInfo, args)));
     }
 }
コード例 #2
0
 /// <summary>
 /// Checks whether commands should reply to a user via chat.
 /// </summary>
 /// <param name="client">The <see cref="SMClient"/> object representing the client for which to reply.</param>
 /// <returns><c>true</c> to reply via chat; <c>false</c> to reply via console.</returns>
 protected bool ShouldReplyToChat(SMClient client)
 {
     return(ChatHook.ShouldReplyToChat(client?.ClientInfo));
 }