mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 10:46:00 +08:00
== string.Empty is .Lenght == 0
This commit is contained in:
@@ -70,9 +70,9 @@ namespace OpenSim.Services.AssetService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ namespace OpenSim.Services.AssetService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,16 +81,16 @@ namespace OpenSim.Services.AuthenticationService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
//
|
||||
// We tried, but this doesn't exist. We can't proceed.
|
||||
//
|
||||
if (dllName == String.Empty || realm == String.Empty)
|
||||
if (dllName.Length == 0 || realm.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
m_Database = LoadPlugin<IAuthenticationData>(dllName,
|
||||
|
||||
@@ -71,16 +71,16 @@ namespace OpenSim.Services.AuthenticationService
|
||||
{
|
||||
m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID);
|
||||
result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime, out realID);
|
||||
if (result == String.Empty)
|
||||
if (result.Length == 0)
|
||||
{
|
||||
m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID);
|
||||
}
|
||||
}
|
||||
if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt"))
|
||||
if (result.Length == 0 && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt"))
|
||||
{
|
||||
m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID);
|
||||
result = m_svcChecks["password"].Authenticate(principalID, password, lifetime, out realID);
|
||||
if (result == String.Empty)
|
||||
if (result.Length == 0)
|
||||
{
|
||||
m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace OpenSim.Services.AuthenticationService
|
||||
|
||||
|
||||
|
||||
if (result == string.Empty)
|
||||
if (result.Length == 0)
|
||||
{
|
||||
m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID);
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@ namespace OpenSim.Services.AuthorizationService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ namespace OpenSim.Services.AvatarService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace OpenSim.Services.Connectors
|
||||
// trigger since current callers don't pass emtpy IDs
|
||||
// We need the asset ID to route the request to the proper
|
||||
// cluster member, so we can't have the server assign one.
|
||||
if (asset.ID == string.Empty || asset.ID == stringUUIDZero)
|
||||
if (asset.ID.Length == 0 || asset.ID == stringUUIDZero)
|
||||
{
|
||||
if (asset.FullID.IsZero())
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = assetConfig.GetString("AuthenticationServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[AUTH CONNECTOR]: No Server URI named in section AuthenticationService");
|
||||
throw new Exception("Authentication connector init error");
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = authorizationConfig.GetString("AuthorizationServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[AUTHORIZATION CONNECTOR]: No Server URI named in section AuthorizationService");
|
||||
throw new Exception("Authorization connector init error");
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = gridConfig.GetString("AvatarServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[AVATAR CONNECTOR]: No Server URI named in section AvatarService");
|
||||
throw new Exception("Avatar connector init error");
|
||||
@@ -118,7 +118,7 @@ namespace OpenSim.Services.Connectors
|
||||
try
|
||||
{
|
||||
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
|
||||
if (reply == null || (reply != null && reply == string.Empty))
|
||||
if (string.IsNullOrEmpty(reply))
|
||||
{
|
||||
m_log.DebugFormat("[AVATAR CONNECTOR]: GetAgent received null or empty reply");
|
||||
return null;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = gridConfig.GetString("EstateServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[ESTATE CONNECTOR]: No Server URI named in section EstateService");
|
||||
throw new Exception("Estate connector init error");
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = freeswitchConfig.GetString("FreeswitchServiceURL",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[FREESWITCH CONNECTOR]: No FreeswitchServiceURL named in section FreeSwitchVoice");
|
||||
throw new Exception("Freeswitch connector init error");
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace OpenSim.Services.Connectors.Friends
|
||||
string serviceURI = gridConfig.GetString("FriendsServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[FRIENDS SERVICE CONNECTOR]: No Server URI named in section FriendsService");
|
||||
throw new Exception("Friends connector init error");
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = gridConfig.GetString("GridServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[GRID CONNECTOR]: No Server URI named in section GridService");
|
||||
throw new Exception("Grid connector init error");
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Services.Connectors
|
||||
try
|
||||
{
|
||||
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
|
||||
if (reply != string.Empty)
|
||||
if (!string.IsNullOrEmpty(reply))
|
||||
{
|
||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors
|
||||
uri,
|
||||
reqString,
|
||||
m_Auth);
|
||||
if (reply == null || (reply != null && reply == string.Empty))
|
||||
if (string.IsNullOrEmpty(reply))
|
||||
{
|
||||
m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received null or empty reply");
|
||||
return null;
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenSim.Services.Connectors
|
||||
// http://valley.virtualportland.org/simtest/Grid/?id=
|
||||
//
|
||||
uri = new Uri(serverURI + "xxx");
|
||||
if (uri.Query == string.Empty)
|
||||
if (uri.Query.Length == 0)
|
||||
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
|
||||
else
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = config.GetString("InventoryServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService");
|
||||
throw new Exception("Inventory connector init error");
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = config.GetString("MapImageServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[MAP IMAGE CONNECTOR]: No Server URI named in section MapImageService");
|
||||
throw new Exception("MapImage connector init error");
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = gridConfig.GetString("MuteListServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[MUTELIST CONNECTOR]: No Server URI named in section GridUserService");
|
||||
throw new Exception("MuteList connector init error");
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors
|
||||
string serviceURI = gridConfig.GetString("PresenceServerURI",
|
||||
String.Empty);
|
||||
|
||||
if (serviceURI == String.Empty)
|
||||
if (serviceURI.Length == 0)
|
||||
{
|
||||
m_log.Error("[PRESENCE CONNECTOR]: No Server URI named in section PresenceService");
|
||||
throw new Exception("Presence connector init error");
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenSim.Services.EstateService
|
||||
}
|
||||
|
||||
// We tried, but this doesn't exist. We can't proceed
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
m_database = LoadPlugin<IEstateDataStore>(dllName, new Object[] { connString });
|
||||
|
||||
@@ -130,10 +130,10 @@ namespace OpenSim.Services.FSAssetService
|
||||
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
|
||||
if (connectionString == String.Empty)
|
||||
if (connectionString.Length == 0)
|
||||
connectionString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace OpenSim.Services.FSAssetService
|
||||
Directory.CreateDirectory(spoolTmp);
|
||||
|
||||
m_FSBase = assetConfig.GetString("BaseDirectory", String.Empty);
|
||||
if (m_FSBase == String.Empty)
|
||||
if (m_FSBase.Length == 0)
|
||||
{
|
||||
m_log.ErrorFormat("[FSASSETS]: BaseDirectory not specified");
|
||||
throw new Exception("Configuration error");
|
||||
@@ -668,7 +668,7 @@ namespace OpenSim.Services.FSAssetService
|
||||
}
|
||||
}
|
||||
|
||||
if (asset.ID == string.Empty)
|
||||
if (asset.ID.Length == 0)
|
||||
{
|
||||
if (asset.FullID.IsZero())
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenSim.Services.FreeswitchService
|
||||
if (freeswitchConfig != null)
|
||||
{
|
||||
m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty);
|
||||
if (m_freeSwitchDefaultWellKnownIP == String.Empty)
|
||||
if (m_freeSwitchDefaultWellKnownIP.Length == 0)
|
||||
{
|
||||
m_log.Error("[FREESWITCH]: No ServerAddress given, cannot start service.");
|
||||
return;
|
||||
|
||||
@@ -61,9 +61,9 @@ namespace OpenSim.Services.Friends
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ namespace OpenSim.Services.GridService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace OpenSim.Services.GridService
|
||||
regInfo.RegionSizeX = sizeX;
|
||||
regInfo.RegionSizeY = sizeY;
|
||||
|
||||
if (externalName == string.Empty)
|
||||
if (externalName.Length == 0)
|
||||
regInfo.RegionName = regInfo.ServerURI;
|
||||
else
|
||||
regInfo.RegionName = externalName;
|
||||
@@ -402,7 +402,7 @@ namespace OpenSim.Services.GridService
|
||||
regInfo.RegionSizeX = sizeX;
|
||||
regInfo.RegionSizeY = sizeY;
|
||||
|
||||
if (externalName == string.Empty)
|
||||
if (externalName.Length == 0)
|
||||
regInfo.RegionName = regInfo.ServerURI;
|
||||
else
|
||||
regInfo.RegionName = externalName;
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace OpenSim.Services.HypergridService
|
||||
string gridUserService = serverConfig.GetString("GridUserService", string.Empty);
|
||||
string bansService = serverConfig.GetString("BansService", string.Empty);
|
||||
// These are mandatory, the others aren't
|
||||
if (gridService == string.Empty || presenceService == string.Empty)
|
||||
if (gridService.Length == 0 || presenceService.Length == 0)
|
||||
throw new Exception("Incomplete specifications, Gatekeeper Service cannot function.");
|
||||
|
||||
string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString());
|
||||
@@ -205,8 +205,8 @@ namespace OpenSim.Services.HypergridService
|
||||
reason = string.Empty;
|
||||
GridRegion region = null;
|
||||
|
||||
//m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName);
|
||||
if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty)
|
||||
//m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName.Length == 0)? "default region" : regionName);
|
||||
if (!m_AllowTeleportsToAnyRegion || regionName.Length == 0)
|
||||
{
|
||||
List<GridRegion> defs = m_GridService.GetDefaultHypergridRegions(m_ScopeID);
|
||||
if (defs != null && defs.Count > 0)
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenSim.Services.HypergridService
|
||||
throw new Exception("No HGAssetService configuration");
|
||||
|
||||
string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);
|
||||
if (userAccountsDll == string.Empty)
|
||||
if (userAccountsDll.Length == 0)
|
||||
throw new Exception("Please specify UserAccountsService in HGAssetService configuration");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
@@ -81,7 +81,7 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
||||
new string[] { "Startup", "Hypergrid", configName }, string.Empty);
|
||||
if (m_HomeURL == string.Empty)
|
||||
if (m_HomeURL.Length == 0)
|
||||
throw new Exception("[HGAssetService] No HomeURI specified");
|
||||
|
||||
m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenSim.Services.HypergridService
|
||||
throw new Exception("No HGAssetService configuration");
|
||||
|
||||
string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);
|
||||
if (userAccountsDll == string.Empty)
|
||||
if (userAccountsDll.Length == 0)
|
||||
throw new Exception("Please specify UserAccountsService in HGAssetService configuration");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
@@ -75,7 +75,7 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
||||
new string[] { "Startup", "Hypergrid", configName }, string.Empty);
|
||||
if (m_HomeURL == string.Empty)
|
||||
if (m_HomeURL.Length == 0)
|
||||
throw new Exception("[HGAssetService] No HomeURI specified");
|
||||
|
||||
m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
|
||||
|
||||
@@ -85,22 +85,22 @@ namespace OpenSim.Services.HypergridService
|
||||
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
|
||||
|
||||
string theService = serverConfig.GetString("FriendsService", string.Empty);
|
||||
if (theService == String.Empty)
|
||||
if (theService.Length == 0)
|
||||
throw new Exception("No FriendsService in config file " + m_ConfigName);
|
||||
m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);
|
||||
|
||||
theService = serverConfig.GetString("UserAccountService", string.Empty);
|
||||
if (theService == String.Empty)
|
||||
if (theService.Length == 0)
|
||||
throw new Exception("No UserAccountService in " + m_ConfigName);
|
||||
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(theService, args);
|
||||
|
||||
theService = serverConfig.GetString("GridService", string.Empty);
|
||||
if (theService == String.Empty)
|
||||
if (theService.Length == 0)
|
||||
throw new Exception("No GridService in " + m_ConfigName);
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(theService, args);
|
||||
|
||||
theService = serverConfig.GetString("PresenceService", string.Empty);
|
||||
if (theService == String.Empty)
|
||||
if (theService.Length == 0)
|
||||
throw new Exception("No PresenceService in " + m_ConfigName);
|
||||
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(theService, args);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Services.HypergridService
|
||||
{
|
||||
// realm = authConfig.GetString("Realm", realm);
|
||||
string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
|
||||
if (userAccountsDll == string.Empty)
|
||||
if (userAccountsDll.Length == 0)
|
||||
throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenSim.Services.HypergridService
|
||||
Object[] args = new Object[] { config };
|
||||
|
||||
string assetConnectorDll = assetConfig.GetString("AssetConnector", String.Empty);
|
||||
if (assetConnectorDll == String.Empty)
|
||||
if (assetConnectorDll.Length == 0)
|
||||
throw new Exception("Please specify AssetConnector in HGAssetService configuration");
|
||||
|
||||
m_assetConnector = ServerUtils.LoadPlugin<IAssetService>(assetConnectorDll, args);
|
||||
@@ -79,7 +79,7 @@ namespace OpenSim.Services.HypergridService
|
||||
throw new Exception(String.Format("Unable to create AssetConnector from {0}", assetConnectorDll));
|
||||
|
||||
string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);
|
||||
if (userAccountsDll == string.Empty)
|
||||
if (userAccountsDll.Length == 0)
|
||||
throw new Exception("Please specify UserAccountsService in HGAssetService configuration");
|
||||
|
||||
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
|
||||
@@ -88,7 +88,7 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
||||
new string[] { "Startup", "Hypergrid", configName }, string.Empty);
|
||||
if (m_HomeURL == string.Empty)
|
||||
if (m_HomeURL.Length == 0)
|
||||
throw new Exception("[HGAssetService] No HomeURI specified");
|
||||
|
||||
m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenSim.Services.HypergridService
|
||||
if (invConfig != null)
|
||||
{
|
||||
string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
|
||||
if (userAccountsDll == string.Empty)
|
||||
if (userAccountsDll.Length == 0)
|
||||
throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
@@ -89,7 +89,7 @@ namespace OpenSim.Services.HypergridService
|
||||
throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
|
||||
|
||||
string avatarDll = invConfig.GetString("AvatarService", string.Empty);
|
||||
if (avatarDll == string.Empty)
|
||||
if (avatarDll.Length == 0)
|
||||
throw new Exception("Please specify AvatarService in HGInventoryService configuration");
|
||||
|
||||
m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarDll, args);
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);
|
||||
|
||||
if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
|
||||
if (gridService.Length == 0 || gridUserService.Length == 0 || gatekeeperService.Length == 0)
|
||||
throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
@@ -141,7 +141,7 @@ namespace OpenSim.Services.HypergridService
|
||||
if (string.IsNullOrEmpty(m_GridName)) // Legacy. Remove soon.
|
||||
{
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
if (m_GridName == string.Empty)
|
||||
if (m_GridName.Length == 0)
|
||||
{
|
||||
serverConfig = config.Configs["GatekeeperService"];
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
|
||||
@@ -52,9 +52,9 @@ namespace OpenSim.Services.HypergridService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,16 +80,16 @@ namespace OpenSim.Services.InventoryService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
//
|
||||
// We tried, but this doesn't exist. We can't proceed.
|
||||
//
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
m_Database = LoadPlugin<IXInventoryData>(dllName,
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
if (messagingConfig != null)
|
||||
m_messageKey = messagingConfig.GetString("MessageKey", string.Empty);
|
||||
// These are required; the others aren't
|
||||
if (accountService == string.Empty || authService == string.Empty)
|
||||
if (accountService.Length == 0 || authService.Length == 0)
|
||||
throw new Exception("LoginService is missing service specifications");
|
||||
|
||||
// replace newlines in welcome message
|
||||
@@ -266,7 +266,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
//
|
||||
string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30);
|
||||
UUID secureSession = UUID.Zero;
|
||||
if ((token == string.Empty) || (!UUID.TryParse(token, out secureSession)))
|
||||
if ((token.Length == 0) || (!UUID.TryParse(token, out secureSession)))
|
||||
{
|
||||
m_log.InfoFormat("[LLOGIN SERVICE]: SetLevel failed, reason: authentication failed");
|
||||
return response;
|
||||
@@ -919,7 +919,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
{
|
||||
if (gatekeeper == null) // login to local grid
|
||||
{
|
||||
if (hostName == string.Empty)
|
||||
if (hostName.Length == 0)
|
||||
SetHostAndPort(m_GatekeeperURL);
|
||||
|
||||
gatekeeper = new GridRegion(destination);
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Services.EstateService
|
||||
}
|
||||
|
||||
// We tried, but this doesn't exist. We can't proceed
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
m_database = LoadPlugin<IMuteListData>(dllName, new Object[] { connString });
|
||||
|
||||
@@ -52,9 +52,9 @@ namespace OpenSim.Services.PresenceService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenSim.Services.SimulationService
|
||||
}
|
||||
|
||||
// We tried, but this doesn't exist. We can't proceed
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
m_database = LoadPlugin<ISimulationDataStore>(dllName, new Object[] { connString });
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenSim.Services.UserAccountService
|
||||
|
||||
dllName = userConfig.GetString("StorageProvider", dllName);
|
||||
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
connString = userConfig.GetString("ConnectionString", connString);
|
||||
|
||||
@@ -51,9 +51,9 @@ namespace OpenSim.Services.UserAccountService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (connString == String.Empty)
|
||||
if (connString.Length == 0)
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenSim.Services.UserAccountService
|
||||
|
||||
dllName = userConfig.GetString("StorageProvider", dllName);
|
||||
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
connString = userConfig.GetString("ConnectionString", connString);
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenSim.Services.ProfilesService
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
if (dllName == String.Empty)
|
||||
if (dllName.Length == 0)
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
if (string.IsNullOrEmpty(connString))
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
|
||||
Reference in New Issue
Block a user