== 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

@@ -403,7 +403,7 @@ namespace OpenSim.Groups
// Here we always return true. The user has been added to the local group,
// independent of whether the remote operation succeeds or not
url = m_UserManagement.GetUserServerURL(uid, "GroupsServerURI");
if (url == string.Empty)
if (url.Length == 0)
{
reason = "You don't have an accessible groups server in your home world. You membership to this group in only within this grid.";
return true;

View File

@@ -66,7 +66,7 @@ namespace OpenSim.Groups
string homeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI",
new string[] { "Startup", "Hypergrid", m_ConfigName}, string.Empty);
if (homeURI == string.Empty)
if (homeURI.Length == 0)
throw new Exception(String.Format("[Groups.RobustHGConnector]: please provide the HomeURI [Startup] or in section {0}", m_ConfigName));
IConfig cnf = config.Configs[m_ConfigName];
@@ -76,7 +76,7 @@ namespace OpenSim.Groups
if (im == null)
{
string imDll = cnf.GetString("OfflineIMService", string.Empty);
if (imDll == string.Empty)
if (imDll.Length == 0)
throw new Exception(String.Format("[Groups.RobustHGConnector]: please provide OfflineIMService in section {0}", m_ConfigName));
Object[] args = new Object[] { config };
@@ -86,7 +86,7 @@ namespace OpenSim.Groups
if (users == null)
{
string usersDll = cnf.GetString("UserAccountService", string.Empty);
if (usersDll == string.Empty)
if (usersDll.Length == 0)
throw new Exception(String.Format("[Groups.RobustHGConnector]: please provide UserAccountService in section {0}", m_ConfigName));
Object[] args = new Object[] { config };

View File

@@ -682,7 +682,7 @@ namespace OpenSim.Groups
ServerUtils.BuildQueryString(sendData),
m_Auth);
if (reply == string.Empty)
if (reply.Length == 0)
return null;
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(

View File

@@ -47,7 +47,7 @@ namespace OpenSim.Groups
string connString = String.Empty;
string realm = "os_groups";
string usersRealm = "GridUser";
string configName = (cName == string.Empty) ? "Groups" : cName;
string configName = (cName.Length == 0) ? "Groups" : cName;
//
// Try reading the [DatabaseService] section, if it exists
@@ -55,9 +55,9 @@ namespace OpenSim.Groups
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);
}

View File

@@ -100,7 +100,7 @@ namespace OpenSim.Groups
return false;
}
if (grec.Data["Location"] == string.Empty)
if (grec.Data["Location"].Length == 0)
{
reason = "Cannot add proxy membership to non-proxy group";
return false;
@@ -234,7 +234,7 @@ namespace OpenSim.Groups
}
// check that the group is remote
if (grec.ServiceLocation == string.Empty)
if (grec.ServiceLocation.Length == 0)
{
m_log.DebugFormat("[Groups.HGGroupsService]: attempt at adding notice to local (non-proxy) group");
return false;

View File

@@ -63,7 +63,7 @@ namespace OpenSim.OfflineIM
m_Enabled = true;
string serviceLocation = cnf.GetString("OfflineMessageURL", string.Empty);
if (serviceLocation == string.Empty)
if (serviceLocation.Length == 0)
m_OfflineIMService = new OfflineIMService(config);
else
m_OfflineIMService = new OfflineIMServiceRemoteConnector(config);

View File

@@ -52,9 +52,9 @@ namespace OpenSim.OfflineIM
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);
}

View File

@@ -63,7 +63,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim();
bool allowRegionless = startupConfig.GetBoolean("allow_regionless", false);
if (url == String.Empty)
if (url.Length == 0)
{
m_log.Error("[WEBLOADER]: Unable to load webserver URL - URL was empty.");
return null;

View File

@@ -56,7 +56,7 @@ namespace OpenSim.Capabilities.Handlers
string invService = serverConfig.GetString("InventoryService", String.Empty);
if (invService == String.Empty)
if (invService.Length == 0)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config };

View File

@@ -52,7 +52,7 @@ namespace OpenSim.Capabilities.Handlers
string invService = serverConfig.GetString("InventoryService", String.Empty);
if (invService == String.Empty)
if (invService.Length == 0)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config };

View File

@@ -52,7 +52,7 @@ namespace OpenSim.Capabilities.Handlers
string assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
if (assetService.Length == 0)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };

View File

@@ -301,7 +301,7 @@ namespace OpenSim.Capabilities.Handlers
string rawEnd = rangeValues[1];
if (rawEnd == "")
if (rawEnd.Length == 0)
{
end = -1;
return true;

View File

@@ -53,7 +53,7 @@ namespace OpenSim.Capabilities.Handlers
string assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
if (assetService.Length == 0)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };

View File

@@ -148,7 +148,7 @@ namespace OpenSim.Data.PGSQL
internal NpgsqlDbType DbtypeFromString(Type type, string PGFieldType)
{
if (PGFieldType == "")
if (PGFieldType.Length == 0)
{
return DbtypeFromType(type);
}

View File

@@ -84,7 +84,7 @@ namespace OpenSim.Data.SQLite
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
if (dbconnect == string.Empty)
if (dbconnect.Length == 0)
{
dbconnect = "URI=file:Asset.db,version=3";
}

View File

@@ -405,7 +405,7 @@ namespace OpenSim.Framework.Console
bool addcr = false;
foreach (string s in current.Keys)
{
if (s == String.Empty)
if (s.Length == 0)
{
CommandInfo ci = (CommandInfo)current[String.Empty];
if (ci.fn.Count != 0)

View File

@@ -127,7 +127,7 @@ namespace OpenSim.Framework.Console
public string Prompt(string p, string def)
{
string ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, true);
if (ret == String.Empty)
if (ret.Length == 0)
ret = def;
return ret;
@@ -168,7 +168,7 @@ namespace OpenSim.Framework.Console
else
ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, echo);
if (ret == String.Empty && def != null)
if (ret.Length == 0 && def != null)
{
ret = def;
}

View File

@@ -371,7 +371,7 @@ namespace OpenSim.Framework.Console
= components.ConvertAll<string>(
c =>
{
if (c == "")
if (c.Length == 0)
return blankComponentFunc.Invoke(c);
else if (c == MaxRawConsoleVectorValue)
return float.MaxValue.ToString();

View File

@@ -402,7 +402,7 @@ namespace OpenSim.Framework.Console
reply["content_type"] = "text/plain";
// Check user name and password
if (m_UserName == String.Empty)
if (m_UserName.Length == 0)
return reply;
if (post["USER"] == null || post["PASS"] == null)

View File

@@ -472,7 +472,7 @@ namespace OpenSim.Framework
m_GridNick = Util.GetConfigVarFromSections<string>(config, "GridNick", namessections, string.Empty);
if (m_GridName == string.Empty)
if (string.IsNullOrEmpty(m_GridName))
m_GridName = "Another bad configured grid";
OSHTTPURI tmpuri;

View File

@@ -322,7 +322,7 @@ namespace OpenSim.Framework
/// <returns>null if the folder is not found</returns>
public InventoryFolderImpl FindFolderByPath(string path)
{
if (path == string.Empty)
if (path.Length == 0)
return this;
path = path.Trim();

View File

@@ -62,7 +62,7 @@ namespace OpenSim.Framework
str += "T";
if ((perms & (int)PermissionMask.Export) != 0)
str += "X";
if (str == "")
if (str.Length == 0)
str = ".";
return str;
}

View File

@@ -184,7 +184,7 @@ namespace OpenSim.Framework
public static PhysicsInertiaData FromXml2(string text)
{
if (text == String.Empty)
if (text.Length == 0)
return null;
bool error;

View File

@@ -444,12 +444,12 @@ namespace OpenSim.Framework
MainConsole.Instance.Output("the default is displayed between [ ] brackets.\n");
MainConsole.Instance.Output("=====================================\n");
if (name == String.Empty)
if (name.Length == 0)
{
while (name.Trim() == string.Empty)
while (name.Trim().Length == 0)
{
name = MainConsole.Instance.Prompt("New region name", name);
if (name.Trim() == string.Empty)
if (name.Trim().Length == 0)
{
MainConsole.Instance.Output("Cannot interactively create region with no name");
}
@@ -461,7 +461,7 @@ namespace OpenSim.Framework
creatingNew = true;
}
if (name == String.Empty)
if (name.Length == 0)
name = source.Configs[0].Name;
if (source.Configs[name] == null)
@@ -505,7 +505,7 @@ namespace OpenSim.Framework
//
allKeys.Remove("Location");
string location = config.GetString("Location", String.Empty);
if (location == String.Empty)
if (location.Length == 0)
{
location = MainConsole.Instance.Prompt("Region Location", "1000,1000");
config.Set("Location", location);

View File

@@ -153,7 +153,7 @@ namespace OpenSim.Framework.Serialization.External
[Obsolete("This method is deprecated. Use RewriteSOP instead.")]
public static string RewriteSOP_Old(string xml, string homeURL, IUserAccountService userService, UUID scopeID)
{
if (xml == string.Empty || homeURL == string.Empty || userService == null)
if (xml.Length == 0 || homeURL.Length == 0 || userService == null)
return xml;
XmlDocument doc = new XmlDocument();
@@ -213,7 +213,7 @@ namespace OpenSim.Framework.Serialization.External
public static string RewriteSOP(string xmlData, string sceneName, string homeURL, IUserAccountService userService, UUID scopeID)
{
// Console.WriteLine("Input XML [{0}]", xmlData);
if (xmlData == string.Empty || homeURL == string.Empty || userService == null)
if (xmlData.Length == 0 || homeURL.Length == 0 || userService == null)
return xmlData;
// Deal with bug introduced in Oct. 20 2014 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)

View File

@@ -82,9 +82,9 @@ namespace OSHttpServer
// Verifies the parameter
if (cookie == null)
throw new ArgumentNullException("cookie");
if (cookie.Name == null || cookie.Name.Trim() == string.Empty)
if (cookie.Name == null || cookie.Name.Trim().Length == 0)
throw new ArgumentException("Name must be specified.");
if (cookie.Value == null || cookie.Value.Trim() == string.Empty)
if (cookie.Value == null || cookie.Value.Trim().Length == 0)
throw new ArgumentException("Content must be specified.");
if (_items.ContainsKey(cookie.Name))

View File

@@ -21,9 +21,9 @@ namespace OSHttpServer
// Verifies the parameter
if (cookie == null)
throw new ArgumentNullException("cookie");
if (cookie.Name == null || cookie.Name.Trim() == string.Empty)
if (cookie.Name == null || cookie.Name.Trim().Length == 0)
throw new ArgumentException("Name must be specified.");
if (cookie.Value == null || cookie.Value.Trim() == string.Empty)
if (cookie.Value == null || cookie.Value.Trim().Length == 0)
throw new ArgumentException("Content must be specified.");
if (_items.ContainsKey(cookie.Name))

View File

@@ -724,7 +724,7 @@ namespace OpenSim.Framework.Servers
while ((currentCommand = readFile.ReadLine()) != null)
{
currentCommand = currentCommand.Trim();
if (!(currentCommand == ""
if (!(currentCommand.Length == 0
|| currentCommand.StartsWith(";")
|| currentCommand.StartsWith("//")
|| currentCommand.StartsWith("#")))

View File

@@ -2587,7 +2587,7 @@ namespace OpenSim.Framework
public static string ServerURIasIP(string uri)
{
if (uri == string.Empty)
if (uri.Length == 0)
return string.Empty;
// Get rid of eventual slashes at the end
@@ -2869,7 +2869,7 @@ namespace OpenSim.Framework
return false;
string rawEnd = rangeValues[1].Trim();
if (rawEnd == "")
if (rawEnd.Length == 0)
{
end = -1;
return true;
@@ -3554,7 +3554,7 @@ namespace OpenSim.Framework
/// <returns></returns>
public static IPEndPoint GetClientIPFromXFF(string xff)
{
if (xff == string.Empty)
if (xff.Length == 0)
return null;
string[] parts = xff.Split(new char[] { ',' });

View File

@@ -99,7 +99,7 @@ namespace OpenSim
m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt");
m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt");
if (startupConfig.GetString("console", String.Empty) == String.Empty)
if (startupConfig.GetString("console", String.Empty).Length == 0)
m_gui = startupConfig.GetBoolean("gui", false);
else
m_consoleType= startupConfig.GetString("console", String.Empty);
@@ -1322,7 +1322,7 @@ namespace OpenSim
// send it off for processing.
IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
response = estateModule.CreateEstate(estateName, userID);
if (response == String.Empty)
if (response.Length == 0)
{
List<int> estates = scene.EstateDataService.GetEstates(estateName);
response = String.Format("Estate {0} created as \"{1}\"", estates.ElementAt(0), estateName);
@@ -1393,7 +1393,7 @@ namespace OpenSim
if (account != null)
response = estateModule.SetEstateOwner(estateId, account);
if (response == String.Empty)
if (response.Length == 0)
{
response = String.Format("Estate owner changed to {0} ({1} {2})", account.PrincipalID, account.FirstName, account.LastName);
}
@@ -1441,7 +1441,7 @@ namespace OpenSim
// send it off for processing.
response = estateModule.SetEstateName(estateId, estateName);
if (response == String.Empty)
if (response.Length == 0)
{
response = String.Format("Estate {0} renamed to \"{1}\"", estateId, estateName);
}
@@ -1492,7 +1492,7 @@ namespace OpenSim
// send it off for processing.
IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
response = estateModule.SetRegionEstate(scene.RegionInfo, estateId);
if (response == String.Empty)
if (response.Length == 0)
{
estateModule.TriggerRegionInfoChange();
estateModule.sendRegionHandshakeToAll();

View File

@@ -182,7 +182,7 @@ namespace OpenSim
// The location can also be specified in the environment. If there
// is no location in the configuration, we must call the constructor
// without a location parameter to allow that to happen.
if (registryLocation == String.Empty)
if (registryLocation.Length == 0)
{
using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this)))
{

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack.Linden
private const int KEEPALIVE = 60; // this could be larger now, but viewers expect it on opensim
// we need to go back to close before viwers, or we may lose data
private const int VIEWERKEEPALIVE = (KEEPALIVE - 1) * 1000; // do it shorter
private const int VIEWERKEEPALIVE = (KEEPALIVE - 2) * 1000; // do it shorter
/// <value>
/// Debug level.

View File

@@ -354,7 +354,7 @@ namespace OpenSim.Region.ClientStack.Linden
string capUrl;
// disable the cap clause
if (url == "")
if (url.Length == 0)
{
return;
}

View File

@@ -1673,7 +1673,7 @@ namespace OpenSim.Region.CoreModules.Asset
public string Store(AssetBase asset)
{
if (asset.FullID == UUID.Zero)
if (asset.FullID.IsZero())
{
asset.FullID = UUID.Random();
}

View File

@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
return;
m_URL = config.GetString("URL", String.Empty);
if (m_URL == String.Empty)
if (m_URL.Length == 0)
return;
m_enabled = true;
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
public WearableCacheItem[] Get(UUID id)
{
if (m_URL == String.Empty)
if (m_URL.Length == 0)
return null;
using (RestClient rc = new RestClient(m_URL))
@@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
public void Store(UUID agentId, WearableCacheItem[] data)
{
if (m_URL == String.Empty)
if (m_URL.Length == 0)
return;
int numberWears = 0;

View File

@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// We need to look for its information in the friends list itself
FriendInfo[] finfos = null;
bool confirming = false;
if (friendUUI == string.Empty)
if (friendUUI.Length == 0)
{
finfos = GetFriendsFromCache(agentID);
foreach (FriendInfo finfo in finfos)

View File

@@ -184,7 +184,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
Util.FireAndForget(delegate
{
bool success = false;
if (foreigner && url == string.Empty) // we don't know about this user
if (foreigner && url.Length == 0) // we don't know about this user
{
string recipientUUI = TryGetRecipientUUI(new UUID(im.fromAgentID), toAgentID);
//m_log.DebugFormat("[HG MESSAGE TRANSFER]: Got UUI {0}", recipientUUI);

View File

@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
m_RestURL = cnf.GetString("OfflineMessageURL", "");
if (m_RestURL == "")
if (m_RestURL.Length == 0)
{
m_log.Error("[OFFLINE MESSAGING] Module was enabled, but no URL is given, disabling");
enabled = false;
@@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private void RetrieveInstantMessages(IClientAPI client)
{
if (m_RestURL == String.Empty)
if (m_RestURL.Length == 0)
{
return;
}

View File

@@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
List<InventoryFolderBase> foundFolders = new List<InventoryFolderBase>();
if (path == string.Empty)
if (path.Length == 0)
{
foundFolders.Add(startFolder);
return foundFolders;

View File

@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
inventoryFolder.Name,
inventoryFolder.ID,
m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath);
m_invPath.Length == 0 ? InventoryFolderImpl.PATH_DELIMITER : m_invPath);
//recurse through all dirs getting dirs and files
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly, options, userAccountService);

View File

@@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
bool ok = true;
bool foreign = GetUserProfileServerURI(avatarID, out serverURI);
if(serverURI == string.Empty)
if(serverURI.Length == 0)
ok = false;
Byte[] membershipType = new Byte[1];
@@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
int val_flags = acc.UserFlags;
flags = (uint)(val_flags & 0xff);
if (acc.UserTitle == "")
if (acc.UserTitle.Length == 0)
membershipType[0] = (byte)((val_flags & 0x0f00) >> 8);
else
membershipType = Utils.StringToBytes(acc.UserTitle);
@@ -1594,7 +1594,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
if (null != account)
{
if (account.UserTitle == "")
if (account.UserTitle.Length == 0)
membershipType[0] = (Byte)((account.UserFlags & 0xf00) >> 8);
else
membershipType = Utils.StringToBytes(account.UserTitle);
@@ -1607,7 +1607,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
if (GetUserAccountData(avatarID, out userInfo) == true)
{
if ((string)userInfo["user_title"] == "")
if ((string)userInfo["user_title"].Length == 0)
membershipType[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8);
else
membershipType = Utils.StringToBytes((string)userInfo["user_title"]);

View File

@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (m_RestrictAppearanceAbroad)
{
m_AccountName = transferConfig.GetString("AccountForAppearance", string.Empty);
if (m_AccountName == string.Empty)
if (m_AccountName.Length == 0)
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: RestrictAppearanceAbroad is on, but no account has been given for avatar appearance!");
}
}

View File

@@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
private bool IsLocalInventoryAssetsUser(UUID uuid, out string assetsURL)
{
assetsURL = UserManagementModule.GetUserServerURL(uuid, "AssetServerURI");
if (assetsURL == string.Empty)
if (assetsURL.Length == 0)
{
AgentCircuitData agent = m_Scene.AuthenticateHandler.GetAgentCircuitData(uuid);
if (agent != null)

View File

@@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
public void SendEmail(UUID objectID, string address, string subject, string body)
{
//Check if address is empty
if (address == string.Empty)
if (address.Length == 0)
return;
//FIXED:Check the email is correct form in REGEX

View File

@@ -71,7 +71,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid
if (fconfig != null)
{
m_LocalServiceDll = fconfig.GetString("LocalServiceModule", m_LocalServiceDll);
if (m_LocalServiceDll == string.Empty)
if (m_LocalServiceDll.Length == 0)
m_log.WarnFormat("[HGGRID IN CONNECTOR]: Friends LocalServiceModule config missing");
}
}

View File

@@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile
string serviceDll = config.GetString("LocalServiceModule", String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: No LocalServiceModule named in section UserProfilesService");
return;

View File

@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication
string serviceDll = userConfig.GetString("LocalServiceModule",
String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[AUTH CONNECTOR]: No LocalServiceModule named in section AuthenticationService");
return;

View File

@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar
string serviceDll = userConfig.GetString("LocalServiceModule",
String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[AVATAR CONNECTOR]: No LocalServiceModule named in section AvatarService");
return;

View File

@@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
{
string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
if (msg == string.Empty && m_RemoteGridService != null)
if (msg.Length == 0 && m_RemoteGridService != null)
return m_RemoteGridService.RegisterRegion(scopeID, regionInfo);
return msg;

View File

@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
string serviceDll = userConfig.GetString("LocalServiceModule", String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: No LocalServiceModule named in section GridUserService");
return;

View File

@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string localDll = inventoryConfig.GetString("LocalGridInventoryService",
String.Empty);
if (localDll == String.Empty)
if (localDll.Length == 0)
{
m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService");
//return;

View File

@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string serviceDll = inventoryConfig.GetString("LocalServiceModule", String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: No LocalServiceModule named in section InventoryService");
return;
@@ -184,7 +184,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
// Protect ourselves against the caller subsequently modifying the items list
List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items);
WorkManager.RunInThread(delegate
WorkManager.RunInThreadPool(delegate
{
foreach (InventoryItemBase item in items)
if (!string.IsNullOrEmpty(item.CreatorData))

View File

@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
}
string service = config.GetString("LocalServiceModule", string.Empty);
if (service == string.Empty)
if (service.Length == 0)
{
m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No service dll given in config. Unable to proceed.");
return;

View File

@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MuteList
string serviceDll = userConfig.GetString("LocalServiceModule",
String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[MuteList LOCALCONNECTOR]: No LocalServiceModule named in section MuteListService");
return;

View File

@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
string serviceDll = inventoryConfig.GetString("LocalServiceModule", String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[LOCAL PRESENCE CONNECTOR]: No LocalServiceModule named in section PresenceService");
return;

View File

@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
string serviceDll = userConfig.GetString("LocalServiceModule", String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[LOCAL USER ACCOUNT SERVICE CONNECTOR]: No LocalServiceModule named in section UserService");
return;

View File

@@ -660,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
catch (Exception e)
{
m_log.Error(string.Format("[ARCHIVER]: Error closing archive: {0} ", e.Message), e);
if (errorMessage == string.Empty)
if (errorMessage.Length == 0)
errorMessage = e.Message;
}

View File

@@ -1863,7 +1863,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
this.Scene.RegionInfo.RegionSettings;
SceneObjectGroup telehub = null;
if (settings.TelehubObject != UUID.Zero &&
if (!settings.TelehubObject.IsZero() &&
(telehub = Scene.GetSceneObjectGroup(settings.TelehubObject)) != null)
{
List<Vector3> spawnPoints = new List<Vector3>();

View File

@@ -345,7 +345,7 @@ namespace OpenSim.Region.CoreModules.World.Region
protected void CreateMarkerFile()
{
if (m_MarkerPath == String.Empty)
if (m_MarkerPath.Length == 0)
return;
string path = Path.Combine(m_MarkerPath, m_Scene.RegionInfo.RegionID.ToString());

View File

@@ -51,9 +51,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.bevel == "taper")
{
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = String.Format("Noise strength must be 0.0 to 1.0: {0}", data.elevation);
}
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.bevel == "taper")
{
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = String.Format("Smoothing strength must be 0.0 to 1.0: {0}", data.elevation);
}
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -66,10 +66,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
{
result = this.parseFloat(args[3], out data.elevation);
}
if (result == String.Empty)
if (result.Length == 0)
{
int index = 3;
while(++index < args.Length && result == String.Empty)
while(++index < args.Length && result.Length == 0)
{
arg = args[index];
// check for shape
@@ -91,15 +91,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain
else
{
result = this.parseInt(coords[0], out data.x0);
if (result == String.Empty)
if (result.Length == 0)
{
result = this.parseInt(coords[1], out data.y0);
}
if (result == String.Empty)
if (result.Length == 0)
{
result = this.parseInt(coords[2], out data.dx);
}
if (result == String.Empty)
if (result.Length == 0)
{
if (coords.Length == 4)
{
@@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
data.dy = data.dx;
}
}
if (result == String.Empty)
if (result.Length == 0)
{
if ((data.dx <= 0) || (data.dy <= 0))
{

View File

@@ -2026,7 +2026,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
result = operation.ModifyTerrain(m_channel, cmd);
}
if (result == String.Empty)
if (result.Length == 0)
{
result = "Modified terrain";
m_log.DebugFormat("Performed terrain operation {0}", operationType);

View File

@@ -587,7 +587,7 @@ namespace OpenSim.Region.Framework.Scenes
public static SOPVehicle FromXml2(string text)
{
if (text == String.Empty)
if (text.Length == 0)
return null;
UTF8Encoding enc = new UTF8Encoding();

View File

@@ -1068,7 +1068,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
if (newName == String.Empty)
if (newName.Length == 0)
newName = item.Name;
AssetBase asset = AssetService.Get(item.AssetID.ToString());

View File

@@ -545,7 +545,7 @@ namespace OpenSim.Region.Framework.Scenes
Scene s = (Scene)ins;
if (objXMLData == String.Empty)
if (objXMLData.Length == 0)
return;
IScriptModule scriptModule = null;

View File

@@ -158,10 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
get
{
// assume SitTargetOrientation is normalized (as needed elsewhere)
if( SitTargetPosition != Vector3.Zero ||
SitTargetOrientation.X != 0f ||
SitTargetOrientation.Y != 0f ||
SitTargetOrientation.Z != 0f)
if( !SitTargetPosition.IsZero() || !SitTargetOrientation.IsIdentityOrZero())
return true;
return false;
}
@@ -534,7 +531,7 @@ namespace OpenSim.Region.Framework.Scenes
set
{
CreatorData = string.Empty;
if ((value == null) || (value != null && value == string.Empty))
if (string.IsNullOrEmpty(value))
return;
// value is uuid or uuid;homeuri;firstname lastname

View File

@@ -1008,7 +1008,7 @@ namespace OpenSim.Region.Framework.Scenes
protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
{
name = FindAvailableInventoryName(name);
if (name == String.Empty)
if (name.Length == 0)
return;
item.ParentID = m_part.UUID;

View File

@@ -114,7 +114,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
string serviceDll = m_Config.GetString("LocalServiceModule",
String.Empty);
if (serviceDll == String.Empty)
if (serviceDll.Length == 0)
{
m_log.Error("[FreeSwitchVoice]: No LocalServiceModule named in section FreeSwitchVoice. Not starting.");
return;

View File

@@ -1303,7 +1303,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
/// </summary>
private bool XmlFind(XmlElement root, string tag, int nth, out string result)
{
if (root == null || tag == null || tag == String.Empty)
if (root == null || string.IsNullOrEmpty(tag))
{
result = String.Empty;
return false;
@@ -1314,7 +1314,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
private bool XmlFind(XmlElement root, string tag, out string result)
{
int nth = 0;
if (root == null || tag == null || tag == String.Empty)
if (root == null || string.IsNullOrEmpty(tag))
{
result = String.Empty;
return false;

View File

@@ -77,7 +77,7 @@ namespace OpenSim.Region.OptionalModules.Framework.Monitoring
IConfig etcdConfig = source.Configs["Etcd"];
string etcdUrls = etcdConfig.GetString("EtcdUrls", String.Empty);
if (etcdUrls == String.Empty)
if (etcdUrls.Length == 0)
return;
m_etcdBasePath = etcdConfig.GetString("BasePath", m_etcdBasePath);

View File

@@ -671,7 +671,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
string pkey = "";
foreach (string k in path)
pkey = (pkey == "") ? k : (k + "." + pkey);
pkey = (pkey.Length == 0) ? k : (k + "." + pkey);
return pkey;
}

View File

@@ -73,7 +73,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
"XmlRpcRouterModule") == "XmlRpcGridRouterModule")
{
m_ServerURI = startupConfig.GetString("XmlRpcHubURI", String.Empty);
if (m_ServerURI == String.Empty)
if (m_ServerURI.Length == 0)
{
m_log.Error("[XMLRPC GRID ROUTER] Module configured but no URI given. Disabling");
return;

View File

@@ -3602,10 +3602,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
PhysicsActor pa = group.RootPart.PhysActor;
//Recoil.
if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
if (pa != null && pa.IsPhysical && !((Vector3)vel).IsZero())
{
Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
if (recoil != Vector3.Zero)
if (!recoil.IsZero())
{
llApplyImpulse(recoil, 0);
}
@@ -5199,7 +5199,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
}
if (message == string.Empty)
if (message.Length == 0)
{
Error("llTextBox", "Empty message");
}
@@ -8115,7 +8115,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
}
if (message == string.Empty)
if (message.Length == 0)
{
Error("llDialog", "Empty message");
}
@@ -8127,7 +8127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string[] buts = new string[length];
for (int i = 0; i < length; i++)
{
if (buttons.Data[i].ToString() == String.Empty)
if (buttons.Data[i].ToString().Length == 0)
{
Error("llDialog", "Button label cannot be blank");
return;
@@ -13800,9 +13800,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScriptSleep(300);
if (str1 == string.Empty)
if (str1.Length == 0)
return string.Empty;
if (str2 == string.Empty)
if (str2.Length == 0)
return str1;
int len = str2.Length;
@@ -13882,9 +13882,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llXorBase64StringsCorrect(string str1, string str2)
{
if (str1 == string.Empty)
if (str1.Length == 0)
return string.Empty;
if (str2 == string.Empty)
if (str2.Length == 0)
return str1;
int len = str2.Length;
@@ -14171,7 +14171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
// The rest of those would be added to the body in SL.
// Let's not do that.
if (urlParts[i] == string.Empty)
if (urlParts[i].Length == 0)
break;
// See if this could be a valid header
@@ -17392,7 +17392,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
if (state == String.Empty)
if (state.Length == 0)
{
llShout(ScriptBaseClass.DEBUG_CHANNEL, "Invalid animation state " + animState);
return;
@@ -17469,7 +17469,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
if (state == String.Empty)
if (state.Length == 0)
{
return;
}
@@ -17507,7 +17507,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
if (state == String.Empty)
if (state.Length == 0)
{
return String.Empty;
}

View File

@@ -713,7 +713,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
seconds -= 15;
}
if (msg == String.Empty)
if (msg.Length == 0)
restartModule.ScheduleRestart(UUID.Zero, "Region: " + World.RegionInfo.RegionName + " is about to restart.\n\nIf you stay here you will be logged out.\n\n\nTime remaining: {0}.\n", times.ToArray(), true);
else
@@ -782,7 +782,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.VeryHigh, "osSetDynamicTextureURL");
if (dynamicID == String.Empty)
if (dynamicID.Length == 0)
{
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
UUID createdTexture =
@@ -803,7 +803,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.VeryHigh, "osSetDynamicTextureURLBlend");
if (dynamicID == String.Empty)
if (dynamicID.Length == 0)
{
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
UUID createdTexture =
@@ -824,7 +824,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.VeryHigh, "osSetDynamicTextureURLBlendFace");
if (dynamicID == String.Empty)
if (dynamicID.Length == 0)
{
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
UUID createdTexture =
@@ -851,12 +851,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData");
if (dynamicID == String.Empty)
if (dynamicID.Length == 0)
{
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
if (textureManager != null)
{
if (extraParams == String.Empty)
if (extraParams.Length == 0)
{
extraParams = "256";
}
@@ -880,12 +880,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlend");
if (dynamicID == String.Empty)
if (dynamicID.Length == 0)
{
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
if (textureManager != null)
{
if (extraParams == String.Empty)
if (extraParams.Length == 0)
{
extraParams = "256";
}
@@ -908,12 +908,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.VeryLow , "osSetDynamicTextureDataBlendFace");
if (dynamicID == String.Empty)
if (dynamicID.Length == 0)
{
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
if (textureManager != null)
{
if (extraParams == String.Empty)
if (extraParams.Length == 0)
{
extraParams = "256";
}
@@ -2711,7 +2711,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
returnValue = userManager.GetUserServerURL(new UUID(uuid), "HomeURI");
}
if (returnValue == "")
if (returnValue.Length == 0)
return World.SceneGridInfo.HomeURLNoEndSlash;
return returnValue;
@@ -4679,7 +4679,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel();
if(impact_sound == "")
if(impact_sound.Length == 0)
{
m_host.CollisionSoundVolume = (float)impact_volume;
m_host.CollisionSound = m_host.invalidCollisionSoundUUID;

View File

@@ -298,7 +298,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
// m_log.DebugFormat("[Compiler]: Compiling assembly {0} for asset {1} in {2}", assembly, asset, m_scriptEngine.World.Name);
if (source == String.Empty)
if (source.Length == 0)
throw new Exception("Cannot find script assembly and no script text present");
enumCompileType language = DefaultCompileLanguage;

View File

@@ -2093,7 +2093,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
// Leading plus sign is allowed, but ignored
v = v.Replace("+", "");
if (v == String.Empty)
if (v.Length == 0)
{
value = 0;
}
@@ -2436,7 +2436,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
v = v.Trim();
if (v == String.Empty || v == null)
if (v.Length == 0 || v == null)
v = "0.0";
else
if (!v.Contains(".") && !v.ToLower().Contains("e"))

View File

@@ -2228,7 +2228,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
// m_log.DebugFormat("[XEngine]: Writing state for script item with ID {0}", itemID);
if (xml == String.Empty)
if (xml.Length == 0)
return false;
XmlDocument doc = new XmlDocument();

View File

@@ -1304,7 +1304,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
foreach(string st in stlines)
{
string stline = st.Trim();
if(stline == "")
if(stline.Length == 0)
continue;
// strip 'at' off the front of line

View File

@@ -194,7 +194,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
public string xmrSetParcelMusicURLGroup (string newurl)
{
string groupname = m_ScriptEngine.Config.GetString ("SetParcelMusicURLGroup", "");
if (groupname == "") throw new ApplicationException ("no SetParcelMusicURLGroup config param set");
if (groupname.Length == 0) throw new ApplicationException ("no SetParcelMusicURLGroup config param set");
IGroupsModule igm = World.RequestModuleInterface<IGroupsModule> ();
if (igm == null) throw new ApplicationException ("no GroupsModule loaded");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More