diff options
author | UbitUmarov | 2016-11-09 22:39:52 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-09 22:39:52 +0000 |
commit | d1baa3e0c3b1783a68061980ffd8b9693c5a474a (patch) | |
tree | 774fb5ae0be5e9b597c46af3b3b5f3e0c6a3f0d6 /OpenSim | |
parent | stop warning about integer division cast to float (diff) | |
download | opensim-SC_OLD-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.zip opensim-SC_OLD-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.tar.gz opensim-SC_OLD-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.tar.bz2 opensim-SC_OLD-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.tar.xz |
fix some invalid string.format arguments
Diffstat (limited to 'OpenSim')
7 files changed, 108 insertions, 9 deletions
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 26e844e..d79e4fa 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs | |||
@@ -286,7 +286,7 @@ namespace OpenSim.Groups | |||
286 | string requestingAgentID = request["RequestingAgentID"].ToString(); | 286 | string requestingAgentID = request["RequestingAgentID"].ToString(); |
287 | 287 | ||
288 | if (!m_GroupsService.RemoveAgentFromGroup(requestingAgentID, agentID, groupID)) | 288 | if (!m_GroupsService.RemoveAgentFromGroup(requestingAgentID, agentID, groupID)) |
289 | NullResult(result, string.Format("Insufficient permissions.", agentID)); | 289 | NullResult(result, string.Format("Insufficient permissions. {0}", agentID)); |
290 | else | 290 | else |
291 | result["RESULT"] = "true"; | 291 | result["RESULT"] = "true"; |
292 | } | 292 | } |
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs index c74033e..9a0044e 100644 --- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs | |||
@@ -193,7 +193,9 @@ namespace OpenSim.Data.MySQL | |||
193 | { | 193 | { |
194 | using (MySqlCommand cmd = new MySqlCommand()) | 194 | using (MySqlCommand cmd = new MySqlCommand()) |
195 | { | 195 | { |
196 | cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1", m_Realm); | 196 | // cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1", m_Realm); |
197 | |||
198 | cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1"); | ||
197 | 199 | ||
198 | cmd.Parameters.AddWithValue("?uuid", principalID.ToString()); | 200 | cmd.Parameters.AddWithValue("?uuid", principalID.ToString()); |
199 | cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); | 201 | cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); |
@@ -212,7 +214,10 @@ namespace OpenSim.Data.MySQL | |||
212 | { | 214 | { |
213 | cmd.Connection = dbcon; | 215 | cmd.Connection = dbcon; |
214 | 216 | ||
215 | cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID", m_Realm); | 217 | // cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID", m_Realm); |
218 | |||
219 | cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID"); | ||
220 | |||
216 | cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); | 221 | cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); |
217 | cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); | 222 | cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); |
218 | 223 | ||
diff --git a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs index a22b882..c34a8dc 100644 --- a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs +++ b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs | |||
@@ -174,7 +174,9 @@ namespace OpenSim.Data.PGSQL | |||
174 | { | 174 | { |
175 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 175 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
176 | { | 176 | { |
177 | cmd.CommandText = String.Format(@"select * from inventoryitems where ""avatarID"" = :uuid and ""assetType"" = :type and ""flags"" = 1", m_Realm); | 177 | // cmd.CommandText = String.Format(@"select * from inventoryitems where ""avatarID"" = :uuid and ""assetType"" = :type and ""flags"" = 1", m_Realm); |
178 | |||
179 | cmd.CommandText = String.Format(@"select * from inventoryitems where ""avatarID"" = :uuid and ""assetType"" = :type and ""flags"" = 1"); | ||
178 | 180 | ||
179 | UUID princID = UUID.Zero; | 181 | UUID princID = UUID.Zero; |
180 | UUID.TryParse(principalID, out princID); | 182 | UUID.TryParse(principalID, out princID); |
@@ -194,11 +196,18 @@ namespace OpenSim.Data.PGSQL | |||
194 | { | 196 | { |
195 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 197 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
196 | { | 198 | { |
199 | /* | ||
197 | cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" | 200 | cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" |
198 | from inventoryitems | 201 | from inventoryitems |
199 | where ""avatarID"" = :PrincipalID | 202 | where ""avatarID"" = :PrincipalID |
200 | and ""assetID"" = :AssetID | 203 | and ""assetID"" = :AssetID |
201 | group by ""assetID"" ", m_Realm); | 204 | group by ""assetID"" ", m_Realm); |
205 | */ | ||
206 | cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" | ||
207 | from inventoryitems | ||
208 | where ""avatarID"" = :PrincipalID | ||
209 | and ""assetID"" = :AssetID | ||
210 | group by ""assetID"" "); | ||
202 | 211 | ||
203 | cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); | 212 | cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); |
204 | cmd.Parameters.Add(m_database.CreateParameter("AssetID", assetID)); | 213 | cmd.Parameters.Add(m_database.CreateParameter("AssetID", assetID)); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index a5abe76..3f48372 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -614,7 +614,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
614 | { | 614 | { |
615 | m_log.Error( | 615 | m_log.Error( |
616 | string.Format( | 616 | string.Format( |
617 | "[AGENT INVENTORY]: Error in SendInventoryAsync() for {0} with folder ID {1}. Exception ", e)); | 617 | "[AGENT INVENTORY]: Error in SendInventoryAsync() for {0} with folder ID {1}. Exception ", e, folderID)); |
618 | } | 618 | } |
619 | Thread.Sleep(20); | 619 | Thread.Sleep(20); |
620 | } | 620 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 1de55ec..d406625 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -287,7 +287,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
287 | } | 287 | } |
288 | catch (Exception e) | 288 | catch (Exception e) |
289 | { | 289 | { |
290 | m_log.Error(string.Format("[SCENE]: SceneBase.cs: Close() - Failed with exception ", e)); | 290 | m_log.Error(string.Format("[SCENE]: SceneBase.cs: Close() - Failed with exception {0}", e)); |
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1a73c3e..bafee28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -14358,6 +14358,91 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14358 | return contacts.ToArray(); | 14358 | return contacts.ToArray(); |
14359 | } | 14359 | } |
14360 | 14360 | ||
14361 | private ContactResult? GroundIntersection2(Vector3 rayStart, Vector3 rayEnd) | ||
14362 | { | ||
14363 | // get work copies | ||
14364 | float sx = rayStart.X; | ||
14365 | float ex = rayEnd.X; | ||
14366 | float sy = rayStart.Y; | ||
14367 | float ey = rayEnd.Y; | ||
14368 | |||
14369 | float dx = ex - sx; | ||
14370 | float dy = ey - sy; | ||
14371 | |||
14372 | // region size info | ||
14373 | float rsx = World.RegionInfo.RegionSizeX; | ||
14374 | |||
14375 | float tmp; | ||
14376 | |||
14377 | // region bounds | ||
14378 | if(sx < 0) | ||
14379 | { | ||
14380 | if(ex < 0) // totally outside | ||
14381 | return null; | ||
14382 | if(dx <= 0) // out and going away | ||
14383 | return null; | ||
14384 | else if(ex >= rsx) | ||
14385 | ex = rsx - 0.001f; | ||
14386 | tmp = -sx / dx; | ||
14387 | sy += dy * dx; | ||
14388 | sx = 0; | ||
14389 | } | ||
14390 | else if(sx >= rsx) | ||
14391 | { | ||
14392 | if(ex >= rsx) // totally outside | ||
14393 | return null; | ||
14394 | if(dx >= 0) // out and going away | ||
14395 | return null; | ||
14396 | else if(ex < 0) | ||
14397 | ex = 0; | ||
14398 | tmp = (rsx - sx) / dx; | ||
14399 | sy += dy * dx; | ||
14400 | sx = rsx - 0.001f; | ||
14401 | } | ||
14402 | |||
14403 | float rsy = World.RegionInfo.RegionSizeY; | ||
14404 | if(sy < 0) | ||
14405 | { | ||
14406 | if(dy <= 0) // out and going away | ||
14407 | return null; | ||
14408 | else if(ey >= rsy) | ||
14409 | ey = rsy - 0.001f; | ||
14410 | tmp = -sy / dy; | ||
14411 | sx += dy * dx; | ||
14412 | sy = 0; | ||
14413 | } | ||
14414 | else if(sy >= rsy) | ||
14415 | { | ||
14416 | if(dy >= 0) // out and going away | ||
14417 | return null; | ||
14418 | else if(ey < 0) | ||
14419 | ey = 0; | ||
14420 | tmp = (rsy - sy) / dy; | ||
14421 | sx += dy * dx; | ||
14422 | sy = rsy - 0.001f; | ||
14423 | } | ||
14424 | |||
14425 | if(sx < 0 || sx >= rsx) | ||
14426 | return null; | ||
14427 | |||
14428 | float sz = rayStart.Z; | ||
14429 | float ez = rayEnd.Z; | ||
14430 | float dz = ez - sz; | ||
14431 | |||
14432 | float dist = dx * dx + dy * dy + dz * dz; | ||
14433 | if(dist < 0.001) | ||
14434 | return null; | ||
14435 | dist = (float)Math.Sqrt(dist); | ||
14436 | tmp = 1.0f / dist; | ||
14437 | Vector3 rayn = new Vector3(dx * tmp, dy * tmp, dz * tmp); | ||
14438 | |||
14439 | ContactResult? result = null; | ||
14440 | |||
14441 | |||
14442 | |||
14443 | return result; | ||
14444 | } | ||
14445 | |||
14361 | private ContactResult? GroundIntersection(Vector3 rayStart, Vector3 rayEnd) | 14446 | private ContactResult? GroundIntersection(Vector3 rayStart, Vector3 rayEnd) |
14362 | { | 14447 | { |
14363 | double[,] heightfield = World.Heightmap.GetDoubles(); | 14448 | double[,] heightfield = World.Heightmap.GetDoubles(); |
@@ -16024,8 +16109,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
16024 | catch (InvalidCastException e) | 16109 | catch (InvalidCastException e) |
16025 | { | 16110 | { |
16026 | Error(originFunc,string.Format( | 16111 | Error(originFunc,string.Format( |
16027 | " error running rule #{1}: arg #{2} ", | 16112 | " error running rule #{0}: arg #{1} {2}", |
16028 | rulesParsed, idx - idxStart) + e.Message); | 16113 | rulesParsed, idx - idxStart, e.Message)); |
16029 | } | 16114 | } |
16030 | finally | 16115 | finally |
16031 | { | 16116 | { |
diff --git a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs index 74935f3..b9a6281 100644 --- a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs +++ b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs | |||
@@ -323,7 +323,7 @@ namespace OpenSim.Services.Connectors | |||
323 | } | 323 | } |
324 | else | 324 | else |
325 | m_log.Error(string.Format( | 325 | m_log.Error(string.Format( |
326 | "[ESTATE CONNECTOR]: WebException for {0} {1} {2} ", | 326 | "[ESTATE CONNECTOR]: WebException for {0} {1} {2} {3}", |
327 | verb, uri, formdata, e)); | 327 | verb, uri, formdata, e)); |
328 | } | 328 | } |
329 | } | 329 | } |