mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Formatting cleanup. Minor refactoring.
This commit is contained in:
@@ -170,7 +170,6 @@ namespace OpenSim.Framework.UserManagement
|
||||
AddClassifiedCategory((Int32) 8, "Service");
|
||||
AddClassifiedCategory((Int32) 9, "Personal");
|
||||
|
||||
|
||||
SessionID = LLUUID.Random();
|
||||
SecureSessionID = LLUUID.Random();
|
||||
AgentID = LLUUID.Random();
|
||||
@@ -244,7 +243,10 @@ namespace OpenSim.Framework.UserManagement
|
||||
{
|
||||
return
|
||||
(GenerateFailureResponse("presence",
|
||||
"You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner. Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.",
|
||||
"You appear to be already logged in. " +
|
||||
"If this is not the case please wait for your session to timeout. " +
|
||||
"If this takes longer than a few minutes please contact the grid owner. " +
|
||||
"Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.",
|
||||
"false"));
|
||||
}
|
||||
|
||||
@@ -252,7 +254,9 @@ namespace OpenSim.Framework.UserManagement
|
||||
{
|
||||
return GenerateFailureResponseLLSD(
|
||||
"presence",
|
||||
"You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner",
|
||||
"You appear to be already logged in. " +
|
||||
"If this is not the case please wait for your session to timeout. " +
|
||||
"If this takes longer than a few minutes please contact the grid owner",
|
||||
"false");
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace OpenSim.Framework.UserManagement
|
||||
|
||||
return logResponse.CreateLoginFailedResponse();
|
||||
}
|
||||
|
||||
if (requestData.Contains("passwd"))
|
||||
{
|
||||
string passwd = (string)requestData["passwd"];
|
||||
@@ -494,8 +495,8 @@ namespace OpenSim.Framework.UserManagement
|
||||
}
|
||||
|
||||
public string GetLoginForm(string firstname, string lastname, string location, string region,
|
||||
string grid, string channel, string version, string lang,
|
||||
string password, string errormessages)
|
||||
string grid, string channel, string version, string lang,
|
||||
string password, string errormessages)
|
||||
{
|
||||
// inject our values in the form at the markers
|
||||
|
||||
@@ -522,6 +523,7 @@ namespace OpenSim.Framework.UserManagement
|
||||
loginform = loginform.Replace("[$lang]", lang);
|
||||
loginform = loginform.Replace("[$password]", password);
|
||||
loginform = loginform.Replace("[$errors]", errormessages);
|
||||
|
||||
return loginform;
|
||||
}
|
||||
|
||||
@@ -588,6 +590,7 @@ namespace OpenSim.Framework.UserManagement
|
||||
responseString += "</div>";
|
||||
responseString += "</body>";
|
||||
responseString += "</html>";
|
||||
|
||||
return responseString;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace OpenSim.Framework.Data.DB4o
|
||||
throw new Exception("GetProfileByString Not supported in DB4oGridData");
|
||||
//return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new specified region to the database
|
||||
/// </summary>
|
||||
|
||||
@@ -180,7 +180,6 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's Region name string
|
||||
/// </summary>
|
||||
@@ -222,7 +221,6 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new specified region to the database
|
||||
/// </summary>
|
||||
@@ -242,7 +240,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
System.Console.WriteLine("No regions found. Create new one.");
|
||||
}
|
||||
|
||||
if ( insertRegionRow(profile))
|
||||
if (insertRegionRow(profile))
|
||||
{
|
||||
return DataResponse.RESPONSE_OK;
|
||||
}
|
||||
@@ -252,7 +250,6 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new region in the database
|
||||
/// </summary>
|
||||
@@ -324,7 +321,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// DEPRECATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID of the challenger</param>
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
|
||||
@@ -331,7 +331,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// DEPRECATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID of the challenger</param>
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
|
||||
@@ -114,13 +114,12 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's Region name string
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region name search query</param>
|
||||
/// <param name="regionName">The region name search query</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
public RegionProfileData GetProfileByString(string regionName)
|
||||
{
|
||||
if (regionName.Length > 2)
|
||||
{
|
||||
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
// Add % because this is a like query.
|
||||
param["?regionName"] = regionName + "%";
|
||||
@@ -133,7 +132,6 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
result.Dispose();
|
||||
|
||||
return row;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -142,7 +140,6 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from it's UUID
|
||||
/// </summary>
|
||||
@@ -191,7 +188,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// DEPRECATED. Attempts to authenticate a region by comparing a shared secret.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The UUID of the challenger</param>
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace OpenSim.Framework.Data
|
||||
/// Coordinates of the region
|
||||
/// </summary>
|
||||
public uint regionLocX;
|
||||
|
||||
public uint regionLocY;
|
||||
public uint regionLocZ; // Reserved (round-robin, layers, etc)
|
||||
|
||||
@@ -65,7 +64,6 @@ namespace OpenSim.Framework.Data
|
||||
/// </summary>
|
||||
/// <remarks>Not very secure, needs improvement.</remarks>
|
||||
public string regionSendKey = String.Empty;
|
||||
|
||||
public string regionRecvKey = String.Empty;
|
||||
public string regionSecret = String.Empty;
|
||||
|
||||
@@ -78,7 +76,6 @@ namespace OpenSim.Framework.Data
|
||||
/// Information about the server that the region is currently hosted on
|
||||
/// </summary>
|
||||
public string serverIP = String.Empty;
|
||||
|
||||
public uint serverPort;
|
||||
public string serverURI = String.Empty;
|
||||
|
||||
@@ -90,7 +87,6 @@ namespace OpenSim.Framework.Data
|
||||
/// Set of optional overrides. Can be used to create non-eulicidean spaces.
|
||||
/// </summary>
|
||||
public ulong regionNorthOverrideHandle;
|
||||
|
||||
public ulong regionSouthOverrideHandle;
|
||||
public ulong regionEastOverrideHandle;
|
||||
public ulong regionWestOverrideHandle;
|
||||
@@ -133,7 +129,6 @@ namespace OpenSim.Framework.Data
|
||||
/// </summary>
|
||||
public LLUUID originUUID;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Sim profile data from grid server when in grid mode
|
||||
/// </summary>
|
||||
@@ -184,7 +179,7 @@ namespace OpenSim.Framework.Data
|
||||
/// <param name="gridserver_recvkey"></param>
|
||||
/// <returns>The sim profile. Null if there was a request failure</returns>
|
||||
public static RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url,
|
||||
string gridserver_sendkey, string gridserver_recvkey)
|
||||
string gridserver_sendkey, string gridserver_recvkey)
|
||||
{
|
||||
Hashtable requestData = new Hashtable();
|
||||
requestData["region_handle"] = region_handle.ToString();
|
||||
@@ -226,7 +221,7 @@ namespace OpenSim.Framework.Data
|
||||
/// <param name="gridserver_recvkey"></param>
|
||||
/// <returns>The sim profile. Null if there was a request failure</returns>
|
||||
public static RegionProfileData RequestSimProfileData(string regionName, string gridserver_url,
|
||||
string gridserver_sendkey, string gridserver_recvkey)
|
||||
string gridserver_sendkey, string gridserver_recvkey)
|
||||
{
|
||||
Hashtable requestData = new Hashtable();
|
||||
requestData["region_name_search"] = regionName;
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace OpenSim.Framework
|
||||
// Get a list of invalid file characters (OS dependent)
|
||||
private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]";
|
||||
|
||||
|
||||
#region Vector Equasions
|
||||
/// <summary>
|
||||
/// Get the distance between two 3d vectors
|
||||
@@ -106,6 +105,7 @@ namespace OpenSim.Framework
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
# endregion
|
||||
|
||||
public static ulong UIntsToLong(uint X, uint Y)
|
||||
@@ -384,8 +384,6 @@ namespace OpenSim.Framework
|
||||
return System.Text.RegularExpressions.Regex.Replace(filename, @regexInvalidFileChars, string.Empty); ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// directory locations
|
||||
//
|
||||
@@ -411,23 +409,17 @@ namespace OpenSim.Framework
|
||||
|
||||
public static string configDir()
|
||||
{
|
||||
string temp;
|
||||
temp = ".";
|
||||
return temp;
|
||||
return ".";
|
||||
}
|
||||
|
||||
public static string dataDir()
|
||||
{
|
||||
string temp;
|
||||
temp = ".";
|
||||
return temp;
|
||||
return ".";
|
||||
}
|
||||
|
||||
public static string logDir()
|
||||
{
|
||||
string temp;
|
||||
temp = ".";
|
||||
return temp;
|
||||
return ".";
|
||||
}
|
||||
|
||||
public static string GetCapsURL(LLUUID userID)
|
||||
@@ -549,8 +541,8 @@ namespace OpenSim.Framework
|
||||
try
|
||||
{
|
||||
stream = new FileStream(
|
||||
filename, FileMode.Create,
|
||||
FileAccess.Write, FileShare.None);
|
||||
filename, FileMode.Create,
|
||||
FileAccess.Write, FileShare.None);
|
||||
|
||||
formatter.Serialize(stream, obj);
|
||||
}
|
||||
@@ -577,8 +569,8 @@ namespace OpenSim.Framework
|
||||
try
|
||||
{
|
||||
stream = new FileStream(
|
||||
filename, FileMode.Open,
|
||||
FileAccess.Read, FileShare.None);
|
||||
filename, FileMode.Open,
|
||||
FileAccess.Read, FileShare.None);
|
||||
|
||||
ret = formatter.Deserialize(stream);
|
||||
}
|
||||
@@ -597,6 +589,7 @@ namespace OpenSim.Framework
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string[] ParseStartLocationRequest(string startLocationRequest)
|
||||
{
|
||||
string[] returnstring = new string[4];
|
||||
@@ -617,33 +610,22 @@ namespace OpenSim.Framework
|
||||
|
||||
if (splitstr.GetLength(0) == 2)
|
||||
{
|
||||
|
||||
string[] splitstr2 = splitstr[1].Split('&');//, 4, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
//System.Console.WriteLine("Found " + splitstr2.GetLength(0) + " elements in 2nd split result");
|
||||
|
||||
if (splitstr2.GetLength(0) >= 1)
|
||||
int len = Math.Min(splitstr2.GetLength(0), 4);
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
returnstring[0] = splitstr2[0];
|
||||
}
|
||||
if (splitstr2.GetLength(0) >= 2)
|
||||
{
|
||||
returnstring[1] = splitstr2[1];
|
||||
}
|
||||
if (splitstr2.GetLength(0) >= 3)
|
||||
{
|
||||
returnstring[2] = splitstr2[2];
|
||||
}
|
||||
if (splitstr2.GetLength(0) >= 4)
|
||||
{
|
||||
returnstring[3] = splitstr2[3];
|
||||
if (len > i)
|
||||
{
|
||||
returnstring[i] = splitstr2[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return returnstring;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user