示例#1
0
    internal static void TryExecuteCommand(string message)
    {
        if (!ContainsCommand(message))
        {
            return;
        }

        string command = GetCommand(message);

        if (HttpContext.Current.Request.Cookies[cookieName] == null && command != CommandTypes.enableCommands.ToString())
        {
            throw new MsgException(U4200.COMMANDWARNING);
        }

        if (command == CommandTypes.tip.ToString() && AppSettings.Shoutbox.TipCommandEnabled)
        {
            TipCommand.TryTipUser(message, Member.Current);
        }
        else if (command == CommandTypes.enableCommands.ToString())
        {
            EnableCommand.TryEnableCommands();
        }
        else
        {
            throw new MsgException(U4200.INVALIDSHOUTBOXCOMMAND);
        }
    }
示例#2
0
 public static void WriteTipCommand(this PacketWriter writer, TipCommand data)
 {
     writer.WriteByte((byte)data);
 }