mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* Optimized usings
* shortened references * Removed redundant 'this' * Normalized EOF
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -26,21 +26,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim;
|
||||
using OpenSim.Framework.Console;
|
||||
using Mono.Addins;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.RegionLoader.Filesystem;
|
||||
using OpenSim.Framework.RegionLoader.Web;
|
||||
using Mono.Addins;
|
||||
using Mono.Addins.Description;
|
||||
using Nini;
|
||||
using Nini.Config;
|
||||
|
||||
[assembly:Addin]
|
||||
[assembly:AddinDependency ("OpenSim", "0.4")]
|
||||
[assembly : Addin]
|
||||
[assembly : AddinDependency("OpenSim", "0.4")]
|
||||
|
||||
namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
@@ -65,7 +58,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
regionLoader.SetIniConfigSource(openSim.ConfigSource);
|
||||
RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
|
||||
|
||||
|
||||
openSim.ModuleLoader.LoadDefaultSharedModules();
|
||||
|
||||
for (int i = 0; i < regionsToLoad.Length; i++)
|
||||
@@ -77,6 +70,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
openSim.ModuleLoader.PostInitialise();
|
||||
openSim.ModuleLoader.ClearCache();
|
||||
}
|
||||
|
||||
public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle)
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised");
|
||||
@@ -103,11 +97,10 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
openSim.CreateRegion(regionsToLoad[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,28 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Addin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.Addin")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly : AssemblyTitle("OpenSim.Addin")]
|
||||
[assembly : AssemblyDescription("")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("")]
|
||||
[assembly : AssemblyProduct("OpenSim.Addin")]
|
||||
[assembly : AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("45b979d9-d8d4-42fd-9780-fe9ac7e86cb4")]
|
||||
|
||||
[assembly : Guid("45b979d9-d8d4-42fd-9780-fe9ac7e86cb4")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
@@ -32,5 +34,6 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
[assembly : AssemblyVersion("1.0.0.0")]
|
||||
[assembly : AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -27,24 +27,19 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Net;
|
||||
using OpenSim;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using Mono.Addins;
|
||||
using Mono.Addins.Description;
|
||||
using Nini;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using System.Collections;
|
||||
using System.Net;
|
||||
using System.Timers;
|
||||
using libsecondlife;
|
||||
using Mono.Addins;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
|
||||
[assembly: Addin]
|
||||
[assembly: AddinDependency("OpenSim", "0.4")]
|
||||
[assembly : Addin]
|
||||
[assembly : AddinDependency("OpenSim", "0.4")]
|
||||
|
||||
namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
@@ -54,6 +49,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
private OpenSimMain m_app;
|
||||
private BaseHttpServer m_httpd;
|
||||
private string requiredPassword = "";
|
||||
|
||||
public void Initialise(OpenSimMain openSim)
|
||||
{
|
||||
try
|
||||
@@ -81,12 +77,13 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
|
||||
LLUUID regionID = new LLUUID((string)requestData["regionID"]);
|
||||
LLUUID regionID = new LLUUID((string) requestData["regionID"]);
|
||||
|
||||
Hashtable responseData = new Hashtable();
|
||||
if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword))
|
||||
if (requiredPassword != "" &&
|
||||
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
|
||||
{
|
||||
responseData["accepted"] = "false";
|
||||
response.Value = responseData;
|
||||
@@ -96,7 +93,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
responseData["accepted"] = "true";
|
||||
response.Value = responseData;
|
||||
|
||||
OpenSim.Region.Environment.Scenes.Scene RebootedScene;
|
||||
Scene RebootedScene;
|
||||
|
||||
if (m_app.SceneManager.TryGetScene(regionID, out RebootedScene))
|
||||
{
|
||||
@@ -115,18 +112,18 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
public XmlRpcResponse XmlRpcAlertMethod(XmlRpcRequest request)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
|
||||
Hashtable responseData = new Hashtable();
|
||||
if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword))
|
||||
if (requiredPassword != "" &&
|
||||
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
|
||||
{
|
||||
responseData["accepted"] = "false";
|
||||
response.Value = responseData;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string message = (string)requestData["message"];
|
||||
string message = (string) requestData["message"];
|
||||
MainLog.Instance.Verbose("RADMIN", "Broadcasting: " + message);
|
||||
|
||||
responseData["accepted"] = "true";
|
||||
@@ -142,23 +139,24 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request");
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
Hashtable responseData = new Hashtable();
|
||||
if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword))
|
||||
if (requiredPassword != "" &&
|
||||
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
|
||||
{
|
||||
responseData["accepted"] = "false";
|
||||
response.Value = responseData;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((string)requestData["shutdown"] == "delayed")
|
||||
if ((string) requestData["shutdown"] == "delayed")
|
||||
{
|
||||
int timeout = (Int32)requestData["milliseconds"];
|
||||
int timeout = (Int32) requestData["milliseconds"];
|
||||
|
||||
responseData["accepted"] = "true";
|
||||
response.Value = responseData;
|
||||
|
||||
m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int)(timeout / 1000)).ToString() +
|
||||
m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() +
|
||||
" second(s). Please save what you are doing and log out.");
|
||||
|
||||
// Perform shutdown
|
||||
@@ -197,9 +195,10 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
MainLog.Instance.Verbose("RADMIN", "Received Create Region Administrator Request");
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
Hashtable responseData = new Hashtable();
|
||||
if (requiredPassword != "" && (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword))
|
||||
if (requiredPassword != "" &&
|
||||
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
|
||||
{
|
||||
responseData["created"] = "false";
|
||||
response.Value = responseData;
|
||||
@@ -210,22 +209,22 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
try
|
||||
{
|
||||
newRegionData.RegionID = (string)requestData["region_id"];
|
||||
newRegionData.RegionName = (string)requestData["region_name"];
|
||||
newRegionData.RegionLocX = Convert.ToUInt32((Int32)requestData["region_x"]);
|
||||
newRegionData.RegionLocY = Convert.ToUInt32((Int32)requestData["region_y"]);
|
||||
newRegionData.RegionID = (string) requestData["region_id"];
|
||||
newRegionData.RegionName = (string) requestData["region_name"];
|
||||
newRegionData.RegionLocX = Convert.ToUInt32((Int32) requestData["region_x"]);
|
||||
newRegionData.RegionLocY = Convert.ToUInt32((Int32) requestData["region_y"]);
|
||||
|
||||
// Security risk
|
||||
newRegionData.DataStore = (string)requestData["datastore"];
|
||||
newRegionData.DataStore = (string) requestData["datastore"];
|
||||
|
||||
newRegionData.InternalEndPoint = new IPEndPoint(
|
||||
IPAddress.Parse((string)requestData["listen_ip"]), 0);
|
||||
IPAddress.Parse((string) requestData["listen_ip"]), 0);
|
||||
|
||||
newRegionData.InternalEndPoint.Port = (Int32)requestData["listen_port"];
|
||||
newRegionData.ExternalHostName = (string)requestData["external_address"];
|
||||
newRegionData.InternalEndPoint.Port = (Int32) requestData["listen_port"];
|
||||
newRegionData.ExternalHostName = (string) requestData["external_address"];
|
||||
|
||||
newRegionData.MasterAvatarFirstName = (string)requestData["region_master_first"];
|
||||
newRegionData.MasterAvatarLastName = (string)requestData["region_master_last"];
|
||||
newRegionData.MasterAvatarFirstName = (string) requestData["region_master_first"];
|
||||
newRegionData.MasterAvatarLastName = (string) requestData["region_master_last"];
|
||||
|
||||
m_app.CreateRegion(newRegionData);
|
||||
|
||||
@@ -245,7 +244,6 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user