mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
== string.Empty is .Lenght == 0
This commit is contained in:
@@ -92,14 +92,14 @@ namespace OpenSim.Server.Base
|
||||
else
|
||||
{
|
||||
string cert_path = networkConfig.GetString("cert_path", string.Empty);
|
||||
if (cert_path == string.Empty)
|
||||
if (cert_path.Length == 0)
|
||||
{
|
||||
System.Console.WriteLine("ERROR: Path to X509 certificate is missing, server can't start.");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
string cert_pass = networkConfig.GetString("cert_pass", string.Empty);
|
||||
if (cert_pass == string.Empty)
|
||||
if (cert_pass.Length == 0)
|
||||
{
|
||||
System.Console.WriteLine("ERROR: Password for X509 certificate is missing, server can't start.");
|
||||
Environment.Exit(1);
|
||||
@@ -120,13 +120,13 @@ namespace OpenSim.Server.Base
|
||||
if (!ssl_external)
|
||||
{
|
||||
string cert_path = networkConfig.GetString("cert_path", string.Empty);
|
||||
if ( cert_path == string.Empty )
|
||||
if ( cert_path.Length == 0 )
|
||||
{
|
||||
System.Console.WriteLine("Path to X509 certificate is missing, server can't start.");
|
||||
Thread.CurrentThread.Abort();
|
||||
}
|
||||
string cert_pass = networkConfig.GetString("cert_pass", string.Empty);
|
||||
if ( cert_pass == string.Empty )
|
||||
if ( cert_pass.Length == 0 )
|
||||
{
|
||||
System.Console.WriteLine("Password for X509 certificate is missing, server can't start.");
|
||||
Thread.CurrentThread.Abort();
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace OpenSim.Server.Base
|
||||
public static T LoadPlugin<T> (string dllName, Object[] args) where T:class
|
||||
{
|
||||
// This is good to debug configuration problems
|
||||
//if (dllName == string.Empty)
|
||||
//if (dllName.Length == 0)
|
||||
// Util.PrintCallStack();
|
||||
|
||||
string className = String.Empty;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenSim.Server.Handlers.Authentication
|
||||
string authenticationService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (authenticationService == String.Empty)
|
||||
if (authenticationService.Length == 0)
|
||||
throw new Exception("No AuthenticationService in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Authentication
|
||||
string userService = serverConfig.GetString("UserAccountServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (authService == String.Empty || userService == String.Empty)
|
||||
if (authService.Length == 0 || userService.Length == 0)
|
||||
throw new Exception("No AuthenticationServiceModule or no UserAccountServiceModule in config file for OpenId authentication");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenSim.Server.Handlers.Authorization
|
||||
string authorizationService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (authorizationService == String.Empty)
|
||||
if (authorizationService.Length == 0)
|
||||
throw new Exception("No AuthorizationService in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Server.Handlers.Avatar
|
||||
string avatarService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (avatarService == String.Empty)
|
||||
if (avatarService.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.BakedTextures
|
||||
}
|
||||
|
||||
m_FSBase = assetConfig.GetString("BaseDirectory", string.Empty);
|
||||
if (m_FSBase == string.Empty)
|
||||
if (m_FSBase.Length == 0)
|
||||
{
|
||||
m_log.ErrorFormat("[BAKES]: BaseDirectory not specified");
|
||||
throw new Exception("Configuration error");
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers
|
||||
string service = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (service == String.Empty)
|
||||
if (service.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
string gridService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (gridService == String.Empty)
|
||||
if (gridService.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
if (rinfo != null)
|
||||
result = m_GridService.RegisterRegion(scopeID, rinfo);
|
||||
|
||||
if (result == String.Empty)
|
||||
if (result.Length == 0)
|
||||
return SuccessResult();
|
||||
else
|
||||
return FailureResult(result);
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Server.Handlers.GridUser
|
||||
string service = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (service == String.Empty)
|
||||
if (service.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -62,12 +62,12 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||
|
||||
string theService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
if (theService == String.Empty)
|
||||
if (theService.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
m_TheService = ServerUtils.LoadPlugin<IHGFriendsService>(theService, args);
|
||||
|
||||
theService = serverConfig.GetString("UserAgentService", string.Empty);
|
||||
if (theService == String.Empty)
|
||||
if (theService.Length == 0)
|
||||
throw new Exception("No UserAgentService in " + m_ConfigName);
|
||||
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(theService, new Object[] { config, localConn });
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||
if (request.ContainsKey("SECRET"))
|
||||
secret = request["SECRET"].ToString();
|
||||
|
||||
if (secret == string.Empty)
|
||||
if (secret.Length == 0)
|
||||
return BoolResult(false);
|
||||
|
||||
bool success = m_TheService.DeleteFriendship(friend, secret);
|
||||
@@ -303,7 +303,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||
string sessionStr = request["SESSIONID"].ToString();
|
||||
|
||||
UUID sessionID;
|
||||
if (!UUID.TryParse(sessionStr, out sessionID) || serviceKey == string.Empty)
|
||||
if (!UUID.TryParse(sessionStr, out sessionID) || serviceKey.Length == 0)
|
||||
return false;
|
||||
|
||||
if (!m_UserAgentService.VerifyAgent(sessionID, serviceKey))
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||
int sizeX = 256;
|
||||
int sizeY = 256;
|
||||
|
||||
m_log.DebugFormat("[HG Handler]: XMLRequest to link to {0} from {1}", (name == string.Empty) ? "default region" : name, remoteClient.Address.ToString());
|
||||
m_log.DebugFormat("[HG Handler]: XMLRequest to link to {0} from {1}", (name.Length == 0) ? "default region" : name, remoteClient.Address.ToString());
|
||||
bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason, out sizeX, out sizeY);
|
||||
|
||||
Hashtable hash = new Hashtable();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||
string inventoryService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (inventoryService == String.Empty)
|
||||
if (inventoryService.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||
string inventoryService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (inventoryService == String.Empty)
|
||||
if (inventoryService.Length == 0)
|
||||
throw new Exception("No InventoryService in config file");
|
||||
|
||||
Object[] args = new Object[] { config, m_ConfigName };
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenSim.Server.Handlers.Login
|
||||
throw new Exception(String.Format("No section LoginService in config file"));
|
||||
|
||||
string loginService = serverConfig.GetString("LocalServiceModule", String.Empty);
|
||||
if (loginService == string.Empty)
|
||||
if (loginService.Length == 0)
|
||||
throw new Exception(String.Format("No LocalServiceModule for LoginService in config file"));
|
||||
|
||||
m_Proxy = serverConfig.GetBoolean("HasProxy", false);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenSim.Server.Handlers.GridUser
|
||||
|
||||
string service = serverConfig.GetString("LocalServiceModule", String.Empty);
|
||||
|
||||
if (service == String.Empty)
|
||||
if (service.Length == 0)
|
||||
throw new Exception("LocalServiceModule not present in MuteListService config file MuteListService section");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Server.Handlers.Presence
|
||||
string gridService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (gridService == String.Empty)
|
||||
if (gridService.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||
string service = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (service == String.Empty)
|
||||
if (service.Length == 0)
|
||||
throw new Exception("No LocalServiceModule in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
Reference in New Issue
Block a user