aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Commands/DebugCommand.cs
blob: fbfde7c8e82824855f5d35c66f3ddfca7184df4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;

namespace libsecondlife.TestClient
{
    public class DebugCommand : Command
    {
        public DebugCommand(TestClient testClient)
        {
            Name = "debug";
            Description = "Turn debug messages on or off. Usage: debug [on/off]";
        }

        public override string Execute(string[] args, LLUUID fromAgentID)
        {
            if (args.Length != 1)
                return "Usage: debug [on/off]";

            if (args[0].ToLower() == "on")
            {
                Client.Settings.DEBUG = true;
                return "Debug logging is on";
            }
            else if (args[0].ToLower() == "off")
            {
                Client.Settings.DEBUG = false;
                return "Debug logging is off";
            }
            else
            {
                return "Usage: debug [on/off]";
            }
        }
    }
}