aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDahlia Trimble2008-06-22 05:08:58 +0000
committerDahlia Trimble2008-06-22 05:08:58 +0000
commiteecaf327b962229a2467e4fbe42873436f0034d1 (patch)
tree240ec074a4d2e5ea37b358d3246375e77ba43136
parentAdded an experimental "kickuser" console command to log off a user by name. (diff)
downloadopensim-SC_OLD-eecaf327b962229a2467e4fbe42873436f0034d1.zip
opensim-SC_OLD-eecaf327b962229a2467e4fbe42873436f0034d1.tar.gz
opensim-SC_OLD-eecaf327b962229a2467e4fbe42873436f0034d1.tar.bz2
opensim-SC_OLD-eecaf327b962229a2467e4fbe42873436f0034d1.tar.xz
Changed the kickuser command to use the new console RegisterCmd feature.
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--OpenSim/Region/Application/OpenSim.cs64
2 files changed, 34 insertions, 32 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 21a3540..e553a45 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -27,6 +27,7 @@ OpenSim Developers
27* adjohn (Genkii) 27* adjohn (Genkii)
28* Alondria 28* Alondria
29* Dr Scofield (IBM) 29* Dr Scofield (IBM)
30* dahlia
30 31
31 32
32Patches 33Patches
@@ -55,7 +56,6 @@ Patches
55* John R Sohn(XenReborn) 56* John R Sohn(XenReborn)
56* Xantor 57* Xantor
57* YZh 58* YZh
58* Dahlia
59* Grumly57 59* Grumly57
60 60
61 61
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 600566b..12977a8 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -117,6 +117,8 @@ namespace OpenSim
117 117
118 PrintFileToConsole("startuplogo.txt"); 118 PrintFileToConsole("startuplogo.txt");
119 RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); 119 RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed");
120 RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving");
121
120 } 122 }
121 123
122 protected ConsoleBase CreateConsole() 124 protected ConsoleBase CreateConsole()
@@ -142,6 +144,37 @@ namespace OpenSim
142 } 144 }
143 } 145 }
144 146
147 private void KickUserCommand(string[] cmdparams)
148 {
149 if (cmdparams.Length < 2)
150 return;
151
152 string firstName = cmdparams[0];
153 string lastName = cmdparams[1];
154
155 IList agents = m_sceneManager.GetCurrentSceneAvatars();
156
157 foreach (ScenePresence presence in agents)
158 {
159 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle);
160
161 if (presence.Firstname.ToLower().Equals(firstName) && presence.Lastname.ToLower().Equals(lastName))
162 {
163 m_console.Notice(
164 String.Format(
165 "Found user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
166 presence.Firstname,
167 presence.Lastname,
168 presence.UUID,
169 regionInfo.RegionName));
170
171 presence.Scene.CloseConnection(regionInfo.RegionHandle, presence.UUID);
172 }
173 }
174 m_console.Notice("");
175
176 }
177
145 /// <summary> 178 /// <summary>
146 /// 179 ///
147 /// </summary> 180 /// </summary>
@@ -254,7 +287,6 @@ namespace OpenSim
254 m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); 287 m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
255 m_console.Notice("export-map [filename] - save image of world map"); 288 m_console.Notice("export-map [filename] - save image of world map");
256 m_console.Notice("force-update - force an update of prims in the scene"); 289 m_console.Notice("force-update - force an update of prims in the scene");
257 m_console.Notice("kickuser [first] [last] - attempts to log off a user from any region we are serving");
258 m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); 290 m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)");
259 m_console.Notice("load-xml2 [filename] - load prims from XML using version 2 format"); 291 m_console.Notice("load-xml2 [filename] - load prims from XML using version 2 format");
260 m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); 292 m_console.Notice("restart - disconnects all clients and restarts the sims in the instance.");
@@ -535,36 +567,6 @@ namespace OpenSim
535 } 567 }
536 } 568 }
537 break; 569 break;
538
539 case "kickuser": // attempts to log off a user from any region we are serving
540 if (cmdparams.Length < 2 )
541 break;
542
543 string firstName = cmdparams[0];
544 string lastName = cmdparams[1];
545
546 IList agents = m_sceneManager.GetCurrentSceneAvatars();
547
548 foreach (ScenePresence presence in agents)
549 {
550 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle);
551
552 if ( presence.Firstname.ToLower().Equals(firstName) && presence.Lastname.ToLower().Equals(lastName))
553 {
554 m_console.Notice(
555 String.Format(
556 "Found user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
557 presence.Firstname,
558 presence.Lastname,
559 presence.UUID,
560 regionInfo.RegionName));
561
562 presence.Scene.CloseConnection(regionInfo.RegionHandle, presence.UUID);
563 }
564 }
565 m_console.Notice("");
566 break;
567
568 case "modules": 570 case "modules":
569 if (cmdparams.Length > 0) 571 if (cmdparams.Length > 0)
570 { 572 {