cosmetics

This commit is contained in:
UbitUmarov
2026-03-15 04:45:37 +00:00
parent 66fb7dee6b
commit 2a5389cc67
17 changed files with 57 additions and 54 deletions

View File

@@ -432,7 +432,7 @@ namespace osWebRtcVoice
{
// The client has finished sending candidates
resp = await viewerSession.Session.TrickleCompleted(viewerSession).ConfigureAwait(false);
_log.DebugFormat($"{LogHeader} VoiceSignalingRequest: candidate completed");
_log.Debug($"{LogHeader} VoiceSignalingRequest: candidate completed");
}
else
{
@@ -483,7 +483,7 @@ namespace osWebRtcVoice
}
if (resp is null)
{
_log.ErrorFormat($"{LogHeader} VoiceSignalingRequest: no response so returning error");
_log.Error($"{LogHeader} VoiceSignalingRequest: no response so returning error");
ret = new OSDMap
{
{ "response", "error" }

View File

@@ -205,7 +205,7 @@ namespace osWebRtcVoice
if(request.HttpMethod != "POST")
{
m_log.DebugFormat($"[{logHeader}][ProvisionVoice]: Not a POST request. Agent={agentID}");
m_log.Debug($"[{logHeader}][ProvisionVoice]: Not a POST request. Agent={agentID}");
response.StatusCode = (int)HttpStatusCode.NotFound;
return;
}
@@ -231,7 +231,7 @@ namespace osWebRtcVoice
}
}
if (_MessageDetails) m_log.DebugFormat($"{logHeader}[ProvisionVoice]: request: {map}");
if (_MessageDetails) m_log.Debug($"{logHeader}[ProvisionVoice]: request: {map}");
if (map.TryGetString("channel_type", out string channelType))
{
@@ -308,7 +308,7 @@ namespace osWebRtcVoice
if(resp is not null)
{
if (_MessageDetails) m_log.DebugFormat($"{logHeader}[ProvisionVoice]: response: {resp}");
if (_MessageDetails) m_log.Debug($"{logHeader}[ProvisionVoice]: response: {resp}");
// TODO: check for errors and package the response
@@ -319,7 +319,7 @@ namespace osWebRtcVoice
}
else
{
m_log.DebugFormat($"{logHeader}[ProvisionVoice]: got null response");
m_log.Debug($"{logHeader}[ProvisionVoice]: got null response");
response.StatusCode = (int)HttpStatusCode.OK;
}
return;
@@ -330,7 +330,7 @@ namespace osWebRtcVoice
IWebRtcVoiceService voiceService = scene.RequestModuleInterface<IWebRtcVoiceService>();
if (voiceService is null)
{
m_log.ErrorFormat($"{logHeader}[VoiceSignalingRequest]: avatar \"{agentID}\": no voice service");
m_log.Error($"{logHeader}[VoiceSignalingRequest]: avatar \"{agentID}\": no voice service");
response.StatusCode = (int)HttpStatusCode.NotFound;
return;
}
@@ -346,7 +346,7 @@ namespace osWebRtcVoice
OSDMap map = BodyToMap(request, "VoiceSignalingRequest");
if (map is null)
{
m_log.ErrorFormat($"{logHeader}[VoiceSignalingRequest]: No request data found. Agent={agentID}");
m_log.Error($"{logHeader}[VoiceSignalingRequest]: No request data found. Agent={agentID}");
response.StatusCode = (int)HttpStatusCode.NoContent;
return;
}
@@ -384,7 +384,7 @@ namespace osWebRtcVoice
/// <param name="scene"></param>
public void ChatSessionRequest(IOSHttpRequest request, IOSHttpResponse response, UUID agentID, Scene scene)
{
m_log.DebugFormat("{0}: ChatSessionRequest received for agent {1} in scene {2}", logHeader, agentID, scene.RegionInfo.RegionName);
m_log.Debug($"{logHeader}: ChatSessionRequest received for agent {agentID} in scene {scene.Name}");
if (request.HttpMethod != "POST")
{
response.StatusCode = (int)HttpStatusCode.NotFound;
@@ -444,7 +444,7 @@ namespace osWebRtcVoice
IEventQueue queue = scene.RequestModuleInterface<IEventQueue>();
if (queue is null)
{
m_log.ErrorFormat("{0}: no event queue for scene {1}", logHeader, scene.RegionInfo.RegionName);
m_log.Error($"{logHeader}: no event queue for scene {scene.Name}");
response.StatusCode = (int)HttpStatusCode.InternalServerError;
}
else

View File

@@ -355,7 +355,7 @@ namespace OpenSim.Framework.Servers.HttpServer
/// <param name="pMessage">Textual reason for the upgrade fail</param>
private void FailUpgrade(HttpStatusCode pCode, string pMessage )
{
string handshakeResponse = string.Format(HandshakeDeclineText, (int)pCode, pMessage.Replace("\n", string.Empty).Replace("\r", string.Empty));
string handshakeResponse = string.Format(HandshakeDeclineText, (int)pCode, pMessage.ReplaceLineEndings(string.Empty));
byte[] bhandshakeResponse = Encoding.UTF8.GetBytes(handshakeResponse);
_networkContext.Stream.Write(bhandshakeResponse, 0, bhandshakeResponse.Length);
_networkContext.Stream.Flush();

View File

@@ -1138,7 +1138,7 @@ namespace OpenSim.Framework
}
catch (Exception e)
{
m_log.ErrorFormat($"[ASYNC REQUEST]: Request {verb} {requestUrl} callback failed with exception {e.Message}");
m_log.Error($"[ASYNC REQUEST]: Request {verb} {requestUrl} callback failed with exception {e.Message}");
}
}, null);

View File

@@ -617,8 +617,7 @@ namespace OpenSim
}
MainConsole.Instance.Output("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
List<char> excluded = new List<char>(new char[1]{' '});
List<char> excluded = new([' ']);
if (estateOwnerFirstName == null || estateOwnerLastName == null)
{

View File

@@ -958,7 +958,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
if (GetUser(userID, out UserData ud) && ud != null)
{
if (ud.LastName.StartsWith("@"))
if (ud.LastName.StartsWith('@'))
{
string[] parts = ud.FirstName.Split('.');
if (parts.Length >= 2)

View File

@@ -1239,7 +1239,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
$"The OAR you are trying to load has major version number of {majorVersion} but this version can only load OARs with major version number {MAX_MAJOR_VERSION} and below");
}
m_log.InfoFormat($"[ARCHIVER]: Loading OAR with version {version}");
m_log.Info($"[ARCHIVER]: Loading OAR with version {version}");
}
else if (xtr.Name.ToString() == "datetime")
{

View File

@@ -157,7 +157,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
if(!UUID.TryParse(thiskey, out UUID id) || id.IsZero())
{
m_log.InfoFormat($"[ARCHIVER]: cannot save asset {kvp.Key} because it has Invalid UUID");
m_log.Info($"[ARCHIVER]: cannot save asset {kvp.Key} because it has Invalid UUID");
m_notFoundAssetUuids.Add(kvp.Key);
continue;
}

View File

@@ -381,12 +381,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
catch (NotImplementedException)
{
m_log.ErrorFormat($"{LogHeader}Unable to load heightmap, the {loader.Value} parser does not support file loading. (May be save only)");
m_log.Error($"{LogHeader}Unable to load heightmap, the {loader.Value} parser does not support file loading. (May be save only)");
throw new TerrainException($"unable to load heightmap: parser {loader.Value} does not support loading");
}
catch (FileNotFoundException)
{
m_log.ErrorFormat($"{LogHeader}Unable to load heightmap, file not found. (A directory permissions error may also cause this)");
m_log.Error($"{LogHeader}Unable to load heightmap, file not found. (A directory permissions error may also cause this)");
throw new TerrainException($"unable to load heightmap: file {filename} not found (or permissions do not allow access");
}
catch (ArgumentException e)
@@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
catch (NotImplementedException)
{
m_log.ErrorFormat($"{LogHeader}Unable to load heightmap, the { loader.Value} parser does not support file loading. (May be save only)");
m_log.Error($"{LogHeader}Unable to load heightmap, the { loader.Value} parser does not support file loading. (May be save only)");
throw new TerrainException("unable to load heightmap: parser {loader.Value} does not support loading");
}
}

View File

@@ -1584,11 +1584,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
try
{
m_log.WarnFormat($"[PHYSICS]: Operation failed for a actor {item.actor.Name} {item.what}");
m_log.Warn($"[PHYSICS]: Operation failed for a actor {item.actor.Name} {item.what}");
}
catch
{
m_log.WarnFormat("[PHYSICS]: Operation failed for a unknown actor");
m_log.Warn("[PHYSICS]: Operation failed for a unknown actor");
}
}
donechanges++;

View File

@@ -948,7 +948,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
return (float)dov;
if (o is LSL_Types.LSLString lso)
return Convert.ToSingle(lso.m_string);
throw new InvalidCastException(string.Format($"LSL float expected but {0} given", o is not null ? o.GetType().Name : "null"));
throw new InvalidCastException(string.Format("LSL float expected but {0} given", o is not null ? o.GetType().Name : "null"));
}
public LSL_Types.LSLString GetLSLStringItem(int itemIndex)

View File

@@ -228,7 +228,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
string oscode = Enum.GetName(typeof(SceneScriptEvents), 1UL << i);
if(mycode != oscode)
{
m_log.ErrorFormat($"[YEngine]: {i} mycode={mycode}, oscode={oscode}");
m_log.Error($"[YEngine]: {i} mycode={mycode}, oscode={oscode}");
err = true;
}
}

View File

@@ -43,6 +43,7 @@ namespace OpenSim.Server.Handlers.Presence
public PresenceServiceConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));

View File

@@ -106,7 +106,6 @@ namespace OpenSim.Server.Handlers.Presence
}
return FailureResult();
}
byte[] LoginAgent(Dictionary<string, object> request)

View File

@@ -316,7 +316,7 @@ namespace OpenSim.Services.Connectors
}
catch (Exception e)
{
m_log.DebugFormat($"[ESTATE CONNECTOR]: Exception when contacting estate server at {uri}: {e.Message}");
m_log.Debug($"[ESTATE CONNECTOR]: Exception when contacting estate server at {uri}: {e.Message}");
}
return null;

View File

@@ -102,41 +102,45 @@ namespace OpenSim.Services.Connectors
else
{
hash = (Hashtable)response.Value;
try
if(hash is not null)
{
landData = new LandData();
landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]);
landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]);
landData.Area = Convert.ToInt32(hash["Area"]);
landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]);
landData.Description = (string)hash["Description"];
landData.Flags = Convert.ToUInt32(hash["Flags"]);
landData.GlobalID = new UUID((string)hash["GlobalID"]);
landData.Name = (string)hash["Name"];
landData.OwnerID = new UUID((string)hash["OwnerID"]);
landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
if (hash["RegionAccess"] != null)
regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
if(hash["Dwell"] != null)
landData.Dwell = Convert.ToSingle((string)hash["Dwell"]);
//m_log.DebugFormat("[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[LAND CONNECTOR]: Got exception while parsing land-data: {0} {1}",
e.Message, e.StackTrace);
try
{
landData = new LandData();
landData.AABBMax = Vector3.Parse((string)hash["AABBMax"]);
landData.AABBMin = Vector3.Parse((string)hash["AABBMin"]);
landData.Area = Convert.ToInt32(hash["Area"]);
landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]);
landData.Description = (string)hash["Description"];
landData.Flags = Convert.ToUInt32(hash["Flags"]);
landData.GlobalID = new UUID((string)hash["GlobalID"]);
landData.Name = (string)hash["Name"];
landData.OwnerID = new UUID((string)hash["OwnerID"]);
landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
if (hash["RegionAccess"] != null)
regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
if(hash["Dwell"] != null)
landData.Dwell = Convert.ToSingle((string)hash["Dwell"]);
//m_log.DebugFormat("[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name);
}
catch (Exception e)
{
m_log.Error(
$"[LAND CONNECTOR]: Got exception while parsing land data: {e.Message} {e.StackTrace}");
}
}
else
m_log.Warn($"[LAND CONNECTOR]: Couldn't get land data for parcel region handle {regionHandle}");
}
}
else
m_log.WarnFormat("[LAND CONNECTOR]: Couldn't find region with handle {0}", regionHandle);
m_log.Warn($"[LAND CONNECTOR]: Couldn't find region with handle {regionHandle}");
}
catch (Exception e)
{
m_log.ErrorFormat("[LAND CONNECTOR]: Couldn't contact region {0}: {1}", regionHandle, e.Message);
m_log.Error($"[LAND CONNECTOR]: Couldn't contact region {regionHandle}: {e.Message}");
}
return landData;

View File

@@ -254,7 +254,7 @@ namespace OpenSim.Services.HypergridService
region = m_GridService.GetLocalRegionByName(m_ScopeID, regionName);
if (region is null)
{
m_log.DebugFormat($"[GATEKEEPER SERVICE]: LinkLocalRegion could not find local region {regionName}");
m_log.Debug($"[GATEKEEPER SERVICE]: LinkLocalRegion could not find local region {regionName}");
reason = "Region not found";
return false;
}