dr scofield's warning safari:

* commented out [Obsolete(....)] attributes where no replacement feature
  was available: if we want to attribute code that we think needs to be 
  reworked, we should define a new attribute and use that instead 
  (together with a little tool to retrieve all the attributed code then)
* commenting out unused variables
0.6.0-stable
Dr Scofield 2008-06-27 16:58:21 +00:00
parent ba989e9fd1
commit feb30217de
18 changed files with 64 additions and 62 deletions

View File

@ -74,13 +74,13 @@ namespace OpenSim.Data
private string _type; private string _type;
private DbConnection _conn; private DbConnection _conn;
private string _subtype; // private string _subtype;
private Assembly _assem; private Assembly _assem;
private Regex _match; private Regex _match;
private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)"; private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)";
private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)";
private static readonly string _migrations_find = "select version from migrations where name='migrations'"; // private static readonly string _migrations_find = "select version from migrations where name='migrations'";
public Migration(DbConnection conn, Assembly assem, string type) public Migration(DbConnection conn, Assembly assem, string type)
{ {
@ -150,23 +150,23 @@ namespace OpenSim.Data
} }
} }
private int MaxVersion() // private int MaxVersion()
{ // {
int max = 0; // int max = 0;
string[] names = _assem.GetManifestResourceNames(); // string[] names = _assem.GetManifestResourceNames();
foreach (string s in names) // foreach (string s in names)
{ // {
Match m = _match.Match(s); // Match m = _match.Match(s);
if (m.Success) // if (m.Success)
{ // {
int MigrationVersion = int.Parse(m.Groups[1].ToString()); // int MigrationVersion = int.Parse(m.Groups[1].ToString());
if (MigrationVersion > max) // if (MigrationVersion > max)
max = MigrationVersion; // max = MigrationVersion;
} // }
} // }
return max; // return max;
} // }
public int Version public int Version
{ {
@ -222,10 +222,10 @@ namespace OpenSim.Data
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
private SortedList<int, string> GetAllMigrations() // private SortedList<int, string> GetAllMigrations()
{ // {
return GetMigrationsAfter(0); // return GetMigrationsAfter(0);
} // }
private SortedList<int, string> GetMigrationsAfter(int after) private SortedList<int, string> GetMigrationsAfter(int after)
{ {

View File

@ -35,9 +35,9 @@ namespace OpenSim.Data
{ {
public abstract class UserDataBase : IUserData public abstract class UserDataBase : IUserData
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<LLUUID, AvatarAppearance> aplist = new Dictionary<LLUUID, AvatarAppearance>(); // private Dictionary<LLUUID, AvatarAppearance> aplist = new Dictionary<LLUUID, AvatarAppearance>();
public abstract UserProfileData GetUserByUUID(LLUUID user); public abstract UserProfileData GetUserByUUID(LLUUID user);
public abstract UserProfileData GetUserByName(string fname, string lname); public abstract UserProfileData GetUserByName(string fname, string lname);

View File

@ -138,7 +138,7 @@ namespace OpenSim.Framework
} }
} }
[Obsolete("Using Obsolete to drive development is invalid. Obsolete presumes that something new has already been created to replace this.")] // [Obsolete("Using Obsolete to drive development is invalid. Obsolete presumes that something new has already been created to replace this.")]
public uint[] GetAllCircuits(LLUUID agentId) public uint[] GetAllCircuits(LLUUID agentId)
{ {
List<uint> circuits = new List<uint>(); List<uint> circuits = new List<uint>();

View File

@ -79,17 +79,17 @@ namespace OpenSim.Framework.Communications.Capabilities
private CapsHandlers m_capsHandlers; private CapsHandlers m_capsHandlers;
private static readonly string m_requestPath = "0000/"; private static readonly string m_requestPath = "0000/";
private static readonly string m_mapLayerPath = "0001/"; // private static readonly string m_mapLayerPath = "0001/";
private static readonly string m_newInventory = "0002/"; private static readonly string m_newInventory = "0002/";
//private static readonly string m_requestTexture = "0003/"; //private static readonly string m_requestTexture = "0003/";
private static readonly string m_notecardUpdatePath = "0004/"; private static readonly string m_notecardUpdatePath = "0004/";
private static readonly string m_notecardTaskUpdatePath = "0005/"; private static readonly string m_notecardTaskUpdatePath = "0005/";
private static readonly string m_fetchInventoryPath = "0006/"; // private static readonly string m_fetchInventoryPath = "0006/";
// The following two entries are in a module, however, there also here so that we don't re-assign // The following two entries are in a module, however, there also here so that we don't re-assign
// the path to another cap by mistake. // the path to another cap by mistake.
private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. // private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module.
private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module.
//private string eventQueue = "0100/"; //private string eventQueue = "0100/";
private BaseHttpServer m_httpListener; private BaseHttpServer m_httpListener;
@ -246,7 +246,7 @@ namespace OpenSim.Framework.Communications.Capabilities
// multiple fetch-folder maps are allowed within the larger folders map. // multiple fetch-folder maps are allowed within the larger folders map.
public string FetchInventoryRequest(string request, string path, string param) public string FetchInventoryRequest(string request, string path, string param)
{ {
string unmodifiedRequest = request.ToString(); // string unmodifiedRequest = request.ToString();
//m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest); //m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest);
m_log.Debug("[CAPS]: Inventory Request in region: " + m_regionName); m_log.Debug("[CAPS]: Inventory Request in region: " + m_regionName);

View File

@ -282,7 +282,7 @@ namespace OpenSim.Framework.Communications
if (profileData != null) if (profileData != null)
{ {
returnstring = new string[2]; returnstring = new string[2];
LLUUID profileId = profileData.ID; // LLUUID profileId = profileData.ID;
returnstring[0] = profileData.FirstName; returnstring[0] = profileData.FirstName;
returnstring[1] = profileData.SurName; returnstring[1] = profileData.SurName;
lock (m_nameRequestCache) lock (m_nameRequestCache)

View File

@ -95,7 +95,7 @@ namespace OpenSim.Framework.Communications
// Response // Response
private XmlRpcResponse xmlRpcResponse; private XmlRpcResponse xmlRpcResponse;
private XmlRpcResponse defaultXmlRpcResponse; // private XmlRpcResponse defaultXmlRpcResponse;
private string welcomeMessage; private string welcomeMessage;
private string startLocation; private string startLocation;
@ -117,7 +117,7 @@ namespace OpenSim.Framework.Communications
loginError = new Hashtable(); loginError = new Hashtable();
uiConfigHash = new Hashtable(); uiConfigHash = new Hashtable();
defaultXmlRpcResponse = new XmlRpcResponse(); // defaultXmlRpcResponse = new XmlRpcResponse();
userProfile = new UserInfo(); userProfile = new UserInfo();
inventoryRoot = new ArrayList(); inventoryRoot = new ArrayList();
initialOutfit = new ArrayList(); initialOutfit = new ArrayList();
@ -126,7 +126,7 @@ namespace OpenSim.Framework.Communications
inventoryLibraryOwner = new ArrayList(); inventoryLibraryOwner = new ArrayList();
xmlRpcResponse = new XmlRpcResponse(); xmlRpcResponse = new XmlRpcResponse();
defaultXmlRpcResponse = new XmlRpcResponse(); // defaultXmlRpcResponse = new XmlRpcResponse();
SetDefaultValues(); SetDefaultValues();
} }

View File

@ -58,7 +58,7 @@ namespace OpenSim.Framework.Communications
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string realuri; // private string realuri;
#region member variables #region member variables
@ -229,7 +229,7 @@ namespace OpenSim.Framework.Communications
sb.Append(kv.Value); sb.Append(kv.Value);
} }
} }
realuri = sb.ToString(); // realuri = sb.ToString();
//m_log.InfoFormat("[REST CLIENT]: RestURL: {0}", realuri); //m_log.InfoFormat("[REST CLIENT]: RestURL: {0}", realuri);
return new Uri(sb.ToString()); return new Uri(sb.ToString());
} }
@ -250,8 +250,9 @@ namespace OpenSim.Framework.Communications
if (read > 0) if (read > 0)
{ {
_resource.Write(_readbuf, 0, read); _resource.Write(_readbuf, 0, read);
IAsyncResult asynchronousResult = // IAsyncResult asynchronousResult =
s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s); // s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s);
s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s);
// TODO! Implement timeout, without killing the server // TODO! Implement timeout, without killing the server
//ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); //ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);

View File

@ -38,8 +38,8 @@ namespace OpenSim.Framework.Communications.XMPP
{ {
public class XmppSerializer public class XmppSerializer
{ {
private static readonly ILog _log = // private static readonly ILog _log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// need to do it this way, as XmlSerializer(type, extratypes) // need to do it this way, as XmlSerializer(type, extratypes)
// does not work on mono (at least). // does not work on mono (at least).

View File

@ -664,7 +664,7 @@ namespace OpenSim.Framework
string LastName { get; } string LastName { get; }
[Obsolete("LLClientView Specific - Replace with ???")] // [Obsolete("LLClientView Specific - Replace with ???")]
int NextAnimationSequenceNumber { get; } int NextAnimationSequenceNumber { get; }
/// <summary> /// <summary>
@ -680,22 +680,22 @@ namespace OpenSim.Framework
set; set;
} }
[Obsolete("LLClientView Specific - Circuits are unique to LLClientView")] // [Obsolete("LLClientView Specific - Circuits are unique to LLClientView")]
uint CircuitCode { get; } uint CircuitCode { get; }
[Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")] // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")]
event ImprovedInstantMessage OnInstantMessage; event ImprovedInstantMessage OnInstantMessage;
[Obsolete("LLClientView Specific - Replace with more bare-bones arguments. Rename OnChat.")] // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments. Rename OnChat.")]
event ChatFromViewer OnChatFromViewer; event ChatFromViewer OnChatFromViewer;
[Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")] // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")]
event TextureRequest OnRequestTexture; event TextureRequest OnRequestTexture;
[Obsolete("LLClientView Specific - Remove bitbuckets. Adam, can you be more specific here.. as I don't see any bit buckets.")] // [Obsolete("LLClientView Specific - Remove bitbuckets. Adam, can you be more specific here.. as I don't see any bit buckets.")]
event RezObject OnRezObject; event RezObject OnRezObject;
[Obsolete("LLClientView Specific - Replace with more suitable arguments.")] // [Obsolete("LLClientView Specific - Replace with more suitable arguments.")]
event ModifyTerrain OnModifyTerrain; event ModifyTerrain OnModifyTerrain;
event BakeTerrain OnBakeTerrain; event BakeTerrain OnBakeTerrain;
[Obsolete("LLClientView Specific.")] // [Obsolete("LLClientView Specific.")]
event SetAppearance OnSetAppearance; event SetAppearance OnSetAppearance;
[Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")] // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")]
event AvatarNowWearing OnAvatarNowWearing; event AvatarNowWearing OnAvatarNowWearing;
event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
event UUIDNameRequest OnDetachAttachmentIntoInv; event UUIDNameRequest OnDetachAttachmentIntoInv;
@ -841,7 +841,7 @@ namespace OpenSim.Framework
event ScriptReset OnScriptReset; event ScriptReset OnScriptReset;
event UpdateVector OnAutoPilotGo; event UpdateVector OnAutoPilotGo;
[Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")] // [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
void OutPacket(Packet newPack, ThrottleOutPacketType packType); void OutPacket(Packet newPack, ThrottleOutPacketType packType);
void SendWearables(AvatarWearable[] wearables, int serial); void SendWearables(AvatarWearable[] wearables, int serial);
void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry);

View File

@ -341,7 +341,7 @@ namespace OpenSim.Framework
byte[] returnbytes = new byte[TotalBytesLength]; byte[] returnbytes = new byte[TotalBytesLength];
uint paramlength = ExtraParamsNum; // uint paramlength = ExtraParamsNum;
// Stick in the number of parameters // Stick in the number of parameters
returnbytes[i++] = (byte)ExtraParamsNum; returnbytes[i++] = (byte)ExtraParamsNum;
@ -462,7 +462,7 @@ namespace OpenSim.Framework
ushort epType = Helpers.BytesToUInt16(data, i); ushort epType = Helpers.BytesToUInt16(data, i);
i += 2; i += 2;
uint paramLength = Helpers.BytesToUIntBig(data, i); // uint paramLength = Helpers.BytesToUIntBig(data, i);
i += 4; i += 4;
switch (epType) switch (epType)

View File

@ -76,7 +76,8 @@ namespace OpenSim.Framework.Servers
Stream requestStream = request.GetRequestStream(); Stream requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length); requestStream.Write(buffer.ToArray(), 0, length);
IAsyncResult result = request.BeginGetResponse(AsyncCallback, request); // IAsyncResult result = request.BeginGetResponse(AsyncCallback, request);
request.BeginGetResponse(AsyncCallback, request);
} }
private void AsyncCallback(IAsyncResult result) private void AsyncCallback(IAsyncResult result)

View File

@ -86,7 +86,7 @@ namespace OpenSim.Framework.Statistics
/// Report back collected statistical information. /// Report back collected statistical information.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public string Report() override public string Report()
{ {
double elapsedHours = (DateTime.Now - startTime).TotalHours; double elapsedHours = (DateTime.Now - startTime).TotalHours;
if (elapsedHours <= 0) { elapsedHours = 1; } // prevent divide by zero if (elapsedHours <= 0) { elapsedHours = 1; } // prevent divide by zero

View File

@ -81,7 +81,7 @@ namespace OpenSim.Framework.Statistics
/// Report back collected statistical information. /// Report back collected statistical information.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public string Report() override public string Report()
{ {
return string.Format( return string.Format(
@"Successful logins total : {0}, today : {1}, yesterday : {2} @"Successful logins total : {0}, today : {1}, yesterday : {2}

View File

@ -44,7 +44,7 @@ namespace OpenSim.Framework
public class TaskInventoryDictionary : Dictionary<LLUUID, TaskInventoryItem>, public class TaskInventoryDictionary : Dictionary<LLUUID, TaskInventoryItem>,
ICloneable, IXmlSerializable ICloneable, IXmlSerializable
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem)); private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));

View File

@ -637,7 +637,7 @@ namespace OpenSim.Framework
} }
memory.Position = 0; memory.Position = 0;
MemoryStream outStream = new MemoryStream(); // MemoryStream outStream = new MemoryStream();
byte[] compressed = new byte[memory.Length]; byte[] compressed = new byte[memory.Length];
memory.Read(compressed, 0, compressed.Length); memory.Read(compressed, 0, compressed.Length);

View File

@ -45,7 +45,7 @@ namespace OpenSim.Region.Communications.Local
protected Dictionary<ulong, RegionCommsListener> m_regionListeners = protected Dictionary<ulong, RegionCommsListener> m_regionListeners =
new Dictionary<ulong, RegionCommsListener>(); new Dictionary<ulong, RegionCommsListener>();
private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); // private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>(); private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>();

View File

@ -209,7 +209,7 @@ namespace OpenSim.Region.Communications.Local
theUser.CurrentAgent.Region = reg.RegionID; theUser.CurrentAgent.Region = reg.RegionID;
theUser.CurrentAgent.Handle = reg.RegionHandle; theUser.CurrentAgent.Handle = reg.RegionHandle;
LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList(); // LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList();
response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.ID)); response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.ID));

View File

@ -34,7 +34,7 @@ namespace OpenSim.Region.Communications.Local
{ {
public class LocalUserServices : UserManagerBase public class LocalUserServices : UserManagerBase
{ {
private readonly NetworkServersInfo m_serversInfo; // private readonly NetworkServersInfo m_serversInfo;
private readonly uint m_defaultHomeX; private readonly uint m_defaultHomeX;
private readonly uint m_defaultHomeY; private readonly uint m_defaultHomeY;
private IInventoryServices m_inventoryService; private IInventoryServices m_inventoryService;
@ -50,7 +50,7 @@ namespace OpenSim.Region.Communications.Local
public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY,
IInventoryServices inventoryService) IInventoryServices inventoryService)
{ {
m_serversInfo = serversInfo; // m_serversInfo = serversInfo;
m_defaultHomeX = defaultHomeLocX; m_defaultHomeX = defaultHomeLocX;
m_defaultHomeY = defaultHomeLocY; m_defaultHomeY = defaultHomeLocY;