* 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.regionUserURI = (string)reader["regionUserURI"];
regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"]; regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"];
regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"]; regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"];
try regionprofile.owner_uuid = new LLUUID((string) reader["owner_uuid"]);
{
regionprofile.owner_uuid = new LLUUID((string)reader["owner_uuid"]);
}
catch(Exception)
{}
// World Map Addition // World Map Addition
string tempRegionMap = reader["regionMapTexture"].ToString(); string tempRegionMap = reader["regionMapTexture"].ToString();
if (tempRegionMap != String.Empty) if (tempRegionMap != String.Empty)

View File

@ -253,13 +253,7 @@ namespace OpenSim.Data.MySQL
lock (dbcon) lock (dbcon)
{ {
// Close the DB connection // Close the DB connection
try dbcon.Close();
{
dbcon.Close();
}
catch
{
}
// Try to reopen it // Try to reopen it
try try
@ -269,7 +263,7 @@ namespace OpenSim.Data.MySQL
} }
catch (Exception e) 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 // Run the query again

View File

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

View File

@ -334,18 +334,9 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="asset"></param> /// <param name="asset"></param>
public void AddAsset(AssetBase asset) 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 (asset.Type == 0)
{ {
if (Textures.ContainsKey(asset.FullID)) if (!Textures.ContainsKey(asset.FullID))
{
result = "Duplicate ignored.";
}
else
{ {
TextureImage textur = new TextureImage(asset); TextureImage textur = new TextureImage(asset);
Textures.Add(textur.FullID, textur); Textures.Add(textur.FullID, textur);
@ -353,24 +344,15 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null) if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddTexture(textur); StatsManager.SimExtraStats.AddTexture(textur);
if (asset.Temporary) if (!asset.Temporary)
{
result = "Added to cache";
}
else
{ {
m_assetServer.StoreAndCommitAsset(asset); m_assetServer.StoreAndCommitAsset(asset);
result = "Added to server";
} }
} }
} }
else else
{ {
if (Assets.ContainsKey(asset.FullID)) if (!Assets.ContainsKey(asset.FullID))
{
result = "Duplicate ignored.";
}
else
{ {
AssetInfo assetInf = new AssetInfo(asset); AssetInfo assetInf = new AssetInfo(asset);
Assets.Add(assetInf.FullID, assetInf); Assets.Add(assetInf.FullID, assetInf);
@ -378,29 +360,17 @@ namespace OpenSim.Framework.Communications.Cache
if (StatsManager.SimExtraStats != null) if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddAsset(assetInf); StatsManager.SimExtraStats.AddAsset(assetInf);
if (asset.Temporary) if (!asset.Temporary)
{
result = "Added to cache";
}
else
{ {
m_assetServer.StoreAndCommitAsset(asset); 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 // See IAssetReceiver
public void AssetReceived(AssetBase asset, bool IsTexture) 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 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 //check if it is a texture or not
@ -411,13 +381,7 @@ namespace OpenSim.Framework.Communications.Cache
if (IsTexture) if (IsTexture)
{ {
TextureImage image = new TextureImage(asset); TextureImage image = new TextureImage(asset);
if (Textures.ContainsKey(image.FullID)) 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
{ {
Textures.Add(image.FullID, image); Textures.Add(image.FullID, image);
@ -430,13 +394,7 @@ namespace OpenSim.Framework.Communications.Cache
else else
{ {
AssetInfo assetInf = new AssetInfo(asset); AssetInfo assetInf = new AssetInfo(asset);
if (Assets.ContainsKey(assetInf.FullID)) 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
{ {
Assets.Add(assetInf.FullID, assetInf); Assets.Add(assetInf.FullID, assetInf);
@ -446,18 +404,14 @@ namespace OpenSim.Framework.Communications.Cache
} }
if (RequestedAssets.ContainsKey(assetInf.FullID)) if (RequestedAssets.ContainsKey(assetInf.FullID))
{ {
#if DEBUG AssetRequest req = RequestedAssets[assetInf.FullID];
//m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID); req.AssetInf = assetInf;
#endif req.NumPackets = CalculateNumPackets(assetInf.Data);
AssetRequest req = RequestedAssets[assetInf.FullID]; RequestedAssets.Remove(assetInf.FullID);
req.AssetInf = assetInf; AssetRequests.Add(req);
req.NumPackets = CalculateNumPackets(assetInf.Data); }
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_needAck.Add(Pack.Header.Sequence, Pack);
m_unAckedBytes += Pack.ToBytes().Length; m_unAckedBytes += Pack.ToBytes().Length;
} }
//BUG: severity=major - This looks like a framework bug!?
catch (Exception) // HACKY catch (Exception) // HACKY
{ {
// Ignore // Ignore

View File

@ -64,11 +64,6 @@ namespace OpenSim.Region.Environment.Scenes
PendingDownloads = 19, PendingDownloads = 19,
PendingUploads = 20, PendingUploads = 20,
UnAckedBytes = 24, 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 // Sending a stats update every 3 seconds

View File

@ -531,13 +531,8 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LLUUID keyID = LLUUID.Zero; LLUUID keyID = LLUUID.Zero;
try LLUUID.TryParse(id, out keyID);
{
if (id.Length > 0) keyID = new LLUUID(id);
}
catch
{
}
m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host);
return; return;
@ -547,13 +542,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LLUUID keyID = LLUUID.Zero; LLUUID keyID = LLUUID.Zero;
try LLUUID.TryParse(id, out keyID);
{
if (id.Length > 0) keyID = new LLUUID(id);
}
catch
{
}
m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host);
return; return;
@ -2252,8 +2241,6 @@ namespace OpenSim.Region.ScriptEngine.Common
m_host.AddScriptLPS(1); 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) if (m_host.ParentGroup.RootPart.m_IsAttachment && agent == m_host.ParentGroup.RootPart.m_attachedAvatar)
{ {
// When attached, certain permissions are implicit if requested from owner // 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]); return Convert.ToInt32(src.Data[index]);
} }
catch (FormatException e) catch (FormatException)
{ {
return 0; return 0;
} }
@ -3216,7 +3203,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
return Convert.ToDouble(src.Data[index]); return Convert.ToDouble(src.Data[index]);
} }
catch (FormatException e) catch (FormatException)
{ {
return 0.0; 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"); 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(); ExecutorBase.scriptEvents evflags = Script.Exec.GetStateEventFlags();
return (int)evflags; return (int)evflags;
} }
catch (Exception e) catch (Exception)
{ {
// Console.WriteLine("Failed to get script reference for <" + localID + "," + itemID + ">");
// Console.WriteLine(e.ToString());
} }
return 0; return 0;