diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index e5aa79b824..61f86c5a94 100755 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs @@ -623,8 +623,7 @@ namespace OpenSim.Groups , OpenMetaverse.Utils.StringToBytes(groupInfo.GroupName) ); - var update = new GroupChatListAgentUpdateData(AgentID); - var updates = new List { update }; + List updates = [new GroupChatListAgentUpdateData(AgentID)]; eq.ChatterBoxSessionAgentListUpdates(GroupID, new UUID(msg.toAgentID), updates); } } @@ -663,8 +662,7 @@ namespace OpenSim.Groups IEventQueue queue = remoteClient.Scene.RequestModuleInterface(); if (queue != null) { - var update = new GroupChatListAgentUpdateData(AgentID); - var updates = new List { update }; + List updates = [new GroupChatListAgentUpdateData(AgentID)]; queue.ChatterBoxSessionAgentListUpdates(GroupID, remoteClient.AgentId, updates); } } @@ -673,8 +671,8 @@ namespace OpenSim.Groups // Send a message from locally connected client to a group if ((im.dialog == (byte)InstantMessageDialog.SessionSend)) { - UUID GroupID = new UUID(im.imSessionID); - UUID AgentID = new UUID(im.fromAgentID); + UUID GroupID = new(im.imSessionID); + UUID AgentID = new(im.fromAgentID); if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString()); diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs index b8e5ae40b6..3a36506c0f 100644 --- a/OpenSim/Addons/Groups/Service/GroupsService.cs +++ b/OpenSim/Addons/Groups/Service/GroupsService.cs @@ -142,20 +142,25 @@ namespace OpenSim.Groups } // Create the group - GroupData data = new GroupData(); - data.GroupID = UUID.Random(); - data.Data = new Dictionary(); - data.Data["Name"] = name; - data.Data["Charter"] = charter; - data.Data["InsigniaID"] = insigniaID.ToString(); - data.Data["FounderID"] = founderID.ToString(); - data.Data["MembershipFee"] = membershipFee.ToString(); - data.Data["OpenEnrollment"] = openEnrollment ? "1" : "0"; - data.Data["ShowInList"] = showInList ? "1" : "0"; - data.Data["AllowPublish"] = allowPublish ? "1" : "0"; - data.Data["MaturePublish"] = maturePublish ? "1" : "0"; UUID ownerRoleID = UUID.Random(); - data.Data["OwnerRoleID"] = ownerRoleID.ToString(); + string founderIDstr = founderID.ToString(); + GroupData data = new() + { + GroupID = UUID.Random(), + Data = new Dictionary + { + ["Name"] = name, + ["Charter"] = charter, + ["InsigniaID"] = insigniaID.ToString(), + ["FounderID"] = founderIDstr, + ["MembershipFee"] = membershipFee.ToString(), + ["OpenEnrollment"] = openEnrollment ? "1" : "0", + ["ShowInList"] = showInList ? "1" : "0", + ["AllowPublish"] = allowPublish ? "1" : "0", + ["MaturePublish"] = maturePublish ? "1" : "0", + ["OwnerRoleID"] = ownerRoleID.ToString() + } + }; if (!m_Database.StoreGroup(data)) return UUID.Zero; @@ -171,8 +176,8 @@ namespace OpenSim.Groups _AddOrUpdateGroupRole(RequestingAgentID, data.GroupID, ownerRoleID, "Owners", "Owners of the group", "Owner of " + name, (ulong)OwnerPowers, true); // Add founder to group - _AddAgentToGroup(RequestingAgentID, founderID.ToString(), data.GroupID, ownerRoleID); - _AddAgentToGroup(RequestingAgentID, founderID.ToString(), data.GroupID, officersRoleID); + _AddAgentToGroup(RequestingAgentID, founderIDstr, data.GroupID, ownerRoleID); + _AddAgentToGroup(RequestingAgentID, founderIDstr, data.GroupID, officersRoleID); return data.GroupID; } @@ -186,7 +191,7 @@ namespace OpenSim.Groups // Check perms if (!HasPower(RequestingAgentID, groupID, GroupPowers.ChangeActions)) { - m_log.DebugFormat("[Groups]: ({0}) Attempt at updating group {1} denied because of lack of permission", RequestingAgentID, groupID); + m_log.Debug($"[Groups]: ({RequestingAgentID}) Attempt at updating group {groupID} denied because of lack of permission"); return; } @@ -219,7 +224,7 @@ namespace OpenSim.Groups public List FindGroups(string RequestingAgentID, string search) { - List groups = new List(); + List groups = []; GroupData[] data = m_Database.RetrieveGroups(search); @@ -228,7 +233,7 @@ namespace OpenSim.Groups foreach (GroupData d in data) { // Don't list group proxies - if (d.Data.ContainsKey("Location") && d.Data["Location"] != string.Empty) + if (d.Data.TryGetValue("Location", out string loc) && loc != string.Empty) continue; int nmembers = m_Database.MemberCount(d.GroupID); @@ -257,7 +262,7 @@ namespace OpenSim.Groups public List GetGroupMembers(string RequestingAgentID, UUID GroupID) { - List members = new List(); + List members = []; GroupData group = m_Database.RetrieveGroup(GroupID); if (group == null) diff --git a/OpenSim/Addons/os-webrtc-janus/Janus/JanusAudioBridge.cs b/OpenSim/Addons/os-webrtc-janus/Janus/JanusAudioBridge.cs index cd09a44a3f..bf14cd208d 100644 --- a/OpenSim/Addons/os-webrtc-janus/Janus/JanusAudioBridge.cs +++ b/OpenSim/Addons/os-webrtc-janus/Janus/JanusAudioBridge.cs @@ -155,7 +155,7 @@ namespace osWebRtcVoice // getHashCode() is not deterministic across sessions. public static int CalcRoomNumber(string pRegionId, string pChannelType, int pParcelLocalID, string pChannelID) { - var hasher = new BHasherMdjb2(); + BHasherMdjb2 hasher = new(); // If there is a channel specified it must be group switch (pChannelType) { @@ -174,7 +174,7 @@ namespace osWebRtcVoice default: throw new Exception("Unknown channel type: " + pChannelType); } - var hashed = hasher.Finish(); + BHash hashed = hasher.Finish(); // The "Abs()" is because Janus room number must be a positive integer // And note that this is the BHash.GetHashCode() and not Object.getHashCode(). int roomNumber = Math.Abs(hashed.GetHashCode()); diff --git a/OpenSim/Addons/os-webrtc-janus/Janus/JanusMessages.cs b/OpenSim/Addons/os-webrtc-janus/Janus/JanusMessages.cs index 5b426cccf7..c6c9ed10a4 100644 --- a/OpenSim/Addons/os-webrtc-janus/Janus/JanusMessages.cs +++ b/OpenSim/Addons/os-webrtc-janus/Janus/JanusMessages.cs @@ -193,7 +193,7 @@ namespace osWebRtcVoice public static JanusMessageResp FromJson(string pJson) { - var newBody = OSDParser.DeserializeJson(pJson) as OSDMap; + OSDMap newBody = OSDParser.DeserializeJson(pJson) as OSDMap; return new JanusMessageResp(newBody); } diff --git a/OpenSim/Addons/os-webrtc-janus/Janus/JanusSession.cs b/OpenSim/Addons/os-webrtc-janus/Janus/JanusSession.cs index f1f0bd4402..39f010fef3 100644 --- a/OpenSim/Addons/os-webrtc-janus/Janus/JanusSession.cs +++ b/OpenSim/Addons/os-webrtc-janus/Janus/JanusSession.cs @@ -105,7 +105,7 @@ namespace osWebRtcVoice JanusMessageResp resp = await SendToJanus(new CreateSessionReq()); if (resp is not null && resp.isSuccess) { - var sessionResp = new CreateSessionResp(resp); + CreateSessionResp sessionResp = new(resp); SessionId = sessionResp.returnedId; IsConnected = true; SessionUri = _JanusServerURI + "/" + SessionId; @@ -702,7 +702,7 @@ namespace osWebRtcVoice break; case "GETERROR": // Special error response from the GET - var errorResp = new ErrorResp(resp); + ErrorResp errorResp = new(resp); switch (errorResp.errorCode) { case 404: diff --git a/OpenSim/Addons/os-webrtc-janus/Janus/WebRtcJanusService.cs b/OpenSim/Addons/os-webrtc-janus/Janus/WebRtcJanusService.cs index a511a10b65..cf6cf7ab93 100644 --- a/OpenSim/Addons/os-webrtc-janus/Janus/WebRtcJanusService.cs +++ b/OpenSim/Addons/os-webrtc-janus/Janus/WebRtcJanusService.cs @@ -720,7 +720,7 @@ namespace osWebRtcVoice roomid, room["description"], room["num_participants"], room["sampling_rate"], room["spatial_audio"], room["record"]); - var participantResp = ab.SendAudioBridgeMsg(new AudioBridgeListParticipantsReq(roomid)).Result; + AudioBridgeResp participantResp = ab.SendAudioBridgeMsg(new AudioBridgeListParticipantsReq(roomid)).Result; if (participantResp is not null && participantResp.AudioBridgeReturnCode == "participants") { diff --git a/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/VoiceViewerSession.cs b/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/VoiceViewerSession.cs index d31cc54b28..1e4240e8a1 100644 --- a/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/VoiceViewerSession.cs +++ b/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/VoiceViewerSession.cs @@ -82,7 +82,7 @@ namespace osWebRtcVoice { lock (ViewerSessions) { - var sessions = ViewerSessions.Where(v => v.Value.VoiceServiceSessionId == pVSSessionId); + IEnumerable> sessions = ViewerSessions.Where(v => v.Value.VoiceServiceSessionId == pVSSessionId); if (sessions.Count() > 0) { pViewerSession = sessions.First().Value; diff --git a/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/WebRtcVoiceServiceConnector.cs b/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/WebRtcVoiceServiceConnector.cs index 7e45f80410..69188b12e2 100644 --- a/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/WebRtcVoiceServiceConnector.cs +++ b/OpenSim/Addons/os-webrtc-janus/WebRtcVoice/WebRtcVoiceServiceConnector.cs @@ -101,7 +101,7 @@ namespace osWebRtcVoice { "userID", pUserID.ToString() }, { "scene", pSceneID.ToString() } }; - var resp = JsonRpcRequest("provision_voice_account_request", m_serverURI, req); + OSDMap resp = JsonRpcRequest("provision_voice_account_request", m_serverURI, req); // Kludge to sync the viewer session number in our IVoiceViewerSession with the one from the WebRTC service. if (resp.TryGetString("viewer_session", out string otherViewerSessionId)) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 5a4897e9fd..8299da9ab7 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -1526,8 +1526,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: AuthenticateUser: new request"); - var responseData = (Hashtable)response.Value; - var requestData = (Hashtable)request.Params[0]; + Hashtable responseData = (Hashtable)response.Value; + Hashtable requestData = (Hashtable)request.Params[0]; lock (m_requestLock) { @@ -1541,11 +1541,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController "token_lifetime" }); - var firstName = (string)requestData["user_firstname"]; - var lastName = (string)requestData["user_lastname"]; - var password = (string)requestData["user_password"]; + string firstName = (string)requestData["user_firstname"]; + string lastName = (string)requestData["user_lastname"]; + string password = (string)requestData["user_password"]; - var scene = m_application.SceneManager.CurrentOrFirstScene; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; if (scene.Equals(null)) { @@ -1553,8 +1553,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController throw new Exception("Scene does not exist."); } - var scopeID = scene.RegionInfo.ScopeID; - var account = scene.UserAccountService.GetUserAccount(scopeID, firstName, lastName); + UUID scopeID = scene.RegionInfo.ScopeID; + UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, firstName, lastName); if (account.Equals(null) || account.PrincipalID.Equals(UUID.Zero)) { @@ -1584,18 +1584,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.DebugFormat("[RADMIN]: AuthenticateUser: token lifetime longer than 30s for {0} {1}", firstName, lastName); - throw new Exception(String.Format("token lifetime longer than 30s for {0} {1}", firstName, - lastName)); + throw new Exception($"token lifetime longer than 30s for {firstName} {lastName}"); } - var authModule = scene.RequestModuleInterface(); + IAuthenticationService authModule = scene.RequestModuleInterface(); if (authModule == null) { m_log.Debug("[RADMIN]: AuthenticateUser: no authentication module loded"); throw new Exception("no authentication module loaded"); } - var token = authModule.Authenticate(account.PrincipalID, password, lifetime); + string token = authModule.Authenticate(account.PrincipalID, password, lifetime); if (String.IsNullOrEmpty(token)) { m_log.DebugFormat("[RADMIN]: AuthenticateUser: authentication failed for {0} {1}", firstName, diff --git a/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs b/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs index 998e8a622b..4ef4d070bc 100644 --- a/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs @@ -93,7 +93,7 @@ namespace OpenSim.Capabilities.Handlers response.StatusCode = (int)HttpStatusCode.BadRequest; - var queries = req.QueryAsDictionary; + Dictionary queries = req.QueryAsDictionary; if(queries.Count == 0) return; diff --git a/OpenSim/Data/PGSQL/PGSQLMuteListData.cs b/OpenSim/Data/PGSQL/PGSQLMuteListData.cs index a1721d1962..97a9b0b578 100644 --- a/OpenSim/Data/PGSQL/PGSQLMuteListData.cs +++ b/OpenSim/Data/PGSQL/PGSQLMuteListData.cs @@ -44,13 +44,12 @@ namespace OpenSim.Data.PGSQL public MuteData[] Get(UUID agentID) { - var data = base.Get("AgentID", agentID.ToString()); - return data; + return base.Get("AgentID", agentID.ToString()); } public bool Delete(UUID agentID, UUID muteID, string muteName) { - var query = $"DELETE FROM MuteList WHERE \"AgentID\" = :AgentID and " + + string query = $"DELETE FROM MuteList WHERE \"AgentID\" = :AgentID and " + $"\"MuteID\" = :MuteID and " + $"\"MuteName\" = :MuteName"; diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 54eb932878..777df5df15 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -981,7 +981,7 @@ namespace OpenSim.Data.PGSQL "TerrainPBR4" = :TerrainPBR4 """; - using (var connection = new NpgsqlConnection(m_connectionString)) + using (NpgsqlConnection connection = new(m_connectionString)) { connection.Open(); NpgsqlCommand command = new NpgsqlCommand(queryString, connection, connection.BeginTransaction()); @@ -1984,7 +1984,7 @@ namespace OpenSim.Data.PGSQL { while (reader.Read()) { - var sp = new SpawnPoint + SpawnPoint sp = new() { Yaw = Convert.ToSingle(reader["Yaw"]), Pitch = Convert.ToSingle(reader["Pitch"]), @@ -2033,9 +2033,9 @@ namespace OpenSim.Data.PGSQL INSERT INTO regionextra ("RegionID", "Name", "value") VALUES (:RegionID, :Name, :Value) """; - using var connection = new NpgsqlConnection(m_connectionString); + using NpgsqlConnection connection = new(m_connectionString); connection.Open(); - using var command = new NpgsqlCommand(queryString, connection, connection.BeginTransaction()); + using NpgsqlCommand command = new(queryString, connection, connection.BeginTransaction()); try { command.Parameters.AddWithValue("RegionID", regionID.ToString()); @@ -2054,9 +2054,9 @@ namespace OpenSim.Data.PGSQL public void RemoveExtra(UUID regionID, string name) { const string queryString = """DELETE FROM regionextra WHERE "RegionID"=:RegionID AND "Name"=:Name"""; - using var connection = new NpgsqlConnection(m_connectionString); + using NpgsqlConnection connection = new(m_connectionString); connection.Open(); - using var command = new NpgsqlCommand(queryString, connection, connection.BeginTransaction()); + using NpgsqlCommand command = new(queryString, connection, connection.BeginTransaction()); try { command.Parameters.AddWithValue("RegionID", regionID.ToString()); diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 999eb6adca..2b36f402c3 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1177,7 +1177,7 @@ namespace OpenSim.Framework.Servers.HttpServer { using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8)) { - var xmlDes = new XmlRpcRequestDeserializer(); + XmlRpcRequestDeserializer xmlDes = new(); xmlRprcRequest = (XmlRpcRequest)xmlDes.Deserialize(reader); } } @@ -1272,7 +1272,7 @@ namespace OpenSim.Framework.Servers.HttpServer using (XmlTextWriter writer = new XmlTextWriter(outs, UTF8NoBOM)) { writer.Formatting = Formatting.None; - var xmlrpcSer = new XmlRpcResponseSerializer(); + XmlRpcResponseSerializer xmlrpcSer = new(); xmlrpcSer.Serialize(writer, xmlRpcResponse); writer.Flush(); response.RawBuffer = outs.GetBuffer(); @@ -1314,7 +1314,7 @@ namespace OpenSim.Framework.Servers.HttpServer { using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8)) { - var xmlDes = new XmlRpcRequestDeserializer(); + XmlRpcRequestDeserializer xmlDes = new(); xmlRprcRequest = (XmlRpcRequest)xmlDes.Deserialize(reader); } } @@ -1406,7 +1406,7 @@ namespace OpenSim.Framework.Servers.HttpServer using (XmlTextWriter writer = new XmlTextWriter(outs, UTF8NoBOM)) { writer.Formatting = Formatting.None; - var xmlrpcSer = new XmlRpcResponseSerializer(); + XmlRpcResponseSerializer xmlrpcSer = new(); xmlrpcSer.Serialize(writer, xmlRpcResponse); writer.Flush(); response.RawBuffer = outs.GetBuffer(); @@ -1641,7 +1641,7 @@ namespace OpenSim.Framework.Servers.HttpServer return false; } - var searchquery = CleanSearchPath(path.AsSpan()); + ReadOnlySpan searchquery = CleanSearchPath(path.AsSpan()); lock (m_llsdHandlers) { @@ -1661,7 +1661,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// true if we have one, false if not private bool DoWeHaveAHTTPHandler(string path) { - var searchquery = CleanSearchPath(path.AsSpan()); + ReadOnlySpan searchquery = CleanSearchPath(path.AsSpan()); //m_log.DebugFormat("[BASE HTTP HANDLER]: Checking if we have an HTTP handler for {0}", searchquery); lock (m_HTTPHandlers) @@ -1688,7 +1688,7 @@ namespace OpenSim.Framework.Servers.HttpServer // {0}/{1}/{2} // where {0} isn't something we really control 100% - var searchquery = CleanSearchPath(path.AsSpan()); + ReadOnlySpan searchquery = CleanSearchPath(path.AsSpan()); // while the matching algorithm below doesn't require it, we're expecting a query in the form // @@ -1808,7 +1808,7 @@ namespace OpenSim.Framework.Servers.HttpServer return false; } - var searchquery = CleanSearchPath(path); + ReadOnlySpan searchquery = CleanSearchPath(path); string bestMatch = null; bool nomatch = true; diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpClientContext.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpClientContext.cs index 61e4865cc0..d70681cb61 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpClientContext.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpClientContext.cs @@ -209,7 +209,7 @@ namespace OSHttpServer /// public virtual void Start() { - Task.Run(ReceiveLoop).ConfigureAwait(false); + _ = Task.Run(ReceiveLoop); } /// @@ -343,7 +343,7 @@ namespace OSHttpServer } } - private async void ReceiveLoop() + private async Task ReceiveLoop() { try { diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpListener.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpListener.cs index 3a96f03cec..f0825a2f8b 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpListener.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpServer/HttpListener.cs @@ -123,7 +123,7 @@ namespace OSHttpServer /// public bool UseTraceLogs { get; set; } - private async void AcceptLoop() + private async Task AcceptLoop() { while (true) { @@ -239,7 +239,7 @@ namespace OSHttpServer m_listener = new TcpListener(m_address, m_port); m_listener.Start(backlog); - Task.Run(AcceptLoop).ConfigureAwait(false); + _ = Task.Run(AcceptLoop); } /// diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 61392e10ca..c63d11c523 100755 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -45,12 +45,6 @@ using Caps=OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Region.ClientStack.Linden { - public struct QueueItem - { - public int id; - public OSDMap body; - } - [Mono.Addins.Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EventQueueGetModule")] public partial class EventQueueGetModule : IEventQueue, INonSharedRegionModule { diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index b0617302da..2edafb73e2 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -347,13 +347,7 @@ namespace OpenSim.Region.ClientStack.Linden GridInfo ginfo = scene.SceneGridInfo; lock (m_features) { - OSDMap extrasMap; - if (m_features.TryGetValue("OpenSimExtras", out OSD extra)) - extrasMap = extra as OSDMap; - else - { - extrasMap = new OSDMap(); - } + OSDMap extrasMap = m_features.TryGetOSDMap("OpenSimExtras", out OSDMap extra) ? extra : new OSDMap(); foreach (string key in extraFeatures.Keys) { diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 129515c859..9ddad536b7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -246,7 +246,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_IsRunningInbound = true; // kick start the receiver tasks dance. - Task.Run(AsyncBeginReceive).ConfigureAwait(false); + _ = Task.Run(AsyncBeginReceive); } } @@ -280,7 +280,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_IsRunningOutbound = false; } - private async void AsyncBeginReceive() + private async Task AsyncBeginReceive() { SocketAddress workSktAddress = new(m_udpSocket.AddressFamily); while (m_IsRunningInbound)