aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/mass test client/Commands/System/LoginCommand.cs
blob: 6cfc1559db27b23bf906b6787704ebbad18f7eab (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
using System;
using System.Collections.Generic;
using System.Reflection;
using libsecondlife;
using libsecondlife.Packets;

namespace libsecondlife.TestClient
{
    public class LoginCommand : Command
    {
        public LoginCommand(TestClient testClient)
        {
            Name = "login";
            Description = "Logs in another avatar";
        }

        public override string Execute(string[] args, LLUUID fromAgentID)
        {
            if (args.Length != 3 && args.Length != 4)
                return "usage: login firstname lastname password [simname]";

            SecondLife newClient = Client.ClientManager.Login(args);

            if (newClient.Network.Connected)
            {
                return "Logged in " + newClient.ToString();
            }
            else
            {
                return "Failed to login: " + newClient.Network.LoginMessage;
            }
        }
    }
}