aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorlbsa712007-12-27 21:41:48 +0000
committerlbsa712007-12-27 21:41:48 +0000
commitefd90b56b761219af6425b1c7a2cdd3b6ffb4de2 (patch)
treebf5b897e1e3c13211e3e2fc61d30508b94c928c0 /OpenSim/ApplicationPlugins
parent* removed always true if (diff)
downloadopensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.zip
opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.gz
opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.bz2
opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.xz
* Optimized usings
* shortened references * Removed redundant 'this' * Normalized EOF
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs23
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs31
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs78
3 files changed, 63 insertions, 69 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index 3c27108..b897c60 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -1,4 +1,4 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
@@ -26,21 +26,14 @@
26* 26*
27*/ 27*/
28 28
29using System; 29using Mono.Addins;
30using System.Collections.Generic;
31using System.Text;
32using OpenSim;
33using OpenSim.Framework.Console;
34using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Framework.Console;
35using OpenSim.Framework.RegionLoader.Filesystem; 32using OpenSim.Framework.RegionLoader.Filesystem;
36using OpenSim.Framework.RegionLoader.Web; 33using OpenSim.Framework.RegionLoader.Web;
37using Mono.Addins;
38using Mono.Addins.Description;
39using Nini;
40using Nini.Config;
41 34
42[assembly:Addin] 35[assembly : Addin]
43[assembly:AddinDependency ("OpenSim", "0.4")] 36[assembly : AddinDependency("OpenSim", "0.4")]
44 37
45namespace OpenSim.ApplicationPlugins.LoadRegions 38namespace OpenSim.ApplicationPlugins.LoadRegions
46{ 39{
@@ -65,7 +58,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
65 58
66 regionLoader.SetIniConfigSource(openSim.ConfigSource); 59 regionLoader.SetIniConfigSource(openSim.ConfigSource);
67 RegionInfo[] regionsToLoad = regionLoader.LoadRegions(); 60 RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
68 61
69 openSim.ModuleLoader.LoadDefaultSharedModules(); 62 openSim.ModuleLoader.LoadDefaultSharedModules();
70 63
71 for (int i = 0; i < regionsToLoad.Length; i++) 64 for (int i = 0; i < regionsToLoad.Length; i++)
@@ -77,6 +70,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
77 openSim.ModuleLoader.PostInitialise(); 70 openSim.ModuleLoader.PostInitialise();
78 openSim.ModuleLoader.ClearCache(); 71 openSim.ModuleLoader.ClearCache();
79 } 72 }
73
80 public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle) 74 public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle)
81 { 75 {
82 MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised"); 76 MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised");
@@ -103,11 +97,10 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
103 openSim.CreateRegion(regionsToLoad[i]); 97 openSim.CreateRegion(regionsToLoad[i]);
104 } 98 }
105 } 99 }
106
107 } 100 }
101
108 public void Close() 102 public void Close()
109 { 103 {
110
111 } 104 }
112 } 105 }
113} \ No newline at end of file 106} \ No newline at end of file
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs b/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs
index 0b5f4bd..ffb3e48 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/Properties/AssemblyInfo.cs
@@ -1,26 +1,28 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 2using System.Runtime.InteropServices;
4 3
5// General Information about an assembly is controlled through the following 4// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 5// set of attributes. Change these attribute values to modify the information
7// associated with an assembly. 6// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Addin")] 7
9[assembly: AssemblyDescription("")] 8[assembly : AssemblyTitle("OpenSim.Addin")]
10[assembly: AssemblyConfiguration("")] 9[assembly : AssemblyDescription("")]
11[assembly: AssemblyCompany("")] 10[assembly : AssemblyConfiguration("")]
12[assembly: AssemblyProduct("OpenSim.Addin")] 11[assembly : AssemblyCompany("")]
13[assembly: AssemblyCopyright("Copyright © 2007")] 12[assembly : AssemblyProduct("OpenSim.Addin")]
14[assembly: AssemblyTrademark("")] 13[assembly : AssemblyCopyright("Copyright © 2007")]
15[assembly: AssemblyCulture("")] 14[assembly : AssemblyTrademark("")]
15[assembly : AssemblyCulture("")]
16 16
17// Setting ComVisible to false makes the types in this assembly not visible 17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from 18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type. 19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)] 20
21[assembly : ComVisible(false)]
21 22
22// The following GUID is for the ID of the typelib if this project is exposed to COM 23// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("45b979d9-d8d4-42fd-9780-fe9ac7e86cb4")] 24
25[assembly : Guid("45b979d9-d8d4-42fd-9780-fe9ac7e86cb4")]
24 26
25// Version information for an assembly consists of the following four values: 27// Version information for an assembly consists of the following four values:
26// 28//
@@ -32,5 +34,6 @@ using System.Runtime.InteropServices;
32// You can specify all the values or you can default the Build and Revision Numbers 34// You can specify all the values or you can default the Build and Revision Numbers
33// by using the '*' as shown below: 35// by using the '*' as shown below:
34// [assembly: AssemblyVersion("1.0.*")] 36// [assembly: AssemblyVersion("1.0.*")]
35[assembly: AssemblyVersion("1.0.0.0")] 37
36[assembly: AssemblyFileVersion("1.0.0.0")] 38[assembly : AssemblyVersion("1.0.0.0")]
39[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 9ae1a7b..b57d3e6 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -27,24 +27,19 @@
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic;
31using System.Text;
32using System.Net;
33using OpenSim;
34using OpenSim.Framework.Console;
35using OpenSim.Framework;
36using OpenSim.Framework.Servers;
37using Mono.Addins;
38using Mono.Addins.Description;
39using Nini;
40using Nini.Config;
41using Nwc.XmlRpc;
42using System.Collections; 30using System.Collections;
31using System.Net;
43using System.Timers; 32using System.Timers;
44using libsecondlife; 33using libsecondlife;
34using Mono.Addins;
35using Nwc.XmlRpc;
36using OpenSim.Framework;
37using OpenSim.Framework.Console;
38using OpenSim.Framework.Servers;
39using OpenSim.Region.Environment.Scenes;
45 40
46[assembly: Addin] 41[assembly : Addin]
47[assembly: AddinDependency("OpenSim", "0.4")] 42[assembly : AddinDependency("OpenSim", "0.4")]
48 43
49namespace OpenSim.ApplicationPlugins.LoadRegions 44namespace OpenSim.ApplicationPlugins.LoadRegions
50{ 45{
@@ -54,6 +49,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
54 private OpenSimMain m_app; 49 private OpenSimMain m_app;
55 private BaseHttpServer m_httpd; 50 private BaseHttpServer m_httpd;
56 private string requiredPassword = ""; 51 private string requiredPassword = "";
52
57 public void Initialise(OpenSimMain openSim) 53 public void Initialise(OpenSimMain openSim)
58 { 54 {
59 try 55 try
@@ -81,12 +77,13 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
81 public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request) 77 public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request)
82 { 78 {
83 XmlRpcResponse response = new XmlRpcResponse(); 79 XmlRpcResponse response = new XmlRpcResponse();
84 Hashtable requestData = (Hashtable)request.Params[0]; 80 Hashtable requestData = (Hashtable) request.Params[0];
85 81
86 LLUUID regionID = new LLUUID((string)requestData["regionID"]); 82 LLUUID regionID = new LLUUID((string) requestData["regionID"]);
87 83
88 Hashtable responseData = new Hashtable(); 84 Hashtable responseData = new Hashtable();
89 if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) 85 if (requiredPassword != "" &&
86 (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
90 { 87 {
91 responseData["accepted"] = "false"; 88 responseData["accepted"] = "false";
92 response.Value = responseData; 89 response.Value = responseData;
@@ -96,7 +93,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
96 responseData["accepted"] = "true"; 93 responseData["accepted"] = "true";
97 response.Value = responseData; 94 response.Value = responseData;
98 95
99 OpenSim.Region.Environment.Scenes.Scene RebootedScene; 96 Scene RebootedScene;
100 97
101 if (m_app.SceneManager.TryGetScene(regionID, out RebootedScene)) 98 if (m_app.SceneManager.TryGetScene(regionID, out RebootedScene))
102 { 99 {
@@ -115,18 +112,18 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
115 public XmlRpcResponse XmlRpcAlertMethod(XmlRpcRequest request) 112 public XmlRpcResponse XmlRpcAlertMethod(XmlRpcRequest request)
116 { 113 {
117 XmlRpcResponse response = new XmlRpcResponse(); 114 XmlRpcResponse response = new XmlRpcResponse();
118 Hashtable requestData = (Hashtable)request.Params[0]; 115 Hashtable requestData = (Hashtable) request.Params[0];
119 116
120 Hashtable responseData = new Hashtable(); 117 Hashtable responseData = new Hashtable();
121 if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) 118 if (requiredPassword != "" &&
119 (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
122 { 120 {
123 responseData["accepted"] = "false"; 121 responseData["accepted"] = "false";
124 response.Value = responseData; 122 response.Value = responseData;
125 } 123 }
126 else 124 else
127 { 125 {
128 126 string message = (string) requestData["message"];
129 string message = (string)requestData["message"];
130 MainLog.Instance.Verbose("RADMIN", "Broadcasting: " + message); 127 MainLog.Instance.Verbose("RADMIN", "Broadcasting: " + message);
131 128
132 responseData["accepted"] = "true"; 129 responseData["accepted"] = "true";
@@ -142,23 +139,24 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
142 { 139 {
143 MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request"); 140 MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request");
144 XmlRpcResponse response = new XmlRpcResponse(); 141 XmlRpcResponse response = new XmlRpcResponse();
145 Hashtable requestData = (Hashtable)request.Params[0]; 142 Hashtable requestData = (Hashtable) request.Params[0];
146 Hashtable responseData = new Hashtable(); 143 Hashtable responseData = new Hashtable();
147 if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) 144 if (requiredPassword != "" &&
145 (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
148 { 146 {
149 responseData["accepted"] = "false"; 147 responseData["accepted"] = "false";
150 response.Value = responseData; 148 response.Value = responseData;
151 } 149 }
152 else 150 else
153 { 151 {
154 if ((string)requestData["shutdown"] == "delayed") 152 if ((string) requestData["shutdown"] == "delayed")
155 { 153 {
156 int timeout = (Int32)requestData["milliseconds"]; 154 int timeout = (Int32) requestData["milliseconds"];
157 155
158 responseData["accepted"] = "true"; 156 responseData["accepted"] = "true";
159 response.Value = responseData; 157 response.Value = responseData;
160 158
161 m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int)(timeout / 1000)).ToString() + 159 m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() +
162 " second(s). Please save what you are doing and log out."); 160 " second(s). Please save what you are doing and log out.");
163 161
164 // Perform shutdown 162 // Perform shutdown
@@ -197,9 +195,10 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
197 { 195 {
198 MainLog.Instance.Verbose("RADMIN", "Received Create Region Administrator Request"); 196 MainLog.Instance.Verbose("RADMIN", "Received Create Region Administrator Request");
199 XmlRpcResponse response = new XmlRpcResponse(); 197 XmlRpcResponse response = new XmlRpcResponse();
200 Hashtable requestData = (Hashtable)request.Params[0]; 198 Hashtable requestData = (Hashtable) request.Params[0];
201 Hashtable responseData = new Hashtable(); 199 Hashtable responseData = new Hashtable();
202 if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) 200 if (requiredPassword != "" &&
201 (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
203 { 202 {
204 responseData["created"] = "false"; 203 responseData["created"] = "false";
205 response.Value = responseData; 204 response.Value = responseData;
@@ -210,22 +209,22 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
210 209
211 try 210 try
212 { 211 {
213 newRegionData.RegionID = (string)requestData["region_id"]; 212 newRegionData.RegionID = (string) requestData["region_id"];
214 newRegionData.RegionName = (string)requestData["region_name"]; 213 newRegionData.RegionName = (string) requestData["region_name"];
215 newRegionData.RegionLocX = Convert.ToUInt32((Int32)requestData["region_x"]); 214 newRegionData.RegionLocX = Convert.ToUInt32((Int32) requestData["region_x"]);
216 newRegionData.RegionLocY = Convert.ToUInt32((Int32)requestData["region_y"]); 215 newRegionData.RegionLocY = Convert.ToUInt32((Int32) requestData["region_y"]);
217 216
218 // Security risk 217 // Security risk
219 newRegionData.DataStore = (string)requestData["datastore"]; 218 newRegionData.DataStore = (string) requestData["datastore"];
220 219
221 newRegionData.InternalEndPoint = new IPEndPoint( 220 newRegionData.InternalEndPoint = new IPEndPoint(
222 IPAddress.Parse((string)requestData["listen_ip"]), 0); 221 IPAddress.Parse((string) requestData["listen_ip"]), 0);
223 222
224 newRegionData.InternalEndPoint.Port = (Int32)requestData["listen_port"]; 223 newRegionData.InternalEndPoint.Port = (Int32) requestData["listen_port"];
225 newRegionData.ExternalHostName = (string)requestData["external_address"]; 224 newRegionData.ExternalHostName = (string) requestData["external_address"];
226 225
227 newRegionData.MasterAvatarFirstName = (string)requestData["region_master_first"]; 226 newRegionData.MasterAvatarFirstName = (string) requestData["region_master_first"];
228 newRegionData.MasterAvatarLastName = (string)requestData["region_master_last"]; 227 newRegionData.MasterAvatarLastName = (string) requestData["region_master_last"];
229 228
230 m_app.CreateRegion(newRegionData); 229 m_app.CreateRegion(newRegionData);
231 230
@@ -245,7 +244,6 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
245 244
246 public void Close() 245 public void Close()
247 { 246 {
248
249 } 247 }
250 } 248 }
251} \ No newline at end of file 249} \ No newline at end of file