== string.Empty is .Lenght == 0

This commit is contained in:
UbitUmarov
2022-01-13 20:31:52 +00:00
parent 6595e3ae26
commit fbbcc1edd7
149 changed files with 261 additions and 264 deletions

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 };

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);
}