From 142f8a4aeca211ff6f88c7227f8654cd43a0dbaf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 25 Feb 2012 21:00:19 -0800 Subject: HG: Remove async in posting assets to foreign grid. Mono hates concurrency there. --- .../CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 0c4ff7f..d2fe388 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess string userAssetServer = string.Empty; if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission) { - Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); }); + m_assMapper.Post(assetID, avatarID, userAssetServer); } } -- cgit v1.1 From 4268427ac36410452bcfee9fe51d7deeb0ef303d Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 27 Feb 2012 15:15:03 -0800 Subject: Some clean up in WebUtil, remove unused ServiceRequest function. --- OpenSim/Framework/WebUtil.cs | 78 ++++---------------------------------------- 1 file changed, 7 insertions(+), 71 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index b761dfe..af25da9 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -63,77 +63,7 @@ namespace OpenSim.Framework // a "long" call for warning & debugging purposes public const int LongCallTime = 500; -// /// -// /// Send LLSD to an HTTP client in application/llsd+json form -// /// -// /// HTTP response to send the data in -// /// LLSD to send to the client -// public static void SendJSONResponse(OSHttpResponse response, OSDMap body) -// { -// byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body)); -// -// response.ContentEncoding = Encoding.UTF8; -// response.ContentLength = responseData.Length; -// response.ContentType = "application/llsd+json"; -// response.Body.Write(responseData, 0, responseData.Length); -// } -// -// /// -// /// Send LLSD to an HTTP client in application/llsd+xml form -// /// -// /// HTTP response to send the data in -// /// LLSD to send to the client -// public static void SendXMLResponse(OSHttpResponse response, OSDMap body) -// { -// byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body); -// -// response.ContentEncoding = Encoding.UTF8; -// response.ContentLength = responseData.Length; -// response.ContentType = "application/llsd+xml"; -// response.Body.Write(responseData, 0, responseData.Length); -// } - - /// - /// Make a GET or GET-like request to a web service that returns LLSD - /// or JSON data - /// - public static OSDMap ServiceRequest(string url, string httpVerb) - { - string errorMessage; - - try - { - HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); - request.Method = httpVerb; - - using (WebResponse response = request.GetResponse()) - { - using (Stream responseStream = response.GetResponseStream()) - { - try - { - string responseStr = responseStream.GetStreamString(); - OSD responseOSD = OSDParser.Deserialize(responseStr); - if (responseOSD.Type == OSDType.Map) - return (OSDMap)responseOSD; - else - errorMessage = "Response format was invalid."; - } - catch - { - errorMessage = "Failed to parse the response."; - } - } - } - } - catch (Exception ex) - { - m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message); - errorMessage = ex.Message; - } - - return new OSDMap { { "Message", OSD.FromString("Service request failed. " + errorMessage) } }; - } + #region JSONRequest /// /// PUT JSON-encoded data to a web service that returns LLSD or @@ -303,6 +233,10 @@ namespace OpenSim.Framework return result; } + #endregion JSONRequest + + #region FormRequest + /// /// POST URL-encoded form data to a web service that returns LLSD or /// JSON data @@ -397,6 +331,8 @@ namespace OpenSim.Framework result["Message"] = OSD.FromString("Service request failed: " + msg); return result; } + + #endregion FormRequest #region Uri -- cgit v1.1 From a813e7ffdd811979a0b326fd73f2199b528e95a6 Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Tue, 28 Feb 2012 15:45:07 -0500 Subject: Fixed two typos. White space cleanups. Signed-off-by: nebadon --- .../CoreModules/World/WorldMap/WorldMapModule.cs | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 74b047b..fd122da 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // There is a major hack going on in this method. The viewer doesn't request // map blocks (RequestMapBlocks) above 2048. That means that if we don't hack, // grids above that cell don't have a map at all. So, here's the hack: we wait - // for this CAP request to come, and we inject the map blocks at this point. + // for this CAP request to come, and we inject the map blocks at this point. // In a normal scenario, this request simply sends back the MapLayer (the blue color). // In the hacked scenario, it also sends the map blocks via UDP. // @@ -751,7 +751,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { uint x = 0, y = 0; Utils.LongToUInts(regionhandle, out x, out y); - GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); + GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); if (mreg != null) { @@ -857,7 +857,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap finally { if (os != null) - os.Close(); + os.Close(); } string response_mapItems_reply = null; @@ -960,16 +960,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // on an unloaded square. // But make sure: Look whether the one we requested is in there List regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, - minX * (int)Constants.RegionSize, - maxX * (int)Constants.RegionSize, - minY * (int)Constants.RegionSize, + minX * (int)Constants.RegionSize, + maxX * (int)Constants.RegionSize, + minY * (int)Constants.RegionSize, maxY * (int)Constants.RegionSize); if (regions != null) { foreach (GridRegion r in regions) { - if ((r.RegionLocX == minX * (int)Constants.RegionSize) && + if ((r.RegionLocX == minX * (int)Constants.RegionSize) && (r.RegionLocY == minY * (int)Constants.RegionSize)) { // found it => add it to response @@ -1004,7 +1004,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { List mapBlocks = new List(); List regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, - (minX - 4) * (int)Constants.RegionSize, + (minX - 4) * (int)Constants.RegionSize, (maxX + 4) * (int)Constants.RegionSize, (minY - 4) * (int)Constants.RegionSize, (maxY + 4) * (int)Constants.RegionSize); @@ -1336,7 +1336,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // Cannot create a map for a nonexistant heightmap if (m_scene.Heightmap == null) return; - + //create a texture asset of the terrain IMapImageGenerator terrain = m_scene.RequestModuleInterface(); if (terrain == null) @@ -1345,7 +1345,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap byte[] data = terrain.WriteJpeg2000Image(); if (data == null) return; - + byte[] overlay = GenerateOverlay(); m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); @@ -1366,7 +1366,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // Store the new one m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID); m_scene.AssetService.Store(asset); - + if (overlay != null) { parcelImageID = UUID.Random(); @@ -1390,7 +1390,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID; m_scene.RegionInfo.RegionSettings.ParcelImageID = parcelImageID; m_scene.RegionInfo.RegionSettings.Save(); - + // Delete the old one // m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastTerrainImageID); m_scene.AssetService.Delete(lastTerrainImageID.ToString()); @@ -1469,18 +1469,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0) { landForSale = true; - + saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap()); } } if (!landForSale) { - m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not geenrating overlay", m_scene.RegionInfo.RegionName); + m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not generating overlay", m_scene.RegionInfo.RegionName); return null; } - m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName); + m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName); for (int x = 0 ; x < 64 ; x++) { -- cgit v1.1 From 2fce7dd593571986cc08122a4fe015800fa765a6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 28 Feb 2012 22:54:21 +0000 Subject: Call Dispose() via using() on SqliteCommands in WebStatsModule after use. --- OpenSim/Region/UserStatistics/WebStatsModule.cs | 197 ++++++++++++------------ 1 file changed, 98 insertions(+), 99 deletions(-) diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index ad272f7..b9ba4bc 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs @@ -224,13 +224,11 @@ namespace OpenSim.Region.UserStatistics concurrencyCounter--; response_code = 200; - } else { strOut = MainServer.Instance.GetHTTP404(""); } - responsedata["int_response_code"] = response_code; responsedata["content_type"] = contenttype; @@ -247,43 +245,44 @@ namespace OpenSim.Region.UserStatistics // TODO: FIXME: implement stats migrations const string SQL = @"SELECT * FROM migrations LIMIT 1"; - SqliteCommand cmd = new SqliteCommand(SQL, db); - - try - { - cmd.ExecuteNonQuery(); - } - catch (SqliteSyntaxException) + using (SqliteCommand cmd = new SqliteCommand(SQL, db)) { - CreateTables(db); + try + { + cmd.ExecuteNonQuery(); + } + catch (SqliteSyntaxException) + { + CreateTables(db); + } } } } public void CreateTables(SqliteConnection db) { - SqliteCommand createcmd = new SqliteCommand(SQL_STATS_TABLE_CREATE, db); - createcmd.ExecuteNonQuery(); + using (SqliteCommand createcmd = new SqliteCommand(SQL_STATS_TABLE_CREATE, db)) + { + createcmd.ExecuteNonQuery(); - createcmd.CommandText = SQL_MIGRA_TABLE_CREATE; - createcmd.ExecuteNonQuery(); + createcmd.CommandText = SQL_MIGRA_TABLE_CREATE; + createcmd.ExecuteNonQuery(); + } } public virtual void PostInitialise() { if (!enabled) - { return; - } + AddHandlers(); } public virtual void Close() { if (!enabled) - { return; - } + dbConn.Close(); dbConn.Dispose(); m_sessions.Clear(); @@ -304,7 +303,8 @@ namespace OpenSim.Region.UserStatistics public void OnRegisterCaps(UUID agentID, Caps caps) { - m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); +// m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); + string capsPath = "/CAPS/VS/" + UUID.Random(); caps.RegisterHandler("ViewerStats", new RestStreamHandler("POST", capsPath, @@ -318,7 +318,6 @@ namespace OpenSim.Region.UserStatistics public void OnDeRegisterCaps(UUID agentID, Caps caps) { - } protected virtual void AddHandlers() @@ -368,7 +367,6 @@ namespace OpenSim.Region.UserStatistics public void OnMakeChildAgent(ScenePresence agent) { - } public void OnClientClosed(UUID agentID, Scene scene) @@ -430,6 +428,7 @@ namespace OpenSim.Region.UserStatistics return scene.RegionInfo.RegionID; } } + return UUID.Zero; } @@ -458,14 +457,14 @@ namespace OpenSim.Region.UserStatistics UserSessionData usd; OSD message = OSDParser.DeserializeLLSDXml(request); OSDMap mmap; + lock (m_sessions) { if (agentID != UUID.Zero) { - if (!m_sessions.ContainsKey(agentID)) { - m_log.Warn("[WEB STATS MODULE]: no session for stat disclosure"); + m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID); return new UserSessionID(); } uid = m_sessions[agentID]; @@ -585,8 +584,6 @@ namespace OpenSim.Region.UserStatistics usd.n_out_kb = (float)net_out["kbytes"].AsReal(); usd.n_out_pk = net_out["packets"].AsInteger(); } - - } } @@ -602,83 +599,85 @@ namespace OpenSim.Region.UserStatistics lock (db) { - SqliteCommand updatecmd = new SqliteCommand(SQL_STATS_TABLE_UPDATE, db); - updatecmd.Parameters.Add(new SqliteParameter(":session_id", uid.session_data.session_id.ToString())); - updatecmd.Parameters.Add(new SqliteParameter(":agent_id", uid.session_data.agent_id.ToString())); - updatecmd.Parameters.Add(new SqliteParameter(":region_id", uid.session_data.region_id.ToString())); - updatecmd.Parameters.Add(new SqliteParameter(":last_updated", (int) uid.session_data.last_updated)); - updatecmd.Parameters.Add(new SqliteParameter(":remote_ip", uid.session_data.remote_ip)); - updatecmd.Parameters.Add(new SqliteParameter(":name_f", uid.session_data.name_f)); - updatecmd.Parameters.Add(new SqliteParameter(":name_l", uid.session_data.name_l)); - updatecmd.Parameters.Add(new SqliteParameter(":avg_agents_in_view", uid.session_data.avg_agents_in_view)); - updatecmd.Parameters.Add(new SqliteParameter(":min_agents_in_view", - (int) uid.session_data.min_agents_in_view)); - updatecmd.Parameters.Add(new SqliteParameter(":max_agents_in_view", - (int) uid.session_data.max_agents_in_view)); - updatecmd.Parameters.Add(new SqliteParameter(":mode_agents_in_view", - (int) uid.session_data.mode_agents_in_view)); - updatecmd.Parameters.Add(new SqliteParameter(":avg_fps", uid.session_data.avg_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":min_fps", uid.session_data.min_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":max_fps", uid.session_data.max_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":mode_fps", uid.session_data.mode_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":a_language", uid.session_data.a_language)); - updatecmd.Parameters.Add(new SqliteParameter(":mem_use", uid.session_data.mem_use)); - updatecmd.Parameters.Add(new SqliteParameter(":meters_traveled", uid.session_data.meters_traveled)); - updatecmd.Parameters.Add(new SqliteParameter(":avg_ping", uid.session_data.avg_ping)); - updatecmd.Parameters.Add(new SqliteParameter(":min_ping", uid.session_data.min_ping)); - updatecmd.Parameters.Add(new SqliteParameter(":max_ping", uid.session_data.max_ping)); - updatecmd.Parameters.Add(new SqliteParameter(":mode_ping", uid.session_data.mode_ping)); - updatecmd.Parameters.Add(new SqliteParameter(":regions_visited", uid.session_data.regions_visited)); - updatecmd.Parameters.Add(new SqliteParameter(":run_time", uid.session_data.run_time)); - updatecmd.Parameters.Add(new SqliteParameter(":avg_sim_fps", uid.session_data.avg_sim_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":min_sim_fps", uid.session_data.min_sim_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":max_sim_fps", uid.session_data.max_sim_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":mode_sim_fps", uid.session_data.mode_sim_fps)); - updatecmd.Parameters.Add(new SqliteParameter(":start_time", uid.session_data.start_time)); - updatecmd.Parameters.Add(new SqliteParameter(":client_version", uid.session_data.client_version)); - updatecmd.Parameters.Add(new SqliteParameter(":s_cpu", uid.session_data.s_cpu)); - updatecmd.Parameters.Add(new SqliteParameter(":s_gpu", uid.session_data.s_gpu)); - updatecmd.Parameters.Add(new SqliteParameter(":s_os", uid.session_data.s_os)); - updatecmd.Parameters.Add(new SqliteParameter(":s_ram", uid.session_data.s_ram)); - updatecmd.Parameters.Add(new SqliteParameter(":d_object_kb", uid.session_data.d_object_kb)); - updatecmd.Parameters.Add(new SqliteParameter(":d_texture_kb", uid.session_data.d_texture_kb)); - updatecmd.Parameters.Add(new SqliteParameter(":d_world_kb", uid.session_data.d_world_kb)); - updatecmd.Parameters.Add(new SqliteParameter(":n_in_kb", uid.session_data.n_in_kb)); - updatecmd.Parameters.Add(new SqliteParameter(":n_in_pk", uid.session_data.n_in_pk)); - updatecmd.Parameters.Add(new SqliteParameter(":n_out_kb", uid.session_data.n_out_kb)); - updatecmd.Parameters.Add(new SqliteParameter(":n_out_pk", uid.session_data.n_out_pk)); - updatecmd.Parameters.Add(new SqliteParameter(":f_dropped", uid.session_data.f_dropped)); - updatecmd.Parameters.Add(new SqliteParameter(":f_failed_resends", uid.session_data.f_failed_resends)); - updatecmd.Parameters.Add(new SqliteParameter(":f_invalid", uid.session_data.f_invalid)); - - updatecmd.Parameters.Add(new SqliteParameter(":f_off_circuit", uid.session_data.f_off_circuit)); - updatecmd.Parameters.Add(new SqliteParameter(":f_resent", uid.session_data.f_resent)); - updatecmd.Parameters.Add(new SqliteParameter(":f_send_packet", uid.session_data.f_send_packet)); - - updatecmd.Parameters.Add(new SqliteParameter(":session_key", uid.session_data.session_id.ToString())); - updatecmd.Parameters.Add(new SqliteParameter(":agent_key", uid.session_data.agent_id.ToString())); - updatecmd.Parameters.Add(new SqliteParameter(":region_key", uid.session_data.region_id.ToString())); -// m_log.Debug("UPDATE"); - - int result = updatecmd.ExecuteNonQuery(); - - if (result == 0) + using (SqliteCommand updatecmd = new SqliteCommand(SQL_STATS_TABLE_UPDATE, db)) { -// m_log.Debug("INSERT"); - updatecmd.CommandText = SQL_STATS_TABLE_INSERT; - try - { - updatecmd.ExecuteNonQuery(); - } - catch (SqliteExecutionException) + updatecmd.Parameters.Add(new SqliteParameter(":session_id", uid.session_data.session_id.ToString())); + updatecmd.Parameters.Add(new SqliteParameter(":agent_id", uid.session_data.agent_id.ToString())); + updatecmd.Parameters.Add(new SqliteParameter(":region_id", uid.session_data.region_id.ToString())); + updatecmd.Parameters.Add(new SqliteParameter(":last_updated", (int) uid.session_data.last_updated)); + updatecmd.Parameters.Add(new SqliteParameter(":remote_ip", uid.session_data.remote_ip)); + updatecmd.Parameters.Add(new SqliteParameter(":name_f", uid.session_data.name_f)); + updatecmd.Parameters.Add(new SqliteParameter(":name_l", uid.session_data.name_l)); + updatecmd.Parameters.Add(new SqliteParameter(":avg_agents_in_view", uid.session_data.avg_agents_in_view)); + updatecmd.Parameters.Add(new SqliteParameter(":min_agents_in_view", + (int) uid.session_data.min_agents_in_view)); + updatecmd.Parameters.Add(new SqliteParameter(":max_agents_in_view", + (int) uid.session_data.max_agents_in_view)); + updatecmd.Parameters.Add(new SqliteParameter(":mode_agents_in_view", + (int) uid.session_data.mode_agents_in_view)); + updatecmd.Parameters.Add(new SqliteParameter(":avg_fps", uid.session_data.avg_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":min_fps", uid.session_data.min_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":max_fps", uid.session_data.max_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":mode_fps", uid.session_data.mode_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":a_language", uid.session_data.a_language)); + updatecmd.Parameters.Add(new SqliteParameter(":mem_use", uid.session_data.mem_use)); + updatecmd.Parameters.Add(new SqliteParameter(":meters_traveled", uid.session_data.meters_traveled)); + updatecmd.Parameters.Add(new SqliteParameter(":avg_ping", uid.session_data.avg_ping)); + updatecmd.Parameters.Add(new SqliteParameter(":min_ping", uid.session_data.min_ping)); + updatecmd.Parameters.Add(new SqliteParameter(":max_ping", uid.session_data.max_ping)); + updatecmd.Parameters.Add(new SqliteParameter(":mode_ping", uid.session_data.mode_ping)); + updatecmd.Parameters.Add(new SqliteParameter(":regions_visited", uid.session_data.regions_visited)); + updatecmd.Parameters.Add(new SqliteParameter(":run_time", uid.session_data.run_time)); + updatecmd.Parameters.Add(new SqliteParameter(":avg_sim_fps", uid.session_data.avg_sim_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":min_sim_fps", uid.session_data.min_sim_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":max_sim_fps", uid.session_data.max_sim_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":mode_sim_fps", uid.session_data.mode_sim_fps)); + updatecmd.Parameters.Add(new SqliteParameter(":start_time", uid.session_data.start_time)); + updatecmd.Parameters.Add(new SqliteParameter(":client_version", uid.session_data.client_version)); + updatecmd.Parameters.Add(new SqliteParameter(":s_cpu", uid.session_data.s_cpu)); + updatecmd.Parameters.Add(new SqliteParameter(":s_gpu", uid.session_data.s_gpu)); + updatecmd.Parameters.Add(new SqliteParameter(":s_os", uid.session_data.s_os)); + updatecmd.Parameters.Add(new SqliteParameter(":s_ram", uid.session_data.s_ram)); + updatecmd.Parameters.Add(new SqliteParameter(":d_object_kb", uid.session_data.d_object_kb)); + updatecmd.Parameters.Add(new SqliteParameter(":d_texture_kb", uid.session_data.d_texture_kb)); + updatecmd.Parameters.Add(new SqliteParameter(":d_world_kb", uid.session_data.d_world_kb)); + updatecmd.Parameters.Add(new SqliteParameter(":n_in_kb", uid.session_data.n_in_kb)); + updatecmd.Parameters.Add(new SqliteParameter(":n_in_pk", uid.session_data.n_in_pk)); + updatecmd.Parameters.Add(new SqliteParameter(":n_out_kb", uid.session_data.n_out_kb)); + updatecmd.Parameters.Add(new SqliteParameter(":n_out_pk", uid.session_data.n_out_pk)); + updatecmd.Parameters.Add(new SqliteParameter(":f_dropped", uid.session_data.f_dropped)); + updatecmd.Parameters.Add(new SqliteParameter(":f_failed_resends", uid.session_data.f_failed_resends)); + updatecmd.Parameters.Add(new SqliteParameter(":f_invalid", uid.session_data.f_invalid)); + + updatecmd.Parameters.Add(new SqliteParameter(":f_off_circuit", uid.session_data.f_off_circuit)); + updatecmd.Parameters.Add(new SqliteParameter(":f_resent", uid.session_data.f_resent)); + updatecmd.Parameters.Add(new SqliteParameter(":f_send_packet", uid.session_data.f_send_packet)); + + updatecmd.Parameters.Add(new SqliteParameter(":session_key", uid.session_data.session_id.ToString())); + updatecmd.Parameters.Add(new SqliteParameter(":agent_key", uid.session_data.agent_id.ToString())); + updatecmd.Parameters.Add(new SqliteParameter(":region_key", uid.session_data.region_id.ToString())); + +// m_log.DebugFormat("[WEB STATS MODULE]: Database stats update for {0}", uid.session_data.agent_id); + + int result = updatecmd.ExecuteNonQuery(); + + if (result == 0) { - m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage Execution Exception"); - } - catch (SqliteSyntaxException) - { - m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage SQL Syntax Exception"); - } +// m_log.DebugFormat("[WEB STATS MODULE]: Database stats insert for {0}", uid.session_data.agent_id); + + updatecmd.CommandText = SQL_STATS_TABLE_INSERT; + try + { + updatecmd.ExecuteNonQuery(); + } + catch (Exception e) + { + m_log.WarnFormat( + "[WEB STATS MODULE]: failed to write stats for {0}, storage Execution Exception {1}{2}", + uid.session_data.agent_id, e.Message, e.StackTrace); + } + } } } } -- cgit v1.1 From 40c838896c18a9ee0283386cdcdc13adec5ae3d6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 29 Feb 2012 00:33:17 +0000 Subject: Use correct casing of RegionSettings.Sandbox in the various database modules. MySQL and MSSQL have it as Sandbox, sqlite as sandbox. In various different places in every plugin the wrong casing is used... Consistency, who needs it? Or one day sqlite can change to Sandbox. --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 4 ++-- OpenSim/Data/MySQL/MySQLSimulationData.cs | 2 +- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index e58620a..d6b1561 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -1367,7 +1367,7 @@ VALUES newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]); newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); - newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); + newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]); newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); newSettings.SunVector = new Vector3( @@ -1782,7 +1782,7 @@ VALUES parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit)); parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit)); parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun)); - parameters.Add(_Database.CreateParameter("sandbox", settings.Sandbox)); + parameters.Add(_Database.CreateParameter("Sandbox", settings.Sandbox)); parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun)); parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition)); parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X)); diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 7c995ad..381a514 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1283,7 +1283,7 @@ namespace OpenSim.Data.MySQL newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]); newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); - newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); + newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]); newSettings.SunVector = new Vector3 ( Convert.ToSingle(row["sunvectorx"]), Convert.ToSingle(row["sunvectory"]), diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 186a586..7e7c08a 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -2157,7 +2157,7 @@ namespace OpenSim.Data.SQLite row["terrain_raise_limit"] = settings.TerrainRaiseLimit; row["terrain_lower_limit"] = settings.TerrainLowerLimit; row["use_estate_sun"] = settings.UseEstateSun; - row["Sandbox"] = settings.Sandbox; // database uses upper case S for sandbox + row["sandbox"] = settings.Sandbox; // unlike other database modules, sqlite uses a lower case s for sandbox! row["sunvectorx"] = settings.SunVector.X; row["sunvectory"] = settings.SunVector.Y; row["sunvectorz"] = settings.SunVector.Z; -- cgit v1.1 From a181fae72276073d7b3cd9c15e1448a3fabbb8f9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 29 Feb 2012 03:00:56 +0000 Subject: Don't start pCampbot if the user doesn't supply bot firstname, lastname stub and password --- OpenSim/Tools/pCampBot/pCampBot.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index a73fcbe..ec5ad04 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs @@ -56,6 +56,10 @@ namespace pCampBot { Help(); } + else if (config.Get("firstname") == null || config.Get("lastname") == null || config.Get("password") == null) + { + Console.WriteLine("ERROR: You must supply a firstname, lastname and password for the bots."); + } else { int botcount = config.GetInt("botcount", 1); -- cgit v1.1 From 1a54e769488c9d2eaaaa7e65e0956e7a7bac789a Mon Sep 17 00:00:00 2001 From: BlueWall Date: Wed, 29 Feb 2012 14:54:06 -0500 Subject: Trigger a build --- README.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/README.txt b/README.txt index 72702a2..a5dec24 100644 --- a/README.txt +++ b/README.txt @@ -128,3 +128,4 @@ OpenSim, as well as how to report bugs, and participate in the OpenSim project can always be found at http://opensimulator.org. Thanks for trying OpenSim, we hope it is a pleasant experience. + -- cgit v1.1 From 69c999033b4d5772c8eed0a90d5f9237785224ff Mon Sep 17 00:00:00 2001 From: BlueWall Date: Wed, 29 Feb 2012 15:52:15 -0500 Subject: Revert "Fix authentication for OpenID provider" This reverts commit 9f597c2d423a80279c4aed042be8a991eedefa21. Fixing OpenID causes issues with other parts of the code. --- .../Services/AuthenticationService/PasswordAuthenticationService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index da19b2e..48eb3f8 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -78,9 +78,9 @@ namespace OpenSim.Services.AuthenticationService } else { - string hashed = Util.Md5Hash(Util.Md5Hash(password) + ":" + data.Data["passwordSalt"].ToString()); + string hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString()); - // m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}; passonly {3}", password, hashed, data.Data["passwordHash"].ToString(), hashed2); + //m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); if (data.Data["passwordHash"].ToString() == hashed) { -- cgit v1.1 From 1e95b01f13044703c6737a0aee84ae3ac998534c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 29 Feb 2012 21:51:46 +0000 Subject: Extend distsrc target to cleanup the files generated by running prebuild --- .nant/local.include | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.nant/local.include b/.nant/local.include index 7d16810..6d3e972 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -8,6 +8,24 @@ + + + + + + + + + + + + + + + + + + -- cgit v1.1 From aabbbb32ffd353ece2addf39c64f3ff3e15ca7d4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 29 Feb 2012 23:45:14 +0000 Subject: Flick master up to 0.7.4 --- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index f30cb7a..7a5d715 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -29,7 +29,7 @@ namespace OpenSim { public class VersionInfo { - private const string VERSION_NUMBER = "0.7.3"; + private const string VERSION_NUMBER = "0.7.4"; private const Flavour VERSION_FLAVOUR = Flavour.Dev; public enum Flavour -- cgit v1.1 From 255afbf08a8829d05ea7fb24ad9d21e397d53428 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Mar 2012 02:11:15 +0000 Subject: Remove more now unused third party libraries. --- bin/Google.ProtocolBuffers.dll | Bin 246784 -> 0 bytes bin/Iesi.Collections.dll | Bin 32768 -> 0 bytes bin/Kds.Serialization.dll | Bin 40960 -> 0 bytes bin/MonoXnaCompactMaths.dll | Bin 36864 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100755 bin/Google.ProtocolBuffers.dll delete mode 100755 bin/Iesi.Collections.dll delete mode 100755 bin/Kds.Serialization.dll delete mode 100755 bin/MonoXnaCompactMaths.dll diff --git a/bin/Google.ProtocolBuffers.dll b/bin/Google.ProtocolBuffers.dll deleted file mode 100755 index 666aa93..0000000 Binary files a/bin/Google.ProtocolBuffers.dll and /dev/null differ diff --git a/bin/Iesi.Collections.dll b/bin/Iesi.Collections.dll deleted file mode 100755 index 107c362..0000000 Binary files a/bin/Iesi.Collections.dll and /dev/null differ diff --git a/bin/Kds.Serialization.dll b/bin/Kds.Serialization.dll deleted file mode 100755 index 7f03277..0000000 Binary files a/bin/Kds.Serialization.dll and /dev/null differ diff --git a/bin/MonoXnaCompactMaths.dll b/bin/MonoXnaCompactMaths.dll deleted file mode 100755 index 9fe8334..0000000 Binary files a/bin/MonoXnaCompactMaths.dll and /dev/null differ -- cgit v1.1 From 0007711eb5947d292f10325dd4af640ece79ea2d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Mar 2012 03:23:10 +0000 Subject: Use a fully stubbed out MockConsole for unit tests rather than inheriting from CommandConsole. This is so that the static MainConsole.Instance doesn't retain references to methods registered by scene and other modules to service commands. This prevents the scene from being garbage collected at the end of a test. This is not the final thing preventing GC - next up is the timer started by SimStatsReporter that holds a reference to Scene that prevents end of test gc. --- OpenSim/Framework/Console/MockConsole.cs | 59 +++++++++++++++++----------- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs index a29b370..4d8751f 100644 --- a/OpenSim/Framework/Console/MockConsole.cs +++ b/OpenSim/Framework/Console/MockConsole.cs @@ -29,6 +29,7 @@ using System; using System.Threading; using System.Collections.Generic; using System.Text; +using System.Xml; namespace OpenSim.Framework.Console { @@ -37,28 +38,42 @@ namespace OpenSim.Framework.Console /// Don't use this except for Unit Testing or you're in for a world of hurt when the /// sim gets to ReadLine /// - public class MockConsole : CommandConsole + public class MockConsole : ICommandConsole { - public MockConsole(string defaultPrompt) : base(defaultPrompt) - { - } - public override void Output(string text) - { - } - public override void Output(string text, string level) - { - } + private MockCommands m_commands = new MockCommands(); - public override string ReadLine(string p, bool isCommand, bool e) - { - //Thread.CurrentThread.Join(1000); - return string.Empty; - } - public override void UnlockOutput() - { - } - public override void LockOutput() - { - } + public ICommands Commands { get { return m_commands; } } + + public void Prompt() {} + + public void RunCommand(string cmd) {} + + public string ReadLine(string p, bool isCommand, bool e) { return ""; } + + public object ConsoleScene { get { return null; } } + + public void Output(string text, string level) {} + public void Output(string text) {} + public void OutputFormat(string format, params object[] components) {} + + public string CmdPrompt(string p) { return ""; } + public string CmdPrompt(string p, string def) { return ""; } + public string CmdPrompt(string p, List excludedCharacters) { return ""; } + public string CmdPrompt(string p, string def, List excludedCharacters) { return ""; } + + public string CmdPrompt(string prompt, string defaultresponse, List options) { return ""; } + + public string PasswdPrompt(string p) { return ""; } + } + + public class MockCommands : ICommands + { + public void FromXml(XmlElement root, CommandDelegate fn) {} + public List GetHelp(string[] cmd) { return null; } + public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) {} + public void AddCommand(string module, bool shared, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn) {} + public string[] FindNextOption(string[] cmd, bool term) { return null; } + public string[] Resolve(string[] cmd) { return null; } + public XmlElement GetXml(XmlDocument doc) { return null; } } -} +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index aa904aa..8a69d7c 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -113,7 +113,7 @@ namespace OpenSim.Tests.Common Console.WriteLine("Setting up test scene {0}", name); // We must set up a console otherwise setup of some modules may fail - MainConsole.Instance = new MockConsole("TEST PROMPT"); + MainConsole.Instance = new MockConsole(); RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); regInfo.RegionName = name; -- cgit v1.1 From a2b0ed537ebb539e17491ea368903a346b1bed56 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Thu, 1 Mar 2012 14:18:48 -0500 Subject: Fix indexing on string trim Thanks to zadark for pointing this out, smxy for deciphering the ?: operator and Plugh for the fix \o/ yay for IRC --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c5392b5..0003515 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4039,7 +4039,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f), Util.Clip((float)color.y, 0.0f, 1.0f), Util.Clip((float)color.z, 0.0f, 1.0f)); - m_host.SetText(text.Length > 254 ? text.Remove(255) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); + m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); //m_host.ParentGroup.HasGroupChanged = true; //m_host.ParentGroup.ScheduleGroupForFullUpdate(); } -- cgit v1.1 From 8a375f3c30302c4a7ace1afb05a8b49fbb415640 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 1 Mar 2012 14:49:49 -0800 Subject: Adds an OSSL command for regular expression-based string replacement. Parameters are osReplaceString(string source, string patter, string replace, integer count, integer start) The count parameter specifies the total number of replacements to make, -1 makes all replacements. --- .../Shared/Api/Implementation/OSSL_Api.cs | 25 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ff1f5fd..8edd146 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2160,6 +2160,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return result; } + public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) + { + CheckThreatLevel(ThreatLevel.High, "osReplaceString"); + m_host.AddScriptLPS(1); + + // Normalize indices (if negative). + // After normlaization they may still be + // negative, but that is now relative to + // the start, rather than the end, of the + // sequence. + if (start < 0) + { + start = src.Length + start; + } + + if (start < 0 || start >= src.Length) + { + return src; + } + + // Find matches beginning at start position + Regex matcher = new Regex(pattern); + return matcher.Replace(src,replace,count,start); + } + public string osLoadedCreationDate() { CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index dbc1dfc..82a6caf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -165,6 +165,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_String osFormatString(string str, LSL_List strings); LSL_List osMatchString(string src, string pattern, int start); + LSL_String osReplaceString(string src, string pattern, string replace, int count, int start); // Information about data loaded into the region string osLoadedCreationDate(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index cc8d417..4341246 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -472,6 +472,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osMatchString(src, pattern, start); } + public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) + { + return m_OSSL_Functions.osReplaceString(src,pattern,replace,count,start); + } + + // Information about data loaded into the region public string osLoadedCreationDate() { -- cgit v1.1 From dcfd05c8eaa4550d9be4c673d660497da1e035c8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Mar 2012 00:22:23 +0000 Subject: lock SenseRepeatListLock when added a new sensor during script reconstitution. This is already being done in the other place where a sensor is added. Adding a sensor whilst another thread is iterating over the sensor list can cause a concurrency exception. --- .../ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 5c1bdff..8383c7f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -635,7 +635,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); - SenseRepeaters.Add(ts); + lock (SenseRepeatListLock) + SenseRepeaters.Add(ts); + idx += 6; } } -- cgit v1.1 From d8c4985527f1ffdea0f21714808522a350d85013 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Mar 2012 00:28:37 +0000 Subject: Move SenseRepeaters.Count check inside the SenseRepeatListLock. No methods in the List class are thread safe in the MS specification/documentation --- .../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 8383c7f..fbb7c39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -157,12 +157,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins public void CheckSenseRepeaterEvents() { - // Nothing to do here? - if (SenseRepeaters.Count == 0) - return; - lock (SenseRepeatListLock) { + // Nothing to do here? + if (SenseRepeaters.Count == 0) + return; + // Go through all timers foreach (SenseRepeatClass ts in SenseRepeaters) { -- cgit v1.1 From 94971bf3b9fd53b571701e7d9a3a94628763da71 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Mar 2012 01:31:28 +0000 Subject: Provide feedback on bot login states in pCampbot --- OpenSim/Tools/pCampBot/Bot.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs index 0bd0bcc..da090dd 100644 --- a/OpenSim/Tools/pCampBot/Bot.cs +++ b/OpenSim/Tools/pCampBot/Bot.cs @@ -420,6 +420,8 @@ namespace pCampBot public void Network_LoginProgress(object sender, LoginProgressEventArgs args) { + m_log.DebugFormat("[BOT]: Bot {0} {1} in Network_LoginProcess", Name, args.Status); + if (args.Status == LoginStatus.Success) { if (OnConnected != null) @@ -431,10 +433,15 @@ namespace pCampBot public void Network_SimConnected(object sender, SimConnectedEventArgs args) { + m_log.DebugFormat( + "[BOT]: Bot {0} connected to {1} at {2}", Name, args.Simulator.Name, args.Simulator.IPEndPoint); } public void Network_OnDisconnected(object sender, DisconnectedEventArgs args) { + m_log.DebugFormat( + "[BOT]: Bot {0} disconnected reason {1}, message {2}", Name, args.Reason, args.Message); + // m_log.ErrorFormat("Fired Network_OnDisconnected"); // if ( -- cgit v1.1 From ec48a2f32ba991b89705b8212b0df8a79e961156 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Mar 2012 01:54:48 +0000 Subject: minor: Rename pCampbot console prompt to "pCampbot" rather than "Region" --- OpenSim/Tools/pCampBot/BotManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 6481e97..0f501b7 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -266,7 +266,7 @@ namespace pCampBot /// protected CommandConsole CreateConsole() { - return new LocalConsole("Region"); + return new LocalConsole("pCampbot"); } private void HandleShutdown(string module, string[] cmd) -- cgit v1.1 From e8779cd9e54416349e67d9e5c48b35bab43b69e9 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 1 Mar 2012 19:22:05 -0800 Subject: In ScenePresence, removed several private variables used to store public parameters. They were only used by the get/set and make code harder to refactor. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 152 +++++++---------------- 1 file changed, 44 insertions(+), 108 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 40c8d06..e982bfe 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -341,15 +341,9 @@ namespace OpenSim.Region.Framework.Scenes /// /// Position of agent's camera in world (region cordinates) /// - protected Vector3 m_lastCameraPosition; - - protected Vector3 m_CameraPosition; - - public Vector3 CameraPosition - { - get { return m_CameraPosition; } - private set { m_CameraPosition = value; } - } + protected Vector3 m_lastCameraPosition; + + public Vector3 CameraPosition { get; set; } public Quaternion CameraRotation { @@ -358,29 +352,10 @@ namespace OpenSim.Region.Framework.Scenes // Use these three vectors to figure out what the agent is looking at // Convert it to a Matrix and/or Quaternion - // - protected Vector3 m_CameraAtAxis; - protected Vector3 m_CameraLeftAxis; - protected Vector3 m_CameraUpAxis; - - public Vector3 CameraAtAxis - { - get { return m_CameraAtAxis; } - private set { m_CameraAtAxis = value; } - } - - - public Vector3 CameraLeftAxis - { - get { return m_CameraLeftAxis; } - private set { m_CameraLeftAxis = value; } - } - - public Vector3 CameraUpAxis - { - get { return m_CameraUpAxis; } - private set { m_CameraUpAxis = value; } - } + // + public Vector3 CameraAtAxis { get; set; } + public Vector3 CameraLeftAxis { get; set; } + public Vector3 CameraUpAxis { get; set; } public Vector3 Lookat { @@ -396,33 +371,15 @@ namespace OpenSim.Region.Framework.Scenes } #endregion - public readonly string Firstname; - public readonly string Lastname; - - private string m_grouptitle; - - public string Grouptitle - { - get { return m_grouptitle; } - set { m_grouptitle = value; } - } - - // Agent's Draw distance. - protected float m_DrawDistance; - - public float DrawDistance - { - get { return m_DrawDistance; } - private set { m_DrawDistance = value; } - } - - protected bool m_allowMovement = true; + public string Firstname { get; private set; } + public string Lastname { get; private set; } + + public string Grouptitle { get; set; } - public bool AllowMovement - { - get { return m_allowMovement; } - set { m_allowMovement = value; } - } + // Agent's Draw distance. + public float DrawDistance { get; set; } + + public bool AllowMovement { get; set; } private bool m_setAlwaysRun; @@ -447,15 +404,9 @@ namespace OpenSim.Region.Framework.Scenes PhysicsActor.SetAlwaysRun = value; } } - } - - private byte m_state; - - public byte State - { - get { return m_state; } - set { m_state = value; } - } + } + + public byte State { get; set; } private AgentManager.ControlFlags m_AgentControlFlags; @@ -463,31 +414,16 @@ namespace OpenSim.Region.Framework.Scenes { get { return (uint)m_AgentControlFlags; } set { m_AgentControlFlags = (AgentManager.ControlFlags)value; } - } - - /// - /// This works out to be the ClientView object associated with this avatar, or it's client connection manager - /// - private IClientAPI m_controllingClient; - - public IClientAPI ControllingClient - { - get { return m_controllingClient; } - private set { m_controllingClient = value; } - } + } + + public IClientAPI ControllingClient { get; set; } public IClientCore ClientView - { - get { return (IClientCore) m_controllingClient; } - } - - protected Vector3 m_parentPosition; - - public Vector3 ParentPosition - { - get { return m_parentPosition; } - set { m_parentPosition = value; } - } + { + get { return (IClientCore)ControllingClient; } + } + + public Vector3 ParentPosition { get; set; } /// /// Position of this avatar relative to the region the avatar is in @@ -825,18 +761,18 @@ namespace OpenSim.Region.Framework.Scenes private Vector3[] GetWalkDirectionVectors() { - Vector3[] vector = new Vector3[11]; - vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD - vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK + Vector3[] vector = new Vector3[11]; + vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD + vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK vector[2] = Vector3.UnitY; //LEFT - vector[3] = -Vector3.UnitY; //RIGHT - vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP - vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN - vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE - vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE + vector[3] = -Vector3.UnitY; //RIGHT + vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP + vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN + vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE + vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE vector[8] = Vector3.UnitY; //LEFT_NUDGE - vector[9] = -Vector3.UnitY; //RIGHT_NUDGE - vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE + vector[9] = -Vector3.UnitY; //RIGHT_NUDGE + vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE return vector; } @@ -1333,7 +1269,7 @@ namespace OpenSim.Region.Framework.Scenes // Convert it to a Matrix and/or Quaternion CameraAtAxis = agentData.CameraAtAxis; CameraLeftAxis = agentData.CameraLeftAxis; - m_CameraUpAxis = agentData.CameraUpAxis; + CameraUpAxis = agentData.CameraUpAxis; // The Agent's Draw distance setting // When we get to the point of re-computing neighbors everytime this @@ -1343,9 +1279,9 @@ namespace OpenSim.Region.Framework.Scenes DrawDistance = Scene.DefaultDrawDistance; // Check if Client has camera in 'follow cam' or 'build' mode. - Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); - - m_followCamAuto = ((m_CameraUpAxis.Z > 0.959f && m_CameraUpAxis.Z < 0.98f) + Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); + + m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f) && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false; m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; @@ -3077,8 +3013,8 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Velocity = m_velocity; cAgent.Center = CameraPosition; cAgent.AtAxis = CameraAtAxis; - cAgent.LeftAxis = CameraLeftAxis; - cAgent.UpAxis = m_CameraUpAxis; + cAgent.LeftAxis = CameraLeftAxis; + cAgent.UpAxis = CameraUpAxis; cAgent.Far = DrawDistance; @@ -3163,8 +3099,8 @@ namespace OpenSim.Region.Framework.Scenes m_velocity = cAgent.Velocity; CameraPosition = cAgent.Center; CameraAtAxis = cAgent.AtAxis; - CameraLeftAxis = cAgent.LeftAxis; - m_CameraUpAxis = cAgent.UpAxis; + CameraLeftAxis = cAgent.LeftAxis; + CameraUpAxis = cAgent.UpAxis; // When we get to the point of re-computing neighbors everytime this // changes, then start using the agent's drawdistance rather than the -- cgit v1.1 From 8fccd2b55514a373bf127b49a729d047240c9701 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 1 Mar 2012 19:55:51 -0800 Subject: Send the right name and creation date on the BasicProfileModule. --- .../Region/CoreModules/Avatar/Profile/BasicProfileModule.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index eb1e4b5..8101ca2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs @@ -150,7 +150,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile string skillsText = String.Empty; string languages = String.Empty; - Byte[] charterMember = Utils.StringToBytes("Avatar"); + UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, avatarID); + + string name = "Avatar"; + int created = 0; + if (account != null) + { + name = account.FirstName + " " + account.LastName; + created = account.Created; + } + Byte[] charterMember = Utils.StringToBytes(name); profileUrl = "No profile data"; aboutText = string.Empty; @@ -160,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile partner = UUID.Zero; remoteClient.SendAvatarProperties(avatarID, aboutText, - Util.ToDateTime(0).ToString( + Util.ToDateTime(created).ToString( "M/d/yyyy", CultureInfo.InvariantCulture), charterMember, firstLifeAboutText, (uint)(0 & 0xff), -- cgit v1.1 From 6e3523e25e8d5538ed63984241093c1cfb6f2388 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Mar 2012 04:08:07 +0000 Subject: minor: remove mono compiler warning --- OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index e4b607d..e16903c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -65,8 +65,7 @@ namespace OpenSim.Region.Framework.Tests // Create an object embedded inside the first UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); - TaskInventoryItem taskSceneObjectItem - = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); + TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); -- cgit v1.1 From 8d249f8456f6bf70f4d81098007a02b1ede5587e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 2 Mar 2012 09:19:13 -0800 Subject: ScenePresence line endings and fix AllowMovement default to true. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 60 ++++++++++++------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e982bfe..ec6bb89 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -341,8 +341,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// Position of agent's camera in world (region cordinates) /// - protected Vector3 m_lastCameraPosition; - + protected Vector3 m_lastCameraPosition; + public Vector3 CameraPosition { get; set; } public Quaternion CameraRotation @@ -352,9 +352,9 @@ namespace OpenSim.Region.Framework.Scenes // Use these three vectors to figure out what the agent is looking at // Convert it to a Matrix and/or Quaternion - // - public Vector3 CameraAtAxis { get; set; } - public Vector3 CameraLeftAxis { get; set; } + // + public Vector3 CameraAtAxis { get; set; } + public Vector3 CameraLeftAxis { get; set; } public Vector3 CameraUpAxis { get; set; } public Vector3 Lookat @@ -371,14 +371,14 @@ namespace OpenSim.Region.Framework.Scenes } #endregion - public string Firstname { get; private set; } - public string Lastname { get; private set; } - + public string Firstname { get; private set; } + public string Lastname { get; private set; } + public string Grouptitle { get; set; } - // Agent's Draw distance. - public float DrawDistance { get; set; } - + // Agent's Draw distance. + public float DrawDistance { get; set; } + public bool AllowMovement { get; set; } private bool m_setAlwaysRun; @@ -404,8 +404,8 @@ namespace OpenSim.Region.Framework.Scenes PhysicsActor.SetAlwaysRun = value; } } - } - + } + public byte State { get; set; } private AgentManager.ControlFlags m_AgentControlFlags; @@ -414,15 +414,15 @@ namespace OpenSim.Region.Framework.Scenes { get { return (uint)m_AgentControlFlags; } set { m_AgentControlFlags = (AgentManager.ControlFlags)value; } - } - + } + public IClientAPI ControllingClient { get; set; } public IClientCore ClientView - { + { get { return (IClientCore)ControllingClient; } - } - + } + public Vector3 ParentPosition { get; set; } /// @@ -683,7 +683,7 @@ namespace OpenSim.Region.Framework.Scenes IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) { AttachmentsSyncLock = new Object(); - + AllowMovement = true; IsChildAgent = true; m_sendCourseLocationsMethod = SendCoarseLocationsDefault; Animator = new ScenePresenceAnimator(this); @@ -761,17 +761,17 @@ namespace OpenSim.Region.Framework.Scenes private Vector3[] GetWalkDirectionVectors() { - Vector3[] vector = new Vector3[11]; - vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD + Vector3[] vector = new Vector3[11]; + vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK vector[2] = Vector3.UnitY; //LEFT - vector[3] = -Vector3.UnitY; //RIGHT - vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP - vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN - vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE + vector[3] = -Vector3.UnitY; //RIGHT + vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP + vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN + vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE vector[8] = Vector3.UnitY; //LEFT_NUDGE - vector[9] = -Vector3.UnitY; //RIGHT_NUDGE + vector[9] = -Vector3.UnitY; //RIGHT_NUDGE vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE return vector; } @@ -1279,8 +1279,8 @@ namespace OpenSim.Region.Framework.Scenes DrawDistance = Scene.DefaultDrawDistance; // Check if Client has camera in 'follow cam' or 'build' mode. - Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); - + Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); + m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f) && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false; @@ -3013,7 +3013,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Velocity = m_velocity; cAgent.Center = CameraPosition; cAgent.AtAxis = CameraAtAxis; - cAgent.LeftAxis = CameraLeftAxis; + cAgent.LeftAxis = CameraLeftAxis; cAgent.UpAxis = CameraUpAxis; cAgent.Far = DrawDistance; @@ -3099,7 +3099,7 @@ namespace OpenSim.Region.Framework.Scenes m_velocity = cAgent.Velocity; CameraPosition = cAgent.Center; CameraAtAxis = cAgent.AtAxis; - CameraLeftAxis = cAgent.LeftAxis; + CameraLeftAxis = cAgent.LeftAxis; CameraUpAxis = cAgent.UpAxis; // When we get to the point of re-computing neighbors everytime this -- cgit v1.1