aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/mass test client/Commands/System/SetMasterCommand.cs
diff options
context:
space:
mode:
authorlbsa712007-06-29 13:51:21 +0000
committerlbsa712007-06-29 13:51:21 +0000
commitf6deaf8a65693d022f58961a007f2492c9ac97fa (patch)
tree7428eccc93a3f64f46e08d7269bc337f3d26d8a8 /tools/mass test client/Commands/System/SetMasterCommand.cs
parentDeleted some files that are no longer in use. (I am sure I deleted these yest... (diff)
parent*Hopefully fixed the empty dialog box error on client when logging in on sand... (diff)
downloadopensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.zip
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.gz
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.bz2
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.xz
Switched in NameSpaceChanges
Diffstat (limited to 'tools/mass test client/Commands/System/SetMasterCommand.cs')
-rw-r--r--tools/mass test client/Commands/System/SetMasterCommand.cs73
1 files changed, 0 insertions, 73 deletions
diff --git a/tools/mass test client/Commands/System/SetMasterCommand.cs b/tools/mass test client/Commands/System/SetMasterCommand.cs
deleted file mode 100644
index 8601865..0000000
--- a/tools/mass test client/Commands/System/SetMasterCommand.cs
+++ /dev/null
@@ -1,73 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading;
5using libsecondlife;
6using libsecondlife.Packets;
7
8namespace libsecondlife.TestClient
9{
10 public class SetMasterCommand: Command
11 {
12 public DateTime Created = DateTime.Now;
13 private LLUUID resolvedMasterKey = LLUUID.Zero;
14 private ManualResetEvent keyResolution = new ManualResetEvent(false);
15 private LLUUID query = LLUUID.Zero;
16
17 public SetMasterCommand(TestClient testClient)
18 {
19 Name = "setMaster";
20 Description = "Sets the user name of the master user. The master user can IM to run commands.";
21
22 }
23
24 public override string Execute(string[] args, LLUUID fromAgentID)
25 {
26 string masterName = String.Empty;
27 for (int ct = 0; ct < args.Length;ct++)
28 masterName = masterName + args[ct] + " ";
29 masterName = masterName.TrimEnd();
30
31 if (masterName.Length == 0)
32 return "Usage setMaster name";
33
34 DirectoryManager.DirPeopleReplyCallback callback = new DirectoryManager.DirPeopleReplyCallback(KeyResolvHandler);
35 Client.Directory.OnDirPeopleReply += callback;
36 query = Client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, masterName, 0);
37 if (keyResolution.WaitOne(TimeSpan.FromMinutes(1), false))
38 {
39 Client.MasterKey = resolvedMasterKey;
40 keyResolution.Reset();
41 Client.Directory.OnDirPeopleReply -= callback;
42 }
43 else
44 {
45 keyResolution.Reset();
46 Client.Directory.OnDirPeopleReply -= callback;
47 return "Unable to obtain UUID for \"" + masterName + "\". Master unchanged.";
48 }
49
50
51 foreach (Avatar av in Client.AvatarList.Values)
52 {
53 if (av.ID == Client.MasterKey)
54 {
55 Client.Self.InstantMessage(av.ID, "You are now my master. IM me with \"help\" for a command list.");
56 break;
57 }
58 }
59
60 return "Master set to " + masterName + " (" + Client.MasterKey.ToStringHyphenated() + ")";
61 }
62
63 private void KeyResolvHandler(LLUUID queryid, List<DirectoryManager.AgentSearchData> matches)
64 {
65 if (query != queryid)
66 return;
67 // We can't handle ambiguities here as nicely as we can in ClientManager.
68 resolvedMasterKey = matches[0].AgentID;
69 keyResolution.Set();
70 query = LLUUID.Zero;
71 }
72 }
73}