示例#1
0
 public InviteToGroupCommand(TestClient testClient)
 {
     testC = testClient;
     Name = "invitetogroup";
     Description = "invites and avatar to a group the bot is in. Usage: invitetogroup AvatarName|AvatarUUID GroupName|UUIDGroupId";
     Category = CommandCategory.Groups;
 }
示例#2
0
        public DumpOutfitCommand(TestClient testClient)
        {
            Name = "dumpoutfit";
            Description = "Dumps all of the textures from an avatars outfit to the hard drive. Usage: dumpoutfit [avatar-uuid]";
            Category = CommandCategory.Inventory;

        }
示例#3
0
 public WearCommand(TestClient testClient)
 {
     Client = testClient;
     Name = "wear";
     Description = "Wear an outfit folder from inventory. Usage: wear [outfit name] [nobake]";
     Category = CommandCategory.Appearance;
 }
示例#4
0
 public FindTextureCommand(TestClient testClient)
 {
     Name = "findtexture";
     Description = "Checks if a specified texture is currently visible on a specified face. " +
         "Usage: findtexture [face-index] [texture-uuid]";
     Category = CommandCategory.Objects;
 }
示例#5
0
 public PrimRegexCommand(TestClient testClient)
 {
     Name = "primregex";
     Description = "Find prim by text predicat. " +
         "Usage: primregex [text predicat] (eg findprim .away.)";
     Category = CommandCategory.Objects;
 }
示例#6
0
        public ImGroupCommand(TestClient testClient)
        {

            Name = "imgroup";
            Description = "Send an instant message to a group. Usage: imgroup [group_uuid] [message]";
            Category = CommandCategory.Communication;
        }
示例#7
0
 public AttachmentsCommand(TestClient testClient)
 {
     Client = testClient;
     Name = "attachments";
     Description = "Prints a list of the currently known agent attachments";
     Category = CommandCategory.Appearance;
 }
        public DownloadTextureCommand(TestClient testClient)
        {
            Name = "downloadtexture";
            Description = "Downloads the specified texture. " +
                "Usage: downloadtexture [texture-uuid] [discardlevel]";
            Category = CommandCategory.Inventory;

        }
示例#9
0
        public GridLayerCommand(TestClient testClient)
        {
            Name = "gridlayer";
            Description = "Downloads all of the layer chunks for the grid object map";
            Category = CommandCategory.Simulator;

            testClient.Grid.OnGridLayer += new GridManager.GridLayerCallback(Grid_OnGridLayer);
        }
示例#10
0
        public DownloadCommand(TestClient testClient)
        {
            Name = "download";
            Description = "Downloads the specified asset. Usage: download [uuid] [assetType]";
            Category = CommandCategory.Inventory;

            testClient.Assets.OnAssetReceived += new AssetManager.AssetReceivedCallback(Assets_OnAssetReceived);
        }
示例#11
0
 public ImportCommand(TestClient testClient)
 {
     Name = "import";
     Description = "Import prims from an exported xml file. Usage: import inputfile.xml [usegroup]";
     Category = CommandCategory.Objects;
     
     testClient.Objects.ObjectUpdate += Objects_OnNewPrim;
 }
示例#12
0
        public GridLayerCommand(TestClient testClient)
        {
            Name = "gridlayer";
            Description = "Downloads all of the layer chunks for the grid object map";
            Category = CommandCategory.Simulator;

            testClient.Grid.GridLayer += Grid_GridLayer;
        }
        public PacketLogCommand(TestClient testClient)
        {
            Name = "logpacket";
            Description = "Logs a given number of packets to a file.  For example, packetlog 10 tenpackets.xml";
            Category = CommandCategory.TestClient;

            m_client = testClient;
        }
示例#14
0
		public FollowCommand(TestClient testClient)
		{
			Name = "follow";
			Description = "Follow another avatar. (usage: follow [FirstName LastName])  If no target is set then will follow master.";
            Category = CommandCategory.Movement;

            testClient.Network.RegisterCallback(PacketType.AlertMessage, new NetworkManager.PacketCallback(AlertMessageHandler));
		}
示例#15
0
        public ImCommand(TestClient testClient)
        {
            testClient.Avatars.AvatarPickerReply += Avatars_AvatarPickerReply;

            Name = "im";
            Description = "Instant message someone. Usage: im [firstname] [lastname] [message]";
            Category = CommandCategory.Communication;
        }
示例#16
0
        public ParcelVoiceInfoCommand(TestClient testClient)
        {
            Name = "voiceparcel";
            Description = "obtain parcel voice info. Usage: voiceparcel";
            Category = CommandCategory.Other;

            Client = testClient;
        }
示例#17
0
        public DumpOutfitCommand(TestClient testClient)
        {
            Name = "dumpoutfit";
            Description = "Dumps all of the textures from an avatars outfit to the hard drive. Usage: dumpoutfit [avatar-Guid]";
            Category = CommandCategory.Inventory;

            ImageReceivedHandler = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
        }
示例#18
0
        public FollowCommand(TestClient testClient)
        {
            Name = "follow";
            Description = "Follow another avatar. Usage: follow [FirstName LastName]/off.";
            Category = CommandCategory.Movement;

            testClient.Network.RegisterCallback(PacketType.AlertMessage, AlertMessageHandler);
        }
示例#19
0
 /// <summary>
 /// Constructor for FriendsCommand class
 /// </summary>
 /// <param name="testClient">A reference to the TestClient object</param>
 public FriendsCommand(TestClient testClient)
 {
     // The name of the command
     Name = "friends";
     // A short description of the command with usage instructions
     Description = "List avatar friends. Usage: friends";
     Category = CommandCategory.Friends;
 }
示例#20
0
        public ChangePermsCommand(TestClient testClient)
        {
            testClient.Objects.OnObjectProperties += new ObjectManager.ObjectPropertiesCallback(Objects_OnObjectProperties);

            Name = "changeperms";
            Description = "Recursively changes all of the permissions for child and task inventory objects. Usage prim-uuid [copy] [mod] [xfer]";
            Category = CommandCategory.Objects;
        }
示例#21
0
        public ParcelInfoCommand(TestClient testClient)
        {
            Name = "parcelinfo";
            Description = "Prints out info about all the parcels in this simulator";
            Category = CommandCategory.Parcel;

            testClient.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
        }
示例#22
0
        public ImCommand(TestClient testClient)
        {
            testClient.Avatars.OnAvatarNameSearch += new AvatarManager.AvatarNameSearchCallback(Avatars_OnAvatarNameSearch);

            Name = "im";
            Description = "Instant message someone. Usage: im [firstname] [lastname] [message]";
            Category = CommandCategory.Communication;
        }
示例#23
0
        public VoiceAccountCommand(TestClient testClient)
        {
            Name = "voiceaccount";
            Description = "obtain voice account info. Usage: voiceaccount";
            Category = CommandCategory.Voice;

            Client = testClient;
        }
示例#24
0
        public GroupsCommand(TestClient testClient)
        {
            testClient.Groups.OnCurrentGroups += new GroupManager.CurrentGroupsCallback(Groups_OnCurrentGroups);

            Name = "groups";
            Description = "List avatar groups. Usage: groups";
            Category = CommandCategory.Groups;
        }
示例#25
0
        public ImportCommand(TestClient testClient)
        {
            Name = "import";
            Description = "Import prims from an exported xml file. Usage: import inputfile.xml [usegroup]";
            Category = CommandCategory.Objects;

            testClient.Objects.OnNewPrim += new ObjectManager.NewPrimCallback(Objects_OnNewPrim);
        }
示例#26
0
        public FindObjectsCommand(TestClient testClient)
        {
            testClient.Objects.ObjectProperties += new EventHandler<ObjectPropertiesEventArgs>(Objects_OnObjectProperties);

            Name = "findobjects";
            Description = "Finds all objects, which name contains search-string. " +
                "Usage: findobjects [radius] <search-string>";
            Category = CommandCategory.Objects;
        }
示例#27
0
 public BotsCommand(TestClient testClient)
 {
     Name = "bots";
     Description = "detects avatars that appear to be bots.";
     Category = CommandCategory.Other;        
     testClient.Avatars.ViewerEffect += new EventHandler<ViewerEffectEventArgs>(Avatars_ViewerEffect);
     testClient.Avatars.ViewerEffectLookAt += new EventHandler<ViewerEffectLookAtEventArgs>(Avatars_ViewerEffectLookAt);
     testClient.Avatars.ViewerEffectPointAt += new EventHandler<ViewerEffectPointAtEventArgs>(Avatars_ViewerEffectPointAt);
 }
示例#28
0
        public ShowEffectsCommand(TestClient testClient)
        {
            Name = "showeffects";
            Description = "Prints out information for every viewer effect that is received. Usage: showeffects [on/off]";
            Category = CommandCategory.Other;

            testClient.Avatars.OnEffect += new AvatarManager.EffectCallback(Avatars_OnEffect);
            testClient.Avatars.OnLookAt += new AvatarManager.LookAtCallback(Avatars_OnLookAt);
            testClient.Avatars.OnPointAt += new AvatarManager.PointAtCallback(Avatars_OnPointAt);
        }
示例#29
0
        public ExportCommand(TestClient testClient)
        {
            testClient.Objects.OnObjectPropertiesFamily += new ObjectManager.ObjectPropertiesFamilyCallback(Objects_OnObjectPropertiesFamily);
            testClient.Objects.OnObjectProperties += new ObjectManager.ObjectPropertiesCallback(Objects_OnObjectProperties);
            testClient.Avatars.ViewerEffectPointAt += new EventHandler<ViewerEffectPointAtEventArgs>(Avatars_ViewerEffectPointAt);

            Name = "export";
            Description = "Exports an object to an xml file. Usage: export uuid outputfile.xml";
            Category = CommandCategory.Objects;
        }
示例#30
0
        public DownloadTextureCommand(TestClient testClient)
        {
            Name = "downloadtexture";
            Description = "Downloads the specified texture. " +
                "Usage: downloadtexture [texture-uuid]";
            Category = CommandCategory.Inventory;

            testClient.Assets.OnImageReceiveProgress += new AssetManager.ImageReceiveProgressCallback(Assets_OnImageReceiveProgress);
            testClient.Assets.OnImageReceived += new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
        }
 public ExportParticlesCommand(TestClient testClient)
 {
     Name        = "exportparticles";
     Description = "Reverse engineers a prim with a particle system to an LSL script. Usage: exportscript [prim-uuid]";
     Category    = CommandCategory.Objects;
 }
示例#32
0
 public LoadCommand(TestClient testClient)
 {
     Name        = "load";
     Description = "Loads commands from a dll. (Usage: load AssemblyNameWithoutExtension)";
     Category    = CommandCategory.TestClient;
 }
 public ParcelPrimOwnersCommand(TestClient testClient)
 {
     Name        = "primowners";
     Description = "Displays a list of prim owners and prim counts on a parcel. Usage: primowners parcelID";
     Category    = CommandCategory.Parcel;
 }
示例#34
0
 public WhisperCommand(TestClient testClient)
 {
     Name        = "whisper";
     Description = "Whisper something.";
     Category    = CommandCategory.Communication;
 }
示例#35
0
 public WhoCommand(TestClient testClient)
 {
     Name        = "who";
     Description = "Lists seen avatars.";
     Category    = CommandCategory.Other;
 }
示例#36
0
 public InviteGroupCommand(TestClient testClient)
 {
     Name        = "invitegroup";
     Description = "invite an avatar into a group. Usage: invitegroup AvatarUUID GroupUUID RoleUUID*";
     Category    = CommandCategory.Groups;
 }
 /// <summary>
 ///  The default constructor for TestClient commands
 /// </summary>
 /// <param name="testClient"></param>
 public UploadScriptCommand(TestClient testClient)
 {
     Name        = "uploadscript";
     Description = "Upload a local .lsl file file into your inventory.";
     Category    = CommandCategory.Inventory;
 }
示例#38
0
 public PrimCountCommand(TestClient testClient)
 {
     Name        = "primcount";
     Description = "Shows the number of objects currently being tracked.";
     Category    = CommandCategory.TestClient;
 }
 public CreateNotecardCommand(TestClient testClient)
 {
     Name        = "createnotecard";
     Description = "Creates a notecard from a local text file and optionally embed an inventory item. Usage: createnotecard filename.txt [itemid]";
     Category    = CommandCategory.Inventory;
 }
示例#40
0
 /// <summary>
 /// TestClient command to download and display a notecard asset
 /// </summary>
 /// <param name="testClient"></param>
 public ViewNotecardCommand(TestClient testClient)
 {
     Name        = "viewnote";
     Description = "Downloads and displays a notecard asset";
     Category    = CommandCategory.Inventory;
 }
示例#41
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="client"></param>
 public void Logout(TestClient client)
 {
     Clients.Remove(client.Self.AgentID);
     client.Network.Logout();
 }
示例#42
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cmd"></param>
        /// <param name="fromAgentID"></param>
        /// <param name="imSessionID"></param>
        public void DoCommandAll(string cmd, UUID fromAgentID)
        {
            string[] tokens = cmd.Trim().Split(new char[] { ' ', '\t' });
            if (tokens.Length == 0)
            {
                return;
            }

            string firstToken = tokens[0].ToLower();

            if (String.IsNullOrEmpty(firstToken))
            {
                return;
            }

            // Allow for comments when cmdline begins with ';' or '#'
            if (firstToken[0] == ';' || firstToken[0] == '#')
            {
                return;
            }

            if ('@' == firstToken[0])
            {
                onlyAvatar = String.Empty;
                if (tokens.Length == 3)
                {
                    bool found = false;
                    onlyAvatar = tokens[1] + " " + tokens[2];
                    foreach (TestClient client in Clients.Values)
                    {
                        if ((client.ToString() == onlyAvatar) && (client.Network.Connected))
                        {
                            found = true;
                            break;
                        }
                    }
                    if (found)
                    {
                        Logger.Log("Commanding only " + onlyAvatar + " now", Helpers.LogLevel.Info);
                    }
                    else
                    {
                        Logger.Log("Commanding nobody now. Avatar " + onlyAvatar + " is offline", Helpers.LogLevel.Info);
                    }
                }
                else
                {
                    Logger.Log("Commanding all avatars now", Helpers.LogLevel.Info);
                }
                return;
            }

            string[] args = new string[tokens.Length - 1];
            if (args.Length > 0)
            {
                Array.Copy(tokens, 1, args, 0, args.Length);
            }

            if (firstToken == "login")
            {
                Login(args);
            }
            else if (firstToken == "quit")
            {
                Quit();
                Logger.Log("All clients logged out and program finished running.", Helpers.LogLevel.Info);
            }
            else if (firstToken == "help")
            {
                if (Clients.Count > 0)
                {
                    foreach (TestClient client in Clients.Values)
                    {
                        Console.WriteLine(client.Commands["help"].Execute(args, UUID.Zero));
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("You must login at least one bot to use the help command");
                }
            }
            else if (firstToken == "script")
            {
                // No reason to pass this to all bots, and we also want to allow it when there are no bots
                ScriptCommand command = new ScriptCommand(null);
                Logger.Log(command.Execute(args, UUID.Zero), Helpers.LogLevel.Info);
            }
            else if (firstToken == "waitforlogin")
            {
                // Special exception to allow this to run before any bots have logged in
                if (ClientManager.Instance.PendingLogins > 0)
                {
                    WaitForLoginCommand command = new WaitForLoginCommand(null);
                    Logger.Log(command.Execute(args, UUID.Zero), Helpers.LogLevel.Info);
                }
                else
                {
                    Logger.Log("No pending logins", Helpers.LogLevel.Info);
                }
            }
            else
            {
                // Make an immutable copy of the Clients dictionary to safely iterate over
                Dictionary <UUID, TestClient> clientsCopy = new Dictionary <UUID, TestClient>(Clients);

                int completed = 0;

                foreach (TestClient client in clientsCopy.Values)
                {
                    ThreadPool.QueueUserWorkItem((WaitCallback)
                                                 delegate(object state)
                    {
                        TestClient testClient = (TestClient)state;
                        if ((String.Empty == onlyAvatar) || (testClient.ToString() == onlyAvatar))
                        {
                            if (testClient.Commands.ContainsKey(firstToken))
                            {
                                Logger.Log(testClient.Commands[firstToken].Execute(args, fromAgentID),
                                           Helpers.LogLevel.Info, testClient);
                            }
                            else
                            {
                                Logger.Log("Unknown command " + firstToken, Helpers.LogLevel.Warning);
                            }
                        }

                        ++completed;
                    },
                                                 client);
                }

                while (completed < clientsCopy.Count)
                {
                    Thread.Sleep(50);
                }
            }
        }
示例#43
0
 public DumpOutfitCommand(TestClient testClient)
 {
     Name        = "dumpoutfit";
     Description = "Dumps all of the textures from an avatars outfit to the hard drive. Usage: dumpoutfit [avatar-uuid]";
     Category    = CommandCategory.Inventory;
 }
示例#44
0
 /// <summary>
 /// Download a simulators raw terrain data and save it to a file
 /// </summary>
 /// <param name="testClient"></param>
 public DownloadTerrainCommand(TestClient testClient)
 {
     Name        = "downloadterrain";
     Description = "Download the RAW terrain file for this estate. Usage: downloadterrain [timeout]";
     Category    = CommandCategory.Simulator;
 }
示例#45
0
 public ShoutCommand(TestClient testClient)
 {
     Name        = "shout";
     Description = "Shout something.";
     Category    = CommandCategory.Communication;
 }
示例#46
0
 public UptimeCommand(TestClient testClient)
 {
     Name        = "uptime";
     Description = "Shows the login name, login time and length of time logged on.";
     Category    = CommandCategory.TestClient;
 }
示例#47
0
 public BackupCommand(TestClient testClient)
 {
     Name        = "backuptext";
     Description = "Backup inventory to a folder on your hard drive. Usage: " + Name + " [to <directory>] | [abort] | [status]";
     testClient.Assets.OnAssetReceived += new AssetManager.AssetReceivedCallback(Assets_OnAssetReceived);
 }
 public UploadImageCommand(TestClient testClient)
 {
     Name        = "uploadimage";
     Description = "Upload an image to your inventory. Usage: uploadimage [inventoryname] [timeout] [filename]";
     Category    = CommandCategory.Inventory;
 }
 public ActivateGroupCommand(TestClient testClient)
 {
     Name        = "activategroup";
     Description = "Set a group as active. Usage: activategroup GroupName";
     Category    = CommandCategory.Groups;
 }
示例#50
0
 public QuitCommand(TestClient testClient)
 {
     Name        = "quit";
     Description = "Log all avatars out and shut down";
     Category    = CommandCategory.TestClient;
 }
示例#51
0
 public LeaveGroupCommand(TestClient testClient)
 {
     Name        = "leavegroup";
     Description = "Leave a group. Usage: leavegroup GroupName";
     Category    = CommandCategory.Groups;
 }
示例#52
0
 public ImGroupCommand(TestClient testClient)
 {
     Name        = "imgroup";
     Description = "Send an instant message to a group. Usage: imgroup [group_uuid] [message]";
     Category    = CommandCategory.Communication;
 }
 public CrouchCommand(TestClient testClient)
 {
     Name        = "crouch";
     Description = "Starts or stops crouching. Usage: crouch [start/stop]";
     Category    = CommandCategory.Movement;
 }
 public GroupRolesCommand(TestClient testClient)
 {
     Name        = "grouproles";
     Description = "Dump group roles to console. Usage: grouproles GroupName";
     Category    = CommandCategory.Groups;
 }
示例#55
0
 public GridMapCommand(TestClient testClient)
 {
     Name        = "gridmap";
     Description = "Downloads all visible information about the grid map";
     Category    = CommandCategory.Simulator;
 }
示例#56
0
 public ScriptCommand(TestClient testClient)
 {
     Name        = "script";
     Description = "Reads TestClient commands from a file. One command per line, arguments separated by spaces. Usage: script [filename]";
     Category    = CommandCategory.TestClient;
 }
示例#57
0
 public TreeCommand(TestClient testClient)
 {
     Name        = "tree";
     Description = "Rez a tree.";
     Category    = CommandCategory.Objects;
 }
示例#58
0
 public BalanceCommand(TestClient testClient)
 {
     Name        = "balance";
     Description = "Shows the amount of L$.";
     Category    = CommandCategory.Other;
 }
示例#59
0
        public TestClient Login(LoginDetails account)
        {
            // Check if this client is already logged in
            foreach (TestClient c in Clients.Values)
            {
                if (c.Self.FirstName == account.FirstName && c.Self.LastName == account.LastName)
                {
                    Logout(c);
                    break;
                }
            }

            ++PendingLogins;

            TestClient client = new TestClient(this);

            client.Network.LoginProgress +=
                delegate(object sender, LoginProgressEventArgs e)
            {
                Logger.Log(String.Format("Login {0}: {1}", e.Status, e.Message), Helpers.LogLevel.Info, client);

                if (e.Status == LoginStatus.Success)
                {
                    Clients[client.Self.AgentID] = client;

                    if (client.MasterKey == UUID.Zero)
                    {
                        UUID query = UUID.Zero;
                        EventHandler <DirPeopleReplyEventArgs> peopleDirCallback =
                            delegate(object sender2, DirPeopleReplyEventArgs dpe)
                        {
                            if (dpe.QueryID == query)
                            {
                                if (dpe.MatchedPeople.Count != 1)
                                {
                                    Logger.Log("Unable to resolve master key from " + client.MasterName, Helpers.LogLevel.Warning);
                                }
                                else
                                {
                                    client.MasterKey = dpe.MatchedPeople[0].AgentID;
                                    Logger.Log("Master key resolved to " + client.MasterKey, Helpers.LogLevel.Info);
                                }
                            }
                        };

                        client.Directory.DirPeopleReply += peopleDirCallback;
                        query = client.Directory.StartPeopleSearch(client.MasterName, 0);
                    }

                    Logger.Log("Logged in " + client.ToString(), Helpers.LogLevel.Info);
                    client.Appearance.RequestSetAppearance();
                    --PendingLogins;
                }
                else if (e.Status == LoginStatus.Failed)
                {
                    Logger.Log("Failed to login " + account.FirstName + " " + account.LastName + ": " +
                               client.Network.LoginMessage, Helpers.LogLevel.Warning);
                    --PendingLogins;
                }
            };

            // Optimize the throttle
            client.Throttle.Wind  = 0;
            client.Throttle.Cloud = 0;
            client.Throttle.Land  = 1000000;
            client.Throttle.Task  = 1000000;

            client.GroupCommands     = account.GroupCommands;
            client.MasterName        = account.MasterName;
            client.MasterKey         = account.MasterKey;
            client.AllowObjectMaster = client.MasterKey != UUID.Zero; // Require UUID for object master.

            LoginParams loginParams = client.Network.DefaultLoginParams(
                account.FirstName, account.LastName, account.Password, "TestClient", VERSION);

            if (!String.IsNullOrEmpty(account.StartLocation))
            {
                loginParams.Start = account.StartLocation;
            }

            if (!String.IsNullOrEmpty(account.URI))
            {
                loginParams.URI = account.URI;
            }

            client.Network.BeginLogin(loginParams);
            return(client);
        }
示例#60
0
 public LocationCommand(TestClient testClient)
 {
     Name        = "location";
     Description = "Show current location of avatar.";
     Category    = CommandCategory.Movement;
 }