* You can haz more spring cleaning.

* Eventually this codebase will be clean. >_>
0.6.0-stable
Adam Frisby 2008-05-08 05:35:01 +00:00
parent 872af8e04d
commit 4fa0cbdfbb
9 changed files with 25 additions and 102 deletions

View File

@ -264,12 +264,7 @@ namespace OpenSim.Data.MSSQL
regionprofile.regionUserURI = (string)reader["regionUserURI"];
regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"];
regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"];
try
{
regionprofile.owner_uuid = new LLUUID((string)reader["owner_uuid"]);
}
catch(Exception)
{}
regionprofile.owner_uuid = new LLUUID((string) reader["owner_uuid"]);
// World Map Addition
string tempRegionMap = reader["regionMapTexture"].ToString();
if (tempRegionMap != String.Empty)

View File

@ -253,13 +253,7 @@ namespace OpenSim.Data.MySQL
lock (dbcon)
{
// Close the DB connection
try
{
dbcon.Close();
}
catch
{
}
dbcon.Close();
// Try to reopen it
try
@ -269,7 +263,7 @@ namespace OpenSim.Data.MySQL
}
catch (Exception e)
{
m_log.Error("Unable to reconnect to database " + e.ToString());
m_log.Error("Unable to reconnect to database " + e);
}
// Run the query again

View File

@ -188,8 +188,7 @@ namespace OpenSim.Framework
}
packet.Effect = effectBlock.ToArray();
// Wasteful, I know
IClientAPI[] LocalClients = new IClientAPI[0];
IClientAPI[] LocalClients;
lock (m_clients)
{
LocalClients = new IClientAPI[m_clients.Count];

View File

@ -334,18 +334,9 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="asset"></param>
public void AddAsset(AssetBase asset)
{
string temporary = asset.Temporary ? "temporary" : String.Empty;
string type = asset.Type == 0 ? "texture" : "asset";
string result = "Ignored";
if (asset.Type == 0)
{
if (Textures.ContainsKey(asset.FullID))
{
result = "Duplicate ignored.";
}
else
if (!Textures.ContainsKey(asset.FullID))
{
TextureImage textur = new TextureImage(asset);
Textures.Add(textur.FullID, textur);
@ -353,24 +344,15 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddTexture(textur);
if (asset.Temporary)
{
result = "Added to cache";
}
else
if (!asset.Temporary)
{
m_assetServer.StoreAndCommitAsset(asset);
result = "Added to server";
}
}
}
else
{
if (Assets.ContainsKey(asset.FullID))
{
result = "Duplicate ignored.";
}
else
if (!Assets.ContainsKey(asset.FullID))
{
AssetInfo assetInf = new AssetInfo(asset);
Assets.Add(assetInf.FullID, assetInf);
@ -378,29 +360,17 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddAsset(assetInf);
if (asset.Temporary)
{
result = "Added to cache";
}
else
if (!asset.Temporary)
{
m_assetServer.StoreAndCommitAsset(asset);
result = "Added to server";
}
}
}
#if DEBUG
//m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result);
#endif
}
// See IAssetReceiver
public void AssetReceived(AssetBase asset, bool IsTexture)
{
#if DEBUG
//m_log.DebugFormat("[ASSET CACHE]: Received {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID);
#endif
if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
{
//check if it is a texture or not
@ -411,13 +381,7 @@ namespace OpenSim.Framework.Communications.Cache
if (IsTexture)
{
TextureImage image = new TextureImage(asset);
if (Textures.ContainsKey(image.FullID))
{
#if DEBUG
//m_log.DebugFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID);
#endif
}
else
if (!Textures.ContainsKey(image.FullID))
{
Textures.Add(image.FullID, image);
@ -430,13 +394,7 @@ namespace OpenSim.Framework.Communications.Cache
else
{
AssetInfo assetInf = new AssetInfo(asset);
if (Assets.ContainsKey(assetInf.FullID))
{
#if DEBUG
//m_log.DebugFormat("[ASSET CACHE]: There's already an asset {0} in memory. Skipping.", asset.FullID);
#endif
}
else
if (!Assets.ContainsKey(assetInf.FullID))
{
Assets.Add(assetInf.FullID, assetInf);
@ -446,18 +404,14 @@ namespace OpenSim.Framework.Communications.Cache
}
if (RequestedAssets.ContainsKey(assetInf.FullID))
{
#if DEBUG
//m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID);
#endif
{
AssetRequest req = RequestedAssets[assetInf.FullID];
req.AssetInf = assetInf;
req.NumPackets = CalculateNumPackets(assetInf.Data);
AssetRequest req = RequestedAssets[assetInf.FullID];
req.AssetInf = assetInf;
req.NumPackets = CalculateNumPackets(assetInf.Data);
RequestedAssets.Remove(assetInf.FullID);
AssetRequests.Add(req);
}
RequestedAssets.Remove(assetInf.FullID);
AssetRequests.Add(req);
}
}
}

View File

@ -3279,6 +3279,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_needAck.Add(Pack.Header.Sequence, Pack);
m_unAckedBytes += Pack.ToBytes().Length;
}
//BUG: severity=major - This looks like a framework bug!?
catch (Exception) // HACKY
{
// Ignore

View File

@ -64,11 +64,6 @@ namespace OpenSim.Region.Environment.Scenes
PendingDownloads = 19,
PendingUploads = 20,
UnAckedBytes = 24,
// Havok4 related... May or may not be in upcoming LLclients
// (kelly added them sometime late in January 2008)
NumRCCSLODReduced = 25,
NumRCCSFixed = 26
}
// Sending a stats update every 3 seconds

View File

@ -531,13 +531,8 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_host.AddScriptLPS(1);
LLUUID keyID = LLUUID.Zero;
try
{
if (id.Length > 0) keyID = new LLUUID(id);
}
catch
{
}
LLUUID.TryParse(id, out keyID);
m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host);
return;
@ -547,13 +542,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_host.AddScriptLPS(1);
LLUUID keyID = LLUUID.Zero;
try
{
if (id.Length > 0) keyID = new LLUUID(id);
}
catch
{
}
LLUUID.TryParse(id, out keyID);
m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host);
return;
@ -2252,8 +2241,6 @@ namespace OpenSim.Region.ScriptEngine.Common
m_host.AddScriptLPS(1);
bool attachment=false; // Attachments not implemented yet. TODO: reflect real attachemnt state
if (m_host.ParentGroup.RootPart.m_IsAttachment && agent == m_host.ParentGroup.RootPart.m_attachedAvatar)
{
// When attached, certain permissions are implicit if requested from owner
@ -3181,7 +3168,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
return Convert.ToInt32(src.Data[index]);
}
catch (FormatException e)
catch (FormatException)
{
return 0;
}
@ -3216,7 +3203,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
return Convert.ToDouble(src.Data[index]);
}
catch (FormatException e)
catch (FormatException)
{
return 0.0;
}

View File

@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
//}
}
}
catch(ThreadAbortException ex)
catch(ThreadAbortException)
{
m_log.Error("Thread aborted in MaintenanceLoopThread. If this is during shutdown, please ignore");
}

View File

@ -335,10 +335,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
ExecutorBase.scriptEvents evflags = Script.Exec.GetStateEventFlags();
return (int)evflags;
}
catch (Exception e)
catch (Exception)
{
// Console.WriteLine("Failed to get script reference for <" + localID + "," + itemID + ">");
// Console.WriteLine(e.ToString());
}
return 0;