cosmetics

This commit is contained in:
UbitUmarov
2020-07-15 19:13:22 +01:00
parent 6a27f3fb20
commit 402186844c
3 changed files with 69 additions and 96 deletions

View File

@@ -77,12 +77,7 @@ namespace OpenSim
Culture.SetCurrentCulture();
Culture.SetDefaultCurrentCulture();
if(Util.IsWindows())
ServicePointManager.DefaultConnectionLimit = 32;
else
{
ServicePointManager.DefaultConnectionLimit = 12;
}
ServicePointManager.DefaultConnectionLimit = 64;
try { ServicePointManager.DnsRefreshTimeout = 5000; } catch { }
ServicePointManager.Expect100Continue = false;
@@ -127,14 +122,12 @@ namespace OpenSim
int iocpThreadsMin = 1000;
int iocpThreadsMax = 2000; // may need further adjustment to match other CLR
int currentMinWorkerThreads, currentMinIocpThreads;
System.Threading.ThreadPool.GetMinThreads(out currentMinWorkerThreads, out currentMinIocpThreads);
System.Threading.ThreadPool.GetMinThreads(out int currentMinWorkerThreads, out int currentMinIocpThreads);
m_log.InfoFormat(
"[OPENSIM MAIN]: Runtime gave us {0} min worker threads and {1} min IOCP threads",
currentMinWorkerThreads, currentMinIocpThreads);
int workerThreads, iocpThreads;
System.Threading.ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads);
System.Threading.ThreadPool.GetMaxThreads(out int workerThreads, out int iocpThreads);
m_log.InfoFormat("[OPENSIM MAIN]: Runtime gave us {0} max worker threads and {1} max IOCP threads", workerThreads, iocpThreads);
if (workerThreads < workerThreadsMin)

View File

@@ -114,8 +114,8 @@ namespace OpenSim
}
string asyncCallMethodStr = startupConfig.GetString("async_call_method", String.Empty);
FireAndForgetMethod asyncCallMethod;
if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
if (!String.IsNullOrEmpty(asyncCallMethodStr) &&
Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out FireAndForgetMethod asyncCallMethod))
Util.FireAndForgetMethod = asyncCallMethod;
stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 );
@@ -266,9 +266,11 @@ namespace OpenSim
// Start timer script (run a script every xx seconds)
if (m_timedScript != "disabled")
{
m_scriptTimer = new System.Timers.Timer();
m_scriptTimer.Enabled = true;
m_scriptTimer.Interval = m_timeInterval*1000;
m_scriptTimer = new System.Timers.Timer()
{
Enabled = true,
Interval = m_timeInterval*1000,
};
m_scriptTimer.Elapsed += RunAutoTimerScript;
}
}
@@ -784,8 +786,7 @@ namespace OpenSim
regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName);
}
Scene existingScene;
if (SceneManager.TryGetScene(regInfo.RegionID, out existingScene))
if (SceneManager.TryGetScene(regInfo.RegionID, out Scene existingScene))
{
MainConsole.Instance.Output(
"ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}",
@@ -795,8 +796,7 @@ namespace OpenSim
}
bool changed = PopulateRegionEstateInfo(regInfo);
IScene scene;
CreateRegion(regInfo, true, out scene);
CreateRegion(regInfo, true, out IScene scene);
if (changed)
m_estateDataService.StoreEstateSettings(regInfo.EstateSettings);
@@ -1279,13 +1279,11 @@ namespace OpenSim
protected void CreateEstateCommand(string module, string[] args)
{
string response = null;
UUID userID;
if (args.Length == 2)
{
response = "No user specified.";
}
else if (!UUID.TryParse(args[2], out userID))
else if (!UUID.TryParse(args[2], out UUID userID))
{
response = String.Format("{0} is not a valid UUID", args[2]);
}
@@ -1341,8 +1339,7 @@ namespace OpenSim
}
else
{
int estateId;
if (!int.TryParse(args[3], out estateId))
if (!int.TryParse(args[3], out int estateId))
{
response = String.Format("\"{0}\" is not a valid ID for an Estate", args[3]);
}
@@ -1363,8 +1360,7 @@ namespace OpenSim
if (args.Length == 5)
{
// attempt to get account by UUID
UUID u;
if (UUID.TryParse(s1, out u))
if (UUID.TryParse(s1, out UUID u))
{
account = scene.UserAccountService.GetUserAccount(scopeID, u);
if (account == null)
@@ -1414,8 +1410,7 @@ namespace OpenSim
}
else
{
int estateId;
if (!int.TryParse(args[3], out estateId))
if (!int.TryParse(args[3], out int estateId))
{
response = String.Format("\"{0}\" is not a valid ID for an Estate", args[3]);
}