diff --git a/OpenSim/Addons/Groups/GroupsExtendedData.cs b/OpenSim/Addons/Groups/GroupsExtendedData.cs index c783b9eeda..d92c4421c7 100644 --- a/OpenSim/Addons/Groups/GroupsExtendedData.cs +++ b/OpenSim/Addons/Groups/GroupsExtendedData.cs @@ -46,7 +46,7 @@ namespace OpenSim.Groups public string AccessToken; } - public class ExtendedGroupMembersData + public class ExtendedGroupMembersData { // This is the only difference: this is a string public string AgentID; @@ -65,7 +65,7 @@ namespace OpenSim.Groups public UUID RoleID; // This is the only difference: this is a string public string MemberID; - + } public struct ExtendedGroupNoticeData diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index 2ec9652b8a..f4d3490ddc 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs @@ -131,7 +131,7 @@ namespace OpenSim.Groups { if (!m_groupMessagingEnabled) return; - + scene.RegisterModuleInterface(this); m_sceneList.Add(scene); @@ -163,7 +163,7 @@ namespace OpenSim.Groups if (m_groupData == null) { m_log.Error("[Groups.Messaging]: Could not get IGroupsServicesConnector, GroupsMessagingModule is now disabled."); - RemoveRegion(scene); + RemoveRegion(scene); return; } @@ -218,7 +218,7 @@ namespace OpenSim.Groups m_msgTransferModule = null; } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -262,7 +262,7 @@ namespace OpenSim.Groups { if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); - + GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID.ToString(), groupID, null); if (groupInfo != null) @@ -279,7 +279,7 @@ namespace OpenSim.Groups { SendMessageToGroup(im, groupID, UUID.Zero, null); } - + public void SendMessageToGroup( GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func sendCondition) { @@ -355,9 +355,9 @@ namespace OpenSim.Groups { if (!sendCondition(member)) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[Groups.Messaging]: Not sending to {0} as they do not fulfill send condition", + "[Groups.Messaging]: Not sending to {0} as they do not fulfill send condition", member.AgentID); continue; @@ -366,7 +366,7 @@ namespace OpenSim.Groups else if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID)) { // Don't deliver messages to people who have dropped this session - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID); continue; @@ -414,7 +414,7 @@ namespace OpenSim.Groups "[Groups.Messaging]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms", groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick); } - + #region SimGridEventHandlers void OnClientLogin(IClientAPI client) @@ -445,13 +445,13 @@ namespace OpenSim.Groups // The instant message module will only deliver messages of dialog types: // MessageFromAgent, StartTyping, StopTyping, MessageFromObject // - // Any other message type will not be delivered to a client by the + // Any other message type will not be delivered to a client by the // Instant Message Module UUID regionID = new UUID(msg.RegionID); if (m_debugEnabled) { - m_log.DebugFormat("[Groups.Messaging]: {0} called, IM from region {1}", + m_log.DebugFormat("[Groups.Messaging]: {0} called, IM from region {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, regionID); DebugGridInstantMessage(msg); @@ -508,7 +508,7 @@ namespace OpenSim.Groups m_log.DebugFormat("[Groups.Messaging]: skipping agent {0} because he has an agent in region of origin", sp.UUID); return; } - else + else { if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: not skipping agent {0}", sp.UUID); @@ -531,7 +531,7 @@ namespace OpenSim.Groups } } }); - + } } } @@ -555,7 +555,7 @@ namespace OpenSim.Groups break; case (byte)InstantMessageDialog.SessionSend: - // User hasn't dropped, so they're in the session, + // User hasn't dropped, so they're in the session, // maybe we should deliver it. IClientAPI client = GetActiveClient(new UUID(msg.toAgentID)); if (client != null) @@ -655,7 +655,7 @@ namespace OpenSim.Groups UUID AgentID = new UUID(im.fromAgentID); GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero.ToString(), GroupID, null); - + if (groupInfo != null) { AgentInvitedToGroupChatSession(AgentID.ToString(), GroupID); @@ -681,7 +681,7 @@ namespace OpenSim.Groups UUID GroupID = new UUID(im.imSessionID); UUID AgentID = new UUID(im.fromAgentID); - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString()); //If this agent is sending a message, then they want to be in the session diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 57fbbf7893..1e9f2b5297 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Groups private List m_sceneList = new List(); private IMessageTransferModule m_msgTransferModule = null; - + private IGroupsServicesConnector m_groupData = null; private IUserManagement m_UserManagement; @@ -210,7 +210,7 @@ namespace OpenSim.Groups if (m_debugEnabled) m_log.Debug("[Groups]: Shutting down Groups module."); } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -318,7 +318,7 @@ namespace OpenSim.Groups SendAgentGroupDataUpdate(remoteClient, false); - // also current viewers do ignore it and ask later on a much nicer thread + // also current viewers do ignore it and ask later on a much nicer thread // its a info request not a change, so nothing is sent to others // they do get the group title with the avatar object update on arrivel to a region } @@ -453,9 +453,9 @@ namespace OpenSim.Groups } if (m_groupData.AddGroupNotice(GetRequestingAgentIDStr(remoteClient), GroupID, NoticeID, im.fromAgentName, Subject, Message, - hasAttachment, + hasAttachment, (byte)(item == null ? 0 : item.AssetType), - item == null ? null : item.Name, + item == null ? null : item.Name, item == null ? UUID.Zero : item.ID, item == null ? UUID.Zero.ToString() : item.Owner.ToString())) { @@ -463,7 +463,7 @@ namespace OpenSim.Groups { OnNewGroupNotice(GroupID, NoticeID); } - + // Send notice out to everyone that wants notices foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), GroupID)) { @@ -497,7 +497,7 @@ namespace OpenSim.Groups m_log.DebugFormat("[Groups]: Giving inventory from {0} to {1}", giver, remoteClient.AgentId); string message; - InventoryItemBase itemCopy = ((Scene)(remoteClient.Scene)).GiveInventoryItem(remoteClient.AgentId, + InventoryItemBase itemCopy = ((Scene)(remoteClient.Scene)).GiveInventoryItem(remoteClient.AgentId, giver, notice.noticeData.AttachmentItemID, out message); if (itemCopy == null) @@ -509,10 +509,10 @@ namespace OpenSim.Groups remoteClient.SendInventoryItemCreateUpdate(itemCopy, 0); } } - + // Interop, received special 210 code for ejecting a group member // this only works within the comms servers domain, and won't work hypergrid - // TODO:FIXME: Use a presense server of some kind to find out where the + // TODO:FIXME: Use a presense server of some kind to find out where the // client actually is, and try contacting that region directly to notify them, // or provide the notification via xmlrpc update queue if ((im.dialog == 210)) @@ -523,7 +523,7 @@ namespace OpenSim.Groups UUID ejecteeID = new UUID(im.toAgentID); - im.imSessionID = UUID.Zero.Guid; + im.imSessionID = UUID.Zero.Guid; im.dialog = (byte)InstantMessageDialog.MessageFromAgent; OutgoingInstantMessage(im, ejecteeID); @@ -577,7 +577,7 @@ namespace OpenSim.Groups { return m_groupData.GetGroupRecord(UUID.Zero.ToString(), UUID.Zero, name); } - + public void ActivateGroup(IClientAPI remoteClient, UUID groupID) { if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -585,7 +585,7 @@ namespace OpenSim.Groups m_groupData.SetAgentActiveGroup(GetRequestingAgentIDStr(remoteClient), GetRequestingAgentIDStr(remoteClient), groupID); // Changing active group changes title, active powers, all kinds of things - // anyone who is in any region that can see this client, should probably be + // anyone who is in any region that can see this client, should probably be // updated with new group info. At a minimum, they should get ScenePresence // updated with new title. SendAgentGroupDataUpdate(remoteClient, true); @@ -620,10 +620,10 @@ namespace OpenSim.Groups public List GroupMembersRequest(IClientAPI remoteClient, UUID groupID) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( "[Groups]: GroupMembersRequest called for {0} from client {1}", groupID, remoteClient.Name); - + List data = m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), groupID); if (m_debugEnabled) @@ -706,7 +706,7 @@ namespace OpenSim.Groups public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( "[Groups]: {0} called with groupID={1}, agentID={2}", System.Reflection.MethodBase.GetCurrentMethod().Name, groupID, agentID); @@ -776,7 +776,7 @@ namespace OpenSim.Groups } string reason = string.Empty; - UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment, + UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, remoteClient.AgentId, out reason); if (groupID != UUID.Zero) @@ -823,7 +823,7 @@ namespace OpenSim.Groups if (membership != null) { return membership.GroupTitle; - } + } return string.Empty; } @@ -839,7 +839,7 @@ namespace OpenSim.Groups // TODO: Not sure what all is needed here, but if the active group role change is for the group // the client currently has set active, then we need to do a scene presence update too // if (m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient)).GroupID == GroupID) - + SendDataUpdate(remoteClient, true); } @@ -899,7 +899,7 @@ namespace OpenSim.Groups case 1: // Remove m_groupData.RemoveAgentFromGroupRole(GetRequestingAgentIDStr(remoteClient), memberID.ToString(), groupID, roleID); - + break; default: m_log.ErrorFormat("[Groups]: {0} does not understand changes == {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, changes); @@ -1072,7 +1072,7 @@ namespace OpenSim.Groups // Send Message to Ejectee GridInstantMessage msg = new GridInstantMessage(); - + // if local send a normal message if(ejecteeClient != null) { @@ -1324,7 +1324,7 @@ namespace OpenSim.Groups membershipArray = membershipData.ToArray(); } } - + if (m_debugEnabled) { m_log.InfoFormat("[Groups]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId); diff --git a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs index 7d57de190b..98525812e4 100644 --- a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs +++ b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs @@ -103,7 +103,7 @@ namespace OpenSim.Groups if (!m_Enabled) return; - m_log.DebugFormat("[Groups]: Registering {0} with {1}", this.Name, scene.RegionInfo.RegionName); + m_log.DebugFormat("[Groups]: Registering {0} with {1}", this.Name, scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); m_Scenes.Add(scene); @@ -135,7 +135,7 @@ namespace OpenSim.Groups { m_LocalGroupsConnector = new GroupsServiceLocalConnectorModule(m_Config, m_UserManagement); // Also, if local, create the endpoint for the HGGroupsService - new HGGroupsServiceRobustConnector(m_Config, MainServer.Instance, string.Empty, + new HGGroupsServiceRobustConnector(m_Config, MainServer.Instance, string.Empty, scene.RequestModuleInterface(), scene.RequestModuleInterface()); } @@ -170,7 +170,7 @@ namespace OpenSim.Groups if (sp is ScenePresence && ((ScenePresence)sp).PresenceType != PresenceType.Npc) { AgentCircuitData aCircuit = ((ScenePresence)sp).Scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId); - if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 && + if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 && m_OfflineIM != null && m_Messaging != null) { List ims = m_OfflineIM.GetMessages(aCircuit.AgentID); @@ -184,12 +184,12 @@ namespace OpenSim.Groups #region IGroupsServicesConnector - public UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, + public UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID, out string reason) { reason = string.Empty; if (m_UserManagement.IsLocalGridUser(RequestingAgentID)) - return m_LocalGroupsConnector.CreateGroup(RequestingAgentID, name, charter, showInList, insigniaID, + return m_LocalGroupsConnector.CreateGroup(RequestingAgentID, name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, founderID, out reason); else { @@ -198,14 +198,14 @@ namespace OpenSim.Groups } } - public bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, + public bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, out string reason) { reason = string.Empty; string url = string.Empty; string name = string.Empty; if (IsLocal(groupID, out url, out name)) - return m_LocalGroupsConnector.UpdateGroup(AgentUUI(RequestingAgentID), groupID, charter, showInList, insigniaID, membershipFee, + return m_LocalGroupsConnector.UpdateGroup(AgentUUI(RequestingAgentID), groupID, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, out reason); else { @@ -374,7 +374,7 @@ namespace OpenSim.Groups } } - + return new List(); } @@ -626,7 +626,7 @@ namespace OpenSim.Groups } if (agent != null) return Util.ProduceUserUniversalIdentifier(agent); - + // we don't know anything about this foreign user // try asking the user management module, which may know more return m_UserManagement.GetUserUUI(AgentID); @@ -664,7 +664,7 @@ namespace OpenSim.Groups string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty; if (Util.ParseUniversalUserIdentifier(uID, out userID, out url, out first, out last, out tmp)) m_UserManagement.AddUser(userID, first, last, url); - + return userID; } diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs index f60c1a5f68..af007709be 100644 --- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs @@ -64,8 +64,8 @@ namespace OpenSim.Groups m_log.DebugFormat("[Groups.RobustHGConnector]: Starting with config name {0}", m_ConfigName); - string homeURI = Util.GetConfigVarFromSections(config, "HomeURI", - new string[] { "Startup", "Hypergrid", m_ConfigName}, string.Empty); + string homeURI = Util.GetConfigVarFromSections(config, "HomeURI", + new string[] { "Startup", "Hypergrid", m_ConfigName}, string.Empty); if (homeURI == string.Empty) throw new Exception(String.Format("[Groups.RobustHGConnector]: please provide the HomeURI [Startup] or in section {0}", m_ConfigName)); diff --git a/OpenSim/Addons/Groups/IGroupsServicesConnector.cs b/OpenSim/Addons/Groups/IGroupsServicesConnector.cs index a09b59e238..8a6e88dfbf 100644 --- a/OpenSim/Addons/Groups/IGroupsServicesConnector.cs +++ b/OpenSim/Addons/Groups/IGroupsServicesConnector.cs @@ -34,9 +34,9 @@ namespace OpenSim.Groups { public interface IGroupsServicesConnector { - UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, + UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID, out string reason); - bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, + bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, out string reason); ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName); List FindGroups(string RequestingAgentID, string search); @@ -75,7 +75,7 @@ namespace OpenSim.Groups /// If the user is a member of the group then the data structure is returned. If not, then null is returned. /// ExtendedGroupMembershipData GetAgentGroupMembership(string RequestingAgentID, string AgentID, UUID GroupID); - + /// /// Get information about the groups to which a user belongs. /// @@ -87,7 +87,7 @@ namespace OpenSim.Groups /// List GetAgentGroupMemberships(string RequestingAgentID, string AgentID); - bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, + bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID); GroupNoticeInfo GetGroupNotice(string RequestingAgentID, UUID noticeID); List GetGroupNotices(string RequestingAgentID, UUID GroupID); diff --git a/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs b/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs index 8e30df5755..c7877c6b9f 100644 --- a/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs +++ b/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs @@ -108,7 +108,7 @@ namespace OpenSim.Groups if (!m_Enabled) return; - m_log.DebugFormat("[Groups]: Registering {0} with {1}", this.Name, scene.RegionInfo.RegionName); + m_log.DebugFormat("[Groups]: Registering {0} with {1}", this.Name, scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); m_Scenes.Add(scene); } @@ -146,16 +146,16 @@ namespace OpenSim.Groups #region IGroupsServicesConnector - public UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, + public UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID, out string reason) { m_log.DebugFormat("[Groups]: Creating group {0}", name); reason = string.Empty; - return m_GroupsService.CreateGroup(RequestingAgentID.ToString(), name, charter, showInList, insigniaID, + return m_GroupsService.CreateGroup(RequestingAgentID.ToString(), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, founderID, out reason); } - public bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, + public bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, out string reason) { reason = string.Empty; @@ -296,7 +296,7 @@ namespace OpenSim.Groups public bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID) { - return m_GroupsService.AddGroupNotice(RequestingAgentID, groupID, noticeID, fromName, subject, message, + return m_GroupsService.AddGroupNotice(RequestingAgentID, groupID, noticeID, fromName, subject, message, hasAttachment, attType, attName, attItemID, attOwnerID); } diff --git a/OpenSim/Addons/Groups/Properties/AssemblyInfo.cs b/OpenSim/Addons/Groups/Properties/AssemblyInfo.cs index 98630eb9a8..e9be9c450d 100644 --- a/OpenSim/Addons/Groups/Properties/AssemblyInfo.cs +++ b/OpenSim/Addons/Groups/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Mono.Addins; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Addons.Groups")] @@ -15,8 +15,8 @@ using Mono.Addins; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -26,7 +26,7 @@ using Mono.Addins; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs index 7450c1442e..8f6be0d0b5 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs @@ -41,7 +41,7 @@ using Nini.Config; namespace OpenSim.Groups { - public class GroupsServiceRemoteConnector + public class GroupsServiceRemoteConnector { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -71,7 +71,7 @@ namespace OpenSim.Groups } /// - m_log.DebugFormat("[Groups.RemoteConnector]: Groups server at {0}, authentication {1}", + m_log.DebugFormat("[Groups.RemoteConnector]: Groups server at {0}, authentication {1}", m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString())); } diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs index d4739c6ac1..b6c75a8c7b 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs @@ -113,7 +113,7 @@ namespace OpenSim.Groups if (!m_Enabled) return; - m_log.DebugFormat("[Groups.RemoteConnector]: Registering {0} with {1}", this.Name, scene.RegionInfo.RegionName); + m_log.DebugFormat("[Groups.RemoteConnector]: Registering {0} with {1}", this.Name, scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); m_Scenes.Add(scene); } @@ -151,7 +151,7 @@ namespace OpenSim.Groups #region IGroupsServicesConnector - public UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, + public UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID, out string reason) { m_log.DebugFormat("[Groups.RemoteConnector]: Creating group {0}", name); @@ -167,7 +167,7 @@ namespace OpenSim.Groups return groupID; } - public bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, + public bool UpdateGroup(string RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, out string reason) { string r = string.Empty; @@ -186,9 +186,9 @@ namespace OpenSim.Groups if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty)) return null; - return m_CacheWrapper.GetGroupRecord(RequestingAgentID,GroupID,GroupName, delegate - { - return m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName); + return m_CacheWrapper.GetGroupRecord(RequestingAgentID,GroupID,GroupName, delegate + { + return m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName); }); } @@ -362,7 +362,7 @@ namespace OpenSim.Groups m_GroupsService.RemoveAgentToGroupInvite(RequestingAgentID, inviteID); } - public bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, + public bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID) { GroupNoticeInfo notice = new GroupNoticeInfo(); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index d79e4fa0f0..598e7a5a9d 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs @@ -393,7 +393,7 @@ namespace OpenSim.Groups if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("GroupID") || !request.ContainsKey("RoleID") || !request.ContainsKey("Name") || !request.ContainsKey("Description") || !request.ContainsKey("Title") || - !request.ContainsKey("Powers") || !request.ContainsKey("OP")) + !request.ContainsKey("Powers") || !request.ContainsKey("OP")) NullResult(result, "Bad network data"); else @@ -519,11 +519,11 @@ namespace OpenSim.Groups bool success = false; if (op == "ADD") - success = m_GroupsService.AddAgentToGroupRole(request["RequestingAgentID"].ToString(), request["AgentID"].ToString(), + success = m_GroupsService.AddAgentToGroupRole(request["RequestingAgentID"].ToString(), request["AgentID"].ToString(), new UUID(request["GroupID"].ToString()), new UUID(request["RoleID"].ToString())); else if (op == "DELETE") - success = m_GroupsService.RemoveAgentFromGroupRole(request["RequestingAgentID"].ToString(), request["AgentID"].ToString(), + success = m_GroupsService.RemoveAgentFromGroupRole(request["RequestingAgentID"].ToString(), request["AgentID"].ToString(), new UUID(request["GroupID"].ToString()), new UUID(request["RoleID"].ToString())); result["RESULT"] = success.ToString(); @@ -647,8 +647,8 @@ namespace OpenSim.Groups string op = request["OP"].ToString(); if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID")) - { - bool success = m_GroupsService.AddAgentToGroupInvite(request["RequestingAgentID"].ToString(), + { + bool success = m_GroupsService.AddAgentToGroupInvite(request["RequestingAgentID"].ToString(), new UUID(request["InviteID"].ToString()), new UUID(request["GroupID"].ToString()), new UUID(request["RoleID"].ToString()), request["AgentID"].ToString()); @@ -664,7 +664,7 @@ namespace OpenSim.Groups } else if (op == "GET") { - GroupInviteInfo invite = m_GroupsService.GetAgentToGroupInvite(request["RequestingAgentID"].ToString(), + GroupInviteInfo invite = m_GroupsService.GetAgentToGroupInvite(request["RequestingAgentID"].ToString(), new UUID(request["InviteID"].ToString())); if (invite != null) diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs index 710b00a43e..ea0fedd9de 100644 --- a/OpenSim/Addons/Groups/Service/GroupsService.cs +++ b/OpenSim/Addons/Groups/Service/GroupsService.cs @@ -126,7 +126,7 @@ namespace OpenSim.Groups #endregion - public UUID CreateGroup(string RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, + public UUID CreateGroup(string RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID, out string reason) { reason = string.Empty; @@ -264,7 +264,7 @@ namespace OpenSim.Groups if (ownerRole != null) ownerRoleID = ownerRole.RoleID; - // Check visibility? + // Check visibility? // When we don't want to check visibility, we pass it "all" as the requestingAgentID bool checkVisibility = !RequestingAgentID.Equals(UUID.Zero.ToString()); @@ -307,20 +307,20 @@ namespace OpenSim.Groups m.Contribution = Int32.Parse(d.Data["Contribution"]); m.ListInProfile = d.Data["ListInProfile"] == "1" ? true : false; - GridUserData gud = m_GridUserService.Get(d.PrincipalID); - if (gud != null) - { - if (bool.Parse(gud.Data["Online"])) - { - m.OnlineStatus = @"Online"; - } - else - { - int unixtime = int.Parse(gud.Data["Login"]); - // The viewer is very picky about how these strings are formed. Eg. it will crash on malformed dates! - m.OnlineStatus = (unixtime == 0) ? @"unknown" : Util.ToDateTime(unixtime).ToString("MM/dd/yyyy"); - } - } + GridUserData gud = m_GridUserService.Get(d.PrincipalID); + if (gud != null) + { + if (bool.Parse(gud.Data["Online"])) + { + m.OnlineStatus = @"Online"; + } + else + { + int unixtime = int.Parse(gud.Data["Login"]); + // The viewer is very picky about how these strings are formed. Eg. it will crash on malformed dates! + m.OnlineStatus = (unixtime == 0) ? @"unknown" : Util.ToDateTime(unixtime).ToString("MM/dd/yyyy"); + } + } // Is this person an owner of the group? m.IsOwner = (rolemembershipsList.Find(r => r.RoleID == ownerRoleID) != null) ? true : false; @@ -553,8 +553,8 @@ namespace OpenSim.Groups { newRoleID = r.RoleID; break; - } - } + } + } MembershipData member = m_Database.RetrieveMember(GroupID, AgentID); if (member != null) @@ -712,7 +712,7 @@ namespace OpenSim.Groups m_Database.StoreMember(membership); } - public bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, + public bool AddGroupNotice(string RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID) { // Check perms diff --git a/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs b/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs index 8e237aa44b..98d01729c1 100644 --- a/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs +++ b/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs @@ -35,67 +35,67 @@ using OpenSim.Services.Base; namespace OpenSim.Groups { - public class GroupsServiceBase : ServiceBase - { - protected IGroupsData m_Database = null; - protected IGridUserData m_GridUserService = null; + public class GroupsServiceBase : ServiceBase + { + protected IGroupsData m_Database = null; + protected IGridUserData m_GridUserService = null; - public GroupsServiceBase(IConfigSource config, string cName) - : base(config) - { - string dllName = String.Empty; - string connString = String.Empty; - string realm = "os_groups"; - string usersRealm = "GridUser"; - string configName = (cName == string.Empty) ? "Groups" : cName; + public GroupsServiceBase(IConfigSource config, string cName) + : base(config) + { + string dllName = String.Empty; + string connString = String.Empty; + string realm = "os_groups"; + string usersRealm = "GridUser"; + string configName = (cName == string.Empty) ? "Groups" : cName; - // - // Try reading the [DatabaseService] section, if it exists - // - IConfig dbConfig = config.Configs["DatabaseService"]; - if (dbConfig != null) - { - if (dllName == String.Empty) - dllName = dbConfig.GetString("StorageProvider", String.Empty); - if (connString == String.Empty) - connString = dbConfig.GetString("ConnectionString", String.Empty); - } + // + // Try reading the [DatabaseService] section, if it exists + // + IConfig dbConfig = config.Configs["DatabaseService"]; + if (dbConfig != null) + { + if (dllName == String.Empty) + dllName = dbConfig.GetString("StorageProvider", String.Empty); + if (connString == String.Empty) + connString = dbConfig.GetString("ConnectionString", String.Empty); + } - // - // [Groups] section overrides [DatabaseService], if it exists - // - IConfig groupsConfig = config.Configs[configName]; - if (groupsConfig != null) - { - dllName = groupsConfig.GetString("StorageProvider", dllName); - connString = groupsConfig.GetString("ConnectionString", connString); - realm = groupsConfig.GetString("Realm", realm); - } + // + // [Groups] section overrides [DatabaseService], if it exists + // + IConfig groupsConfig = config.Configs[configName]; + if (groupsConfig != null) + { + dllName = groupsConfig.GetString("StorageProvider", dllName); + connString = groupsConfig.GetString("ConnectionString", connString); + realm = groupsConfig.GetString("Realm", realm); + } - // - // We tried, but this doesn't exist. We can't proceed. - // - if (dllName.Equals(String.Empty)) - throw new Exception("No StorageProvider configured"); + // + // We tried, but this doesn't exist. We can't proceed. + // + if (dllName.Equals(String.Empty)) + throw new Exception("No StorageProvider configured"); - m_Database = LoadPlugin(dllName, new Object[] { connString, realm }); - if (m_Database == null) - throw new Exception("Could not find a storage interface in the given module " + dllName); + m_Database = LoadPlugin(dllName, new Object[] { connString, realm }); + if (m_Database == null) + throw new Exception("Could not find a storage interface in the given module " + dllName); - // - // [GridUserService] section overrides [DatabaseService], if it exists - // - IConfig usersConfig = config.Configs["GridUserService"]; - if (usersConfig != null) - { - dllName = usersConfig.GetString("StorageProvider", dllName); - connString = usersConfig.GetString("ConnectionString", connString); + // + // [GridUserService] section overrides [DatabaseService], if it exists + // + IConfig usersConfig = config.Configs["GridUserService"]; + if (usersConfig != null) + { + dllName = usersConfig.GetString("StorageProvider", dllName); + connString = usersConfig.GetString("ConnectionString", connString); usersRealm = usersConfig.GetString("Realm", usersRealm); - } + } - m_GridUserService = LoadPlugin(dllName, new Object[] { connString, usersRealm }); - if (m_GridUserService == null) - throw new Exception("Could not find a storage inferface for the given users module " + dllName); - } - } + m_GridUserService = LoadPlugin(dllName, new Object[] { connString, usersRealm }); + if (m_GridUserService == null) + throw new Exception("Could not find a storage inferface for the given users module " + dllName); + } + } } diff --git a/OpenSim/Addons/Groups/Service/HGGroupsService.cs b/OpenSim/Addons/Groups/Service/HGGroupsService.cs index 56e999bde4..7d86f85186 100644 --- a/OpenSim/Addons/Groups/Service/HGGroupsService.cs +++ b/OpenSim/Addons/Groups/Service/HGGroupsService.cs @@ -76,7 +76,7 @@ namespace OpenSim.Groups // Check if it already exists GroupData grec = m_Database.RetrieveGroup(groupID); - if (grec == null || + if (grec == null || (grec != null && grec.Data["Location"] != string.Empty && grec.Data["Location"].ToLower() != serviceLocation.ToLower())) { // Create the group diff --git a/OpenSim/Addons/OfflineIM/Properties/AssemblyInfo.cs b/OpenSim/Addons/OfflineIM/Properties/AssemblyInfo.cs index a980f2215f..fe828bc7ef 100644 --- a/OpenSim/Addons/OfflineIM/Properties/AssemblyInfo.cs +++ b/OpenSim/Addons/OfflineIM/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Mono.Addins; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Addons.OfflineIM")] @@ -15,8 +15,8 @@ using Mono.Addins; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -26,7 +26,7 @@ using Mono.Addins; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs index 047b8becf3..46d497924e 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs @@ -77,7 +77,7 @@ namespace OpenSim.OfflineIM break; } /// - m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: Offline IM server at {0} with auth {1}", + m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: Offline IM server at {0} with auth {1}", m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString())); } @@ -140,7 +140,7 @@ namespace OpenSim.OfflineIM { Dictionary sendData = new Dictionary(); sendData["UserID"] = userID; - + MakeRequest("DELETE", sendData); } diff --git a/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs b/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs index 02084ffbfe..d1ecdce77b 100644 --- a/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs +++ b/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs @@ -90,7 +90,7 @@ namespace OpenSim.OfflineIM public bool StoreMessage(GridInstantMessage im, out string reason) { reason = string.Empty; - + // Check limits UUID principalID = new UUID(im.toAgentID); long count = m_Database.GetCount("PrincipalID", principalID.ToString()); diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 89224a64a8..feb73a992c 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -124,7 +124,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() + ")"); - + bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); m_openSim.CreateRegion(regionsToLoad[i], true, out scene); diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs index 1873a0658e..976714c11b 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs @@ -38,7 +38,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions public class RegionLoaderFileSystem : IRegionLoader { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private IConfigSource m_configSource; public void SetIniConfigSource(IConfigSource configSource) @@ -72,11 +72,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions // Create an empty Regions.ini if there are no existing config files. if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) - { + { new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); } - + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); List regionInfos = new List(); @@ -85,16 +85,16 @@ namespace OpenSim.ApplicationPlugins.LoadRegions foreach (string file in iniFiles) { m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); - + IConfigSource source = new IniConfigSource(file); foreach (IConfig config in source.Configs) - { + { RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); regionInfos.Add(regionInfo); - + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); - + i++; } } @@ -102,12 +102,12 @@ namespace OpenSim.ApplicationPlugins.LoadRegions foreach (string file in configFiles) { m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); - + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); regionInfos.Add(regionInfo); - + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); - + i++; } diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/Properties/AssemblyInfo.cs b/OpenSim/ApplicationPlugins/RegionModulesController/Properties/AssemblyInfo.cs index a8e1f95ed9..a45abad0c6 100644 --- a/OpenSim/ApplicationPlugins/RegionModulesController/Properties/AssemblyInfo.cs +++ b/OpenSim/ApplicationPlugins/RegionModulesController/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Mono.Addins; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.ApplicationPlugins.RegionModulesController")] @@ -15,8 +15,8 @@ using Mono.Addins; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -26,7 +26,7 @@ using Mono.Addins; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs index 8f38a2978b..2e25c60063 100644 --- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs +++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs @@ -75,7 +75,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController } #region IApplicationPlugin implementation - + public void Initialise (OpenSimBase openSim) { m_openSim = openSim; @@ -111,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController { m_log.InfoFormat( "[REGIONMODULES]: From plugin {0}, (version {1}), loaded {2} modules, {3} shared, {4} non-shared {5} unknown", - loadedModuleData.Key.Id, + loadedModuleData.Key.Id, loadedModuleData.Key.Version, loadedModuleData.Value[0] + loadedModuleData.Value[1] + loadedModuleData.Value[2], loadedModuleData.Value[0], loadedModuleData.Value[1], loadedModuleData.Value[2]); @@ -261,7 +261,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController } #region Region Module interfacesController implementation - + /// /// Check that the given module is no disabled in the [Modules] section of the config files. /// @@ -293,10 +293,10 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController if (className != String.Empty && node.Type.ToString() != className) return false; - } - + } + return true; - } + } // The root of all evil. // This is where we handle adding the modules to scenes when they diff --git a/OpenSim/ApplicationPlugins/RemoteController/Properties/AssemblyInfo.cs b/OpenSim/ApplicationPlugins/RemoteController/Properties/AssemblyInfo.cs index c841a694af..590a6a9ce1 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/Properties/AssemblyInfo.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Mono.Addins; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.ApplicationPlugins.RemoteController")] @@ -15,8 +15,8 @@ using Mono.Addins; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -26,7 +26,7 @@ using Mono.Addins; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 1a7c698eb1..a5c9fb4c48 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -575,7 +575,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController } responseData["success"] = true; - + m_log.Info("[RADMIN]: Shutdown Administrator Request complete"); } @@ -747,9 +747,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController { // No INI setting recorded. } - + string regionIniPath; - + if (requestData.Contains("region_file")) { // Make sure that the file to be created is in a subdirectory of the region storage directory. @@ -773,7 +773,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController region.RegionName.Replace(" ", "_").Replace(":", "_"). Replace("/", "_"))); } - + m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", region.RegionID, regionIniPath); region.SaveRegionToFile("dynamic region", regionIniPath); @@ -782,9 +782,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController { region.Persistent = false; } - + // Set the estate - + // Check for an existing estate List estateIDs = m_application.EstateDataService.GetEstates((string) requestData["estate_name"]); if (estateIDs.Count < 1) @@ -795,12 +795,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController // ok, client wants us to use an explicit UUID // regardless of what the avatar name provided userID = new UUID((string) requestData["estate_owner_uuid"]); - + // Check that the specified user exists Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene; IUserAccountService accountService = currentOrFirst.UserAccountService; UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, userID); - + if (user == null) throw new Exception("Specified user was not found."); } @@ -809,23 +809,23 @@ namespace OpenSim.ApplicationPlugins.RemoteController // We need to look up the UUID for the avatar with the provided name. string ownerFirst = (string) requestData["estate_owner_first"]; string ownerLast = (string) requestData["estate_owner_last"]; - + Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene; IUserAccountService accountService = currentOrFirst.UserAccountService; UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, ownerFirst, ownerLast); - + // Check that the specified user exists if (user == null) throw new Exception("Specified user was not found."); - + userID = user.PrincipalID; } else { throw new Exception("Estate owner details not provided."); } - + // Create a new estate with the name provided region.EstateSettings = m_application.EstateDataService.CreateNewEstate(); @@ -852,7 +852,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController throw new Exception("Failed to join estate."); } } - + // Create the region and perform any initial initialization IScene newScene; @@ -1159,7 +1159,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Set home position - GridRegion home = scene.GridService.GetRegionByPosition(scopeID, + GridRegion home = scene.GridService.GetRegionByPosition(scopeID, (int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation)); if (null == home) { @@ -1389,7 +1389,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController if ((null != regionXLocation) && (null != regionYLocation)) { - GridRegion home = scene.GridService.GetRegionByPosition(scopeID, + GridRegion home = scene.GridService.GetRegionByPosition(scopeID, (int)Util.RegionToWorldLoc((uint)regionXLocation), (int)Util.RegionToWorldLoc((uint)regionYLocation)); if (null == home) { m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName); @@ -1416,7 +1416,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController throw e; } - + m_log.Info("[RADMIN]: UpdateUserAccount: request complete"); } } @@ -1608,7 +1608,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController GetSceneFromRegionParams(requestData, responseData, out scene); string filename = (string) requestData["filename"]; - + bool mergeOar = false; bool skipAssets = false; @@ -1735,7 +1735,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; m_log.InfoFormat( - "[RADMIN]: Submitting save OAR request for {0} to file {1}, request ID {2}", + "[RADMIN]: Submitting save OAR request for {0} to file {1}, request ID {2}", scene.Name, filename, requestId); archiver.ArchiveRegion(filename, requestId, options); @@ -2082,8 +2082,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController Hashtable responseData = (Hashtable)response.Value; // Hashtable requestData = (Hashtable)request.Params[0]; - m_application.SceneManager.ForEachScene(s => - s.RegionInfo.EstateSettings = m_application.EstateDataService.LoadEstateSettings(s.RegionInfo.RegionID, false) + m_application.SceneManager.ForEachScene(s => + s.RegionInfo.EstateSettings = m_application.EstateDataService.LoadEstateSettings(s.RegionInfo.RegionID, false) ); responseData["success"] = true; @@ -2815,7 +2815,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (destinationFolder.Type != (short)FolderType.Clothing) { destinationFolder = new InventoryFolderBase(); - + destinationFolder.ID = UUID.Random(); destinationFolder.Name = "Clothing"; destinationFolder.Owner = destination; @@ -2951,11 +2951,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController { sourceFolder = new InventoryFolderBase(); sourceFolder.ID = UUID.Random(); - if (assetType == FolderType.Clothing) + if (assetType == FolderType.Clothing) { sourceFolder.Name = "Clothing"; - } - else + } + else { sourceFolder.Name = "Body Parts"; } @@ -3168,7 +3168,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Set home position - GridRegion home = scene.GridService.GetRegionByPosition(scopeID, + GridRegion home = scene.GridService.GetRegionByPosition(scopeID, (int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation)); if (null == home) { m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]); diff --git a/OpenSim/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs index 7ba65c9a76..7492602c46 100644 --- a/OpenSim/Capabilities/Caps.cs +++ b/OpenSim/Capabilities/Caps.cs @@ -64,7 +64,7 @@ namespace OpenSim.Framework.Capabilities private CapsHandlers m_capsHandlers; - private Dictionary m_pollServiceHandlers + private Dictionary m_pollServiceHandlers = new Dictionary(); private Dictionary m_externalCapsHandlers = new Dictionary(); @@ -160,7 +160,7 @@ namespace OpenSim.Framework.Capabilities public void RegisterPollHandler(string capName, PollServiceEventArgs pollServiceHandler) { // m_log.DebugFormat( -// "[CAPS]: Registering handler with name {0}, url {1} for {2}", +// "[CAPS]: Registering handler with name {0}, url {1} for {2}", // capName, pollServiceHandler.Url, m_agentID, m_regionName); m_pollServiceHandlers.Add(capName, pollServiceHandler); @@ -170,7 +170,7 @@ namespace OpenSim.Framework.Capabilities // uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; // string protocol = "http"; // string hostName = m_httpListenerHostName; -// +// // if (MainServer.Instance.UseSSL) // { // hostName = MainServer.Instance.SSLCommonName; @@ -238,7 +238,7 @@ namespace OpenSim.Framework.Capabilities string hostName = m_httpListenerHostName; uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; string protocol = "http"; - + if (MainServer.Instance.UseSSL) { hostName = MainServer.Instance.SSLCommonName; diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs index 6d3b9b54bf..f5a40dfcae 100644 --- a/OpenSim/Capabilities/CapsHandlers.cs +++ b/OpenSim/Capabilities/CapsHandlers.cs @@ -112,9 +112,9 @@ namespace OpenSim.Framework.Capabilities m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); m_capsHandlers.Remove(idx); } - + if (null == value) return; - + m_capsHandlers[idx] = value; m_httpListener.AddStreamHandler(value); } @@ -147,7 +147,7 @@ namespace OpenSim.Framework.Capabilities { Hashtable caps = new Hashtable(); string protocol = "http://"; - + if (m_useSSL) protocol = "https://"; diff --git a/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs b/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs index 426174d252..5163169dd9 100644 --- a/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs +++ b/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs @@ -74,7 +74,7 @@ namespace OpenSim.Capabilities.Handlers int page_size = (string.IsNullOrEmpty(psize) ? 500 : Int32.Parse(psize)); int page_number = (string.IsNullOrEmpty(pnumber) ? 1 : Int32.Parse(pnumber)); - + // Full content request httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK; //httpResponse.ContentLength = ??; diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs index e3d285a28a..0f3f48eca0 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs @@ -44,7 +44,7 @@ using Caps = OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Capabilities.Handlers { - public class FetchInvDescHandler + public class FetchInvDescHandler { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -54,13 +54,13 @@ namespace OpenSim.Capabilities.Handlers private IScene m_Scene; // private object m_fetchLock = new Object(); - public FetchInvDescHandler(IInventoryService invService, ILibraryService libService, IScene s) + public FetchInvDescHandler(IInventoryService invService, ILibraryService libService, IScene s) { m_InventoryService = invService; m_LibraryService = libService; m_Scene = s; } - + public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { //m_log.DebugFormat("[XXX]: FetchInventoryDescendentsRequest in {0}, {1}", (m_Scene == null) ? "none" : m_Scene.Name, request); @@ -72,14 +72,14 @@ namespace OpenSim.Capabilities.Handlers // correctly mark it as a uuid // request = request.Replace("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); - + // another hack 1 results in a // System.ArgumentException: Object type System.Int32 cannot // be converted to target type: System.Boolean // request = request.Replace("fetch_folders0", "fetch_folders0"); request = request.Replace("fetch_folders1", "fetch_folders1"); - + Hashtable hash = new Hashtable(); try { @@ -90,9 +90,9 @@ namespace OpenSim.Capabilities.Handlers m_log.ErrorFormat("[WEB FETCH INV DESC HANDLER]: Fetch error: {0}{1}" + e.Message, e.StackTrace); m_log.Error("Request: " + request); } - + ArrayList foldersrequested = (ArrayList)hash["folders"]; - + StringBuilder tmpresponse = new StringBuilder(1024); StringBuilder tmpbadfolders = new StringBuilder(1024); diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs index 8200a96caf..e239a90dbf 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs @@ -80,7 +80,7 @@ namespace OpenSim.Capabilities.Handlers { // OMG!!! One by one!!! This is fallback code, in case the backend isn't updated m_log.WarnFormat("[FETCH INVENTORY HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); - items = new InventoryItemBase[itemsRequested.Count]; + items = new InventoryItemBase[itemsRequested.Count]; foreach (UUID id in itemIDs) items[i++] = m_inventoryService.GetItem(m_agentID, id); } diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs index 8af3c6485d..94c2c89f45 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs @@ -120,7 +120,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests string request = "itemsitem_id"; request += "10000000-0000-0000-0000-000000000001"; // Notecard 1 request += ""; - + string llsdresponse = handler.FetchInventoryRequest(request, "/FETCH", string.Empty, req, resp); Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs index 94eef3bb7d..4143aa33af 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs @@ -140,7 +140,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests string request = "foldersfetch_folders1fetch_items1folder_id"; request += m_rootFolderID; request += "owner_id00000000-0000-0000-0000-000000000000sort_order1"; - + string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); @@ -203,7 +203,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests // Make sure that the note card link is included Assert.That(llsdresponse.Contains("Link to notecard"), Is.True, "Link to notecard is missing"); - + //Make sure the notecard item itself is included Assert.That(llsdresponse.Contains("Test Notecard 2"), Is.True, "Notecard 2 item (the source) is missing"); diff --git a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs index 3e01bbb756..41cfdb6bf1 100644 --- a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs @@ -87,12 +87,12 @@ namespace OpenSim.Capabilities.Handlers OSDMap osdname = new OSDMap(); if(parts[0] == "Unknown") { - osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1)); + osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1)); osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2)); } else { - osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8)); + osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8)); osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1)); } osdname["display_name"] = OSD.FromString(kvp.Value); diff --git a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesServerConnector.cs b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesServerConnector.cs index 8f70c97880..32da1c2b09 100644 --- a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesServerConnector.cs @@ -61,7 +61,7 @@ namespace OpenSim.Capabilities.Handlers if (m_UserManagement == null) throw new Exception(String.Format("Failed to load UserManagement from {0}; config is {1}", umService, m_ConfigName)); - + server.AddStreamHandler( new GetDisplayNamesHandler("/CAPS/agents/", m_UserManagement, "GetDisplayNames", null)); } diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 8215124625..062a842748 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs @@ -55,7 +55,7 @@ namespace OpenSim.Capabilities.Handlers private IAssetService m_assetService; public const string DefaultFormat = "x-j2c"; - + public GetTextureHandler(IAssetService assService) { m_assetService = assService; @@ -83,7 +83,7 @@ namespace OpenSim.Capabilities.Handlers if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID)) { // m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID); - + string[] formats; if (!string.IsNullOrEmpty(format)) { @@ -129,7 +129,7 @@ namespace OpenSim.Capabilities.Handlers } /// - /// + /// /// /// /// @@ -190,7 +190,7 @@ namespace OpenSim.Capabilities.Handlers //response = new Hashtable(); - + //WriteTextureData(request,response,null,format); // not found //m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found"); @@ -287,7 +287,7 @@ namespace OpenSim.Capabilities.Handlers response["content_type"] = texture.Metadata.ContentType; else response["content_type"] = "image/" + format; - + response["bin_response_data"] = texture.Data; response["int_bytes"] = texture.Data.Length; @@ -400,7 +400,7 @@ namespace OpenSim.Capabilities.Handlers if (image != null) image.Dispose(); - + if(managedImage != null) managedImage.Clear(); if (imgstream != null) diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs index 5f86ed4dbf..d5df7a29bd 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + using System; using System.Collections; using System.Collections.Specialized; @@ -44,7 +44,7 @@ using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Services.Interfaces; using Caps = OpenSim.Framework.Capabilities.Caps; - + namespace OpenSim.Capabilities.Handlers { public class GetTextureRobustHandler : BaseStreamHandler @@ -52,9 +52,9 @@ namespace OpenSim.Capabilities.Handlers private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IAssetService m_assetService; - + public const string DefaultFormat = "x-j2c"; - + // TODO: Change this to a config option private string m_RedirectURL = null; @@ -66,28 +66,28 @@ namespace OpenSim.Capabilities.Handlers if (m_RedirectURL != null && !m_RedirectURL.EndsWith("/")) m_RedirectURL += "/"; } - + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // Try to parse the texture ID from the request URL NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); string textureStr = query.GetOne("texture_id"); string format = query.GetOne("format"); - + //m_log.DebugFormat("[GETTEXTURE]: called {0}", textureStr); - + if (m_assetService == null) { m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service"); httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound; return null; } - + UUID textureID; if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID)) { // m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID); - + string[] formats; if (!string.IsNullOrEmpty(format)) { @@ -98,10 +98,10 @@ namespace OpenSim.Capabilities.Handlers formats = WebUtil.GetPreferredImageTypes(httpRequest.Headers.Get("Accept")); if (formats.Length == 0) formats = new string[1] { DefaultFormat }; // default - + } // OK, we have an array with preferred formats, possibly with only one entry - + httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound; foreach (string f in formats) { @@ -113,14 +113,14 @@ namespace OpenSim.Capabilities.Handlers { m_log.Warn("[GETTEXTURE]: Failed to parse a texture_id from GetTexture request: " + httpRequest.Url); } - + // m_log.DebugFormat( // "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}", // textureID, httpResponse.StatusCode, httpResponse.ContentLength); - + return null; } - + /// /// /// @@ -133,16 +133,16 @@ namespace OpenSim.Capabilities.Handlers { // m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); AssetBase texture; - + string fullID = textureID.ToString(); if (format != DefaultFormat) fullID = fullID + "-" + format; - + if (!String.IsNullOrEmpty(m_RedirectURL)) { // Only try to fetch locally cached textures. Misses are redirected texture = m_assetService.GetCached(fullID); - + if (texture != null) { if (texture.Type != (sbyte)AssetType.Texture) @@ -166,14 +166,14 @@ namespace OpenSim.Capabilities.Handlers { // try the cache texture = m_assetService.GetCached(fullID); - + if (texture == null) { // m_log.DebugFormat("[GETTEXTURE]: texture was not in the cache"); - + // Fetch locally or remotely. Misses return a 404 texture = m_assetService.Get(textureID.ToString()); - + if (texture != null) { if (texture.Type != (sbyte)AssetType.Texture) @@ -192,7 +192,7 @@ namespace OpenSim.Capabilities.Handlers newTexture.Data = ConvertTextureData(texture, format); if (newTexture.Data.Length == 0) return false; // !!! Caller try another codec, please! - + newTexture.Flags = AssetFlags.Collectable; newTexture.Temporary = true; newTexture.Local = true; @@ -209,17 +209,17 @@ namespace OpenSim.Capabilities.Handlers return true; } } - + // not found // m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found"); httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound; return true; } - + private void WriteTextureData(IOSHttpRequest request, IOSHttpResponse response, AssetBase texture, string format) { string range = request.Headers.GetOne("Range"); - + if (!String.IsNullOrEmpty(range)) // JP2's only { // Range request @@ -233,7 +233,7 @@ namespace OpenSim.Capabilities.Handlers // m_log.DebugFormat( // "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}", // texture.ID, start, texture.Data.Length); - + // Stricly speaking, as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, we should be sending back // Requested Range Not Satisfiable (416) here. However, it appears that at least recent implementations // of the Linden Lab viewer (3.2.1 and 3.3.4 and probably earlier), a viewer that has previously @@ -244,7 +244,7 @@ namespace OpenSim.Capabilities.Handlers // level 2. If this estimate is greater than the total texture size, returning a RequestedRangeNotSatisfiable // here will cause the viewer to treat the texture as bad and never display the full resolution // However, if we return PartialContent (or OK) instead, the viewer will display that resolution. - + // response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; // response.AddHeader("Content-Range", String.Format("bytes */{0}", texture.Data.Length)); // response.StatusCode = (int)System.Net.HttpStatusCode.OK; @@ -257,13 +257,13 @@ namespace OpenSim.Capabilities.Handlers // the rest of the entity. if (end == -1) end = int.MaxValue; - + end = Utils.Clamp(end, 0, texture.Data.Length - 1); start = Utils.Clamp(start, 0, end); int len = end - start + 1; - + // m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); - + // Always return PartialContent, even if the range covered the entire data length // We were accidentally sending back 404 before in this situation // https://issues.apache.org/bugzilla/show_bug.cgi?id=51878 supports sending 206 even if the @@ -275,11 +275,11 @@ namespace OpenSim.Capabilities.Handlers // response.StatusCode = (int)System.Net.HttpStatusCode.OK; // else response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; - + response.ContentLength = len; response.ContentType = texture.Metadata.ContentType; response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length)); - + response.Body.Write(texture.Data, start, len); } } @@ -300,7 +300,7 @@ namespace OpenSim.Capabilities.Handlers response.ContentType = "image/" + format; response.Body.Write(texture.Data, 0, texture.Data.Length); } - + // if (response.StatusCode < 200 || response.StatusCode > 299) // m_log.WarnFormat( // "[GETTEXTURE]: For texture {0} requested range {1} responded {2} with content length {3} (actual {4})", @@ -310,7 +310,7 @@ namespace OpenSim.Capabilities.Handlers // "[GETTEXTURE]: For texture {0} requested range {1} responded {2} with content length {3} (actual {4})", // texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length); } - + /// /// Parse a range header. /// @@ -327,18 +327,18 @@ namespace OpenSim.Capabilities.Handlers private bool TryParseRange(string header, out int start, out int end) { start = end = 0; - + if (header.StartsWith("bytes=")) { string[] rangeValues = header.Substring(6).Split('-'); - + if (rangeValues.Length == 2) { if (!Int32.TryParse(rangeValues[0], out start)) return false; - + string rawEnd = rangeValues[1]; - + if (rawEnd == "") { end = -1; @@ -350,27 +350,27 @@ namespace OpenSim.Capabilities.Handlers } } } - + start = end = 0; return false; } - + private byte[] ConvertTextureData(AssetBase texture, string format) { m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format); byte[] data = new byte[0]; - + MemoryStream imgstream = new MemoryStream(); Bitmap mTexture = null; ManagedImage managedImage = null; Image image = null; - + try { // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data - + imgstream = new MemoryStream(); - + // Decode image to System.Drawing.Image if (OpenJPEG.DecodeToImage(texture.Data, out managedImage, out image) && image != null) { @@ -380,7 +380,7 @@ namespace OpenSim.Capabilities.Handlers using(EncoderParameters myEncoderParameters = new EncoderParameters()) { myEncoderParameters.Param[0] = new EncoderParameter(Encoder.Quality,95L); - + // Save bitmap to stream ImageCodecInfo codec = GetEncoderInfo("image/" + format); if (codec != null) @@ -404,10 +404,10 @@ namespace OpenSim.Capabilities.Handlers // If we encountered an exception, one or more of these will be null if (mTexture != null) mTexture.Dispose(); - + if (image != null) image.Dispose(); - + if(managedImage != null) managedImage.Clear(); @@ -417,10 +417,10 @@ namespace OpenSim.Capabilities.Handlers imgstream.Dispose(); } } - + return data; } - + // From msdn private static ImageCodecInfo GetEncoderInfo(String mimeType) { diff --git a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs index f628ac1251..387b3de9dd 100644 --- a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs +++ b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Capabilities.Handlers")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs index 5536564233..80b83069e2 100644 --- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs @@ -51,7 +51,7 @@ namespace OpenSim.Capabilities.Handlers { public class UploadBakedTextureHandler { - + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Caps m_HostCapsObj; @@ -81,7 +81,7 @@ namespace OpenSim.Capabilities.Handlers { string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); - + BakedTextureUploader uploader = new BakedTextureUploader(capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_HostCapsObj.AgentID); uploader.OnUpLoad += BakedTextureUploaded; @@ -127,7 +127,7 @@ namespace OpenSim.Capabilities.Handlers asset.Temporary = true; asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are m_assetService.Store(asset); - + } } @@ -151,7 +151,7 @@ namespace OpenSim.Capabilities.Handlers // m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID); } - + /// /// Handle raw uploaded baked texture data. diff --git a/OpenSim/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Capabilities/LLSDAssetUploadResponse.cs index 7c4bc97476..97491e33b6 100644 --- a/OpenSim/Capabilities/LLSDAssetUploadResponse.cs +++ b/OpenSim/Capabilities/LLSDAssetUploadResponse.cs @@ -78,7 +78,7 @@ namespace OpenSim.Framework.Capabilities public string state; public int upload_price; public string rsvp; - + public LLSDNewFileAngentInventoryVariablePriceReplyResponse() { state = "confirm_upload"; diff --git a/OpenSim/Capabilities/LLSDAvatarPicker.cs b/OpenSim/Capabilities/LLSDAvatarPicker.cs index d0b3f3a5ec..12e892c9de 100644 --- a/OpenSim/Capabilities/LLSDAvatarPicker.cs +++ b/OpenSim/Capabilities/LLSDAvatarPicker.cs @@ -42,7 +42,7 @@ namespace OpenSim.Framework.Capabilities { public string username; public string display_name; - //'display_name_next_update':d"1970-01-01T00:00:00Z" + //'display_name_next_update':d"1970-01-01T00:00:00Z" public string legacy_first_name; public string legacy_last_name; public UUID id; diff --git a/OpenSim/Capabilities/LLSDInventoryItem.cs b/OpenSim/Capabilities/LLSDInventoryItem.cs index 958e8079b4..460a2155ed 100644 --- a/OpenSim/Capabilities/LLSDInventoryItem.cs +++ b/OpenSim/Capabilities/LLSDInventoryItem.cs @@ -87,12 +87,12 @@ namespace OpenSim.Framework.Capabilities [OSDMap] public class LLSDInventoryFolderContents { - public UUID agent_id; + public UUID agent_id; public int descendents; - public UUID folder_id; + public UUID folder_id; public OSDArray categories = new OSDArray(); public OSDArray items = new OSDArray(); - public UUID owner_id; + public UUID owner_id; public int version; } diff --git a/OpenSim/Capabilities/Properties/AssemblyInfo.cs b/OpenSim/Capabilities/Properties/AssemblyInfo.cs index f8a9daeac0..72a52409ad 100644 --- a/OpenSim/Capabilities/Properties/AssemblyInfo.cs +++ b/OpenSim/Capabilities/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Capabilities")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index 7c003eaf81..e689424d7d 100644 --- a/OpenSim/ConsoleClient/ConsoleClient.cs +++ b/OpenSim/ConsoleClient/ConsoleClient.cs @@ -178,7 +178,7 @@ namespace OpenSim.ConsoleClient Requester.MakeRequest(requestUrl, requestData, ReadResponses); return; } - + List lines = new List(); foreach (XmlNode part in rootNodeL[0].ChildNodes) @@ -202,7 +202,7 @@ namespace OpenSim.ConsoleClient string[] parts = l.Split(new char[] {':'}, 3); if (parts.Length != 3) continue; - + if (parts[2].StartsWith("+++") || parts[2].StartsWith("-++")) prompt = parts[2]; else diff --git a/OpenSim/ConsoleClient/Properties/AssemblyInfo.cs b/OpenSim/ConsoleClient/Properties/AssemblyInfo.cs index 9c0c784838..87bff142d5 100644 --- a/OpenSim/ConsoleClient/Properties/AssemblyInfo.cs +++ b/OpenSim/ConsoleClient/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.ConsoleClient")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Data/DBGuids.cs b/OpenSim/Data/DBGuids.cs index ad1c19c6ee..1a2bf4169f 100644 --- a/OpenSim/Data/DBGuids.cs +++ b/OpenSim/Data/DBGuids.cs @@ -38,7 +38,7 @@ namespace OpenSim.Data /// This function converts a value returned from the database in one of the /// supported formats into a UUID. This function is not actually DBMS-specific right /// now - /// + /// /// /// /// diff --git a/OpenSim/Data/IAvatarData.cs b/OpenSim/Data/IAvatarData.cs index 0a18e211f4..b3f12c17a4 100644 --- a/OpenSim/Data/IAvatarData.cs +++ b/OpenSim/Data/IAvatarData.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data public Dictionary Data; } - public interface IAvatarData + public interface IAvatarData { AvatarBaseData[] Get(string field, string val); bool Store(AvatarBaseData data); diff --git a/OpenSim/Data/IEstateDataStore.cs b/OpenSim/Data/IEstateDataStore.cs index f9070eaf2f..6b30db2295 100644 --- a/OpenSim/Data/IEstateDataStore.cs +++ b/OpenSim/Data/IEstateDataStore.cs @@ -46,14 +46,14 @@ namespace OpenSim.Data /// If true, then an estate is created if one is not found. /// EstateSettings LoadEstateSettings(UUID regionID, bool create); - + /// /// Load estate settings for an estate ID. /// /// /// EstateSettings LoadEstateSettings(int estateID); - + /// /// Create a new estate. /// @@ -67,7 +67,7 @@ namespace OpenSim.Data /// /// An empty list if no estates were found. List LoadEstateSettingsAll(); - + /// /// Store estate settings. /// @@ -75,7 +75,7 @@ namespace OpenSim.Data /// This is also called by EstateSettings.Save() /// void StoreEstateSettings(EstateSettings es); - + /// /// Get estate IDs. /// @@ -88,13 +88,13 @@ namespace OpenSim.Data /// /// An empty list if no estates were found. List GetEstatesByOwner(UUID ownerID); - + /// /// Get the IDs of all estates. /// /// An empty list if no estates were found. List GetEstatesAll(); - + /// /// Link a region to an estate. /// @@ -102,14 +102,14 @@ namespace OpenSim.Data /// /// true if the link succeeded, false otherwise bool LinkRegion(UUID regionID, int estateID); - + /// /// Get the UUIDs of all the regions in an estate. /// /// /// List GetRegions(int estateID); - + /// /// Delete an estate /// diff --git a/OpenSim/Data/IGridUserData.cs b/OpenSim/Data/IGridUserData.cs index 9afa477f30..1b2ea87e80 100644 --- a/OpenSim/Data/IGridUserData.cs +++ b/OpenSim/Data/IGridUserData.cs @@ -47,7 +47,7 @@ namespace OpenSim.Data /// /// An interface for connecting to the user grid datastore /// - public interface IGridUserData + public interface IGridUserData { GridUserData Get(string userID); GridUserData[] GetAll(string query); diff --git a/OpenSim/Data/IGroupsData.cs b/OpenSim/Data/IGroupsData.cs index c11e6499a5..bd059e0894 100644 --- a/OpenSim/Data/IGroupsData.cs +++ b/OpenSim/Data/IGroupsData.cs @@ -81,7 +81,7 @@ namespace OpenSim.Data } - public interface IGroupsData + public interface IGroupsData { // groups table bool StoreGroup(GroupData data); diff --git a/OpenSim/Data/IHGTravelingData.cs b/OpenSim/Data/IHGTravelingData.cs index 452af7bc50..5e4894ebf0 100644 --- a/OpenSim/Data/IHGTravelingData.cs +++ b/OpenSim/Data/IHGTravelingData.cs @@ -48,7 +48,7 @@ namespace OpenSim.Data /// /// An interface for connecting to the user grid datastore /// - public interface IHGTravelingData + public interface IHGTravelingData { HGTravelingData Get(UUID sessionID); HGTravelingData[] GetSessions(UUID userID); diff --git a/OpenSim/Data/IOfflineIMData.cs b/OpenSim/Data/IOfflineIMData.cs index 58501a3b7d..a0f4d694ef 100644 --- a/OpenSim/Data/IOfflineIMData.cs +++ b/OpenSim/Data/IOfflineIMData.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data } - public interface IOfflineIMData + public interface IOfflineIMData { OfflineIMData[] Get(string field, string val); long GetCount(string field, string key); diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs index 9ec48b0e2a..408624511b 100644 --- a/OpenSim/Data/IPresenceData.cs +++ b/OpenSim/Data/IPresenceData.cs @@ -44,7 +44,7 @@ namespace OpenSim.Data /// /// An interface for connecting to the presence datastore /// - public interface IPresenceData + public interface IPresenceData { bool Store(PresenceData data); diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index ca9b32716c..c8e38a49ce 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -67,7 +67,7 @@ namespace OpenSim.Data /// /// An interface for connecting to the authentication datastore /// - public interface IRegionData + public interface IRegionData { RegionData Get(UUID regionID, UUID ScopeID); List Get(string regionName, UUID ScopeID); diff --git a/OpenSim/Data/IXGroupData.cs b/OpenSim/Data/IXGroupData.cs index e5821ef2dc..82073fe80d 100644 --- a/OpenSim/Data/IXGroupData.cs +++ b/OpenSim/Data/IXGroupData.cs @@ -38,12 +38,12 @@ namespace OpenSim.Data public UUID ownerRoleID; public string name; public string charter; - public bool showInList; - public UUID insigniaID; + public bool showInList; + public UUID insigniaID; public int membershipFee; public bool openEnrollment; public bool allowPublish; - public bool maturePublish; + public bool maturePublish; public UUID founderID; public ulong everyonePowers; public ulong ownersPowers; diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index d60647015f..e54bf55a7b 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -80,10 +80,10 @@ namespace OpenSim.Data /// Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint. /// Currently this is only used in the tests. A Migration instance created this way must be then - /// initialized with Initialize(). Regular creation should be through the parameterized constructors. + /// initialized with Initialize(). Regular creation should be through the parameterized constructors. /// public Migration() - { + { } public Migration(DbConnection conn, Assembly assem, string subtype, string type) @@ -91,7 +91,7 @@ namespace OpenSim.Data Initialize(conn, assem, type, subtype); } - public Migration(DbConnection conn, Assembly assem, string type) + public Migration(DbConnection conn, Assembly assem, string type) { Initialize(conn, assem, type, ""); } @@ -191,7 +191,7 @@ namespace OpenSim.Data int newversion = kvp.Key; // we need to up the command timeout to infinite as we might be doing long migrations. - /* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like + /* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like * stored proc definitions might have to be sent to the server each in a separate batch. * This is certainly so for MS SQL; not sure how the MySQL connector sorts out the mess * with 'delimiter @@'/'delimiter ;' around procs. So each "script" this code executes now is not @@ -276,7 +276,7 @@ namespace OpenSim.Data private delegate void FlushProc(); /// Scans for migration resources in either old-style "scattered" (one file per version) - /// or new-style "integrated" format (single file with ":VERSION nnn" sections). + /// or new-style "integrated" format (single file with ":VERSION nnn" sections). /// In the new-style migrations it also recognizes ':GO' separators for parts of the SQL script /// that must be sent to the server separately. The old-style migrations are loaded each in one piece /// and don't support the ':GO' feature. @@ -301,12 +301,12 @@ namespace OpenSim.Data { /* The filename should be '.migrations[.NNN]' where NNN * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip - * the file without looking inside if we have a higher version already. Without the suffix we read + * the file without looking inside if we have a higher version already. Without the suffix we read * the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql') * is valid but ignored. - * - * NOTE that we expect only one 'merged' migration file. If there are several, we take the last one. - * If you are numbering them, leave only the latest one in the project or at least make sure they numbered + * + * NOTE that we expect only one 'merged' migration file. If there are several, we take the last one. + * If you are numbering them, leave only the latest one in the project or at least make sure they numbered * to come up in the correct order (e.g. 'SomeStore.migrations.001' rather than 'SomeStore.migrations.1') */ @@ -351,7 +351,7 @@ namespace OpenSim.Data if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) { if (sb.Length == 0) continue; - if (nVersion > after) + if (nVersion > after) script.Add(sb.ToString()); sb.Length = 0; continue; @@ -405,10 +405,10 @@ scan_old_style: } } } - - if (migrations.Count < 1) + + if (migrations.Count < 1) m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after); - + return migrations; } } diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 1488e1a5bb..f16cd913e7 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -329,8 +329,8 @@ namespace OpenSim.Data.MySQL { m_log.Error( string.Format( - "[ASSETS DB]: MySql failure fetching asset set from {0}, count {1}. Exception ", - start, count), + "[ASSETS DB]: MySql failure fetching asset set from {0}, count {1}. Exception ", + start, count), e); } } diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index 76274972a8..af6be75bf7 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs @@ -77,21 +77,21 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); IDataReader result = cmd.ExecuteReader(); - + if (result.Read()) { ret.PrincipalID = principalID; - + CheckColumnNames(result); - + foreach (string s in m_ColumnNames) { if (s == "UUID") continue; - + ret.Data[s] = result[s].ToString(); } - + return ret; } else @@ -132,25 +132,25 @@ namespace OpenSim.Data.MySQL if (!first) update += ", "; update += "`" + field + "` = ?"+field; - + first = false; - + cmd.Parameters.AddWithValue("?"+field, data.Data[field]); } - + update += " where UUID = ?principalID"; - + cmd.CommandText = update; cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString()); - + if (ExecuteNonQuery(cmd) < 1) { string insert = "insert into `" + m_Realm + "` (`UUID`, `" + String.Join("`, `", fields) + "`) values (?principalID, ?" + String.Join(", ?", fields) + ")"; - + cmd.CommandText = insert; - + if (ExecuteNonQuery(cmd) < 1) return false; } @@ -166,7 +166,7 @@ namespace OpenSim.Data.MySQL { cmd.Parameters.AddWithValue("?"+item, value); cmd.Parameters.AddWithValue("?UUID", principalID.ToString()); - + if (ExecuteNonQuery(cmd) > 0) return true; } @@ -186,7 +186,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); cmd.Parameters.AddWithValue("?token", token); cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString()); - + if (ExecuteNonQuery(cmd) > 0) return true; } diff --git a/OpenSim/Data/MySQL/MySQLAvatarData.cs b/OpenSim/Data/MySQL/MySQLAvatarData.cs index 6a2f5d814d..63e80209b4 100644 --- a/OpenSim/Data/MySQL/MySQLAvatarData.cs +++ b/OpenSim/Data/MySQL/MySQLAvatarData.cs @@ -57,7 +57,7 @@ namespace OpenSim.Data.MySQL cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm); cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); cmd.Parameters.AddWithValue("?Name", name); - + if (ExecuteNonQuery(cmd) > 0) return true; } diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index fe1487bba8..a5c8d24de5 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -403,19 +403,19 @@ namespace OpenSim.Data.MySQL return e; } } - + public List LoadEstateSettingsAll() { - List allEstateSettings = new List(); - + List allEstateSettings = new List(); + List allEstateIds = GetEstatesAll(); - + foreach (int estateId in allEstateIds) allEstateSettings.Add(LoadEstateSettings(estateId)); - + return allEstateSettings; } - + public List GetEstatesAll() { List result = new List(); @@ -441,7 +441,7 @@ namespace OpenSim.Data.MySQL dbcon.Close(); } - return result; + return result; } public List GetEstates(string search) diff --git a/OpenSim/Data/MySQL/MySQLFSAssetData.cs b/OpenSim/Data/MySQL/MySQLFSAssetData.cs index 4ed2de688e..2837ce31be 100644 --- a/OpenSim/Data/MySQL/MySQLFSAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLFSAssetData.cs @@ -54,7 +54,7 @@ namespace OpenSim.Data.MySQL { get { return GetType().Assembly; } } - + public MySQLFSAssetData() { } diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index dc657c82a8..6aae9c644b 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs @@ -40,7 +40,7 @@ namespace OpenSim.Data.MySQL public class MySQLGenericTableHandler : MySqlFramework where T: class, new() { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected Dictionary m_Fields = new Dictionary(); @@ -58,7 +58,7 @@ namespace OpenSim.Data.MySQL { m_Realm = realm; m_connectionString = connectionString; - + if (storeName != String.Empty) { using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) @@ -130,7 +130,7 @@ namespace OpenSim.Data.MySQL m_Realm, where); cmd.CommandText = query; - + return DoQuery(cmd); } } @@ -185,7 +185,7 @@ namespace OpenSim.Data.MySQL m_Fields[name].SetValue(row, reader[name]); } } - + if (m_DataField != null) { Dictionary data = @@ -215,9 +215,9 @@ namespace OpenSim.Data.MySQL { string query = String.Format("select * from {0} where {1}", m_Realm, where); - + cmd.CommandText = query; - + return DoQuery(cmd); } } @@ -236,16 +236,16 @@ namespace OpenSim.Data.MySQL { names.Add(fi.Name); values.Add("?" + fi.Name); - + // Temporarily return more information about what field is unexpectedly null for - // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the + // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the // InventoryTransferModule or we may be required to substitute a DBNull here. if (fi.GetValue(row) == null) throw new NullReferenceException( string.Format( - "[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null", + "[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null", fi.Name, row)); - + cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString()); } diff --git a/OpenSim/Data/MySQL/MySQLGroupsData.cs b/OpenSim/Data/MySQL/MySQLGroupsData.cs index 5734d19038..4e73ee7186 100644 --- a/OpenSim/Data/MySQL/MySQLGroupsData.cs +++ b/OpenSim/Data/MySQL/MySQLGroupsData.cs @@ -133,10 +133,10 @@ namespace OpenSim.Data.MySQL public bool DeleteMember(UUID groupID, string pricipalID) { - return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, + return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, new string[] { groupID.ToString(), pricipalID }); } - + public int MemberCount(UUID groupID) { return (int)m_Membership.GetCount("GroupID", groupID.ToString()); @@ -168,7 +168,7 @@ namespace OpenSim.Data.MySQL public bool DeleteRole(UUID groupID, UUID roleID) { - return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, + return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, new string[] { groupID.ToString(), roleID.ToString() }); } @@ -360,7 +360,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsGroupsHandler(string connectionString, string realm, string store) + public MySqlGroupsGroupsHandler(string connectionString, string realm, string store) : base(connectionString, realm, store) { } @@ -375,7 +375,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsMembershipHandler(string connectionString, string realm) + public MySqlGroupsMembershipHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -390,7 +390,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsRolesHandler(string connectionString, string realm) + public MySqlGroupsRolesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -405,7 +405,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsRoleMembershipHandler(string connectionString, string realm) + public MySqlGroupsRoleMembershipHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -420,7 +420,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsInvitesHandler(string connectionString, string realm) + public MySqlGroupsInvitesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -447,7 +447,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsNoticesHandler(string connectionString, string realm) + public MySqlGroupsNoticesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -475,7 +475,7 @@ namespace OpenSim.Data.MySQL get { return GetType().Assembly; } } - public MySqlGroupsPrincipalsHandler(string connectionString, string realm) + public MySqlGroupsPrincipalsHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index e9b10f3cdf..382d4a5c33 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -288,7 +288,7 @@ namespace OpenSim.Data.MySQL // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) item.CreatorId = reader["creatorID"].ToString(); - + // Be a bit safer in parsing these because the // database doesn't enforce them to be not null, and // the inventory still works if these are weird in the @@ -453,7 +453,7 @@ namespace OpenSim.Data.MySQL itemName = item.Name.Substring(0, 64); m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length + " to " + itemName.Length + " characters on add item"); } - + string itemDesc = item.Description; if (item.Description.Length > 128) { @@ -490,10 +490,10 @@ namespace OpenSim.Data.MySQL result.Parameters.AddWithValue("?groupID", item.GroupID); result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); result.Parameters.AddWithValue("?flags", item.Flags); - + lock (m_dbLock) result.ExecuteNonQuery(); - + result.Dispose(); } @@ -630,7 +630,7 @@ namespace OpenSim.Data.MySQL { cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); - + try { lock (m_dbLock) @@ -860,7 +860,7 @@ namespace OpenSim.Data.MySQL deleteOneFolder(folderID); deleteItemsInFolder(folderID); } - + public List fetchActiveGestures(UUID avatarID) { lock (m_dbLock) diff --git a/OpenSim/Data/MySQL/MySQLMigrations.cs b/OpenSim/Data/MySQL/MySQLMigrations.cs index 81a0e837ea..2043dae052 100644 --- a/OpenSim/Data/MySQL/MySQLMigrations.cs +++ b/OpenSim/Data/MySQL/MySQLMigrations.cs @@ -39,16 +39,16 @@ namespace OpenSim.Data.MySQL { /// This is a MySQL-customized migration processor. The only difference is in how /// it executes SQL scripts (using MySqlScript instead of MyCommand) - /// + /// /// public class MySqlMigration : Migration { public MySqlMigration() : base() - { + { } - public MySqlMigration(DbConnection conn, Assembly assem, string subtype, string type) : + public MySqlMigration(DbConnection conn, Assembly assem, string subtype, string type) : base(conn, assem, subtype, type) { } diff --git a/OpenSim/Data/MySQL/MySQLOfflineIMData.cs b/OpenSim/Data/MySQL/MySQLOfflineIMData.cs index bafd204a32..7608858d2c 100644 --- a/OpenSim/Data/MySQL/MySQLOfflineIMData.cs +++ b/OpenSim/Data/MySQL/MySQLOfflineIMData.cs @@ -50,7 +50,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand()) { cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 WEEK", m_Realm); - + ExecuteNonQuery(cmd); } diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 3f906399ec..70aca5f271 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs @@ -66,9 +66,9 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand()) { cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm); - + cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); - + ExecuteNonQuery(cmd); } } @@ -85,10 +85,10 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand()) { cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm); - + cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); - + if (ExecuteNonQuery(cmd) == 0) return false; } diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 99d4944b52..0e55285451 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -410,7 +410,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(command)) { cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - + return RunCommand(cmd); } } diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 2aaa2ff553..8278c0ec20 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL /// /// This lock was being used to serialize database operations when the connection was shared, but this has /// been unnecessary for a long time after we switched to using MySQL's underlying connection pooling instead. - /// FIXME: However, the locks remain in many places since they are effectively providing a level of + /// FIXME: However, the locks remain in many places since they are effectively providing a level of /// transactionality. This should be replaced by more efficient database transactions which would not require /// unrelated operations to block each other or unrelated operations on the same tables from blocking each /// other. @@ -268,7 +268,7 @@ namespace OpenSim.Data.MySQL public virtual void RemoveObject(UUID obj, UUID regionUUID) { // m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID); - + List uuids = new List(); // Formerly, this used to check the region UUID. @@ -509,7 +509,7 @@ namespace OpenSim.Data.MySQL #region Prim Inventory Loading // Instead of attempting to LoadItems on every prim, - // most of which probably have no items... get a + // most of which probably have no items... get a // list from DB of all prims which have items and // LoadItems only on those List primsWithInventory = new List(); @@ -807,7 +807,7 @@ namespace OpenSim.Data.MySQL "UserLocationX, UserLocationY, UserLocationZ, " + "UserLookAtX, UserLookAtY, UserLookAtZ, " + "AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " + - "MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " + + "MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " + "SeeAVs, AnyAVSounds, GroupAVSounds) values (" + "?UUID, ?RegionUUID, " + "?LocalLandID, ?Bitmap, ?Name, ?Description, " + @@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); - + ExecuteNonQuery(cmd); } } @@ -1273,7 +1273,7 @@ namespace OpenSim.Data.MySQL { SceneObjectPart prim = new SceneObjectPart(); - // depending on the MySQL connector version, CHAR(36) may be already converted to Guid! + // depending on the MySQL connector version, CHAR(36) may be already converted to Guid! prim.UUID = DBGuid.FromDB(row["UUID"]); prim.CreatorIdentification = (string)row["CreatorID"]; prim.OwnerID = DBGuid.FromDB(row["OwnerID"]); @@ -1401,11 +1401,11 @@ namespace OpenSim.Data.MySQL prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]); prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"]; - + prim.PassTouches = ((sbyte)row["PassTouches"] != 0); prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0); prim.LinkNum = (int)row["LinkNumber"]; - + if (!(row["MediaURL"] is System.DBNull)) prim.MediaUrl = (string)row["MediaURL"]; @@ -1421,7 +1421,7 @@ namespace OpenSim.Data.MySQL if (!(row["DynAttrs"] is System.DBNull)) prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); else - prim.DynAttrs = new DAMap(); + prim.DynAttrs = new DAMap(); if (!(row["KeyframeMotion"] is DBNull)) { @@ -1543,10 +1543,10 @@ namespace OpenSim.Data.MySQL newSettings.Covenant = DBGuid.FromDB(row["covenant"]); newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); - + if (row["loaded_creation_id"] is DBNull) newSettings.LoadedCreationID = ""; - else + else newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); @@ -2023,7 +2023,7 @@ namespace OpenSim.Data.MySQL s.State = (byte)(int)row["State"]; s.LastAttachPoint = (byte)(int)row["LastAttachPoint"]; - + if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); @@ -2103,13 +2103,13 @@ namespace OpenSim.Data.MySQL "?flags, ?itemID, ?primID, ?assetID, " + "?parentFolderID, ?creatorID, ?ownerID, " + "?groupID, ?lastOwnerID)"; - + foreach (TaskInventoryItem item in items) { cmd.Parameters.Clear(); - + FillItemCommand(cmd, item); - + ExecuteNonQuery(cmd); } } diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index c389ae4c17..8af2a3ef29 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs @@ -40,39 +40,39 @@ namespace OpenSim.Data.MySQL public class UserProfilesData: IProfilesData { static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + #region Properites string ConnectionString { get; set; } - + protected virtual Assembly Assembly { get { return GetType().Assembly; } } - + #endregion Properties - + #region class Member Functions public UserProfilesData(string connectionString) { ConnectionString = connectionString; Init(); } - + void Init() { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) { dbcon.Open(); - + Migration m = new Migration(dbcon, Assembly, "UserProfiles"); m.Update(); } } #endregion Member Functions - + #region Classifieds Queries /// /// Gets the classified records. @@ -86,7 +86,7 @@ namespace OpenSim.Data.MySQL public OSDArray GetClassifiedRecords(UUID creatorId) { OSDArray data = new OSDArray(); - + using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) { string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id"; @@ -102,7 +102,7 @@ namespace OpenSim.Data.MySQL { OSDMap n = new OSDMap(); UUID Id = UUID.Zero; - + string Name = null; try { @@ -124,12 +124,12 @@ namespace OpenSim.Data.MySQL } return data; } - + public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) { string query = string.Empty; - - + + query += "INSERT INTO classifieds ("; query += "`classifieduuid`,"; query += "`creatoruuid`,"; @@ -173,21 +173,21 @@ namespace OpenSim.Data.MySQL query += "classifiedflags=?Flags, "; query += "priceforlisting=?ListingPrice, "; query += "snapshotuuid=?SnapshotId"; - + if(string.IsNullOrEmpty(ad.ParcelName)) ad.ParcelName = "Unknown"; if(ad.ParcelId == null) ad.ParcelId = UUID.Zero; if(string.IsNullOrEmpty(ad.Description)) ad.Description = "No Description"; - + DateTime epoch = new DateTime(1970, 1, 1); DateTime now = DateTime.Now; TimeSpan epochnow = now - epoch; TimeSpan duration; DateTime expiration; TimeSpan epochexp; - + if(ad.Flags == 2) { duration = new TimeSpan(7,0,0,0); @@ -202,7 +202,7 @@ namespace OpenSim.Data.MySQL } ad.CreationDate = (int)epochnow.TotalSeconds; ad.ExpirationDate = (int)epochexp.TotalSeconds; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -225,7 +225,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?ParcelName", ad.ParcelName.ToString()); cmd.Parameters.AddWithValue("?Flags", ad.Flags.ToString()); cmd.Parameters.AddWithValue("?ListingPrice", ad.Price.ToString ()); - + cmd.ExecuteNonQuery(); } } @@ -239,20 +239,20 @@ namespace OpenSim.Data.MySQL } return true; } - + public bool DeleteClassifiedRecord(UUID recordId) { string query = string.Empty; - + query += "DELETE FROM classifieds WHERE "; query += "classifieduuid = ?recordId"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) { dbcon.Open(); - + using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { cmd.Parameters.AddWithValue("?recordId", recordId.ToString()); @@ -268,14 +268,14 @@ namespace OpenSim.Data.MySQL } return true; } - + public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result) { string query = string.Empty; - + query += "SELECT * FROM classifieds WHERE "; query += "classifieduuid = ?AdId"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -284,7 +284,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { cmd.Parameters.AddWithValue("?AdId", ad.ClassifiedId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader()) { if(reader.Read ()) @@ -303,7 +303,7 @@ namespace OpenSim.Data.MySQL ad.SimName = reader.GetString("simname"); ad.GlobalPos = reader.GetString("posglobal"); ad.ParcelName = reader.GetString("parcelname"); - + } } } @@ -318,16 +318,16 @@ namespace OpenSim.Data.MySQL return true; } #endregion Classifieds Queries - + #region Picks Queries public OSDArray GetAvatarPicks(UUID avatarId) { string query = string.Empty; - + query += "SELECT `pickuuid`,`name` FROM userpicks WHERE "; query += "creatoruuid = ?Id"; OSDArray data = new OSDArray(); - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -336,7 +336,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader()) { if(reader.HasRows) @@ -344,7 +344,7 @@ namespace OpenSim.Data.MySQL while (reader.Read()) { OSDMap record = new OSDMap(); - + record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"])); record.Add("name",OSD.FromString((string)reader["name"])); data.Add(record); @@ -361,16 +361,16 @@ namespace OpenSim.Data.MySQL } return data; } - + public UserProfilePick GetPickInfo(UUID avatarId, UUID pickId) { string query = string.Empty; UserProfilePick pick = new UserProfilePick(); - + query += "SELECT * FROM userpicks WHERE "; query += "creatoruuid = ?CreatorId AND "; query += "pickuuid = ?PickId"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -380,18 +380,18 @@ namespace OpenSim.Data.MySQL { cmd.Parameters.AddWithValue("?CreatorId", avatarId.ToString()); cmd.Parameters.AddWithValue("?PickId", pickId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader()) { if(reader.HasRows) { reader.Read(); - + string description = (string)reader["description"]; - + if (string.IsNullOrEmpty(description)) description = "No description given."; - + UUID.TryParse((string)reader["pickuuid"], out pick.PickId); UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId); UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId); @@ -419,11 +419,11 @@ namespace OpenSim.Data.MySQL } return pick; } - + public bool UpdatePicksRecord(UserProfilePick pick) - { + { string query = string.Empty; - + query += "INSERT INTO userpicks VALUES ("; query += "?PickId,"; query += "?CreatorId,"; @@ -449,7 +449,7 @@ namespace OpenSim.Data.MySQL query += "pickuuid=?PickId,"; query += "posglobal=?GlobalPos,"; query += "gatekeeper=?Gatekeeper"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -471,7 +471,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?Gatekeeper",pick.Gatekeeper); cmd.Parameters.AddWithValue("?SortOrder", pick.SortOrder.ToString ()); cmd.Parameters.AddWithValue("?Enabled", pick.Enabled.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -484,24 +484,24 @@ namespace OpenSim.Data.MySQL } return true; } - + public bool DeletePicksRecord(UUID pickId) { string query = string.Empty; - + query += "DELETE FROM userpicks WHERE "; query += "pickuuid = ?PickId"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) { dbcon.Open(); - + using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { cmd.Parameters.AddWithValue("?PickId", pickId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -515,12 +515,12 @@ namespace OpenSim.Data.MySQL return true; } #endregion Picks Queries - + #region Avatar Notes Queries public bool GetAvatarNotes(ref UserProfileNotes notes) { // WIP string query = string.Empty; - + query += "SELECT `notes` FROM usernotes WHERE "; query += "useruuid = ?Id AND "; query += "targetuuid = ?TargetId"; @@ -534,7 +534,7 @@ namespace OpenSim.Data.MySQL { cmd.Parameters.AddWithValue("?Id", notes.UserId.ToString()); cmd.Parameters.AddWithValue("?TargetId", notes.TargetId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.HasRows) @@ -557,12 +557,12 @@ namespace OpenSim.Data.MySQL } return true; } - + public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result) - { + { string query = string.Empty; bool remove; - + if(string.IsNullOrEmpty(note.Notes)) { remove = true; @@ -581,7 +581,7 @@ namespace OpenSim.Data.MySQL query += "UPDATE "; query += "notes=?Notes"; } - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -593,7 +593,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?Notes", note.Notes); cmd.Parameters.AddWithValue("?TargetId", note.TargetId.ToString ()); cmd.Parameters.AddWithValue("?UserId", note.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -605,18 +605,18 @@ namespace OpenSim.Data.MySQL return false; } return true; - + } #endregion Avatar Notes Queries - + #region Avatar Properties public bool GetAvatarProperties(ref UserProfileProperties props, ref string result) { string query = string.Empty; - + query += "SELECT * FROM userprofile WHERE "; query += "useruuid = ?Id"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -625,7 +625,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { cmd.Parameters.AddWithValue("?Id", props.UserId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.HasRows) @@ -649,7 +649,7 @@ namespace OpenSim.Data.MySQL { m_log.DebugFormat("[PROFILES_DATA]" + ": No data for {0}", props.UserId); - + props.WebUrl = string.Empty; props.ImageId = UUID.Zero; props.AboutText = string.Empty; @@ -730,11 +730,11 @@ namespace OpenSim.Data.MySQL } return true; } - + public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result) - { + { string query = string.Empty; - + query += "UPDATE userprofile SET "; query += "profileURL=?profileURL, "; query += "profileImage=?image, "; @@ -742,7 +742,7 @@ namespace OpenSim.Data.MySQL query += "profileFirstImage=?firstlifeimage,"; query += "profileFirstText=?firstlifetext "; query += "WHERE useruuid=?uuid"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -756,7 +756,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?firstlifeimage", props.FirstLifeImageId.ToString()); cmd.Parameters.AddWithValue("?firstlifetext", props.FirstLifeText); cmd.Parameters.AddWithValue("?uuid", props.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -765,18 +765,18 @@ namespace OpenSim.Data.MySQL { m_log.ErrorFormat("[PROFILES_DATA]" + ": AgentPropertiesUpdate exception {0}", e.Message); - + return false; } return true; } #endregion Avatar Properties - + #region Avatar Interests public bool UpdateAvatarInterests(UserProfileProperties up, ref string result) - { + { string query = string.Empty; - + query += "UPDATE userprofile SET "; query += "profileWantToMask=?WantMask, "; query += "profileWantToText=?WantText,"; @@ -784,7 +784,7 @@ namespace OpenSim.Data.MySQL query += "profileSkillsText=?SkillsText, "; query += "profileLanguages=?Languages "; query += "WHERE useruuid=?uuid"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -798,7 +798,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?SkillsText", up.SkillsText); cmd.Parameters.AddWithValue("?Languages", up.Language); cmd.Parameters.AddWithValue("?uuid", up.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -820,8 +820,8 @@ namespace OpenSim.Data.MySQL string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id"; // Get classified image assets - - + + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -831,7 +831,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`classifieds`"), dbcon)) { cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.HasRows) @@ -850,7 +850,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon)) { cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.HasRows) @@ -862,7 +862,7 @@ namespace OpenSim.Data.MySQL } } } - + dbcon.Close(); dbcon.Open(); @@ -871,7 +871,7 @@ namespace OpenSim.Data.MySQL using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon)) { cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.HasRows) @@ -893,7 +893,7 @@ namespace OpenSim.Data.MySQL } return data; } - + #region User Preferences public bool GetUserPreferences(ref UserPreferences pref, ref string result) { @@ -987,16 +987,16 @@ namespace OpenSim.Data.MySQL return true; } #endregion User Preferences - + #region Integration public bool GetUserAppData(ref UserAppData props, ref string result) { string query = string.Empty; - + query += "SELECT * FROM `userdata` WHERE "; query += "UserId = ?Id AND "; query += "TagId = ?TagId"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) @@ -1006,7 +1006,7 @@ namespace OpenSim.Data.MySQL { cmd.Parameters.AddWithValue("?Id", props.UserId.ToString()); cmd.Parameters.AddWithValue ("?TagId", props.TagId.ToString()); - + using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.HasRows) @@ -1022,7 +1022,7 @@ namespace OpenSim.Data.MySQL query += "?TagId,"; query += "?DataKey,"; query += "?DataVal) "; - + using (MySqlCommand put = new MySqlCommand(query, dbcon)) { put.Parameters.AddWithValue("?UserId", props.UserId.ToString()); @@ -1048,16 +1048,16 @@ namespace OpenSim.Data.MySQL } public bool SetUserAppData(UserAppData props, ref string result) - { + { string query = string.Empty; - + query += "UPDATE userdata SET "; query += "TagId = ?TagId, "; query += "DataKey = ?DataKey, "; query += "DataVal = ?DataVal WHERE "; query += "UserId = ?UserId AND "; query += "TagId = ?TagId"; - + try { using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index ec2bcc69e9..2c6acdef32 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs @@ -209,7 +209,7 @@ namespace OpenSim.Data.MySQL { assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); m_log.WarnFormat( - "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Name, asset.ID, asset.Name.Length, assetName.Length); } @@ -218,7 +218,7 @@ namespace OpenSim.Data.MySQL { assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); m_log.WarnFormat( - "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } @@ -341,7 +341,7 @@ namespace OpenSim.Data.MySQL catch (Exception) { m_log.ErrorFormat( - "[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}", + "[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}", assetMetadata.ID, assetMetadata.Name); } } diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs index 9a0044eb8b..4e41fec9cd 100644 --- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs @@ -80,7 +80,7 @@ namespace OpenSim.Data.MySQL return m_Items.Store(item); } - + public bool DeleteFolders(string field, string val) { return m_Folders.Delete(field, val); @@ -220,12 +220,12 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); - + using (IDataReader reader = cmd.ExecuteReader()) { int perms = 0; - + if (reader.Read()) { perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]); diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index 57592f180d..9f2289600c 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs @@ -102,19 +102,19 @@ namespace OpenSim.Data.Null { return new EstateSettings(); } - + public List LoadEstateSettingsAll() { List allEstateSettings = new List(); allEstateSettings.Add(GetEstate()); return allEstateSettings; } - + public List GetEstatesAll() { List result = new List(); result.Add((int)GetEstate().EstateID); - return result; + return result; } public List GetEstates(string search) diff --git a/OpenSim/Data/Null/NullFriendsData.cs b/OpenSim/Data/Null/NullFriendsData.cs index 473999fdb2..dc9cd38758 100644 --- a/OpenSim/Data/Null/NullFriendsData.cs +++ b/OpenSim/Data/Null/NullFriendsData.cs @@ -79,7 +79,7 @@ namespace OpenSim.Data.Null { return fdata.PrincipalID == userID.ToString(); }); - + if (lst != null) { lst.ForEach(f => @@ -87,14 +87,14 @@ namespace OpenSim.Data.Null FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID); if (f2 != null) f.Data["TheirFlags"] = f2.Data["Flags"]; - + // m_log.DebugFormat( // "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}", // f.Friend, f.Data["Flags"], f2 != null ? f.Data["TheirFlags"] : "not found!", f.PrincipalID); }); - + // m_log.DebugFormat("[NULL FRIENDS DATA]: Got {0} friends for {1}", lst.Count, userID); - + return lst.ToArray(); } } @@ -134,7 +134,7 @@ namespace OpenSim.Data.Null // m_log.DebugFormat( // "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}", // friend.Friend, friend.Data["Flags"], friend.PrincipalID); - + m_Data.Remove(friend); return true; } diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index aff0b0b479..8c442c9c5b 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data.Null public class NullPresenceData : IPresenceData { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public static NullPresenceData Instance; Dictionary m_presenceData = new Dictionary(); @@ -100,7 +100,7 @@ namespace OpenSim.Data.Null { if (Instance != this) return Instance.ReportAgent(sessionID, regionID); - + if (m_presenceData.ContainsKey(sessionID)) { m_presenceData[sessionID].RegionID = regionID; @@ -129,7 +129,7 @@ namespace OpenSim.Data.Null // Console.WriteLine("HOME for " + p.UserID + " is " + (p.Data.ContainsKey("HomeRegionID") ? p.Data["HomeRegionID"] : "Not found")); } } - + return presences.ToArray(); } else if (field == "SessionID") @@ -172,7 +172,7 @@ namespace OpenSim.Data.Null { // m_log.DebugFormat( // "[NULL PRESENCE DATA]: Deleting presence data for field {0} with parameter {1}", field, data); - + if (Instance != this) return Instance.Delete(field, data); diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs index 241616ba3c..6d2e05ac23 100644 --- a/OpenSim/Data/Null/NullUserAccountData.cs +++ b/OpenSim/Data/Null/NullUserAccountData.cs @@ -40,7 +40,7 @@ namespace OpenSim.Data.Null public class NullUserAccountData : IUserAccountData { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private Dictionary m_DataByUUID = new Dictionary(); private Dictionary m_DataByName = new Dictionary(); private Dictionary m_DataByEmail = new Dictionary(); @@ -48,7 +48,7 @@ namespace OpenSim.Data.Null public NullUserAccountData(string connectionString, string realm) { // m_log.DebugFormat( -// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]", +// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]", // connectionString, realm); } @@ -65,12 +65,12 @@ namespace OpenSim.Data.Null // if (m_log.IsDebugEnabled) // { // m_log.DebugFormat( -// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]", +// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]", // string.Join(", ", fields), string.Join(", ", values)); // } - + UserAccountData[] userAccounts = new UserAccountData[0]; - + List fieldsLst = new List(fields); if (fieldsLst.Contains("PrincipalID")) { @@ -79,33 +79,33 @@ namespace OpenSim.Data.Null if (UUID.TryParse(values[i], out id)) if (m_DataByUUID.ContainsKey(id)) userAccounts = new UserAccountData[] { m_DataByUUID[id] }; - } + } else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName")) { int findex = fieldsLst.IndexOf("FirstName"); int lindex = fieldsLst.IndexOf("LastName"); if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex])) - { + { userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] }; } - } + } else if (fieldsLst.Contains("Email")) { int i = fieldsLst.IndexOf("Email"); if (m_DataByEmail.ContainsKey(values[i])) userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] }; } - + // if (m_log.IsDebugEnabled) // { // StringBuilder sb = new StringBuilder(); // foreach (UserAccountData uad in userAccounts) // sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID); -// +// // m_log.DebugFormat( // "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb); // } - + return userAccounts; } @@ -113,16 +113,16 @@ namespace OpenSim.Data.Null { if (data == null) return false; - + m_log.DebugFormat( - "[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}", + "[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}", data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode()); - + m_DataByUUID[data.PrincipalID] = data; m_DataByName[data.FirstName + " " + data.LastName] = data; if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty) m_DataByEmail[data.Data["Email"]] = data; - + // m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count); return true; @@ -132,7 +132,7 @@ namespace OpenSim.Data.Null { // m_log.DebugFormat( // "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query); - + string[] words = query.Split(new char[] { ' ' }); for (int i = 0; i < words.Length; i++) diff --git a/OpenSim/Data/PGSQL/PGSQLAssetData.cs b/OpenSim/Data/PGSQL/PGSQLAssetData.cs index 81adb034a9..7b79521591 100644 --- a/OpenSim/Data/PGSQL/PGSQLAssetData.cs +++ b/OpenSim/Data/PGSQL/PGSQLAssetData.cs @@ -151,35 +151,35 @@ namespace OpenSim.Data.PGSQL /// the asset override public bool StoreAsset(AssetBase asset) { - + string sql = @"UPDATE assets set name = :name, description = :description, " + "\"assetType\" " + @" = :assetType, local = :local, temporary = :temporary, creatorid = :creatorid, data = :data WHERE id=:id; INSERT INTO assets - (id, name, description, " + "\"assetType\" " + @", local, + (id, name, description, " + "\"assetType\" " + @", local, temporary, create_time, access_time, creatorid, asset_flags, data) - Select :id, :name, :description, :assetType, :local, + Select :id, :name, :description, :assetType, :local, :temporary, :create_time, :access_time, :creatorid, :asset_flags, :data - Where not EXISTS(SELECT * FROM assets WHERE id=:id) + Where not EXISTS(SELECT * FROM assets WHERE id=:id) "; - + string assetName = asset.Name; if (asset.Name.Length > AssetBase.MAX_ASSET_NAME) { assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); m_log.WarnFormat( - "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Name, asset.ID, asset.Name.Length, assetName.Length); } - + string assetDescription = asset.Description; if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) { assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); m_log.WarnFormat( - "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } @@ -278,7 +278,7 @@ namespace OpenSim.Data.PGSQL { List retList = new List(count); string sql = @" SELECT id, name, description, " + "\"assetType\"" + @", temporary, creatorid - FROM assets + FROM assets order by id limit :stop offset :start;"; diff --git a/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs b/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs index d174112f0f..8f83309f06 100644 --- a/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs @@ -145,7 +145,7 @@ namespace OpenSim.Data.PGSQL updateBuilder.AppendFormat("\"{0}\" = :{0}",field); first = false; - + cmd.Parameters.Add(m_database.CreateParameter("" + field, data.Data[field])); } @@ -154,7 +154,7 @@ namespace OpenSim.Data.PGSQL cmd.CommandText = updateBuilder.ToString(); cmd.Connection = conn; cmd.Parameters.Add(m_database.CreateParameter("principalID", data.PrincipalID)); - + conn.Open(); if (cmd.ExecuteNonQuery() < 1) { @@ -195,7 +195,7 @@ namespace OpenSim.Data.PGSQL { if (System.Environment.TickCount - m_LastExpire > 30000) DoExpire(); - + string sql = "insert into tokens (uuid, token, validity) values (:principalID, :token, :lifetime)"; using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) diff --git a/OpenSim/Data/PGSQL/PGSQLAvatarData.cs b/OpenSim/Data/PGSQL/PGSQLAvatarData.cs index d9c49052d4..3d56d4d051 100644 --- a/OpenSim/Data/PGSQL/PGSQLAvatarData.cs +++ b/OpenSim/Data/PGSQL/PGSQLAvatarData.cs @@ -45,7 +45,7 @@ namespace OpenSim.Data.PGSQL IAvatarData { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public PGSQLAvatarData(string connectionString, string realm) : base(connectionString, realm, "Avatar") { diff --git a/OpenSim/Data/PGSQL/PGSQLEstateData.cs b/OpenSim/Data/PGSQL/PGSQLEstateData.cs index b5ca235200..9489d6cec6 100644 --- a/OpenSim/Data/PGSQL/PGSQLEstateData.cs +++ b/OpenSim/Data/PGSQL/PGSQLEstateData.cs @@ -594,7 +594,7 @@ namespace OpenSim.Data.PGSQL public bool DeleteEstate(int estateID) { - // TODO: Implementation! + // TODO: Implementation! return false; } #endregion diff --git a/OpenSim/Data/PGSQL/PGSQLFriendsData.cs b/OpenSim/Data/PGSQL/PGSQLFriendsData.cs index a8413531fd..58dffedc2f 100644 --- a/OpenSim/Data/PGSQL/PGSQLFriendsData.cs +++ b/OpenSim/Data/PGSQL/PGSQLFriendsData.cs @@ -50,7 +50,7 @@ namespace OpenSim.Data.PGSQL } } - + public override bool Delete(string principalID, string friend) { UUID princUUID = UUID.Zero; @@ -97,7 +97,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { - cmd.CommandText = String.Format("select a.*,case when b.\"Flags\" is null then '-1' else b.\"Flags\" end as \"TheirFlags\" from {0} as a " + + cmd.CommandText = String.Format("select a.*,case when b.\"Flags\" is null then '-1' else b.\"Flags\" end as \"TheirFlags\" from {0} as a " + " left join {0} as b on a.\"PrincipalID\" = b.\"Friend\" and a.\"Friend\" = b.\"PrincipalID\" " + " where a.\"PrincipalID\" = :PrincipalID", m_Realm); cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID.ToString())); @@ -111,6 +111,6 @@ namespace OpenSim.Data.PGSQL { return GetFriends(principalID); } - + } } diff --git a/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs b/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs index 061de22eff..5b247200d3 100644 --- a/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs +++ b/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs @@ -64,7 +64,7 @@ namespace OpenSim.Data.PGSQL : base(connectionString) { m_Realm = realm; - + m_ConnectionString = connectionString; if (storeName != String.Empty) @@ -104,7 +104,7 @@ namespace OpenSim.Data.PGSQL m_FieldTypes = new Dictionary(); string query = string.Format(@"select column_name,data_type - from INFORMATION_SCHEMA.COLUMNS + from INFORMATION_SCHEMA.COLUMNS where table_name = lower('{0}'); ", m_Realm); @@ -232,7 +232,7 @@ namespace OpenSim.Data.PGSQL if (reader == null) return new T[0]; - CheckColumnNames(reader); + CheckColumnNames(reader); while (reader.Read()) { @@ -339,7 +339,7 @@ namespace OpenSim.Data.PGSQL names.Add(fi.Name); values.Add(":" + fi.Name); // Temporarily return more information about what field is unexpectedly null for - // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the + // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the // InventoryTransferModule or we may be required to substitute a DBNull here. if (fi.GetValue(row) == null) throw new NullReferenceException( @@ -395,11 +395,11 @@ namespace OpenSim.Data.PGSQL } string where = String.Join(" AND ", terms.ToArray()); query.AppendFormat(" WHERE {0} ", where); - + } cmd.Connection = conn; cmd.CommandText = query.ToString(); - + conn.Open(); if (cmd.ExecuteNonQuery() > 0) { @@ -416,7 +416,7 @@ namespace OpenSim.Data.PGSQL query.Append("\") values (" + String.Join(",", values.ToArray()) + ")"); cmd.Connection = conn; cmd.CommandText = query.ToString(); - + // m_log.WarnFormat("[PGSQLGenericTable]: Inserting into {0} sql {1}", m_Realm, cmd.CommandText); if (conn.State != ConnectionState.Open) diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs index e257e7c723..6ef576bccc 100755 --- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs +++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs @@ -37,7 +37,7 @@ using Npgsql; namespace OpenSim.Data.PGSQL { public class PGSQLGroupsData : IGroupsData - { + { private PGSqlGroupsGroupsHandler m_Groups; private PGSqlGroupsMembershipHandler m_Membership; private PGSqlGroupsRolesHandler m_Roles; @@ -83,17 +83,17 @@ namespace OpenSim.Data.PGSQL public GroupData[] RetrieveGroups(string pattern) { - + if (string.IsNullOrEmpty(pattern)) // True for where clause { pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100"; - + return m_Groups.Get(pattern); } - else - { + else + { pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100"; - + return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); } } @@ -138,10 +138,10 @@ namespace OpenSim.Data.PGSQL public bool DeleteMember(UUID groupID, string pricipalID) { - return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, + return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, new string[] { groupID.ToString(), pricipalID }); } - + public int MemberCount(UUID groupID) { return (int)m_Membership.GetCount("GroupID", groupID.ToString()); @@ -173,7 +173,7 @@ namespace OpenSim.Data.PGSQL public bool DeleteRole(UUID groupID, UUID roleID) { - return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, + return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, new string[] { groupID.ToString(), roleID.ToString() }); } @@ -365,7 +365,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) + public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) : base(connectionString, realm, store) { } @@ -380,7 +380,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsMembershipHandler(string connectionString, string realm) + public PGSqlGroupsMembershipHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -395,7 +395,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsRolesHandler(string connectionString, string realm) + public PGSqlGroupsRolesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -410,7 +410,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) + public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -425,7 +425,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsInvitesHandler(string connectionString, string realm) + public PGSqlGroupsInvitesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -436,7 +436,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); - + ExecuteNonQuery(cmd); } @@ -451,7 +451,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsNoticesHandler(string connectionString, string realm) + public PGSqlGroupsNoticesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -462,7 +462,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); - + ExecuteNonQuery(cmd); } @@ -477,7 +477,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) + public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } diff --git a/OpenSim/Data/PGSQL/PGSQLInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLInventoryData.cs index c9994332fa..30fc5ea574 100644 --- a/OpenSim/Data/PGSQL/PGSQLInventoryData.cs +++ b/OpenSim/Data/PGSQL/PGSQLInventoryData.cs @@ -69,7 +69,7 @@ namespace OpenSim.Data.PGSQL { m_connectionString = connectionString; database = new PGSQLManager(connectionString); - + //New migrations check of store database.CheckMigration(_migrationStore); } @@ -190,8 +190,8 @@ namespace OpenSim.Data.PGSQL /* NOTE: the implementation below is very inefficient (makes a separate request to get subfolders for * every found folder, recursively). Inventory code for other DBs has been already rewritten to get ALL * inventory for a specific user at once. - * - * Meanwhile, one little thing is corrected: getFolderHierarchy(UUID.Zero) doesn't make sense and should never + * + * Meanwhile, one little thing is corrected: getFolderHierarchy(UUID.Zero) doesn't make sense and should never * be used, so check for that and return an empty list. */ @@ -264,11 +264,11 @@ namespace OpenSim.Data.PGSQL /// Folder to update public void updateInventoryFolder(InventoryFolderBase folder) { - string sql = @"UPDATE inventoryfolders SET ""agentID"" = :agentID, + string sql = @"UPDATE inventoryfolders SET ""agentID"" = :agentID, ""parentFolderID"" = :parentFolderID, ""folderName"" = :folderName, type = :type, - version = :version + version = :version WHERE folderID = :folderID"; string folderName = folder.Name; @@ -337,7 +337,7 @@ namespace OpenSim.Data.PGSQL cmd.Parameters.Add(database.CreateParameter("parentID", UUID.Zero)); conn.Open(); subFolders = getFolderHierarchy(folderID, cmd); - + //Delete all sub-folders foreach (InventoryFolderBase f in subFolders) @@ -403,7 +403,7 @@ namespace OpenSim.Data.PGSQL } } } - + m_log.InfoFormat("[INVENTORY DB]: Found no inventory item with ID : {0}", itemID); return null; } @@ -420,24 +420,24 @@ namespace OpenSim.Data.PGSQL return; } - string sql = @"INSERT INTO inventoryitems - (""inventoryID"", ""assetID"", ""assetType"", ""parentFolderID"", ""avatarID"", ""inventoryName"", + string sql = @"INSERT INTO inventoryitems + (""inventoryID"", ""assetID"", ""assetType"", ""parentFolderID"", ""avatarID"", ""inventoryName"", ""inventoryDescription"", ""inventoryNextPermissions"", ""inventoryCurrentPermissions"", ""invType"", ""creatorID"", ""inventoryBasePermissions"", ""inventoryEveryOnePermissions"", ""inventoryGroupPermissions"", - ""salePrice"", ""SaleType"", ""creationDate"", ""groupID"", ""groupOwned"", flags) + ""salePrice"", ""SaleType"", ""creationDate"", ""groupID"", ""groupOwned"", flags) VALUES (:inventoryID, :assetID, :assetType, :parentFolderID, :avatarID, :inventoryName, :inventoryDescription, :inventoryNextPermissions, :inventoryCurrentPermissions, :invType, :creatorID, :inventoryBasePermissions, :inventoryEveryOnePermissions, :inventoryGroupPermissions, :SalePrice, :SaleType, :creationDate, :groupID, :groupOwned, :flags)"; - + string itemName = item.Name; if (item.Name.Length > 64) { itemName = item.Name.Substring(0, 64); m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters"); } - + string itemDesc = item.Description; if (item.Description.Length > 128) { @@ -502,25 +502,25 @@ namespace OpenSim.Data.PGSQL /// Inventory item to update public void updateInventoryItem(InventoryItemBase item) { - string sql = @"UPDATE inventoryitems SET ""assetID"" = :assetID, + string sql = @"UPDATE inventoryitems SET ""assetID"" = :assetID, ""assetType"" = :assetType, ""parentFolderID"" = :parentFolderID, ""avatarID"" = :avatarID, - ""inventoryName"" = :inventoryName, - ""inventoryDescription"" = :inventoryDescription, - ""inventoryNextPermissions"" = :inventoryNextPermissions, - ""inventoryCurrentPermissions"" = :inventoryCurrentPermissions, - ""invType"" = :invType, - ""creatorID"" = :creatorID, - ""inventoryBasePermissions"" = :inventoryBasePermissions, - ""inventoryEveryOnePermissions"" = :inventoryEveryOnePermissions, - ""inventoryGroupPermissions"" = :inventoryGroupPermissions, - ""salePrice"" = :SalePrice, - ""saleType"" = :SaleType, - ""creationDate"" = :creationDate, - ""groupID"" = :groupID, - ""groupOwned"" = :groupOwned, - flags = :flags + ""inventoryName"" = :inventoryName, + ""inventoryDescription"" = :inventoryDescription, + ""inventoryNextPermissions"" = :inventoryNextPermissions, + ""inventoryCurrentPermissions"" = :inventoryCurrentPermissions, + ""invType"" = :invType, + ""creatorID"" = :creatorID, + ""inventoryBasePermissions"" = :inventoryBasePermissions, + ""inventoryEveryOnePermissions"" = :inventoryEveryOnePermissions, + ""inventoryGroupPermissions"" = :inventoryGroupPermissions, + ""salePrice"" = :SalePrice, + ""saleType"" = :SaleType, + ""creationDate"" = :creationDate, + ""groupID"" = :groupID, + ""groupOwned"" = :groupOwned, + flags = :flags WHERE ""inventoryID"" = :inventoryID"; string itemName = item.Name; @@ -529,7 +529,7 @@ namespace OpenSim.Data.PGSQL itemName = item.Name.Substring(0, 64); m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters on update"); } - + string itemDesc = item.Description; if (item.Description.Length > 128) { diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index af5a7cd02d..276a37cbb5 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs @@ -326,7 +326,7 @@ namespace OpenSim.Data.PGSQL /// migrationStore. public void CheckMigration(string migrationStore) { - using (NpgsqlConnection connection = new NpgsqlConnection(connectionString)) + using (NpgsqlConnection connection = new NpgsqlConnection(connectionString)) { connection.Open(); Assembly assem = GetType().Assembly; diff --git a/OpenSim/Data/PGSQL/PGSQLMigration.cs b/OpenSim/Data/PGSQL/PGSQLMigration.cs index 709fde04f2..749a3f2bd0 100644 --- a/OpenSim/Data/PGSQL/PGSQLMigration.cs +++ b/OpenSim/Data/PGSQL/PGSQLMigration.cs @@ -54,8 +54,8 @@ namespace OpenSim.Data.PGSQL { try { - cmd.CommandText = "select version from migrations where name = '" + type + "' " + - " order by version desc limit 1"; //Must be + cmd.CommandText = "select version from migrations where name = '" + type + "' " + + " order by version desc limit 1"; //Must be using (NpgsqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) diff --git a/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs b/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs index 82e5ed829e..a0c354227a 100644 --- a/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs +++ b/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs @@ -47,7 +47,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); - + ExecuteNonQuery(cmd); } diff --git a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs index 0376585863..ebbe8d35d1 100755 --- a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs +++ b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs @@ -80,7 +80,7 @@ namespace OpenSim.Data.PGSQL PresenceData[] pd = Get("SessionID", sessionID.ToString()); if (pd.Length == 0) return false; - + if (regionID == UUID.Zero) return false; @@ -103,7 +103,7 @@ namespace OpenSim.Data.PGSQL public bool VerifyAgent(UUID agentId, UUID secureSessionID) { PresenceData[] ret = Get("SecureSessionID", secureSessionID.ToString()); - + if (ret.Length == 0) return false; diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs index fc352c3905..1272e37d96 100644 --- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs +++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs @@ -57,7 +57,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSQLRegionData(string connectionString, string realm) + public PGSQLRegionData(string connectionString, string realm) { m_Realm = realm; m_ConnectionString = connectionString; @@ -77,7 +77,7 @@ namespace OpenSim.Data.PGSQL m_FieldTypes = new Dictionary(); string query = string.Format(@"select column_name,data_type - from INFORMATION_SCHEMA.COLUMNS + from INFORMATION_SCHEMA.COLUMNS where table_name = lower('{0}'); ", m_Realm); @@ -107,7 +107,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) { cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName)); - if (scopeID != UUID.Zero) + if (scopeID != UUID.Zero) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); return RunCommand(cmd); @@ -134,7 +134,7 @@ namespace OpenSim.Data.PGSQL cmd.Parameters.Add(m_database.CreateParameter("startY", startY)); cmd.Parameters.Add(m_database.CreateParameter("endX", endX)); cmd.Parameters.Add(m_database.CreateParameter("endY", endY)); - if (scopeID != UUID.Zero) + if (scopeID != UUID.Zero) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); ret = RunCommand(cmd); @@ -167,7 +167,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) { cmd.Parameters.Add(m_database.CreateParameter("regionID", regionID)); - if (scopeID != UUID.Zero) + if (scopeID != UUID.Zero) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); List ret = RunCommand(cmd); @@ -196,7 +196,7 @@ namespace OpenSim.Data.PGSQL cmd.Parameters.Add(m_database.CreateParameter("startY", qstartY)); cmd.Parameters.Add(m_database.CreateParameter("endX", endX)); cmd.Parameters.Add(m_database.CreateParameter("endY", endY)); - if (scopeID != UUID.Zero) + if (scopeID != UUID.Zero) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); @@ -298,7 +298,7 @@ namespace OpenSim.Data.PGSQL { string update = "update " + m_Realm + " set \"locX\"=:posX, \"locY\"=:posY, \"sizeX\"=:sizeX, \"sizeY\"=:sizeY "; - + foreach (string field in fields) { diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 902aae0ae5..33d12bd71e 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -110,11 +110,11 @@ namespace OpenSim.Data.PGSQL Dictionary objects = new Dictionary(); SceneObjectGroup grp = null; - string sql = @"SELECT *, - CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort - FROM prims - LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID"" - WHERE ""RegionUUID"" = :RegionUUID + string sql = @"SELECT *, + CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort + FROM prims + LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID"" + WHERE ""RegionUUID"" = :RegionUUID ORDER BY ""SceneGroupID"" asc, sort asc, ""LinkNumber"" asc"; using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) @@ -146,7 +146,7 @@ namespace OpenSim.Data.PGSQL // There sometimes exist OpenSim bugs that 'orphan groups' so that none of the prims are // recorded as the root prim (for which the UUID must equal the persisted group UUID). In // this case, force the UUID to be the same as the group UUID so that at least these can be - // deleted (we need to change the UUID so that any other prims in the linkset can also be + // deleted (we need to change the UUID so that any other prims in the linkset can also be // deleted). if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero) { @@ -178,7 +178,7 @@ namespace OpenSim.Data.PGSQL objects[grp.UUID] = grp; // Instead of attempting to LoadItems on every prim, - // most of which probably have no items... get a + // most of which probably have no items... get a // list from DB of all prims which have items and // LoadItems only on those List primsWithInventory = new List(); @@ -331,52 +331,52 @@ namespace OpenSim.Data.PGSQL private void StoreSceneObjectPrim(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID) { //Big query to update or insert a new prim. - + string queryPrims = @" - UPDATE prims SET - ""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName, - ""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask, - ""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ, - ""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX, - ""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY, - ""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY, - ""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW, - ""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ, - ""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY, - ""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID, - ""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2, - ""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain, - ""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX, - ""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX, - ""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook, - ""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice, - ""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem, + UPDATE prims SET + ""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName, + ""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask, + ""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ, + ""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX, + ""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY, + ""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY, + ""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW, + ""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ, + ""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY, + ""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID, + ""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2, + ""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain, + ""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX, + ""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX, + ""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook, + ""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice, + ""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem, ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches, ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution WHERE ""UUID"" = :UUID ; - INSERT INTO + INSERT INTO prims ( ""UUID"", ""CreationDate"", ""Name"", ""Text"", ""Description"", ""SitName"", ""TouchName"", ""ObjectFlags"", ""OwnerMask"", ""NextOwnerMask"", ""GroupMask"", - ""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"", - ""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"", - ""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"", - ""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"", - ""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"", - ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"", - ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", + ""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"", + ""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"", + ""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"", + ""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"", + ""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"", + ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"", + ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"", ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"" - ) Select - :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, - :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, - :VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ, - :RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW, - :SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID, - :PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX, - :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ, - :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, + ) Select + :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, + :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, + :VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ, + :RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW, + :SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID, + :PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX, + :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ, + :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs, :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID); @@ -401,26 +401,26 @@ namespace OpenSim.Data.PGSQL private void StoreSceneObjectPrimShapes(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID) { //Big query to or insert or update primshapes - + string queryPrimShapes = @" - UPDATE primshapes SET - ""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin, - ""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY, - ""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions, - ""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin, - ""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow, + UPDATE primshapes SET + ""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin, + ""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY, + ""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions, + ""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin, + ""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow, ""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media WHERE ""UUID"" = :UUID ; - INSERT INTO + INSERT INTO primshapes ( - ""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"", - ""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"", + ""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"", + ""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"", ""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media"" - ) + ) Select - :UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY, - :PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin, + :UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY, + :PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin, :ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID); "; @@ -500,7 +500,7 @@ namespace OpenSim.Data.PGSQL sql = @"INSERT INTO primitems ( ""itemID"",""primID"",""assetID"",""parentFolderID"",""invType"",""assetType"",""name"",""description"",""creationDate"",""creatorID"",""ownerID"",""lastOwnerID"",""groupID"", - ""nextPermissions"",""currentPermissions"",""basePermissions"",""everyonePermissions"",""groupPermissions"",""flags"") + ""nextPermissions"",""currentPermissions"",""basePermissions"",""everyonePermissions"",""groupPermissions"",""flags"") VALUES (:itemID,:primID,:assetID,:parentFolderID,:invType,:assetType,:name,:description,:creationDate,:creatorID,:ownerID, :lastOwnerID,:groupID,:nextPermissions,:currentPermissions,:basePermissions,:everyonePermissions,:groupPermissions,:flags)"; @@ -538,7 +538,7 @@ namespace OpenSim.Data.PGSQL { TerrainData terrData = null; - string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from terrain + string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from terrain where ""RegionUUID"" = :RegionUUID order by ""Revision"" desc limit 1; "; using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) @@ -577,7 +577,7 @@ namespace OpenSim.Data.PGSQL { TerrainData terrData = null; - string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from bakedterrain + string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from bakedterrain where ""RegionUUID"" = :RegionUUID; "; using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) @@ -1319,7 +1319,7 @@ namespace OpenSim.Data.PGSQL { { string sql = "DELETE FROM regionenvironment WHERE region_id = :region_id ;"; - + using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) { @@ -1420,17 +1420,17 @@ namespace OpenSim.Data.PGSQL { //This method only updates region settings!!! First call LoadRegionSettings to create new region settings in DB sql = - @"UPDATE regionsettings SET block_terraform = :block_terraform ,block_fly = :block_fly ,allow_damage = :allow_damage -,restrict_pushing = :restrict_pushing ,allow_land_resell = :allow_land_resell ,allow_land_join_divide = :allow_land_join_divide -,block_show_in_search = :block_show_in_search ,agent_limit = :agent_limit ,object_bonus = :object_bonus ,maturity = :maturity -,disable_scripts = :disable_scripts ,disable_collisions = :disable_collisions ,disable_physics = :disable_physics -,terrain_texture_1 = :terrain_texture_1 ,terrain_texture_2 = :terrain_texture_2 ,terrain_texture_3 = :terrain_texture_3 -,terrain_texture_4 = :terrain_texture_4 ,elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw -,elevation_1_ne = :elevation_1_ne ,elevation_2_ne = :elevation_2_ne ,elevation_1_se = :elevation_1_se ,elevation_2_se = :elevation_2_se -,elevation_1_sw = :elevation_1_sw ,elevation_2_sw = :elevation_2_sw ,water_height = :water_height ,terrain_raise_limit = :terrain_raise_limit -,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position -,covenant = :covenant ,covenant_datetime = :covenant_datetime, sunvectorx = :sunvectorx, sunvectory = :sunvectory, sunvectorz = :sunvectorz, -""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID, + @"UPDATE regionsettings SET block_terraform = :block_terraform ,block_fly = :block_fly ,allow_damage = :allow_damage +,restrict_pushing = :restrict_pushing ,allow_land_resell = :allow_land_resell ,allow_land_join_divide = :allow_land_join_divide +,block_show_in_search = :block_show_in_search ,agent_limit = :agent_limit ,object_bonus = :object_bonus ,maturity = :maturity +,disable_scripts = :disable_scripts ,disable_collisions = :disable_collisions ,disable_physics = :disable_physics +,terrain_texture_1 = :terrain_texture_1 ,terrain_texture_2 = :terrain_texture_2 ,terrain_texture_3 = :terrain_texture_3 +,terrain_texture_4 = :terrain_texture_4 ,elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw +,elevation_1_ne = :elevation_1_ne ,elevation_2_ne = :elevation_2_ne ,elevation_1_se = :elevation_1_se ,elevation_2_se = :elevation_2_se +,elevation_1_sw = :elevation_1_sw ,elevation_2_sw = :elevation_2_sw ,water_height = :water_height ,terrain_raise_limit = :terrain_raise_limit +,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position +,covenant = :covenant ,covenant_datetime = :covenant_datetime, sunvectorx = :sunvectorx, sunvectory = :sunvectory, sunvectorz = :sunvectorz, +""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID, ""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID WHERE ""regionUUID"" = :regionUUID"; @@ -1465,13 +1465,13 @@ namespace OpenSim.Data.PGSQL elevation_2_ne,elevation_1_se,elevation_2_se,elevation_1_sw,elevation_2_sw,water_height,terrain_raise_limit, terrain_lower_limit,use_estate_sun,fixed_sun,sun_position,covenant,covenant_datetime,sunvectorx, sunvectory, sunvectorz, ""Sandbox"", loaded_creation_datetime, loaded_creation_id - ) + ) VALUES (:regionUUID,:block_terraform,:block_fly,:allow_damage,:restrict_pushing,:allow_land_resell,:allow_land_join_divide, :block_show_in_search,:agent_limit,:object_bonus,:maturity,:disable_scripts,:disable_collisions,:disable_physics, :terrain_texture_1,:terrain_texture_2,:terrain_texture_3,:terrain_texture_4,:elevation_1_nw,:elevation_2_nw,:elevation_1_ne, :elevation_2_ne,:elevation_1_se,:elevation_2_se,:elevation_1_sw,:elevation_2_sw,:water_height,:terrain_raise_limit, - :terrain_lower_limit,:use_estate_sun,:fixed_sun,:sun_position,:covenant, :covenant_datetime, :sunvectorx,:sunvectory, + :terrain_lower_limit,:use_estate_sun,:fixed_sun,:sun_position,:covenant, :covenant_datetime, :sunvectorx,:sunvectory, :sunvectorz, :Sandbox, :loaded_creation_datetime, :loaded_creation_id )"; using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) @@ -1626,7 +1626,7 @@ namespace OpenSim.Data.PGSQL newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); - + newData.SeeAVs = Convert.ToBoolean(row["SeeAVs"]); newData.AnyAVSounds = Convert.ToBoolean(row["AnyAVSounds"]); newData.GroupAVSounds = Convert.ToBoolean(row["GroupAVSounds"]); @@ -1789,7 +1789,7 @@ namespace OpenSim.Data.PGSQL if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "") prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); else - prim.DynAttrs = new DAMap(); + prim.DynAttrs = new DAMap(); prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]); prim.Density = Convert.ToSingle(primRow["Density"]); @@ -2195,17 +2195,17 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("CollisionSound", prim.CollisionSound)); parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume)); - + parameters.Add(_Database.CreateParameter("PassTouches", prim.PassTouches)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); - + if (prim.DynAttrs.CountNamespaces > 0) parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); else parameters.Add(_Database.CreateParameter("DynAttrs", null)); - + parameters.Add(_Database.CreateParameter("PhysicsShapeType", prim.PhysicsShapeType)); parameters.Add(_Database.CreateParameter("Density", (double)prim.Density)); parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier)); diff --git a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs index a2b5a2aa52..64cfff03b1 100644 --- a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs +++ b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs @@ -42,13 +42,13 @@ namespace OpenSim.Data.PGSQL { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public PGSQLUserAccountData(string connectionString, string realm) : base(connectionString, realm, "UserAccount") { } - - /* + + /* private string m_Realm; private List m_ColumnNames = null; private PGSQLManager m_database; @@ -122,7 +122,7 @@ namespace OpenSim.Data.PGSQL { cmd.Parameters.Add(m_database.CreateParameter("principalID", principalID)); cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); - + conn.Open(); using (NpgsqlDataReader result = cmd.ExecuteReader()) { @@ -158,8 +158,8 @@ namespace OpenSim.Data.PGSQL } return null; } - - + + public override bool Store(UserAccountData data) { if (data.Data.ContainsKey("PrincipalID")) @@ -214,7 +214,7 @@ namespace OpenSim.Data.PGSQL catch (Exception e){ m_log.ErrorFormat("[USER]: ERROR opened update user {0} ", e.Message); } - + if (conta < 1) { @@ -242,14 +242,14 @@ namespace OpenSim.Data.PGSQL } return true; } - + public bool Store(UserAccountData data, UUID principalID, string token) { return false; } - + public bool SetDataItem(UUID principalID, string item, string value) { string sql = string.Format(@"update {0} set {1} = :{1} where ""UUID"" = :UUID", m_Realm, item); @@ -299,7 +299,7 @@ namespace OpenSim.Data.PGSQL string sql = ""; UUID scope_id; - UUID.TryParse(scopeID.ToString(), out scope_id); + UUID.TryParse(scopeID.ToString(), out scope_id); using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) using (NpgsqlCommand cmd = new NpgsqlCommand()) diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs index f1669766af..75a51e2de1 100644 --- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs +++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs @@ -412,15 +412,15 @@ namespace OpenSim.Data.PGSQL query = @"WITH upsert AS ( UPDATE userpicks SET pickuuid = :PickId, creatoruuid = :CreatorId, toppick = :TopPick, parceluuid = :ParcelId, - name = :Name, description = :Desc, snapshotuuid = :SnapshotId, ""user"" = :User, - originalname = :Original, simname = :SimName, posglobal = :GlobalPos, - sortorder = :SortOrder, enabled = :Enabled - RETURNING * ) + name = :Name, description = :Desc, snapshotuuid = :SnapshotId, ""user"" = :User, + originalname = :Original, simname = :SimName, posglobal = :GlobalPos, + sortorder = :SortOrder, enabled = :Enabled + RETURNING * ) INSERT INTO userpicks (pickuuid,creatoruuid,toppick,parceluuid,name,description, - snapshotuuid,""user"",originalname,simname,posglobal,sortorder,enabled) + snapshotuuid,""user"",originalname,simname,posglobal,sortorder,enabled) SELECT :PickId,:CreatorId,:TopPick,:ParcelId,:Name,:Desc,:SnapshotId,:User, - :Original,:SimName,:GlobalPos,:SortOrder,:Enabled + :Original,:SimName,:GlobalPos,:SortOrder,:Enabled WHERE NOT EXISTS ( SELECT * FROM upsert )"; diff --git a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs index d3518cf536..6e884898f5 100644 --- a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs +++ b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs @@ -141,7 +141,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand( @"SELECT name, description, access_time, ""AssetType"", local, temporary, asset_flags, creatorid, data - FROM XAssetsMeta + FROM XAssetsMeta JOIN XAssetsData ON XAssetsMeta.hash = XAssetsData.Hash WHERE id=:ID", dbcon)) { @@ -179,7 +179,7 @@ namespace OpenSim.Data.PGSQL WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue); // int compressedLength = asset.Data.Length; asset.Data = outputStream.ToArray(); - + // m_log.DebugFormat( // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}", // asset.ID, asset.Name, asset.Data.Length, compressedLength); @@ -223,16 +223,16 @@ namespace OpenSim.Data.PGSQL { assetName = asset.Name.Substring(0, 64); m_log.WarnFormat( - "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Name, asset.ID, asset.Name.Length, assetName.Length); } - + string assetDescription = asset.Description; if (asset.Description.Length > 64) { assetDescription = asset.Description.Substring(0, 64); m_log.WarnFormat( - "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } @@ -268,8 +268,8 @@ namespace OpenSim.Data.PGSQL where not exists( Select id from XAssetsMeta where id = :ID); update XAssetsMeta - set id = :ID, hash = :Hash, name = :Name, description = :Description, - ""AssetType"" = :AssetType, local = :Local, temporary = :Temporary, create_time = :CreateTime, + set id = :ID, hash = :Hash, name = :Name, description = :Description, + ""AssetType"" = :AssetType, local = :Local, temporary = :Temporary, create_time = :CreateTime, access_time = :AccessTime, asset_flags = :AssetFlags, creatorid = :CreatorID where id = :ID; ", @@ -321,13 +321,13 @@ namespace OpenSim.Data.PGSQL { m_log.ErrorFormat("[XASSET DB]: PGSQL failure creating asset data {0} with name \"{1}\". Error: {2}", asset.FullID, asset.Name, e.Message); - + transaction.Rollback(); - + return; } } - + transaction.Commit(); } } @@ -374,7 +374,7 @@ namespace OpenSim.Data.PGSQL catch (Exception e) { m_log.ErrorFormat( - "[XASSET PGSQL DB]: Failure updating access_time for asset {0} with name {1} : {2}", + "[XASSET PGSQL DB]: Failure updating access_time for asset {0} with name {1} : {2}", assetMetadata.ID, assetMetadata.Name, e.Message); } } @@ -519,7 +519,7 @@ namespace OpenSim.Data.PGSQL { dbcon.Open(); using(NpgsqlCommand cmd = new NpgsqlCommand(@"SELECT name, description, access_time, ""AssetType"", temporary, id, asset_flags, creatorid - FROM XAssetsMeta + FROM XAssetsMeta LIMIT :start, :count",dbcon)) { cmd.Parameters.Add(m_database.CreateParameter("start",start)); diff --git a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs index 959c2cf393..55a1996f51 100644 --- a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs +++ b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs @@ -197,16 +197,16 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { /* - cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" - from inventoryitems - where ""avatarID"" = :PrincipalID - and ""assetID"" = :AssetID + cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" + from inventoryitems + where ""avatarID"" = :PrincipalID + and ""assetID"" = :AssetID group by ""assetID"" ", m_Realm); */ - cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" - from inventoryitems + cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" + from inventoryitems where ""avatarID""::uuid = :PrincipalID - and ""assetID"" = :AssetID + and ""assetID"" = :AssetID group by ""assetID"" "); cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 9c2bd2e46e..966d0b8bea 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -138,7 +138,7 @@ namespace OpenSim.Data.SQLite { assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); m_log.WarnFormat( - "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Name, asset.ID, asset.Name.Length, assetName.Length); } @@ -147,7 +147,7 @@ namespace OpenSim.Data.SQLite { assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); m_log.WarnFormat( - "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index 0428c11f76..8fb955c799 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs @@ -45,7 +45,7 @@ namespace OpenSim.Data.SQLite public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private string m_Realm; private List m_ColumnNames; private int m_LastExpire; @@ -223,7 +223,7 @@ namespace OpenSim.Data.SQLite if (System.Environment.TickCount - m_LastExpire > 30000) DoExpire(); - using (SqliteCommand cmd = new SqliteCommand("insert into tokens (UUID, token, validity) values ('" + principalID.ToString() + + using (SqliteCommand cmd = new SqliteCommand("insert into tokens (UUID, token, validity) values ('" + principalID.ToString() + "', '" + token + "', datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes'))")) { if (ExecuteNonQuery(cmd, m_Connection) > 0) @@ -238,7 +238,7 @@ namespace OpenSim.Data.SQLite if (System.Environment.TickCount - m_LastExpire > 30000) DoExpire(); - using (SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() + + using (SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')")) { if (ExecuteNonQuery(cmd, m_Connection) > 0) diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index d51f2d413d..0fcab21824 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -190,7 +190,7 @@ namespace OpenSim.Data.SQLite IDataReader r = null; using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) - { + { names.Remove("EstateID"); string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; @@ -386,15 +386,15 @@ namespace OpenSim.Data.SQLite return DoLoad(cmd, UUID.Zero, false); } } - + public List LoadEstateSettingsAll() { List estateSettings = new List(); - + List estateIds = GetEstatesAll(); foreach (int estateId in estateIds) estateSettings.Add(LoadEstateSettings(estateId)); - + return estateSettings; } @@ -421,7 +421,7 @@ namespace OpenSim.Data.SQLite return result; } - + public List GetEstatesAll() { List result = new List(); @@ -442,7 +442,7 @@ namespace OpenSim.Data.SQLite } r.Close(); - return result; + return result; } public List GetEstatesByOwner(UUID ownerID) diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 9fbeb100ce..a4b84b1d15 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs @@ -189,7 +189,7 @@ namespace OpenSim.Data.SQLite m_Fields[name].SetValue(row, reader[name]); } } - + if (m_DataField != null) { Dictionary data = @@ -268,7 +268,7 @@ namespace OpenSim.Data.SQLite public virtual bool Delete(string field, string key) { return Delete(new string[] { field }, new string[] { key }); - } + } public virtual bool Delete(string[] fields, string[] keys) { diff --git a/OpenSim/Data/SQLite/SQLiteGridUserData.cs b/OpenSim/Data/SQLite/SQLiteGridUserData.cs index d8c52f8880..987240cd5a 100644 --- a/OpenSim/Data/SQLite/SQLiteGridUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteGridUserData.cs @@ -43,7 +43,7 @@ namespace OpenSim.Data.SQLite { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public SQLiteGridUserData(string connectionString, string realm) + public SQLiteGridUserData(string connectionString, string realm) : base(connectionString, realm, "GridUserStore") {} public new GridUserData Get(string userID) diff --git a/OpenSim/Data/SQLite/SQLiteHGTravelData.cs b/OpenSim/Data/SQLite/SQLiteHGTravelData.cs index db288b2486..dd347109bb 100644 --- a/OpenSim/Data/SQLite/SQLiteHGTravelData.cs +++ b/OpenSim/Data/SQLite/SQLiteHGTravelData.cs @@ -44,7 +44,7 @@ namespace OpenSim.Data.SQLite { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public SQLiteHGTravelData(string connectionString, string realm) + public SQLiteHGTravelData(string connectionString, string realm) : base(connectionString, realm, "HGTravelStore") {} public HGTravelingData Get(UUID sessionID) diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 5cfc202384..eec386fcb0 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -707,7 +707,7 @@ namespace OpenSim.Data.SQLite DataRow[] primsForRegion = prims.Select(byRegion); // m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); - // First, create all groups + // First, create all groups foreach (DataRow primRow in primsForRegion) { try @@ -733,12 +733,12 @@ namespace OpenSim.Data.SQLite } SceneObjectGroup group = new SceneObjectGroup(prim); - + createdObjects.Add(group.UUID, group); retvals.Add(group); LoadItems(prim); - + } } catch (Exception e) @@ -1298,7 +1298,7 @@ namespace OpenSim.Data.SQLite createCol(prims, "VolumeDetect", typeof(Int16)); createCol(prims, "MediaURL", typeof(String)); - + createCol(prims, "AttachedPosX", typeof(Double)); createCol(prims, "AttachedPosY", typeof(Double)); createCol(prims, "AttachedPosZ", typeof(Double)); @@ -1795,7 +1795,7 @@ namespace OpenSim.Data.SQLite // m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); prim.MediaUrl = (string)row["MediaURL"]; } - + prim.AttachedPos = new Vector3( Convert.ToSingle(row["AttachedPosX"]), Convert.ToSingle(row["AttachedPosY"]), @@ -1806,7 +1806,7 @@ namespace OpenSim.Data.SQLite { //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); - } + } else { prim.DynAttrs = new DAMap(); @@ -1818,7 +1818,7 @@ namespace OpenSim.Data.SQLite prim.Friction = Convert.ToSingle(row["Friction"]); prim.Restitution = Convert.ToSingle(row["Restitution"]); - + if (!(row["KeyframeMotion"] is DBNull)) { Byte[] data = (byte[])row["KeyframeMotion"]; @@ -2532,7 +2532,7 @@ namespace OpenSim.Data.SQLite if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); - + return s; } diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 91d62cea4e..1b79185953 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs @@ -75,7 +75,7 @@ namespace OpenSim.Data.SQLite } else { - cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", + cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", m_Realm, scopeID.ToString(), words[0], words[1]); } diff --git a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs index 2dfdba3817..13aac79049 100644 --- a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs @@ -46,43 +46,43 @@ namespace OpenSim.Data.SQLite { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private SqliteConnection m_connection; private string m_connectionString; - + private Dictionary m_FieldMap = new Dictionary(); - + protected virtual Assembly Assembly { get { return GetType().Assembly; } } - + public SQLiteUserProfilesData() { } - + public SQLiteUserProfilesData(string connectionString) { Initialise(connectionString); } - + public void Initialise(string connectionString) { if (Util.IsWindows()) Util.LoadArchSpecificWindowsDll("sqlite3.dll"); - + m_connectionString = connectionString; - + m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString); - + m_connection = new SqliteConnection(m_connectionString); m_connection.Open(); - + Migration m = new Migration(m_connection, Assembly, "UserProfiles"); m.Update(); } - + private string[] FieldList { get { return new List(m_FieldMap.Keys).ToArray(); } @@ -123,7 +123,7 @@ namespace OpenSim.Data.SQLite } reader.Close(); - + return data; } public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) @@ -162,21 +162,21 @@ namespace OpenSim.Data.SQLite query += ":ParcelName,"; query += ":Flags,"; query += ":ListingPrice ) "; - + if(string.IsNullOrEmpty(ad.ParcelName)) ad.ParcelName = "Unknown"; if(ad.ParcelId == null) ad.ParcelId = UUID.Zero; if(string.IsNullOrEmpty(ad.Description)) ad.Description = "No Description"; - + DateTime epoch = new DateTime(1970, 1, 1); DateTime now = DateTime.Now; TimeSpan epochnow = now - epoch; TimeSpan duration; DateTime expiration; TimeSpan epochexp; - + if(ad.Flags == 2) { duration = new TimeSpan(7,0,0,0); @@ -211,7 +211,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.AddWithValue(":ParcelName", ad.ParcelName.ToString()); cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString()); cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ()); - + cmd.ExecuteNonQuery(); } } @@ -227,17 +227,17 @@ namespace OpenSim.Data.SQLite public bool DeleteClassifiedRecord(UUID recordId) { string query = string.Empty; - + query += "DELETE FROM classifieds WHERE "; query += "classifieduuid = :ClasifiedId"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) { cmd.CommandText = query; cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -254,17 +254,17 @@ namespace OpenSim.Data.SQLite { IDataReader reader = null; string query = string.Empty; - + query += "SELECT * FROM classifieds WHERE "; query += "classifieduuid = :AdId"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) { cmd.CommandText = query; cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString()); - + using (reader = cmd.ExecuteReader()) { if(reader.Read ()) @@ -299,24 +299,24 @@ namespace OpenSim.Data.SQLite { IDataReader reader = null; string query = string.Empty; - + query += "SELECT `pickuuid`,`name` FROM userpicks WHERE "; query += "creatoruuid = :Id"; OSDArray data = new OSDArray(); - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) { cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); - + using (reader = cmd.ExecuteReader()) { while (reader.Read()) { OSDMap record = new OSDMap(); - + record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"])); record.Add("name",OSD.FromString((string)reader["name"])); data.Add(record); @@ -336,11 +336,11 @@ namespace OpenSim.Data.SQLite IDataReader reader = null; string query = string.Empty; UserProfilePick pick = new UserProfilePick(); - + query += "SELECT * FROM userpicks WHERE "; query += "creatoruuid = :CreatorId AND "; query += "pickuuid = :PickId"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -348,17 +348,17 @@ namespace OpenSim.Data.SQLite cmd.CommandText = query; cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString()); cmd.Parameters.AddWithValue(":PickId", pickId.ToString()); - + using (reader = cmd.ExecuteReader()) { - + while (reader.Read()) { string description = (string)reader["description"]; - + if (string.IsNullOrEmpty(description)) description = "No description given."; - + UUID.TryParse((string)reader["pickuuid"], out pick.PickId); UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId); UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId); @@ -385,7 +385,7 @@ namespace OpenSim.Data.SQLite } public bool UpdatePicksRecord(UserProfilePick pick) - { + { string query = string.Empty; query += "INSERT OR REPLACE INTO userpicks ("; @@ -416,7 +416,7 @@ namespace OpenSim.Data.SQLite query += ":GlobalPos,"; query += ":SortOrder,"; query += ":Enabled) "; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -456,10 +456,10 @@ namespace OpenSim.Data.SQLite public bool DeletePicksRecord(UUID pickId) { string query = string.Empty; - + query += "DELETE FROM userpicks WHERE "; query += "pickuuid = :PickId"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -479,15 +479,15 @@ namespace OpenSim.Data.SQLite } public bool GetAvatarNotes(ref UserProfileNotes notes) - { + { IDataReader reader = null; string query = string.Empty; - + query += "SELECT `notes` FROM usernotes WHERE "; query += "useruuid = :Id AND "; query += "targetuuid = :TargetId"; OSDArray data = new OSDArray(); - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -495,7 +495,7 @@ namespace OpenSim.Data.SQLite cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString()); cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString()); - + using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { while (reader.Read()) @@ -514,10 +514,10 @@ namespace OpenSim.Data.SQLite } public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result) - { + { string query = string.Empty; bool remove; - + if(string.IsNullOrEmpty(note.Notes)) { remove = true; @@ -533,7 +533,7 @@ namespace OpenSim.Data.SQLite query += ":TargetId,"; query += ":Notes )"; } - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -544,7 +544,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.AddWithValue(":Notes", note.Notes); cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ()); cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -561,7 +561,7 @@ namespace OpenSim.Data.SQLite { IDataReader reader = null; string query = string.Empty; - + query += "SELECT * FROM userprofile WHERE "; query += "useruuid = :Id"; @@ -569,7 +569,7 @@ namespace OpenSim.Data.SQLite { cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); - + try { @@ -611,7 +611,7 @@ namespace OpenSim.Data.SQLite props.Language = string.Empty; props.PublishProfile = false; props.PublishMature = false; - + query = "INSERT INTO userprofile ("; query += "useruuid, "; query += "profilePartner, "; @@ -659,7 +659,7 @@ namespace OpenSim.Data.SQLite put.Parameters.AddWithValue(":profileAboutText", props.AboutText); put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString()); put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText); - + put.ExecuteNonQuery(); } } @@ -668,9 +668,9 @@ namespace OpenSim.Data.SQLite } public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result) - { + { string query = string.Empty; - + query += "UPDATE userprofile SET "; query += "profileURL=:profileURL, "; query += "profileImage=:image, "; @@ -678,7 +678,7 @@ namespace OpenSim.Data.SQLite query += "profileFirstImage=:firstlifeimage,"; query += "profileFirstText=:firstlifetext "; query += "WHERE useruuid=:uuid"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -690,7 +690,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.AddWithValue(":firstlifeimage", props.FirstLifeImageId.ToString()); cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText); cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -698,16 +698,16 @@ namespace OpenSim.Data.SQLite { m_log.ErrorFormat("[PROFILES_DATA]" + ": AgentPropertiesUpdate exception {0}", e.Message); - + return false; } return true; } public bool UpdateAvatarInterests(UserProfileProperties up, ref string result) - { + { string query = string.Empty; - + query += "UPDATE userprofile SET "; query += "profileWantToMask=:WantMask, "; query += "profileWantToText=:WantText,"; @@ -715,7 +715,7 @@ namespace OpenSim.Data.SQLite query += "profileSkillsText=:SkillsText, "; query += "profileLanguages=:Languages "; query += "WHERE useruuid=:uuid"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -727,7 +727,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText); cmd.Parameters.AddWithValue(":Languages", up.Language); cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -741,17 +741,17 @@ namespace OpenSim.Data.SQLite return true; } - + public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) - { + { string query = string.Empty; - + query += "UPDATE usersettings SET "; query += "imviaemail=:ImViaEmail, "; query += "visible=:Visible, "; query += "email=:EMail "; query += "WHERE useruuid=:uuid"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -761,7 +761,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.AddWithValue(":Visible", pref.Visible); cmd.Parameters.AddWithValue(":EMail", pref.EMail); cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString()); - + cmd.ExecuteNonQuery(); } } @@ -779,20 +779,20 @@ namespace OpenSim.Data.SQLite { IDataReader reader = null; string query = string.Empty; - + query += "SELECT imviaemail,visible,email FROM "; query += "usersettings WHERE "; query += "useruuid = :Id"; - + OSDArray data = new OSDArray(); - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) { cmd.CommandText = query; cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); - + using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.Read()) @@ -805,13 +805,13 @@ namespace OpenSim.Data.SQLite { query = "INSERT INTO usersettings VALUES "; query += "(:Id,'false','false', :Email)"; - + using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) { put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); put.Parameters.AddWithValue(":Email", pref.EMail); put.ExecuteNonQuery(); - + } } } @@ -831,11 +831,11 @@ namespace OpenSim.Data.SQLite { IDataReader reader = null; string query = string.Empty; - + query += "SELECT * FROM `userdata` WHERE "; query += "UserId = :Id AND "; query += "TagId = :TagId"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -843,7 +843,7 @@ namespace OpenSim.Data.SQLite cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString()); - + using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.Read()) @@ -858,7 +858,7 @@ namespace OpenSim.Data.SQLite query += ":TagId,"; query += ":DataKey,"; query += ":DataVal) "; - + using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) { put.Parameters.AddWithValue(":Id", props.UserId.ToString()); @@ -882,16 +882,16 @@ namespace OpenSim.Data.SQLite return true; } public bool SetUserAppData(UserAppData props, ref string result) - { + { string query = string.Empty; - + query += "UPDATE userdata SET "; query += "TagId = :TagId, "; query += "DataKey = :DataKey, "; query += "DataVal = :DataVal WHERE "; query += "UserId = :UserId AND "; query += "TagId = :TagId"; - + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) @@ -918,17 +918,17 @@ namespace OpenSim.Data.SQLite IDataReader reader = null; OSDArray data = new OSDArray(); string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id"; - + // Get classified image assets - - + + try { using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) { cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); - + using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { while(reader.Read()) @@ -942,7 +942,7 @@ namespace OpenSim.Data.SQLite { cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); - + using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.Read()) @@ -951,14 +951,14 @@ namespace OpenSim.Data.SQLite } } } - + query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id"; - + using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) { cmd.CommandText = query; cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); - + using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if(reader.Read()) diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs index ca5861fefd..1218ebbb94 100644 --- a/OpenSim/Data/SQLite/SQLiteUtils.cs +++ b/OpenSim/Data/SQLite/SQLiteUtils.cs @@ -49,7 +49,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -147,7 +147,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// Data Table /// @@ -191,7 +191,7 @@ namespace OpenSim.Data.SQLite /// lines for defining SqliteParameters to 2 parameters: /// column name and database type. /// - /// + /// /// /// It assumes certain conventions like :param as the param /// name to replace in parametrized queries, and that source diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 2a0a8f6cc9..7f44a651e9 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -107,7 +107,7 @@ namespace OpenSim.Data.SQLite public bool DeleteItems(string[] fields, string[] vals) { return m_Items.Delete(fields, vals); - } + } public bool MoveItem(string id, string newParent) { @@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite { // m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); // Util.PrintCallStack(); - + using (SqliteCommand cmd = new SqliteCommand()) { cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID"; diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs index 5982a091df..70880cf83a 100644 --- a/OpenSim/Data/Tests/AssetTests.cs +++ b/OpenSim/Data/Tests/AssetTests.cs @@ -110,7 +110,7 @@ namespace OpenSim.Data.Tests public void T010_StoreReadVerifyAssets() { TestHelpers.InMethod(); - + AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); @@ -128,7 +128,7 @@ namespace OpenSim.Data.Tests a1.UploadAttempts = 0; a2.UploadAttempts = 0; a3.UploadAttempts = 0; - + AssetBase a1a = m_db.GetAsset(uuid1); a1a.UploadAttempts = 0; Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); @@ -190,7 +190,7 @@ namespace OpenSim.Data.Tests public void T020_CheckForWeirdCreatorID() { TestHelpers.InMethod(); - + // It is expected that eventually the CreatorID might be an arbitrary string (an URI) // rather than a valid UUID (?). This test is to make sure that the database layer does not // attempt to convert CreatorID to GUID, but just passes it both ways as a string. diff --git a/OpenSim/Data/Tests/BasicDataServiceTest.cs b/OpenSim/Data/Tests/BasicDataServiceTest.cs index acfebd0206..79691e48ac 100644 --- a/OpenSim/Data/Tests/BasicDataServiceTest.cs +++ b/OpenSim/Data/Tests/BasicDataServiceTest.cs @@ -41,11 +41,11 @@ using System.Reflection; namespace OpenSim.Data.Tests { - /// This is a base class for testing any Data service for any DBMS. + /// This is a base class for testing any Data service for any DBMS. /// Requires NUnit 2.5 or better (to support the generics). /// /// - /// FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with + /// FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with /// AssetTests`2 : System.MemberAccessException : Cannot create an instance of OpenSim.Data.Tests.AssetTests`2[TConn,TAssetData] because Type.ContainsGenericParameters is true. /// and similar on EstateTests, InventoryTests and RegionTests. /// Runs fine with mono 2.10.8.1, so easiest thing is to wait until min Mono version uplifts. @@ -60,7 +60,7 @@ namespace OpenSim.Data.Tests private TService m_service; private string m_file; - // TODO: Is this in the right place here? + // TODO: Is this in the right place here? // Later: apparently it's not, but does it matter here? // protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -68,7 +68,7 @@ namespace OpenSim.Data.Tests public BasicDataServiceTest() : this("") - { + { } public BasicDataServiceTest(string conn) @@ -226,7 +226,7 @@ namespace OpenSim.Data.Tests } } - /// Clear tables listed as parameters (without dropping them). + /// Clear tables listed as parameters (without dropping them). /// /// protected virtual void ResetMigrations(params string[] stores) @@ -251,7 +251,7 @@ namespace OpenSim.Data.Tests } } - /// Clear tables listed as parameters (without dropping them). + /// Clear tables listed as parameters (without dropping them). /// /// protected virtual void ClearTables(params string[] tables) diff --git a/OpenSim/Data/Tests/DefaultTestConns.cs b/OpenSim/Data/Tests/DefaultTestConns.cs index 7c47bddd21..5ad238b660 100644 --- a/OpenSim/Data/Tests/DefaultTestConns.cs +++ b/OpenSim/Data/Tests/DefaultTestConns.cs @@ -39,16 +39,16 @@ namespace OpenSim.Data.Tests /// a connection string for testing one of the supported databases. /// The connections must be in the section [TestConnections] with names matching the connection class /// name for the specific database, e.g.: - /// + /// /// [TestConnections] /// MySqlConnection="..." /// SqlConnection="..." /// SqliteConnection="..." - /// + /// /// Note that the conn string may also be set explicitly in the [TestCase()] attribute of test classes /// based on BasicDataServiceTest.cs. /// - + static class DefaultTestConns { private static Dictionary conns = new Dictionary(); @@ -63,8 +63,8 @@ namespace OpenSim.Data.Tests Assembly asm = Assembly.GetExecutingAssembly(); string sType = connType.Name; - // Note: when running from NUnit, the DLL is located in some temp dir, so how do we get - // to the INI file? Ok, so put it into the resources! + // Note: when running from NUnit, the DLL is located in some temp dir, so how do we get + // to the INI file? Ok, so put it into the resources! // string iniName = Path.Combine(Path.GetDirectoryName(asm.Location), "TestDataConnections.ini"); string[] allres = asm.GetManifestResourceNames(); diff --git a/OpenSim/Data/Tests/EstateTests.cs b/OpenSim/Data/Tests/EstateTests.cs index e2b2d12aaa..cf3f2b4602 100644 --- a/OpenSim/Data/Tests/EstateTests.cs +++ b/OpenSim/Data/Tests/EstateTests.cs @@ -100,7 +100,7 @@ namespace OpenSim.Data.Tests public void T010_EstateSettingsSimpleStorage_MinimumParameterSet() { TestHelpers.InMethod(); - + EstateSettingsSimpleStorage( REGION_ID, DataTestUtil.STRING_MIN, @@ -133,7 +133,7 @@ namespace OpenSim.Data.Tests public void T011_EstateSettingsSimpleStorage_MaximumParameterSet() { TestHelpers.InMethod(); - + EstateSettingsSimpleStorage( REGION_ID, DataTestUtil.STRING_MAX(64), @@ -166,7 +166,7 @@ namespace OpenSim.Data.Tests public void T012_EstateSettingsSimpleStorage_AccurateParameterSet() { TestHelpers.InMethod(); - + EstateSettingsSimpleStorage( REGION_ID, DataTestUtil.STRING_MAX(1), @@ -199,7 +199,7 @@ namespace OpenSim.Data.Tests public void T012_EstateSettingsRandomStorage() { TestHelpers.InMethod(); - + // Letting estate store generate rows to database for us EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); new PropertyScrambler() @@ -220,7 +220,7 @@ namespace OpenSim.Data.Tests public void T020_EstateSettingsManagerList() { TestHelpers.InMethod(); - + // Letting estate store generate rows to database for us EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); @@ -241,7 +241,7 @@ namespace OpenSim.Data.Tests public void T021_EstateSettingsUserList() { TestHelpers.InMethod(); - + // Letting estate store generate rows to database for us EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); @@ -262,7 +262,7 @@ namespace OpenSim.Data.Tests public void T022_EstateSettingsGroupList() { TestHelpers.InMethod(); - + // Letting estate store generate rows to database for us EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); @@ -283,7 +283,7 @@ namespace OpenSim.Data.Tests public void T022_EstateSettingsBanList() { TestHelpers.InMethod(); - + // Letting estate store generate rows to database for us EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); @@ -310,7 +310,7 @@ namespace OpenSim.Data.Tests #endregion - #region Parametrizable Test Implementations + #region Parametrizable Test Implementations private void EstateSettingsSimpleStorage( UUID regionId, diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs index e4ec5c18fe..da6e7d46fd 100644 --- a/OpenSim/Data/Tests/InventoryTests.cs +++ b/OpenSim/Data/Tests/InventoryTests.cs @@ -46,7 +46,7 @@ namespace OpenSim.Data.Tests { [TestFixture(Description = "Inventory store tests (MySQL)")] public class MySqlInventoryTests : InventoryTests - { + { } public class InventoryTests : BasicDataServiceTest @@ -102,7 +102,7 @@ namespace OpenSim.Data.Tests public void T001_LoadEmpty() { TestHelpers.InMethod(); - + Assert.That(db.getInventoryFolder(zero), Is.Null); Assert.That(db.getInventoryFolder(folder1), Is.Null); Assert.That(db.getInventoryFolder(folder2), Is.Null); @@ -122,7 +122,7 @@ namespace OpenSim.Data.Tests public void T010_FolderNonParent() { TestHelpers.InMethod(); - + InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2); // the folder will go in db.addInventoryFolder(f1); @@ -134,7 +134,7 @@ namespace OpenSim.Data.Tests public void T011_FolderCreate() { TestHelpers.InMethod(); - + InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1); // TODO: this is probably wrong behavior, but is what we have // db.updateInventoryFolder(f1); @@ -159,7 +159,7 @@ namespace OpenSim.Data.Tests public void T012_FolderList() { TestHelpers.InMethod(); - + InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); db.addInventoryFolder(f2); @@ -175,7 +175,7 @@ namespace OpenSim.Data.Tests public void T013_FolderHierarchy() { TestHelpers.InMethod(); - + int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned) Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); n = db.getFolderHierarchy(folder1).Count; @@ -190,7 +190,7 @@ namespace OpenSim.Data.Tests public void T014_MoveFolder() { TestHelpers.InMethod(); - + InventoryFolderBase f2 = db.getInventoryFolder(folder2); f2.ParentID = folder3; db.moveInventoryFolder(f2); @@ -206,7 +206,7 @@ namespace OpenSim.Data.Tests public void T015_FolderHierarchy() { TestHelpers.InMethod(); - + Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))"); Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))"); @@ -219,7 +219,7 @@ namespace OpenSim.Data.Tests public void T100_NoItems() { TestHelpers.InMethod(); - + Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))"); Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))"); @@ -233,7 +233,7 @@ namespace OpenSim.Data.Tests public void T101_CreatItems() { TestHelpers.InMethod(); - + db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); @@ -244,7 +244,7 @@ namespace OpenSim.Data.Tests public void T102_CompareItems() { TestHelpers.InMethod(); - + InventoryItemBase i1 = db.getInventoryItem(item1); InventoryItemBase i2 = db.getInventoryItem(item2); InventoryItemBase i3 = db.getInventoryItem(item3); @@ -263,7 +263,7 @@ namespace OpenSim.Data.Tests public void T103_UpdateItem() { TestHelpers.InMethod(); - + // TODO: probably shouldn't have the ability to have an // owner of an item in a folder not owned by the user @@ -283,7 +283,7 @@ namespace OpenSim.Data.Tests public void T104_RandomUpdateItem() { TestHelpers.InMethod(); - + PropertyScrambler folderScrambler = new PropertyScrambler() .DontScramble(x => x.Owner) @@ -342,7 +342,7 @@ namespace OpenSim.Data.Tests public void T999_StillNull() { TestHelpers.InMethod(); - + // After all tests are run, these should still return no results Assert.That(db.getInventoryFolder(zero), Is.Null); Assert.That(db.getInventoryItem(zero), Is.Null); diff --git a/OpenSim/Data/Tests/PropertyScrambler.cs b/OpenSim/Data/Tests/PropertyScrambler.cs index e0f5862b93..0d291df0b3 100644 --- a/OpenSim/Data/Tests/PropertyScrambler.cs +++ b/OpenSim/Data/Tests/PropertyScrambler.cs @@ -42,7 +42,7 @@ namespace OpenSim.Data.Tests public class PropertyScrambler { readonly System.Collections.Generic.List membersToNotScramble = new List(); - + private void AddExpressionToNotScrableList(Expression expression) { UnaryExpression unaryExpression = expression as UnaryExpression; diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index e1503d0378..4f81594993 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs @@ -83,7 +83,7 @@ namespace OpenSim.Data.Tests public UUID item3 = UUID.Random(); public static Random random = new Random(); - + public string itemname1 = "item1"; public uint localID = 1; @@ -111,10 +111,10 @@ namespace OpenSim.Data.Tests private void ClearDB() { - string[] reg_tables = new string[] { - "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" + string[] reg_tables = new string[] { + "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" }; - + if (m_rebuildDB) { DropTables(reg_tables); @@ -145,7 +145,7 @@ namespace OpenSim.Data.Tests public void T001_LoadEmpty() { TestHelpers.InMethod(); - + List objs = db.LoadObjects(region1); List objs3 = db.LoadObjects(region3); List land = db.LoadLandObjects(region1); @@ -154,21 +154,21 @@ namespace OpenSim.Data.Tests Assert.That(objs3.Count, Is.EqualTo(0), "Assert.That(objs3.Count, Is.EqualTo(0))"); Assert.That(land.Count, Is.EqualTo(0), "Assert.That(land.Count, Is.EqualTo(0))"); } - + // SOG round trips // * store objects, make sure they save - // * update + // * update [Test] public void T010_StoreSimpleObject() { TestHelpers.InMethod(); - + SceneObjectGroup sog = NewSOG("object1", prim1, region1); SceneObjectGroup sog2 = NewSOG("object2", prim2, region1); // in case the objects don't store - try + try { db.StoreObject(sog, region1); } @@ -177,8 +177,8 @@ namespace OpenSim.Data.Tests m_log.Error(e.ToString()); Assert.Fail(); } - - try + + try { db.StoreObject(sog2, region1); } @@ -190,15 +190,15 @@ namespace OpenSim.Data.Tests // This tests the ADO.NET driver List objs = db.LoadObjects(region1); - + Assert.That(objs.Count, Is.EqualTo(2), "Assert.That(objs.Count, Is.EqualTo(2))"); } - + [Test] public void T011_ObjectNames() { TestHelpers.InMethod(); - + List objs = db.LoadObjects(region1); foreach (SceneObjectGroup sog in objs) { @@ -207,12 +207,12 @@ namespace OpenSim.Data.Tests Assert.That(p.Name, Is.EqualTo(p.Description), "Assert.That(p.Name, Is.EqualTo(p.Description))"); } } - + [Test] public void T012_SceneParts() { TestHelpers.InMethod(); - + UUID tmp0 = UUID.Random(); UUID tmp1 = UUID.Random(); UUID tmp2 = UUID.Random(); @@ -225,10 +225,10 @@ namespace OpenSim.Data.Tests sog.AddPart(p1); sog.AddPart(p2); sog.AddPart(p3); - + SceneObjectPart[] parts = sog.Parts; Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); - + db.StoreObject(sog, newregion); List sogs = db.LoadObjects(newregion); Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); @@ -236,18 +236,18 @@ namespace OpenSim.Data.Tests SceneObjectPart[] newparts = newsog.Parts; Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); - + Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))"); Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))"); Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))"); Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))"); } - + [Test] public void T013_DatabasePersistency() { TestHelpers.InMethod(); - + // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently. @@ -298,7 +298,7 @@ namespace OpenSim.Data.Tests SceneObjectPart sop = new SceneObjectPart(); SceneObjectGroup sog = new SceneObjectGroup(sop); - + sop.RegionHandle = regionh; sop.UUID = uuid; sop.LocalId = localid; @@ -360,10 +360,10 @@ namespace OpenSim.Data.Tests Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))"); Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))"); Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); - + // This is necessary or object will not be inserted in DB sop.Flags = PrimFlags.None; - + // Inserts group in DB db.StoreObject(sog,region3); List sogs = db.LoadObjects(region3); @@ -372,7 +372,7 @@ namespace OpenSim.Data.Tests db.StoreObject(sog,region3); sogs = db.LoadObjects(region3); Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); - + // Tests if the parameters were inserted correctly SceneObjectPart p = sogs[0].RootPart; @@ -414,12 +414,12 @@ namespace OpenSim.Data.Tests Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd), "Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd))"); Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow), "Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow))"); } - + [Test] public void T014_UpdateObject() { TestHelpers.InMethod(); - + string text1 = "object1 text"; SceneObjectGroup sog = FindSOG("object1", region1); sog.RootPart.Text = text1; @@ -459,7 +459,7 @@ namespace OpenSim.Data.Tests PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); pbshap = PrimitiveBaseShape.Default; Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); - + // Updates the region with new values SceneObjectGroup sog2 = FindSOG("Adam West", region3); Assert.That(sog2,Is.Not.Null); @@ -488,11 +488,11 @@ namespace OpenSim.Data.Tests sog2.RootPart.LinkNum = linknum; sog2.RootPart.ClickAction = clickaction; sog2.RootPart.Scale = scale; - + db.StoreObject(sog2, region3); List sogs = db.LoadObjects(region3); Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); - + SceneObjectGroup retsog = FindSOG("West Adam", region3); Assert.That(retsog,Is.Not.Null); SceneObjectPart p = retsog.RootPart; @@ -519,7 +519,7 @@ namespace OpenSim.Data.Tests Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))"); Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))"); } - + /// /// Test storage and retrieval of a scene object with a large number of parts. /// @@ -527,12 +527,12 @@ namespace OpenSim.Data.Tests public void T015_LargeSceneObjects() { TestHelpers.InMethod(); - + UUID id = UUID.Random(); Dictionary mydic = new Dictionary(); SceneObjectGroup sog = NewSOG("Test SOG", id, region4); mydic.Add(sog.RootPart.UUID,sog.RootPart); - for (int i = 0; i < 30; i++) + for (int i = 0; i < 30; i++) { UUID tmp = UUID.Random(); SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); @@ -542,20 +542,20 @@ namespace OpenSim.Data.Tests Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); - + sop.GroupPosition = groupos; sop.RotationOffset = rotoff; sop.OffsetPosition = offset; sop.Velocity = velocity; sop.AngularVelocity = angvelo; sop.Acceleration = accel; - + mydic.Add(tmp,sop); - sog.AddPart(sop); + sog.AddPart(sop); } - + db.StoreObject(sog, region4); - + SceneObjectGroup retsog = FindSOG("Test SOG", region4); SceneObjectPart[] parts = retsog.Parts; for (int i = 0; i < 30; i++) @@ -574,7 +574,7 @@ namespace OpenSim.Data.Tests public void T016_RandomSogWithSceneParts() { TestHelpers.InMethod(); - + PropertyScrambler scrambler = new PropertyScrambler() .DontScramble(x => x.UUID); @@ -634,22 +634,22 @@ namespace OpenSim.Data.Tests SceneObjectGroup sog = FindSOG(name, region1); if (sog == null) { - sog = NewSOG(name, prim1, region1); + sog = NewSOG(name, prim1, region1); db.StoreObject(sog, region1); } return sog; } - + // NOTE: it is a bad practice to rely on some of the previous tests having been run before. // If the tests are run manually, one at a time, each starts with full class init (DB cleared). // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order. // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*! - + [Test] public void T020_PrimInventoryEmpty() { TestHelpers.InMethod(); - + SceneObjectGroup sog = GetMySOG("object1"); TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); Assert.That(t, Is.Null); @@ -673,14 +673,14 @@ namespace OpenSim.Data.Tests public void T021_PrimInventoryBasic() { TestHelpers.InMethod(); - + SceneObjectGroup sog = GetMySOG("object1"); InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True); TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))"); - + StoreInventory(sog); SceneObjectGroup sog1 = FindSOG("object1", region1); @@ -708,12 +708,12 @@ namespace OpenSim.Data.Tests t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); Assert.That(t, Is.Null); } - + [Test] public void T025_PrimInventoryPersistency() { TestHelpers.InMethod(); - + InventoryItemBase i = new InventoryItemBase(); UUID id = UUID.Random(); i.ID = id; @@ -752,11 +752,11 @@ namespace OpenSim.Data.Tests i.Flags = flags; int creationd = random.Next(); i.CreationDate = creationd; - + SceneObjectGroup sog = GetMySOG("object1"); Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True); TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id); - + Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))"); Assert.That(t.AssetID,Is.EqualTo(assetid), "Assert.That(t.AssetID,Is.EqualTo(assetid))"); Assert.That(t.BasePermissions,Is.EqualTo(baseperm), "Assert.That(t.BasePermissions,Is.EqualTo(baseperm))"); @@ -780,13 +780,13 @@ namespace OpenSim.Data.Tests Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); } - + [Test] [ExpectedException(typeof(ArgumentException))] public void T026_PrimInventoryMany() { TestHelpers.InMethod(); - + UUID i1,i2,i3,i4; i1 = UUID.Random(); i2 = UUID.Random(); @@ -796,14 +796,14 @@ namespace OpenSim.Data.Tests InventoryItemBase ib2 = NewItem(i2, zero, zero, RandomName(), zero); InventoryItemBase ib3 = NewItem(i3, zero, zero, RandomName(), zero); InventoryItemBase ib4 = NewItem(i4, zero, zero, RandomName(), zero); - + SceneObjectGroup sog = FindSOG("object1", region1); Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True); Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True); Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True); Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True); - + TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1); Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))"); TaskInventoryItem t2 = sog.GetInventoryItem(sog.RootPart.LocalId, i2); @@ -818,7 +818,7 @@ namespace OpenSim.Data.Tests public void T052_RemoveObject() { TestHelpers.InMethod(); - + db.RemoveObject(prim1, region1); SceneObjectGroup sog = FindSOG("object1", region1); Assert.That(sog, Is.Null); @@ -828,7 +828,7 @@ namespace OpenSim.Data.Tests public void T100_DefaultRegionInfo() { TestHelpers.InMethod(); - + RegionSettings r1 = db.LoadRegionSettings(region1); Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))"); @@ -840,7 +840,7 @@ namespace OpenSim.Data.Tests public void T101_UpdateRegionInfo() { TestHelpers.InMethod(); - + int agentlimit = random.Next(); double objectbonus = random.Next(); int maturity = random.Next(); @@ -900,9 +900,9 @@ namespace OpenSim.Data.Tests r1.FixedSun = true; r1.SunPosition = sunpos; r1.Covenant = cov; - + db.StoreRegionSettings(r1); - + RegionSettings r1a = db.LoadRegionSettings(region1); Assert.That(r1a.RegionUUID, Is.EqualTo(region1), "Assert.That(r1a.RegionUUID, Is.EqualTo(region1))"); Assert.That(r1a.BlockTerraform,Is.True); @@ -939,14 +939,14 @@ namespace OpenSim.Data.Tests //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))"); Assert.That(r1a.FixedSun,Is.True); Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))"); - Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); + Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); } [Test] public void T300_NoTerrain() { TestHelpers.InMethod(); - + Assert.That(db.LoadTerrain(zero), Is.Null); Assert.That(db.LoadTerrain(region1), Is.Null); Assert.That(db.LoadTerrain(region2), Is.Null); @@ -957,13 +957,13 @@ namespace OpenSim.Data.Tests public void T301_CreateTerrain() { TestHelpers.InMethod(); - + double[,] t1 = GenTerrain(height1); db.StoreTerrain(t1, region1); - + // store terrain is async Thread.Sleep(1000); - + Assert.That(db.LoadTerrain(zero), Is.Null); Assert.That(db.LoadTerrain(region1), Is.Not.Null); Assert.That(db.LoadTerrain(region2), Is.Null); @@ -974,7 +974,7 @@ namespace OpenSim.Data.Tests public void T302_FetchTerrain() { TestHelpers.InMethod(); - + double[,] baseterrain1 = GenTerrain(height1); double[,] baseterrain2 = GenTerrain(height2); double[,] t1 = db.LoadTerrain(region1); @@ -986,7 +986,7 @@ namespace OpenSim.Data.Tests public void T303_UpdateTerrain() { TestHelpers.InMethod(); - + double[,] baseterrain1 = GenTerrain(height1); double[,] baseterrain2 = GenTerrain(height2); db.StoreTerrain(baseterrain2, region1); @@ -1003,7 +1003,7 @@ namespace OpenSim.Data.Tests public void T400_EmptyLand() { TestHelpers.InMethod(); - + Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))"); Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))"); Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))"); @@ -1025,15 +1025,15 @@ namespace OpenSim.Data.Tests for (int x = 0; x < Constants.RegionSize; x++) for (int y = 0; y < Constants.RegionSize; y++) terret[x,y] = value; - + return terret; } - + private bool CompareTerrain(double[,] one, double[,] two) { for (int x = 0; x < Constants.RegionSize; x++) for (int y = 0; y < Constants.RegionSize; y++) - if (one[x,y] != two[x,y]) + if (one[x,y] != two[x,y]) return false; return true; @@ -1053,12 +1053,12 @@ namespace OpenSim.Data.Tests // common failure case is people adding new fields that aren't // initialized, but have non-null db constraints. We should // honestly be passing more and more null things in here. - // - // Please note that in Sqlite.BuildPrim there is a commented out inline version + // + // Please note that in Sqlite.BuildPrim there is a commented out inline version // of this so you can debug and step through the build process and check the fields - // + // // Real World Value: Tests for situation where extending a SceneObjectGroup/SceneObjectPart - // causes the application to crash at the database layer because of null values + // causes the application to crash at the database layer because of null values // in NOT NULL fields // private SceneObjectGroup NewSOG(string name, UUID uuid, UUID regionId) @@ -1082,7 +1082,7 @@ namespace OpenSim.Data.Tests return sog; } - + private SceneObjectPart NewSOP(string name, UUID uuid) { SceneObjectPart sop = new SceneObjectPart(); @@ -1096,7 +1096,7 @@ namespace OpenSim.Data.Tests return sop; } - // These are copied from the Inventory Item tests + // These are copied from the Inventory Item tests private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) { @@ -1114,7 +1114,7 @@ namespace OpenSim.Data.Tests private static string RandomName() { StringBuilder name = new StringBuilder(); - int size = random.Next(5,12); + int size = random.Next(5,12); char ch ; for (int i=0; i - /// Number given to the client when they log-in that they provide + /// Number given to the client when they log-in that they provide /// as credentials to the UDP server /// public uint circuitcode; @@ -328,7 +328,7 @@ namespace OpenSim.Framework Vector3.TryParse(args["start_pos"].AsString(), out startpos); //m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos); - + try { // Unpack various appearance elements @@ -353,7 +353,7 @@ namespace OpenSim.Framework { m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message); } - + ServiceURLs = new Dictionary(); // Try parse the new way, OSDMap if (args.ContainsKey("serviceurls") && args["serviceurls"] != null && (args["serviceurls"]).Type == OSDType.Map) diff --git a/OpenSim/Framework/AnimationSet.cs b/OpenSim/Framework/AnimationSet.cs index 6c5b15c11f..87c4a78ea9 100644 --- a/OpenSim/Framework/AnimationSet.cs +++ b/OpenSim/Framework/AnimationSet.cs @@ -84,7 +84,7 @@ namespace OpenSim.Framework it.GroupPermissions = 0; it.EveryOnePermissions = 0; } - + public int AnimationCount { get; private set; } private Dictionary> m_animations = new Dictionary>(); diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 87fd04affe..88edf2f802 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs @@ -112,7 +112,7 @@ namespace OpenSim.Framework { get { - return + return IsTextualAsset && ( Type != (sbyte)AssetType.Notecard && Type != (sbyte)AssetType.CallingCard @@ -137,7 +137,7 @@ namespace OpenSim.Framework { get { - return + return (Type == (sbyte)AssetType.Animation || Type == (sbyte)AssetType.Gesture || Type == (sbyte)AssetType.Simstate || @@ -282,7 +282,7 @@ namespace OpenSim.Framework return m_id; } - + set { UUID uuid = UUID.Zero; diff --git a/OpenSim/Framework/AssetLoader/Filesystem/Properties/AssemblyInfo.cs b/OpenSim/Framework/AssetLoader/Filesystem/Properties/AssemblyInfo.cs index d269e5ded9..b6ea077b33 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Framework.AssetLoader.Filesystem")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Framework/AssetRequestToClient.cs b/OpenSim/Framework/AssetRequestToClient.cs index d602c1f9b6..3dfbb91982 100644 --- a/OpenSim/Framework/AssetRequestToClient.cs +++ b/OpenSim/Framework/AssetRequestToClient.cs @@ -31,10 +31,10 @@ namespace OpenSim.Framework { /// /// This class was created to refactor OutPacket out of AssetCache - /// There is a conflict between + /// There is a conflict between /// OpenSim.Framework.Communications.Cache.AssetRequest and OpenSim.Framework.AssetRequest - /// and unifying them results in a prebuild chicken and egg problem with OpenSim.Framework requiring - /// OpenSim.Framework.Communications.Cache while OpenSim.Framework.Communications.Cache + /// and unifying them results in a prebuild chicken and egg problem with OpenSim.Framework requiring + /// OpenSim.Framework.Communications.Cache while OpenSim.Framework.Communications.Cache /// requiring OpenSim.Framework /// public class AssetRequestToClient diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 07c739d569..77a7621a29 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -53,7 +53,7 @@ namespace OpenSim.Framework // should be only used as initial default value ( V1 viewers ) public readonly static int VISUALPARAM_COUNT = 218; -// public readonly static int TEXTURE_COUNT = 21 +// public readonly static int TEXTURE_COUNT = 21 // 21 bad, make it be updated as libovm gets update // also keeping in sync with it public readonly static int TEXTURE_COUNT = Primitive.TextureEntry.MAX_FACES; @@ -121,7 +121,7 @@ namespace OpenSim.Framework get { return m_avatarHeight; } set { m_avatarHeight = value; } } - + public virtual WearableCacheItem[] WearableCacheItems { get { return m_cacheitems; } @@ -219,7 +219,7 @@ namespace OpenSim.Framework m_wearables[i] = new AvatarWearable(); AvatarWearable wearable = appearance.Wearables[i]; for (int j = 0; j < wearable.Count; j++) - m_wearables[i].Add(wearable[j].ItemID, wearable[j].AssetID); + m_wearables[i].Add(wearable[j].ItemID, wearable[j].AssetID); } } else @@ -291,18 +291,18 @@ namespace OpenSim.Framework public virtual void ResetAppearance() { // m_log.WarnFormat("[AVATAR APPEARANCE]: Reset appearance"); - + m_serial = 0; SetDefaultTexture(); - + //for (int i = 0; i < BAKE_INDICES.Length; i++) // { // int idx = BAKE_INDICES[i]; // m_texture.FaceTextures[idx].TextureID = UUID.Zero; // } } - + protected virtual void SetDefaultParams() { m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 }; @@ -319,14 +319,14 @@ namespace OpenSim.Framework public virtual void ResetBakedTextures() { SetDefaultTexture(); - + //for (int i = 0; i < BAKE_INDICES.Length; i++) // { // int idx = BAKE_INDICES[i]; // m_texture.FaceTextures[idx].TextureID = UUID.Zero; // } } - + protected virtual void SetDefaultTexture() { m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); @@ -371,7 +371,7 @@ namespace OpenSim.Framework } m_texture = textureEntry; - + return changed; } @@ -531,14 +531,14 @@ namespace OpenSim.Framework { lock (m_attachments) { - List alist = new List(); + List alist = new List(); foreach (KeyValuePair> kvp in m_attachments) { foreach (AvatarAttachment attach in kvp.Value) alist.Add(new AvatarAttachment(attach)); } - return alist; - } + return alist; + } } internal void AppendAttachment(AvatarAttachment attach) @@ -551,7 +551,7 @@ namespace OpenSim.Framework { if (!m_attachments.ContainsKey(attach.AttachPoint)) m_attachments[attach.AttachPoint] = new List(); - + foreach (AvatarAttachment prev in m_attachments[attach.AttachPoint]) { if (prev.ItemID == attach.ItemID) @@ -608,7 +608,7 @@ namespace OpenSim.Framework m_attachments.Remove(attachpoint); return true; } - + return false; } @@ -622,13 +622,13 @@ namespace OpenSim.Framework if (existingAttachment != null) { // m_log.DebugFormat( -// "[AVATAR APPEARANCE]: Found existing attachment for {0}, asset {1} at point {2}", +// "[AVATAR APPEARANCE]: Found existing attachment for {0}, asset {1} at point {2}", // existingAttachment.ItemID, existingAttachment.AssetID, existingAttachment.AttachPoint); if (existingAttachment.AssetID != UUID.Zero && existingAttachment.AttachPoint == (attachpoint & 0x7F)) { m_log.DebugFormat( - "[AVATAR APPEARANCE]: Ignoring attempt to attach an already attached item {0} at point {1}", + "[AVATAR APPEARANCE]: Ignoring attempt to attach an already attached item {0} at point {1}", item, attachpoint); return false; @@ -640,7 +640,7 @@ namespace OpenSim.Framework DetachAttachment(existingAttachment.ItemID); } } - + // check if this is an append or a replace, 0x80 marks it as an append if ((attachpoint & 0x80) > 0) { @@ -701,16 +701,16 @@ namespace OpenSim.Framework if (index >= 0) { // m_log.DebugFormat( -// "[AVATAR APPEARANCE]: Detaching attachment {0}, index {1}, point {2}", +// "[AVATAR APPEARANCE]: Detaching attachment {0}, index {1}, point {2}", // m_attachments[kvp.Key][index].ItemID, index, m_attachments[kvp.Key][index].AttachPoint); // Remove it from the list of attachments at that attach point m_attachments[kvp.Key].RemoveAt(index); - + // And remove the list if there are no more attachments here if (m_attachments[kvp.Key].Count == 0) m_attachments.Remove(kvp.Key); - + return true; } } @@ -867,7 +867,7 @@ namespace OpenSim.Framework { AvatarAttachment att = new AvatarAttachment((OSDMap)attachs[i]); AppendAttachment(att); - + // m_log.DebugFormat( // "[AVATAR APPEARANCE]: Unpacked attachment itemID {0}, assetID {1}, point {2}", // att.ItemID, att.AssetID, att.AttachPoint); @@ -1644,14 +1644,14 @@ namespace OpenSim.Framework SHAPE_EYELID_INNER_CORNER_UP = 214, SKIRT_SKIRT_RED = 215, SKIRT_SKIRT_GREEN = 216, - SKIRT_SKIRT_BLUE = 217, + SKIRT_SKIRT_BLUE = 217, /// /// Avatar Physics section. These are 0 type visual params which get transmitted. /// /// - /// Breast Part 1 + /// Breast Part 1 /// BREAST_PHYSICS_MASS = 218, BREAST_PHYSICS_GRAVITY = 219, @@ -1697,7 +1697,7 @@ namespace OpenSim.Framework BREAST_PHYSICS_LEFTRIGHT_GAIN = 249, BREAST_PHYSICS_LEFTRIGHT_DAMPING = 250, - // Ubit: 07/96/2013 new parameters + // Ubit: 07/96/2013 new parameters _APPEARANCEMESSAGE_VERSION = 251, //ID 11000 SHAPE_HOVER = 252, //ID 11001 diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 7bc46edea9..0e8f9608f0 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -96,7 +96,7 @@ namespace OpenSim.Framework // public static readonly UUID DEFAULT_TATTOO_ITEM = new UUID("c47e22bd-3021-4ba4-82aa-2b5cb34d35e1"); // public static readonly UUID DEFAULT_TATTOO_ASSET = new UUID("00000000-0000-2222-3333-100000001007"); - + protected Dictionary m_items = new Dictionary(); protected List m_ids = new List(); @@ -234,10 +234,10 @@ namespace OpenSim.Framework { defaultWearables[i] = new AvatarWearable(); } - + // Body defaultWearables[BODY].Add(DEFAULT_BODY_ITEM, DEFAULT_BODY_ASSET); - + // Hair defaultWearables[HAIR].Add(DEFAULT_HAIR_ITEM, DEFAULT_HAIR_ASSET); @@ -252,7 +252,7 @@ namespace OpenSim.Framework // Pants defaultWearables[PANTS].Add(DEFAULT_PANTS_ITEM, DEFAULT_PANTS_ASSET); - + // // Alpha // defaultWearables[ALPHA].Add(DEFAULT_ALPHA_ITEM, DEFAULT_ALPHA_ASSET); diff --git a/OpenSim/Framework/BasicDOSProtector.cs b/OpenSim/Framework/BasicDOSProtector.cs index 89bfa94191..f1ff18f5cb 100644 --- a/OpenSim/Framework/BasicDOSProtector.cs +++ b/OpenSim/Framework/BasicDOSProtector.cs @@ -31,7 +31,7 @@ using log4net; namespace OpenSim.Framework { - + public class BasicDOSProtector { public enum ThrottleAction @@ -43,7 +43,7 @@ namespace OpenSim.Framework private readonly BasicDosProtectorOptions _options; private readonly Dictionary> _deeperInspection; // per client request checker private readonly Dictionary _tempBlocked; // blocked list - private readonly Dictionary _sessions; + private readonly Dictionary _sessions; private readonly System.Timers.Timer _forgetTimer; // Cleanup timer private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly System.Threading.ReaderWriterLockSlim _blockLockSlim = new System.Threading.ReaderWriterLockSlim(); @@ -133,7 +133,7 @@ namespace OpenSim.Framework else throw new System.Security.SecurityException("Throttled"); } - + _blockLockSlim.ExitReadLock(); lock (_generalRequestTimes) @@ -169,10 +169,10 @@ namespace OpenSim.Framework _blockLockSlim.ExitWriteLock(); } - + } - else + else ProcessConcurrency(key, endpoint); } if (_generalRequestTimes.Size == _generalRequestTimes.Capacity && @@ -194,7 +194,7 @@ namespace OpenSim.Framework _sessionLockSlim.EnterWriteLock(); if (_sessions.ContainsKey(key)) _sessions[key] = _sessions[key] + 1; - else + else _sessions.Add(key,1); _sessionLockSlim.ExitWriteLock(); } @@ -209,7 +209,7 @@ namespace OpenSim.Framework } else _sessions.Add(key, 1); - + _sessionLockSlim.ExitWriteLock(); } diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs index f6861e49d2..2461049107 100644 --- a/OpenSim/Framework/BlockingQueue.cs +++ b/OpenSim/Framework/BlockingQueue.cs @@ -65,7 +65,7 @@ namespace OpenSim.Framework if (m_pqueue.Count > 0) return m_pqueue.Dequeue(); - + if (m_queue.Count > 0) return m_queue.Dequeue(); return default(T); diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs index 80f5ff44ee..7ccc320acd 100644 --- a/OpenSim/Framework/Cache.cs +++ b/OpenSim/Framework/Cache.cs @@ -356,10 +356,10 @@ namespace OpenSim.Framework Expire(true); return null; } - + item.hits++; item.lastUsed = DateTime.UtcNow; - + Expire(true); } diff --git a/OpenSim/Framework/CapsUtil.cs b/OpenSim/Framework/CapsUtil.cs index 4baf505784..020f6e26bd 100644 --- a/OpenSim/Framework/CapsUtil.cs +++ b/OpenSim/Framework/CapsUtil.cs @@ -43,7 +43,7 @@ namespace OpenSim.Framework { return "CAPS/" + capsObjectPath + "0000/"; } - + /// /// Get a random CAPS object path component that will be used as the identifying part of all future CAPS requests /// diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 61c870eb5d..0e5eaf218d 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -332,7 +332,7 @@ namespace OpenSim.Framework public Vector3 UpAxis; /// - /// Signal on a V2 teleport that Scene.IncomingChildAgentDataUpdate(AgentData ad) should wait for the + /// Signal on a V2 teleport that Scene.IncomingChildAgentDataUpdate(AgentData ad) should wait for the /// scene presence to become root (triggered when the viewer sends a CompleteAgentMovement UDP packet after /// establishing the connection triggered by it's receipt of a TeleportFinish EQ message). /// @@ -434,7 +434,7 @@ namespace OpenSim.Framework args["active_group_name"] = OSD.FromString(ActiveGroupName); if(ActiveGroupTitle != null) args["active_group_title"] = OSD.FromString(ActiveGroupTitle); - + if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0) { OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); @@ -623,7 +623,7 @@ namespace OpenSim.Framework if (args.ContainsKey("active_group_name") && args["active_group_name"] != null) ActiveGroupName = args["active_group_name"].AsString(); - + if(args.ContainsKey("active_group_title") && args["active_group_title"] != null) ActiveGroupTitle = args["active_group_title"].AsString(); @@ -843,7 +843,7 @@ namespace OpenSim.Framework public class CompleteAgentData : AgentData { - public override OSDMap Pack(EntityTransferContext ctx) + public override OSDMap Pack(EntityTransferContext ctx) { return base.Pack(ctx); } diff --git a/OpenSim/Framework/CircularBuffer.cs b/OpenSim/Framework/CircularBuffer.cs index e919337a70..e101938bab 100644 --- a/OpenSim/Framework/CircularBuffer.cs +++ b/OpenSim/Framework/CircularBuffer.cs @@ -1,21 +1,21 @@ /* -Copyright (c) 2012, Alex Regueiro +Copyright (c) 2012, Alex Regueiro All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ +*/ using System; using System.Collections; using System.Collections.Generic; diff --git a/OpenSim/Framework/CnmMemoryCache.cs b/OpenSim/Framework/CnmMemoryCache.cs index 92af331102..f996cb0bd0 100644 --- a/OpenSim/Framework/CnmMemoryCache.cs +++ b/OpenSim/Framework/CnmMemoryCache.cs @@ -36,14 +36,14 @@ namespace OpenSim.Framework /// Cenome memory based cache to store key/value pairs (elements) limited time and/or limited size. /// /// - /// The type of keys in the cache. + /// The type of keys in the cache. /// /// - /// The type of values in the dictionary. + /// The type of values in the dictionary. /// /// /// - /// Cenome memory cache stores elements to hash table generations. When new element is being added to cache, and new size would exceed + /// Cenome memory cache stores elements to hash table generations. When new element is being added to cache, and new size would exceed /// maximal allowed size or maximal amount of allowed element count, then elements in oldest generation are deleted. Last access time /// is also tracked in generation level - thus it is possible that some elements are staying in cache far beyond their expiration time. /// If elements in older generations are accessed through method, they are moved to newest generation. @@ -176,7 +176,7 @@ namespace OpenSim.Framework } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Maximal cache size. @@ -201,7 +201,7 @@ namespace OpenSim.Framework } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Maximal cache size. @@ -218,7 +218,7 @@ namespace OpenSim.Framework } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Maximal cache size. @@ -336,7 +336,7 @@ namespace OpenSim.Framework /// private void CheckExpired() { - // Do this only one in every m_operationsBetweenTimeChecks + // Do this only one in every m_operationsBetweenTimeChecks // Fetching time is using several millisecons - it is better not to do all time. m_operationsBetweenTimeChecks--; if (m_operationsBetweenTimeChecks <= 0) @@ -394,7 +394,7 @@ namespace OpenSim.Framework new IEnumerator>[2]; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The cache. @@ -456,7 +456,7 @@ namespace OpenSim.Framework /// if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection. /// /// - /// The collection was modified after the enumerator was created. + /// The collection was modified after the enumerator was created. /// /// 2 public bool MoveNext() @@ -479,7 +479,7 @@ namespace OpenSim.Framework /// Sets the enumerator to its initial position, which is before the first element in the collection. /// /// - /// The collection was modified after the enumerator was created. + /// The collection was modified after the enumerator was created. /// /// 2 public void Reset() @@ -548,7 +548,7 @@ namespace OpenSim.Framework private DateTime m_expirationTime1; /// - /// Index to first free element. + /// Index to first free element. /// private int m_firstFreeElement; @@ -681,8 +681,8 @@ namespace OpenSim.Framework /// Next element in chain. /// /// - /// When element have value (something is stored to it), this is index of - /// next element with same bucket index. When element is free, this + /// When element have value (something is stored to it), this is index of + /// next element with same bucket index. When element is free, this /// is index of next element in free element's list. /// public int Next; @@ -696,7 +696,7 @@ namespace OpenSim.Framework public long Size; /// - /// Element's value. + /// Element's value. /// /// /// It is possible that this value is even when element @@ -812,7 +812,7 @@ namespace OpenSim.Framework /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. /// /// - /// The collection was modified after the enumerator was created. + /// The collection was modified after the enumerator was created. /// public bool MoveNext() { @@ -841,7 +841,7 @@ namespace OpenSim.Framework /// Sets the enumerator to its initial position, which is before the first element in the collection. /// /// - /// The collection was modified after the enumerator was created. + /// The collection was modified after the enumerator was created. /// /// 2 public void Reset() @@ -931,7 +931,7 @@ namespace OpenSim.Framework /// The key to locate in the . /// /// - /// if the contains an element with the ; + /// if the contains an element with the ; /// otherwise . /// public bool Contains(int bucketIndex, TKey key) @@ -1014,7 +1014,7 @@ namespace OpenSim.Framework /// /// /// - /// If element was already existing in generation and new element size fits to collection limits, + /// If element was already existing in generation and new element size fits to collection limits, /// then it's value is replaced with new one and size information is updated. If element didn't /// exists in generation before, then generation must have empty space for a new element and /// size must fit generation's limits, before element is added to generation. @@ -1070,7 +1070,7 @@ namespace OpenSim.Framework if (Size - m_elements[ elementIndex ].Size + size > m_cache.m_generationMaxSize) { // Generation is full - // Remove existing element, because generation is going to be recycled to + // Remove existing element, because generation is going to be recycled to // old generation and element is stored to new generation RemoveElement(bucketIndex, elementIndex, previousIndex); return false; @@ -1110,12 +1110,12 @@ namespace OpenSim.Framework /// /// /// If element is not found from generation then and - /// are set to default value (default(TValue) and 0). + /// are set to default value (default(TValue) and 0). /// /// public bool TryGetValue(int bucketIndex, TKey key, out TValue value, out long size) { - // Find entry index, + // Find entry index, int previousIndex; int elementIndex = FindElementIndex(bucketIndex, key, m_newGeneration, out previousIndex); if (elementIndex == -1) @@ -1166,7 +1166,7 @@ namespace OpenSim.Framework /// /// /// There are two kind generations: "new generation" and "old generation(s)". All new elements - /// are added to "new generation". + /// are added to "new generation". /// /// protected interface IGeneration : IEnumerable> @@ -1211,7 +1211,7 @@ namespace OpenSim.Framework /// The key to locate in the . /// /// - /// if the contains an element with the ; + /// if the contains an element with the ; /// otherwise . /// bool Contains(int bucketIndex, TKey key); @@ -1259,7 +1259,7 @@ namespace OpenSim.Framework /// /// /// - /// If element was already existing in generation and new element size fits to collection limits, + /// If element was already existing in generation and new element size fits to collection limits, /// then it's value is replaced with new one and size information is updated. If element didn't /// exists in generation before, then generation must have empty space for a new element and /// size must fit generation's limits, before element is added to generation. @@ -1288,7 +1288,7 @@ namespace OpenSim.Framework /// /// /// If element is not found from generation then and - /// are set to default value (default(TValue) and 0). + /// are set to default value (default(TValue) and 0). /// /// bool TryGetValue(int bucketIndex, TKey key, out TValue value, out long size); @@ -1303,8 +1303,8 @@ namespace OpenSim.Framework /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -1324,13 +1324,13 @@ namespace OpenSim.Framework /// /// /// - /// When element has been stored in longer than - /// and it is not accessed through method or element's value is - /// not replaced by method, then it is automatically removed from the + /// When element has been stored in longer than + /// and it is not accessed through method or element's value is + /// not replaced by method, then it is automatically removed from the /// . /// /// - /// It is possible that implementation removes element before it's expiration time, + /// It is possible that implementation removes element before it's expiration time, /// because total size or count of elements stored to cache is larger than or . /// /// @@ -1375,17 +1375,17 @@ namespace OpenSim.Framework /// Gets a value indicating whether is limiting count of elements. /// /// - /// if the count of elements is limited; - /// otherwise, . + /// if the count of elements is limited; + /// otherwise, . /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// - /// + /// /// /// public bool IsCountLimited @@ -1397,13 +1397,13 @@ namespace OpenSim.Framework /// Gets a value indicating whether is limiting size of elements. /// /// - /// if the total size of elements is limited; - /// otherwise, . + /// if the total size of elements is limited; + /// otherwise, . /// /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -1420,12 +1420,12 @@ namespace OpenSim.Framework /// Gets a value indicating whether or not access to the is synchronized (thread safe). /// /// - /// if access to the is synchronized (thread safe); - /// otherwise, . + /// if access to the is synchronized (thread safe); + /// otherwise, . /// /// /// - /// To get synchronized (thread safe) access to object, use + /// To get synchronized (thread safe) access to object, use /// in class /// to retrieve synchronized wrapper for object. /// @@ -1441,13 +1441,13 @@ namespace OpenSim.Framework /// Gets a value indicating whether elements stored to have limited inactivity time. /// /// - /// if the has a fixed total size of elements; - /// otherwise, . + /// if the has a fixed total size of elements; + /// otherwise, . /// /// /// If have limited inactivity time and element is not accessed through - /// or methods in , then element is automatically removed from - /// the cache. Depending on implementation of the , some of the elements may + /// or methods in , then element is automatically removed from + /// the cache. Depending on implementation of the , some of the elements may /// stay longer in cache. /// /// @@ -1463,13 +1463,13 @@ namespace OpenSim.Framework /// Gets or sets maximal allowed count of elements that can be stored to . /// /// - /// , if is not limited by count of elements; + /// , if is not limited by count of elements; /// otherwise maximal allowed count of elements. /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// public int MaxCount @@ -1496,7 +1496,7 @@ namespace OpenSim.Framework /// /// /// - /// If element's size is larger than , then element is + /// If element's size is larger than , then element is /// not added to the . /// /// @@ -1522,8 +1522,8 @@ namespace OpenSim.Framework /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -1556,11 +1556,11 @@ namespace OpenSim.Framework /// Normally bytes, but can be any suitable unit of measure. /// /// - /// Element's size is given when element is added or replaced by method. + /// Element's size is given when element is added or replaced by method. /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -1581,8 +1581,8 @@ namespace OpenSim.Framework /// /// /// - /// To get synchronized (thread safe) access to , use - /// method to retrieve synchronized wrapper interface to + /// To get synchronized (thread safe) access to , use + /// method to retrieve synchronized wrapper interface to /// . /// /// @@ -1735,7 +1735,7 @@ namespace OpenSim.Framework } /// - /// Add or replace an element with the provided , and to + /// Add or replace an element with the provided , and to /// . /// /// @@ -1748,7 +1748,7 @@ namespace OpenSim.Framework /// The element's size. Normally bytes, but can be any suitable unit of measure. /// /// - /// if element has been added successfully to the ; + /// if element has been added successfully to the ; /// otherwise . /// /// @@ -1759,17 +1759,17 @@ namespace OpenSim.Framework /// /// /// - /// If element's is larger than , then element is - /// not added to the , however - possible older element is - /// removed from the . + /// If element's is larger than , then element is + /// not added to the , however - possible older element is + /// removed from the . /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -1809,15 +1809,15 @@ namespace OpenSim.Framework /// Gets the associated with the specified . /// /// - /// if the contains an element with + /// if the contains an element with /// the specified key; otherwise, . /// /// /// The key whose to get. /// /// - /// When this method returns, the value associated with the specified , - /// if the is found; otherwise, the + /// When this method returns, the value associated with the specified , + /// if the is found; otherwise, the /// default value for the type of the parameter. This parameter is passed uninitialized. /// /// diff --git a/OpenSim/Framework/CnmSynchronizedCache.cs b/OpenSim/Framework/CnmSynchronizedCache.cs index 2bafbe98a7..b33f4f70a9 100644 --- a/OpenSim/Framework/CnmSynchronizedCache.cs +++ b/OpenSim/Framework/CnmSynchronizedCache.cs @@ -36,10 +36,10 @@ namespace OpenSim.Framework /// Synchronized Cenome cache wrapper. /// /// - /// The type of keys in the cache. + /// The type of keys in the cache. /// /// - /// The type of values in the cache. + /// The type of values in the cache. /// /// /// @@ -60,7 +60,7 @@ namespace OpenSim.Framework private readonly object m_syncRoot; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Initializes a new instance of the class. /// /// @@ -73,13 +73,13 @@ namespace OpenSim.Framework } /// - /// Returns a wrapper that is synchronized (thread safe). + /// Returns a wrapper that is synchronized (thread safe). /// /// /// The to synchronize. /// /// - /// A wrapper that is synchronized (thread safe). + /// A wrapper that is synchronized (thread safe). /// /// /// is null. @@ -125,7 +125,7 @@ namespace OpenSim.Framework } /// - /// Finalizes an instance of the class. + /// Finalizes an instance of the class. /// ~SynchronizedEnumerator() { @@ -184,7 +184,7 @@ namespace OpenSim.Framework /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. /// /// - /// The collection was modified after the enumerator was created. + /// The collection was modified after the enumerator was created. /// public bool MoveNext() { @@ -195,7 +195,7 @@ namespace OpenSim.Framework /// Sets the enumerator to its initial position, which is before the first element in the collection. /// /// - /// The collection was modified after the enumerator was created. + /// The collection was modified after the enumerator was created. /// public void Reset() { @@ -214,8 +214,8 @@ namespace OpenSim.Framework /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -241,13 +241,13 @@ namespace OpenSim.Framework /// /// /// - /// When element has been stored in longer than - /// and it is not accessed through method or element's value is - /// not replaced by method, then it is automatically removed from the + /// When element has been stored in longer than + /// and it is not accessed through method or element's value is + /// not replaced by method, then it is automatically removed from the /// . /// /// - /// It is possible that implementation removes element before it's expiration time, + /// It is possible that implementation removes element before it's expiration time, /// because total size or count of elements stored to cache is larger than or . /// /// @@ -291,17 +291,17 @@ namespace OpenSim.Framework /// Gets a value indicating whether is limiting count of elements. /// /// - /// if the count of elements is limited; - /// otherwise, . + /// if the count of elements is limited; + /// otherwise, . /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// - /// + /// /// /// public bool IsCountLimited @@ -319,13 +319,13 @@ namespace OpenSim.Framework /// Gets a value indicating whether is limiting size of elements. /// /// - /// if the total size of elements is limited; - /// otherwise, . + /// if the total size of elements is limited; + /// otherwise, . /// /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -348,12 +348,12 @@ namespace OpenSim.Framework /// Gets a value indicating whether or not access to the is synchronized (thread safe). /// /// - /// if access to the is synchronized (thread safe); - /// otherwise, . + /// if access to the is synchronized (thread safe); + /// otherwise, . /// /// /// - /// To get synchronized (thread safe) access to object, use + /// To get synchronized (thread safe) access to object, use /// in class /// to retrieve synchronized wrapper for object. /// @@ -369,13 +369,13 @@ namespace OpenSim.Framework /// Gets a value indicating whether elements stored to have limited inactivity time. /// /// - /// if the has a fixed total size of elements; - /// otherwise, . + /// if the has a fixed total size of elements; + /// otherwise, . /// /// /// If have limited inactivity time and element is not accessed through - /// or methods in , then element is automatically removed from - /// the cache. Depending on implementation of the , some of the elements may + /// or methods in , then element is automatically removed from + /// the cache. Depending on implementation of the , some of the elements may /// stay longer in cache. /// /// @@ -397,13 +397,13 @@ namespace OpenSim.Framework /// Gets or sets maximal allowed count of elements that can be stored to . /// /// - /// , if is not limited by count of elements; + /// , if is not limited by count of elements; /// otherwise maximal allowed count of elements. /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// public int MaxCount @@ -433,7 +433,7 @@ namespace OpenSim.Framework /// /// /// - /// If element's size is larger than , then element is + /// If element's size is larger than , then element is /// not added to the . /// /// @@ -463,8 +463,8 @@ namespace OpenSim.Framework /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// value is less than 0. @@ -501,11 +501,11 @@ namespace OpenSim.Framework /// Normally bytes, but can be any suitable unit of measure. /// /// - /// Element's size is given when element is added or replaced by method. + /// Element's size is given when element is added or replaced by method. /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -532,8 +532,8 @@ namespace OpenSim.Framework /// /// /// - /// To get synchronized (thread safe) access to , use - /// method to retrieve synchronized wrapper interface to + /// To get synchronized (thread safe) access to , use + /// method to retrieve synchronized wrapper interface to /// . /// /// @@ -647,7 +647,7 @@ namespace OpenSim.Framework } /// - /// Add or replace an element with the provided , and to + /// Add or replace an element with the provided , and to /// . /// /// @@ -660,7 +660,7 @@ namespace OpenSim.Framework /// The element's size. Normally bytes, but can be any suitable unit of measure. /// /// - /// if element has been added successfully to the ; + /// if element has been added successfully to the ; /// otherwise . /// /// @@ -671,17 +671,17 @@ namespace OpenSim.Framework /// /// /// - /// If element's is larger than , then element is - /// not added to the , however - possible older element is - /// removed from the . + /// If element's is larger than , then element is + /// not added to the , however - possible older element is + /// removed from the . /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -703,15 +703,15 @@ namespace OpenSim.Framework /// Gets the associated with the specified . /// /// - /// if the contains an element with + /// if the contains an element with /// the specified key; otherwise, . /// /// /// The key whose to get. /// /// - /// When this method returns, the value associated with the specified , - /// if the is found; otherwise, the + /// When this method returns, the value associated with the specified , + /// if the is found; otherwise, the /// default value for the type of the parameter. This parameter is passed uninitialized. /// /// diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index 6b7cdf8036..52360b40a2 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -52,27 +52,27 @@ namespace OpenSim.Framework.Console /// The module from which this command comes /// public string module; - + /// /// Whether the module is shared /// public bool shared; - + /// /// Very short BNF description /// public string help_text; - + /// /// Longer one line help text /// public string long_help; - + /// /// Full descriptive help for this command /// public string descriptive_help; - + /// /// The method to invoke for this command /// @@ -106,7 +106,7 @@ namespace OpenSim.Framework.Console { List help = new List(); List helpParts = new List(cmd); - + // Remove initial help keyword helpParts.RemoveAt(0); @@ -154,7 +154,7 @@ namespace OpenSim.Framework.Console return help; } - + /// /// See if we can find the requested command in order to display longer help /// @@ -171,23 +171,23 @@ namespace OpenSim.Framework.Console help.Insert(0, ItemHelpText); return help; } - + Dictionary dict = tree; while (helpParts.Count > 0) { string helpPart = helpParts[0]; - + if (!dict.ContainsKey(helpPart)) break; - + //m_log.Debug("Found {0}", helpParts[0]); - + if (dict[helpPart] is Dictionary) - dict = (Dictionary)dict[helpPart]; - + dict = (Dictionary)dict[helpPart]; + helpParts.RemoveAt(0); } - + // There was a command for the given help string if (dict.ContainsKey(String.Empty)) { @@ -200,14 +200,14 @@ namespace OpenSim.Framework.Console // If we do have some descriptive help then insert a spacing line before for readability. if (descriptiveHelp != string.Empty) help.Add(string.Empty); - + help.Add(commandInfo.descriptive_help); } else { help.Add(string.Format("No help is available for {0}", originalHelpRequest)); } - + return help; } @@ -268,7 +268,7 @@ namespace OpenSim.Framework.Console // } // return result; // } - + /// /// Add a command to those which can be invoked from the console. /// @@ -299,7 +299,7 @@ namespace OpenSim.Framework.Console string[] parts = Parser.Parse(command); Dictionary current = tree; - + foreach (string part in parts) { if (current.ContainsKey(part)) @@ -326,7 +326,7 @@ namespace OpenSim.Framework.Console return; } - + info = new CommandInfo(); info.module = module; info.shared = shared; @@ -471,7 +471,7 @@ namespace OpenSim.Framework.Console return null; } - + public bool HasCommand(string command) { string[] result; diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index 2d8e723af2..64cddea999 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -67,7 +67,7 @@ namespace OpenSim.Framework.Console { System.Console.WriteLine(text); } - + public virtual void OutputFormat(string format, params object[] components) { Output(string.Format(format, components)); @@ -86,7 +86,7 @@ namespace OpenSim.Framework.Console return ret; } - + public string CmdPrompt(string p, List excludedCharacters) { bool itisdone = false; @@ -95,7 +95,7 @@ namespace OpenSim.Framework.Console { itisdone = true; ret = CmdPrompt(p); - + foreach (char c in excludedCharacters) { if (ret.Contains(c.ToString())) @@ -117,7 +117,7 @@ namespace OpenSim.Framework.Console { itisdone = true; ret = CmdPrompt(p, def); - + if (ret == String.Empty) { ret = def; diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs index 44f6dc193b..bfa05a21ef 100644 --- a/OpenSim/Framework/Console/ConsoleUtil.cs +++ b/OpenSim/Framework/Console/ConsoleUtil.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework.Console // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public const int LocalIdNotFound = 0; - + /// /// Used by modules to display stock co-ordinate help, though possibly this should be under some general section /// rather than in each help summary. @@ -57,10 +57,10 @@ namespace OpenSim.Framework.Console show object pos ,20,20 to ,40,40 delete object pos ,,30 to ,,~ show object pos ,,-~ to ,,30"; - + public const string MinRawConsoleVectorValue = "-~"; public const string MaxRawConsoleVectorValue = "~"; - + public const string VectorSeparator = ","; public static char[] VectorSeparatorChars = VectorSeparator.ToCharArray(); @@ -81,7 +81,7 @@ namespace OpenSim.Framework.Console return true; } - + /// /// Try to parse a console UUID from the console. /// @@ -101,7 +101,7 @@ namespace OpenSim.Framework.Console return false; } - + return true; } @@ -259,7 +259,7 @@ namespace OpenSim.Framework.Console return false; } - + /// /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 /// @@ -270,7 +270,7 @@ namespace OpenSim.Framework.Console { return TryParseConsoleVector(rawConsoleVector, c => float.MinValue.ToString(), out vector); } - + /// /// Convert a maximum vector input from the console to an OpenMetaverse.Vector3 /// @@ -281,7 +281,7 @@ namespace OpenSim.Framework.Console { return TryParseConsoleVector(rawConsoleVector, c => float.MaxValue.ToString(), out vector); } - + /// /// Convert a vector input from the console to an OpenMetaverse.Vector3 /// @@ -354,10 +354,10 @@ namespace OpenSim.Framework.Console string rawConsoleVector, int dimensions, Func blankComponentFunc) { List components = rawConsoleVector.Split(VectorSeparatorChars).ToList(); - + if (components.Count < 1 || components.Count > dimensions) return null; - + if (components.Count < dimensions) { if (blankComponentFunc == null) @@ -380,7 +380,7 @@ namespace OpenSim.Framework.Console else return c; }); - + return string.Join(VectorSeparator, cookedComponents.ToArray()); } } diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 28293c0dd0..73f0323874 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -51,7 +51,7 @@ namespace OpenSim.Framework.Console private const string LOGLEVEL_NONE = "(none)"; // Used to extract categories for colourization. - private Regex m_categoryRegex + private Regex m_categoryRegex = new Regex( @"^(?.*?)\[(?[^\]]+)\]:?(?.*)", RegexOptions.Singleline | RegexOptions.Compiled); @@ -167,15 +167,15 @@ namespace OpenSim.Framework.Console { System.Console.CursorLeft = 0; } - else + else { int bufferWidth = System.Console.BufferWidth; - + // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) if (bufferWidth > 0 && left >= bufferWidth) System.Console.CursorLeft = bufferWidth - 1; } - + if (top < 0) { top = 0; @@ -183,7 +183,7 @@ namespace OpenSim.Framework.Console else { int bufferHeight = System.Console.BufferHeight; - + // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) if (bufferHeight > 0 && top >= bufferHeight) top = bufferHeight - 1; @@ -216,14 +216,14 @@ namespace OpenSim.Framework.Console { System.Console.CursorTop = 0; } - else + else { int bufferHeight = System.Console.BufferHeight; // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) if (bufferHeight > 0 && top >= bufferHeight) System.Console.CursorTop = bufferHeight - 1; } - + if (left < 0) { left = 0; @@ -339,7 +339,7 @@ namespace OpenSim.Framework.Console string outText = text; if (level != LOGLEVEL_NONE) - { + { MatchCollection matches = m_categoryRegex.Matches(text); if (matches.Count == 1) @@ -364,7 +364,7 @@ namespace OpenSim.Framework.Console WriteColorText(ConsoleColor.Yellow, outText); else System.Console.Write(outText); - + System.Console.WriteLine(); } @@ -551,7 +551,7 @@ namespace OpenSim.Framework.Console } string commandLine = m_commandLine.ToString(); - + if (isCommand) { string[] cmd = Commands.Resolve(Parser.Parse(commandLine)); @@ -573,7 +573,7 @@ namespace OpenSim.Framework.Console // If we're not echoing to screen (e.g. a password) then we probably don't want it in history if (m_echo && commandLine != "") AddToHistory(commandLine); - + return commandLine; default: break; diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs index 1a142df016..e1ff72054e 100644 --- a/OpenSim/Framework/Console/MockConsole.cs +++ b/OpenSim/Framework/Console/MockConsole.cs @@ -35,7 +35,7 @@ namespace OpenSim.Framework.Console { /// /// This is a Fake console that's used when setting up the Scene in Unit Tests - /// Don't use this except for Unit Testing or you're in for a world of hurt when the + /// 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 : ICommandConsole @@ -56,7 +56,7 @@ namespace OpenSim.Framework.Console public string ReadLine(string p, bool isCommand, bool e) { return ""; } - public object ConsoleScene { + public object ConsoleScene { get { return null; } set {} } diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index b9c7537058..ddd95782dd 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -46,93 +46,93 @@ namespace OpenSim.Framework.Console // public class RemoteConsole : CommandConsole { - // Connection specific data, indexed by a session ID - // we create when a client connects. - protected class ConsoleConnection - { - // Last activity from the client - public int last; + // Connection specific data, indexed by a session ID + // we create when a client connects. + protected class ConsoleConnection + { + // Last activity from the client + public int last; - // Last line of scrollback posted to this client - public long lastLineSeen; + // Last line of scrollback posted to this client + public long lastLineSeen; - // True if this is a new connection, e.g. has never - // displayed a prompt to the user. - public bool newConnection = true; - } + // True if this is a new connection, e.g. has never + // displayed a prompt to the user. + public bool newConnection = true; + } - // A line in the scrollback buffer. - protected class ScrollbackEntry - { - // The line number of this entry - public long lineNumber; + // A line in the scrollback buffer. + protected class ScrollbackEntry + { + // The line number of this entry + public long lineNumber; - // The text to send to the client - public string text; + // The text to send to the client + public string text; - // The level this should be logged as. Omitted for - // prompts and input echo. - public string level; + // The level this should be logged as. Omitted for + // prompts and input echo. + public string level; - // True if the text above is a prompt, e.g. the - // client should turn on the cursor / accept input - public bool isPrompt; + // True if the text above is a prompt, e.g. the + // client should turn on the cursor / accept input + public bool isPrompt; - // True if the requested input is a command. A - // client may offer help or validate input if - // this is set. If false, input should be sent - // as typed. - public bool isCommand; + // True if the requested input is a command. A + // client may offer help or validate input if + // this is set. If false, input should be sent + // as typed. + public bool isCommand; - // True if this text represents a line of text that - // was input in response to a prompt. A client should - // turn off the cursor and refrain from sending commands - // until a new prompt is received. - public bool isInput; - } + // True if this text represents a line of text that + // was input in response to a prompt. A client should + // turn off the cursor and refrain from sending commands + // until a new prompt is received. + public bool isInput; + } - // Data that is relevant to all connections + // Data that is relevant to all connections - // The scrollback buffer + // The scrollback buffer protected List m_Scrollback = new List(); - // Monotonously incrementing line number. This may eventually - // wrap. No provision is made for that case because 64 bits - // is a long, long time. + // Monotonously incrementing line number. This may eventually + // wrap. No provision is made for that case because 64 bits + // is a long, long time. protected long m_lineNumber = 0; - // These two variables allow us to send the correct - // information about the prompt status to the client, - // irrespective of what may have run off the top of the - // scrollback buffer; - protected bool m_expectingInput = false; - protected bool m_expectingCommand = true; - protected string m_lastPromptUsed; - - // This is the list of things received from clients. - // Note: Race conditions can happen. If a client sends - // something while nothing is expected, it will be - // intepreted as input to the next prompt. For - // commands this is largely correct. For other prompts, - // YMMV. - // TODO: Find a better way to fix this + // These two variables allow us to send the correct + // information about the prompt status to the client, + // irrespective of what may have run off the top of the + // scrollback buffer; + protected bool m_expectingInput = false; + protected bool m_expectingCommand = true; + protected string m_lastPromptUsed; + + // This is the list of things received from clients. + // Note: Race conditions can happen. If a client sends + // something while nothing is expected, it will be + // intepreted as input to the next prompt. For + // commands this is largely correct. For other prompts, + // YMMV. + // TODO: Find a better way to fix this protected List m_InputData = new List(); - // Event to allow ReadLine to wait synchronously even though - // everthing else is asynchronous here. + // Event to allow ReadLine to wait synchronously even though + // everthing else is asynchronous here. protected ManualResetEvent m_DataEvent = new ManualResetEvent(false); - // The list of sessions we maintain. Unlike other console types, - // multiple users on the same console are explicitly allowed. + // The list of sessions we maintain. Unlike other console types, + // multiple users on the same console are explicitly allowed. protected Dictionary m_Connections = new Dictionary(); - // Timer to control expiration of sessions that have been - // disconnected. - protected System.Timers.Timer m_expireTimer = new System.Timers.Timer(5000); + // Timer to control expiration of sessions that have been + // disconnected. + protected System.Timers.Timer m_expireTimer = new System.Timers.Timer(5000); - // The less interesting stuff that makes the actual server - // work. + // The less interesting stuff that makes the actual server + // work. protected IHttpServer m_Server = null; protected IConfigSource m_Config = null; @@ -143,130 +143,130 @@ namespace OpenSim.Framework.Console public RemoteConsole(string defaultPrompt) : base(defaultPrompt) { - // There is something wrong with this architecture. - // A prompt is sent on every single input, so why have this? - // TODO: Investigate and fix. - m_lastPromptUsed = defaultPrompt; + // There is something wrong with this architecture. + // A prompt is sent on every single input, so why have this? + // TODO: Investigate and fix. + m_lastPromptUsed = defaultPrompt; - // Start expiration of sesssions. - m_expireTimer.Elapsed += DoExpire; - m_expireTimer.Start(); + // Start expiration of sesssions. + m_expireTimer.Elapsed += DoExpire; + m_expireTimer.Start(); } public void ReadConfig(IConfigSource config) { m_Config = config; - // We're pulling this from the 'Network' section for legacy - // compatibility. However, this is so essentially insecure - // that TLS and client certs should be used instead of - // a username / password. + // We're pulling this from the 'Network' section for legacy + // compatibility. However, this is so essentially insecure + // that TLS and client certs should be used instead of + // a username / password. IConfig netConfig = m_Config.Configs["Network"]; if (netConfig == null) return; - // Get the username and password. + // Get the username and password. m_UserName = netConfig.GetString("ConsoleUser", String.Empty); m_Password = netConfig.GetString("ConsolePass", String.Empty); - // Woefully underdocumented, this is what makes javascript - // console clients work. Set to "*" for anywhere or (better) - // to specific addresses. + // Woefully underdocumented, this is what makes javascript + // console clients work. Set to "*" for anywhere or (better) + // to specific addresses. m_AllowedOrigin = netConfig.GetString("ConsoleAllowedOrigin", String.Empty); } public void SetServer(IHttpServer server) { - // This is called by the framework to give us the server - // instance (means: port) to work with. + // This is called by the framework to give us the server + // instance (means: port) to work with. m_Server = server; - // Add our handlers + // Add our handlers m_Server.AddHTTPHandler("/StartSession/", HandleHttpStartSession); m_Server.AddHTTPHandler("/CloseSession/", HandleHttpCloseSession); m_Server.AddHTTPHandler("/SessionCommand/", HandleHttpSessionCommand); } public override void Output(string text, string level) - { - Output(text, level, false, false, false); - } + { + Output(text, level, false, false, false); + } protected void Output(string text, string level, bool isPrompt, bool isCommand, bool isInput) { - // Increment the line number. It was 0 and they start at 1 - // so we need to pre-increment. - m_lineNumber++; + // Increment the line number. It was 0 and they start at 1 + // so we need to pre-increment. + m_lineNumber++; - // Create and populate the new entry. - ScrollbackEntry newEntry = new ScrollbackEntry(); + // Create and populate the new entry. + ScrollbackEntry newEntry = new ScrollbackEntry(); - newEntry.lineNumber = m_lineNumber; - newEntry.text = text; - newEntry.level = level; - newEntry.isPrompt = isPrompt; - newEntry.isCommand = isCommand; - newEntry.isInput = isInput; + newEntry.lineNumber = m_lineNumber; + newEntry.text = text; + newEntry.level = level; + newEntry.isPrompt = isPrompt; + newEntry.isCommand = isCommand; + newEntry.isInput = isInput; - // Add a line to the scrollback. In some cases, that may not - // actually be a line of text. + // Add a line to the scrollback. In some cases, that may not + // actually be a line of text. lock (m_Scrollback) { - // Prune the scrollback to the length se send as connect - // burst to give the user some context. + // Prune the scrollback to the length se send as connect + // burst to give the user some context. while (m_Scrollback.Count >= 1000) m_Scrollback.RemoveAt(0); m_Scrollback.Add(newEntry); } - // Let the rest of the system know we have output something. + // Let the rest of the system know we have output something. FireOnOutput(text.Trim()); - // Also display it for debugging. + // Also display it for debugging. System.Console.WriteLine(text.Trim()); } public override void Output(string text) { - // Output plain (non-logging style) text. + // Output plain (non-logging style) text. Output(text, String.Empty, false, false, false); } public override string ReadLine(string p, bool isCommand, bool e) { - // Output the prompt an prepare to wait. This - // is called on a dedicated console thread and - // needs to be synchronous. Old architecture but - // not worth upgrading. - if (isCommand) - { - m_expectingInput = true; - m_expectingCommand = true; + // Output the prompt an prepare to wait. This + // is called on a dedicated console thread and + // needs to be synchronous. Old architecture but + // not worth upgrading. + if (isCommand) + { + m_expectingInput = true; + m_expectingCommand = true; Output(p, String.Empty, true, true, false); - m_lastPromptUsed = p; - } - else - { - m_expectingInput = true; + m_lastPromptUsed = p; + } + else + { + m_expectingInput = true; Output(p, String.Empty, true, false, false); - } + } - // Here is where we wait for the user to input something. + // Here is where we wait for the user to input something. m_DataEvent.WaitOne(); string cmdinput; - // Check for empty input. Read input if not empty. + // Check for empty input. Read input if not empty. lock (m_InputData) { if (m_InputData.Count == 0) { m_DataEvent.Reset(); - m_expectingInput = false; - m_expectingCommand = false; + m_expectingInput = false; + m_expectingCommand = false; return ""; } @@ -278,19 +278,19 @@ namespace OpenSim.Framework.Console } - m_expectingInput = false; - m_expectingCommand = false; + m_expectingInput = false; + m_expectingCommand = false; - // Echo to all the other users what we have done. This - // will also go to ourselves. - Output (cmdinput, String.Empty, false, false, true); + // Echo to all the other users what we have done. This + // will also go to ourselves. + Output (cmdinput, String.Empty, false, false, true); - // If this is a command, we need to resolve and execute it. + // If this is a command, we need to resolve and execute it. if (isCommand) { - // This call will actually execute the command and create - // any output associated with it. The core just gets an - // empty string so it will call again immediately. + // This call will actually execute the command and create + // any output associated with it. The core just gets an + // empty string so it will call again immediately. string[] cmd = Commands.Resolve(Parser.Parse(cmdinput)); if (cmd.Length != 0) @@ -306,11 +306,11 @@ namespace OpenSim.Framework.Console } } - // Return the raw input string if not a command. + // Return the raw input string if not a command. return cmdinput; } - // Very simplistic static access control header. + // Very simplistic static access control header. protected Hashtable CheckOrigin(Hashtable result) { if (!string.IsNullOrEmpty(m_AllowedOrigin)) @@ -338,21 +338,21 @@ namespace OpenSim.Framework.Console protected void DoExpire(Object sender, ElapsedEventArgs e) { - // Iterate the list of console connections and find those we - // haven't heard from for longer then the longpoll interval. - // Remove them. + // Iterate the list of console connections and find those we + // haven't heard from for longer then the longpoll interval. + // Remove them. List expired = new List(); lock (m_Connections) { - // Mark the expired ones + // Mark the expired ones foreach (KeyValuePair kvp in m_Connections) { if (System.Environment.TickCount - kvp.Value.last > 500000) expired.Add(kvp.Key); } - // Delete them + // Delete them foreach (UUID id in expired) { m_Connections.Remove(id); @@ -361,10 +361,10 @@ namespace OpenSim.Framework.Console } } - // Start a new session. + // Start a new session. protected Hashtable HandleHttpStartSession(Hashtable request) { - // The login is in the form of a http form post + // The login is in the form of a http form post Hashtable post = DecodePostString(request["body"].ToString()); Hashtable reply = new Hashtable(); @@ -372,7 +372,7 @@ namespace OpenSim.Framework.Console reply["int_response_code"] = 401; reply["content_type"] = "text/plain"; - // Check user name and password + // Check user name and password if (m_UserName == String.Empty) return reply; @@ -385,28 +385,28 @@ namespace OpenSim.Framework.Console return reply; } - // Set up the new console connection record + // Set up the new console connection record ConsoleConnection c = new ConsoleConnection(); c.last = System.Environment.TickCount; c.lastLineSeen = 0; - // Assign session ID + // Assign session ID UUID sessionID = UUID.Random(); - // Add connection to list. + // Add connection to list. lock (m_Connections) { m_Connections[sessionID] = c; } - // This call is a CAP. The URL is the authentication. + // This call is a CAP. The URL is the authentication. string uri = "/ReadResponses/" + sessionID.ToString() + "/"; m_Server.AddPollServiceHTTPHandler( uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, null, sessionID,25000)); // 25 secs timeout - // Our reply is an XML document. - // TODO: Change this to Linq.Xml + // Our reply is an XML document. + // TODO: Change this to Linq.Xml XmlDocument xmldoc = new XmlDocument(); XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, "", ""); @@ -429,7 +429,7 @@ namespace OpenSim.Framework.Console rootElement.AppendChild(MainConsole.Instance.Commands.GetXml(xmldoc)); - // Set up the response and check origin + // Set up the response and check origin reply["str_response_string"] = xmldoc.InnerXml; reply["int_response_code"] = 200; reply["content_type"] = "text/xml"; @@ -438,7 +438,7 @@ namespace OpenSim.Framework.Console return reply; } - // Client closes session. Clean up. + // Client closes session. Clean up. protected Hashtable HandleHttpCloseSession(Hashtable request) { Hashtable post = DecodePostString(request["body"].ToString()); @@ -487,7 +487,7 @@ namespace OpenSim.Framework.Console return reply; } - // Command received from the client. + // Command received from the client. protected Hashtable HandleHttpSessionCommand(Hashtable request) { Hashtable post = DecodePostString(request["body"].ToString()); @@ -497,7 +497,7 @@ namespace OpenSim.Framework.Console reply["int_response_code"] = 404; reply["content_type"] = "text/plain"; - // Check the ID + // Check the ID if (post["ID"] == null) return reply; @@ -505,25 +505,25 @@ namespace OpenSim.Framework.Console if (!UUID.TryParse(post["ID"].ToString(), out id)) return reply; - // Find the connection for that ID. + // Find the connection for that ID. lock (m_Connections) { if (!m_Connections.ContainsKey(id)) return reply; } - // Empty post. Just error out. + // Empty post. Just error out. if (post["COMMAND"] == null) return reply; - // Place the input data in the buffer. + // Place the input data in the buffer. lock (m_InputData) { m_DataEvent.Set(); m_InputData.Add(post["COMMAND"].ToString()); } - // Create the XML reply document. + // Create the XML reply document. XmlDocument xmldoc = new XmlDocument(); XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, "", ""); @@ -547,7 +547,7 @@ namespace OpenSim.Framework.Console return reply; } - // Decode a HTTP form post to a Hashtable + // Decode a HTTP form post to a Hashtable protected Hashtable DecodePostString(string data) { Hashtable result = new Hashtable(); @@ -565,14 +565,14 @@ namespace OpenSim.Framework.Console if (elems.Length > 1) value = System.Web.HttpUtility.UrlDecode(elems[1]); - + result[name] = value; } return result; } - // Close the CAP receiver for the responses for a given client. + // Close the CAP receiver for the responses for a given client. public void CloseConnection(UUID id) { try @@ -586,8 +586,8 @@ namespace OpenSim.Framework.Console } } - // Check if there is anything to send. Return true if this client has - // lines pending. + // Check if there is anything to send. Return true if this client has + // lines pending. protected bool HasEvents(UUID RequestID, UUID sessionID) { ConsoleConnection c = null; @@ -604,10 +604,10 @@ namespace OpenSim.Framework.Console return false; } - // Send all pending output to the client. + // Send all pending output to the client. protected Hashtable GetEvents(UUID RequestID, UUID sessionID) { - // Find the connection that goes with this client. + // Find the connection that goes with this client. ConsoleConnection c = null; lock (m_Connections) @@ -617,14 +617,14 @@ namespace OpenSim.Framework.Console c = m_Connections[sessionID]; } - // If we have nothing to send, send the no events response. + // If we have nothing to send, send the no events response. c.last = System.Environment.TickCount; if (c.lastLineSeen >= m_lineNumber) return NoEvents(RequestID, UUID.Zero); Hashtable result = new Hashtable(); - // Create the response document. + // Create the response document. XmlDocument xmldoc = new XmlDocument(); XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, "", ""); @@ -648,29 +648,29 @@ namespace OpenSim.Framework.Console for (long i = sendStart ; i < m_lineNumber ; i++) { - ScrollbackEntry e = m_Scrollback[(int)(i - startLine)]; + ScrollbackEntry e = m_Scrollback[(int)(i - startLine)]; XmlElement res = xmldoc.CreateElement("", "Line", ""); res.SetAttribute("Number", e.lineNumber.ToString()); res.SetAttribute("Level", e.level); - // Don't include these for the scrollback, we'll send the - // real state later. - if (!c.newConnection) - { - res.SetAttribute("Prompt", e.isPrompt ? "true" : "false"); - res.SetAttribute("Command", e.isCommand ? "true" : "false"); - res.SetAttribute("Input", e.isInput ? "true" : "false"); - } - else if (i == m_lineNumber - 1) // Last line for a new connection - { - res.SetAttribute("Prompt", m_expectingInput ? "true" : "false"); - res.SetAttribute("Command", m_expectingCommand ? "true" : "false"); - res.SetAttribute("Input", (!m_expectingInput) ? "true" : "false"); - } - else - { - res.SetAttribute("Input", e.isInput ? "true" : "false"); - } + // Don't include these for the scrollback, we'll send the + // real state later. + if (!c.newConnection) + { + res.SetAttribute("Prompt", e.isPrompt ? "true" : "false"); + res.SetAttribute("Command", e.isCommand ? "true" : "false"); + res.SetAttribute("Input", e.isInput ? "true" : "false"); + } + else if (i == m_lineNumber - 1) // Last line for a new connection + { + res.SetAttribute("Prompt", m_expectingInput ? "true" : "false"); + res.SetAttribute("Command", m_expectingCommand ? "true" : "false"); + res.SetAttribute("Input", (!m_expectingInput) ? "true" : "false"); + } + else + { + res.SetAttribute("Input", e.isInput ? "true" : "false"); + } res.AppendChild(xmldoc.CreateTextNode(e.text)); @@ -679,7 +679,7 @@ namespace OpenSim.Framework.Console } c.lastLineSeen = m_lineNumber; - c.newConnection = false; + c.newConnection = false; xmldoc.AppendChild(rootElement); @@ -693,8 +693,8 @@ namespace OpenSim.Framework.Console return result; } - // This is really just a no-op. It generates what is sent - // to the client if the poll times out without any events. + // This is really just a no-op. It generates what is sent + // to the client if the poll times out without any events. protected Hashtable NoEvents(UUID RequestID, UUID id) { Hashtable result = new Hashtable(); diff --git a/OpenSim/Framework/DAMap.cs b/OpenSim/Framework/DAMap.cs index 4995a92de0..1915fa52f9 100644 --- a/OpenSim/Framework/DAMap.cs +++ b/OpenSim/Framework/DAMap.cs @@ -63,9 +63,9 @@ namespace OpenSim.Framework { get { return m_map; } set { m_map = value; } - } - - public XmlSchema GetSchema() { return null; } + } + + public XmlSchema GetSchema() { return null; } public static DAMap FromXml(string rawXml) { @@ -73,19 +73,19 @@ namespace OpenSim.Framework map.ReadXml(rawXml); return map; } - + public void ReadXml(XmlReader reader) - { - ReadXml(reader.ReadInnerXml()); + { + ReadXml(reader.ReadInnerXml()); } public void ReadXml(string rawXml) - { + { // System.Console.WriteLine("Trying to deserialize [{0}]", rawXml); - + lock (this) { - m_map = (OSDMap)OSDParser.DeserializeLLSDXml(rawXml); + m_map = (OSDMap)OSDParser.DeserializeLLSDXml(rawXml); SanitiseMap(this); } } @@ -104,7 +104,7 @@ namespace OpenSim.Framework public void CopyFrom(DAMap other) { // Deep copy - + string data = null; lock (other) { @@ -113,7 +113,7 @@ namespace OpenSim.Framework data = OSDParser.SerializeLLSDXmlString(other.m_map); } } - + lock (this) { if (data == null) @@ -185,9 +185,9 @@ namespace OpenSim.Framework /// /// Get the number of stores. /// - public int CountStores + public int CountStores { - get + get { int count = 0; @@ -263,8 +263,8 @@ namespace OpenSim.Framework throw new Exception("Minimum namespace length is " + MIN_NAMESPACE_LENGTH); } - public bool ContainsStore(string ns, string storeName) - { + public bool ContainsStore(string ns, string storeName) + { OSD namespaceOsd; lock (this) @@ -276,7 +276,7 @@ namespace OpenSim.Framework } return false; - } + } public bool TryGetStore(string ns, string storeName, out OSDMap store) { @@ -297,17 +297,17 @@ namespace OpenSim.Framework store = null; return false; - } + } public void Clear() { lock (this) m_map.Clear(); - } + } public bool RemoveStore(string ns, string storeName) { - OSD namespaceOsd; + OSD namespaceOsd; lock (this) { @@ -323,6 +323,6 @@ namespace OpenSim.Framework } return false; - } + } } } \ No newline at end of file diff --git a/OpenSim/Framework/DOMap.cs b/OpenSim/Framework/DOMap.cs index f5b650b375..033cbf9723 100644 --- a/OpenSim/Framework/DOMap.cs +++ b/OpenSim/Framework/DOMap.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework public class DOMap { private IDictionary m_map; - + public void Add(string ns, string objName, object dynObj) { DAMap.ValidateNamespace(ns); diff --git a/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs b/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs index 4ff8cbabfa..55ec13e5d3 100644 --- a/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs +++ b/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs @@ -69,7 +69,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterWriteLock(); @@ -90,10 +90,10 @@ namespace OpenSim.Framework Dictionary1[key1] = value; Dictionary2[key2] = value; } - finally - { + finally + { if (gotLock) - rwLock.ExitWriteLock(); + rwLock.ExitWriteLock(); } } @@ -107,7 +107,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterWriteLock(); @@ -117,10 +117,10 @@ namespace OpenSim.Framework Dictionary1.Remove(key1); success = Dictionary2.Remove(key2); } - finally - { + finally + { if (gotLock) - rwLock.ExitWriteLock(); + rwLock.ExitWriteLock(); } return success; @@ -136,7 +136,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterWriteLock(); @@ -159,10 +159,10 @@ namespace OpenSim.Framework } } } - finally - { + finally + { if (gotLock) - rwLock.ExitWriteLock(); + rwLock.ExitWriteLock(); } return found; @@ -178,7 +178,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterWriteLock(); @@ -201,10 +201,10 @@ namespace OpenSim.Framework } } } - finally - { + finally + { if (gotLock) - rwLock.ExitWriteLock(); + rwLock.ExitWriteLock(); } return found; @@ -219,7 +219,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterWriteLock(); @@ -229,10 +229,10 @@ namespace OpenSim.Framework Dictionary1.Clear(); Dictionary2.Clear(); } - finally - { + finally + { if (gotLock) - rwLock.ExitWriteLock(); + rwLock.ExitWriteLock(); } } @@ -256,24 +256,24 @@ namespace OpenSim.Framework bool success; bool gotLock = false; - try - { + try + { // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); gotLock = true; } - success = Dictionary1.TryGetValue(key, out value); + success = Dictionary1.TryGetValue(key, out value); } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } return success; @@ -284,24 +284,24 @@ namespace OpenSim.Framework bool success; bool gotLock = false; - try - { + try + { // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); gotLock = true; } - success = Dictionary2.TryGetValue(key, out value); + success = Dictionary2.TryGetValue(key, out value); } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } return success; @@ -316,7 +316,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); @@ -326,10 +326,10 @@ namespace OpenSim.Framework foreach (TValue value in Dictionary1.Values) action(value); } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } } @@ -342,7 +342,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); @@ -352,10 +352,10 @@ namespace OpenSim.Framework foreach (KeyValuePair entry in Dictionary1) action(entry); } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } } @@ -368,7 +368,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); @@ -378,10 +378,10 @@ namespace OpenSim.Framework foreach (KeyValuePair entry in Dictionary2) action(entry); } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } } @@ -394,7 +394,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); @@ -407,10 +407,10 @@ namespace OpenSim.Framework return value; } } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } return default(TValue); @@ -426,7 +426,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterReadLock(); @@ -439,10 +439,10 @@ namespace OpenSim.Framework list.Add(value); } } - finally - { + finally + { if (gotLock) - rwLock.ExitReadLock(); + rwLock.ExitReadLock(); } return list; @@ -458,7 +458,7 @@ namespace OpenSim.Framework // Avoid an asynchronous Thread.Abort() from possibly never existing an acquired lock by placing // the acquision inside the main try. The inner finally block is needed because thread aborts cannot // interrupt code in these blocks (hence gotLock is guaranteed to be set correctly). - try {} + try {} finally { rwLock.EnterUpgradeableReadLock(); @@ -482,7 +482,7 @@ namespace OpenSim.Framework try { - try {} + try {} finally { rwLock.EnterUpgradeableReadLock(); @@ -495,16 +495,16 @@ namespace OpenSim.Framework for (int i = 0; i < list2.Count; i++) Dictionary2.Remove(list2[i]); } - finally - { + finally + { if (gotWriteLock) - rwLock.ExitWriteLock(); + rwLock.ExitWriteLock(); } } - finally - { + finally + { if (gotUpgradeableLock) - rwLock.ExitUpgradeableReadLock(); + rwLock.ExitUpgradeableReadLock(); } return list.Count; diff --git a/OpenSim/Framework/EstateBan.cs b/OpenSim/Framework/EstateBan.cs index ebed794619..12a92bb0e2 100644 --- a/OpenSim/Framework/EstateBan.cs +++ b/OpenSim/Framework/EstateBan.cs @@ -43,7 +43,7 @@ namespace OpenSim.Framework { get { - return m_estateID; + return m_estateID; } set { diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 844230b278..7134cbf825 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs @@ -430,7 +430,7 @@ namespace OpenSim.Framework { if (ban == null) return; - if (!IsBanned(ban.BannedUserID, 32) && + if (!IsBanned(ban.BannedUserID, 32) && (l_EstateBans.Count < (int)Constants.EstateAccessLimits.EstateBans)) //Ignore age-based bans l_EstateBans.Add(ban); } diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs index 6954c64e20..1605005a8a 100644 --- a/OpenSim/Framework/GridInstantMessage.cs +++ b/OpenSim/Framework/GridInstantMessage.cs @@ -67,7 +67,7 @@ namespace OpenSim.Framework binaryBucket = im.binaryBucket; RegionID = im.RegionID; ParentEstateID = im.ParentEstateID; - + if (addTimestamp) timestamp = (uint)Util.UnixTimeSinceEpoch(); } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c4de81e93a..1267993d1f 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -60,7 +60,7 @@ namespace OpenSim.Framework public delegate void ObjectAttach( IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); - public delegate void ModifyTerrain(UUID user, + public delegate void ModifyTerrain(UUID user, float height, float seconds, byte size, byte action, float north, float west, float south, float east, UUID agentId); @@ -227,10 +227,10 @@ namespace OpenSim.Framework byte RayEndIsIntersection); public delegate void RequestGodlikePowers( - UUID AgentID, UUID SessionID, UUID token, bool GodLike, IClientAPI remote_client); + UUID AgentID, UUID SessionID, UUID token, bool GodLike); public delegate void GodKickUser( - UUID GodAgentID, UUID GodSessionID, UUID AgentID, uint kickflags, byte[] reason); + UUID GodAgentID, UUID AgentID, uint kickflags, byte[] reason); public delegate void CreateInventoryFolder( IClientAPI remoteClient, UUID folderID, ushort folderType, string folderName, UUID parentID); @@ -473,46 +473,46 @@ namespace OpenSim.Framework public delegate void PlacesQuery(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client); public delegate void AgentFOV(IClientAPI client, float verticalAngle); - + public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int type, uint flags); - + public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name); - + public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); - + public delegate void FindAgentUpdate(IClientAPI client, UUID hunter, UUID target); - + public delegate void TrackAgentUpdate(IClientAPI client, UUID hunter, UUID target); - + public delegate void FreezeUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); - + public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); - + public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string Summary, UUID reporter); - + public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); - + public delegate void GodlikeMessage(IClientAPI client, UUID requester, byte[] Method, byte[] Parameter); - + public delegate void SaveStateHandler(IClientAPI client,UUID agentID); - + public delegate void GroupAccountSummaryRequest(IClientAPI client,UUID agentID, UUID groupID); - + public delegate void GroupAccountDetailsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - + public delegate void GroupAccountTransactionsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - + public delegate void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID); - + public delegate void ParcelGodMark(IClientAPI client, UUID agentID, int ParcelLocalID); - + public delegate void GroupActiveProposalsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - + public delegate void GroupVoteHistoryRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - - + + public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); - + public delegate void SendPostcard(IClientAPI client); public delegate void ChangeInventoryItemFlags(IClientAPI client, UUID itemID, uint flags); @@ -763,7 +763,7 @@ namespace OpenSim.Framework /// Only set for root agents. /// bool IsLoggingOut { get; set; } - + bool SendLogoutPacketWhenClosing { set; } // [Obsolete("LLClientView Specific - Circuits are unique to LLClientView")] @@ -1034,7 +1034,7 @@ namespace OpenSim.Framework event MuteListRequest OnMuteListRequest; event PlacesQuery OnPlacesQuery; - + event FindAgentUpdate OnFindAgent; event TrackAgentUpdate OnTrackAgent; event NewUserReport OnUserReport; @@ -1079,12 +1079,12 @@ namespace OpenSim.Framework void Close(bool sendStop, bool force); void Kick(string message); - + /// /// Start processing for this client. /// void Start(); - + void Stop(); // void ActivateGesture(UUID assetId, UUID gestureId); @@ -1155,7 +1155,7 @@ namespace OpenSim.Framework void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look); void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint); - + /// /// Return circuit information for this client. /// @@ -1223,10 +1223,10 @@ namespace OpenSim.Framework /// /// Used by the server to inform the client of new inventory items and folders. /// - /// + /// /// If the node is a folder then the contents will be transferred /// (including all descendent folders) as well as the folder itself. - /// + /// /// void SendBulkUpdateInventory(InventoryNodeBase node); @@ -1289,7 +1289,7 @@ namespace OpenSim.Framework /// The orbital position is given in radians, and must be "adjusted" for the linden client, see LLClientView void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition); - + void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks); void SendViewerTime(int phase); @@ -1357,7 +1357,7 @@ namespace OpenSim.Framework void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec); /// - /// Send the next packet for a series of packets making up a single texture, + /// Send the next packet for a series of packets making up a single texture, /// as established by SendImageFirstPart() /// /// @@ -1481,7 +1481,7 @@ namespace OpenSim.Framework void SendParcelDwellReply(int localID, UUID parcelID, float dwell); void SendUserInfoReply(bool imViaEmail, bool visible, string email); - + void SendUseCachedMuteList(); void SendMuteListUpdate(string filename); @@ -1495,13 +1495,13 @@ namespace OpenSim.Framework void SendRebakeAvatarTextures(UUID textureID); void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages); - + void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt); - + void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier); - + void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt); - + void SendChangeUserRights(UUID agentID, UUID friendID, int rights); void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId); diff --git a/OpenSim/Framework/ICnmCache.cs b/OpenSim/Framework/ICnmCache.cs index 27b9c56318..69b5b423e5 100644 --- a/OpenSim/Framework/ICnmCache.cs +++ b/OpenSim/Framework/ICnmCache.cs @@ -34,10 +34,10 @@ namespace OpenSim.Framework /// Represent generic cache to store key/value pairs (elements) limited by time, size and count of elements. /// /// - /// The type of keys in the cache. + /// The type of keys in the cache. /// /// - /// The type of values in the cache. + /// The type of values in the cache. /// /// /// @@ -51,8 +51,8 @@ namespace OpenSim.Framework /// /// Time /// - /// Element that is not accessed through or in last are - /// removed from the cache automatically. Depending on implementation of the cache some of elements may stay longer in cache. + /// Element that is not accessed through or in last are + /// removed from the cache automatically. Depending on implementation of the cache some of elements may stay longer in cache. /// returns , if cache is limited by time. /// /// @@ -60,7 +60,7 @@ namespace OpenSim.Framework /// Count /// /// When adding an new element to cache that already have of elements, cache will remove less recently - /// used element(s) from the cache, until element fits to cache. + /// used element(s) from the cache, until element fits to cache. /// returns , if cache is limiting element count. /// /// @@ -69,8 +69,8 @@ namespace OpenSim.Framework /// /// /// When adding an new element to cache that already have of elements, cache will remove less recently - /// used element(s) from the cache, until element fits to cache. - /// returns , if cache is limiting total size of elements. + /// used element(s) from the cache, until element fits to cache. + /// returns , if cache is limiting total size of elements. /// Normally size is bytes used by element in the cache. But it can be any other suitable unit of measure. /// /// @@ -84,8 +84,8 @@ namespace OpenSim.Framework /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -102,13 +102,13 @@ namespace OpenSim.Framework /// /// /// - /// When element has been stored in longer than - /// and it is not accessed through method or element's value is - /// not replaced by method, then it is automatically removed from the + /// When element has been stored in longer than + /// and it is not accessed through method or element's value is + /// not replaced by method, then it is automatically removed from the /// . /// /// - /// It is possible that implementation removes element before it's expiration time, + /// It is possible that implementation removes element before it's expiration time, /// because total size or count of elements stored to cache is larger than or . /// /// @@ -135,12 +135,12 @@ namespace OpenSim.Framework /// Gets a value indicating whether or not access to the is synchronized (thread safe). /// /// - /// if access to the is synchronized (thread safe); - /// otherwise, . + /// if access to the is synchronized (thread safe); + /// otherwise, . /// /// /// - /// To get synchronized (thread safe) access to object, use + /// To get synchronized (thread safe) access to object, use /// in class /// to retrieve synchronized wrapper for object. /// @@ -153,17 +153,17 @@ namespace OpenSim.Framework /// Gets a value indicating whether is limiting count of elements. /// /// - /// if the count of elements is limited; - /// otherwise, . + /// if the count of elements is limited; + /// otherwise, . /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// - /// + /// /// /// bool IsCountLimited { get; } @@ -172,13 +172,13 @@ namespace OpenSim.Framework /// Gets a value indicating whether is limiting size of elements. /// /// - /// if the total size of elements is limited; - /// otherwise, . + /// if the total size of elements is limited; + /// otherwise, . /// /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -192,13 +192,13 @@ namespace OpenSim.Framework /// Gets a value indicating whether elements stored to have limited inactivity time. /// /// - /// if the has a fixed total size of elements; - /// otherwise, . + /// if the has a fixed total size of elements; + /// otherwise, . /// /// /// If have limited inactivity time and element is not accessed through - /// or methods in , then element is automatically removed from - /// the cache. Depending on implementation of the , some of the elements may + /// or methods in , then element is automatically removed from + /// the cache. Depending on implementation of the , some of the elements may /// stay longer in cache. /// /// @@ -206,18 +206,18 @@ namespace OpenSim.Framework /// /// bool IsTimeLimited { get; } - + /// /// Gets or sets maximal allowed count of elements that can be stored to . /// /// - /// , if is not limited by count of elements; + /// , if is not limited by count of elements; /// otherwise maximal allowed count of elements. /// /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// int MaxCount { get; set; } @@ -230,7 +230,7 @@ namespace OpenSim.Framework /// /// /// - /// If element's size is larger than , then element is + /// If element's size is larger than , then element is /// not added to the . /// /// @@ -251,8 +251,8 @@ namespace OpenSim.Framework /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// value is less than 0. @@ -272,11 +272,11 @@ namespace OpenSim.Framework /// Normally bytes, but can be any suitable unit of measure. /// /// - /// Element's size is given when element is added or replaced by method. + /// Element's size is given when element is added or replaced by method. /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -294,8 +294,8 @@ namespace OpenSim.Framework /// /// /// - /// To get synchronized (thread safe) access to , use - /// method to retrieve synchronized wrapper interface to + /// To get synchronized (thread safe) access to , use + /// method to retrieve synchronized wrapper interface to /// . /// /// @@ -367,7 +367,7 @@ namespace OpenSim.Framework void RemoveRange(IEnumerable keys); /// - /// Add or replace an element with the provided , and to + /// Add or replace an element with the provided , and to /// . /// /// @@ -380,7 +380,7 @@ namespace OpenSim.Framework /// The element's size. Normally bytes, but can be any suitable unit of measure. /// /// - /// if element has been added successfully to the ; + /// if element has been added successfully to the ; /// otherwise . /// /// @@ -391,17 +391,17 @@ namespace OpenSim.Framework /// /// /// - /// If element's is larger than , then element is - /// not added to the , however - possible older element is - /// removed from the . + /// If element's is larger than , then element is + /// not added to the , however - possible older element is + /// removed from the . /// /// - /// When adding an new element to that is limiting total size of elements, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting total size of elements, + /// will remove less recently used elements until it can fit an new element. /// /// - /// When adding an new element to that is limiting element count, - /// will remove less recently used elements until it can fit an new element. + /// When adding an new element to that is limiting element count, + /// will remove less recently used elements until it can fit an new element. /// /// /// @@ -417,15 +417,15 @@ namespace OpenSim.Framework /// Gets the associated with the specified . /// /// - /// if the contains an element with + /// if the contains an element with /// the specified key; otherwise, . /// /// /// The key whose to get. /// /// - /// When this method returns, the value associated with the specified , - /// if the is found; otherwise, the + /// When this method returns, the value associated with the specified , + /// if the is found; otherwise, the /// default value for the type of the parameter. This parameter is passed uninitialized. /// /// diff --git a/OpenSim/Framework/ILandChannel.cs b/OpenSim/Framework/ILandChannel.cs index 63cc7ebf1e..44a24b94a3 100644 --- a/OpenSim/Framework/ILandChannel.cs +++ b/OpenSim/Framework/ILandChannel.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// List AllParcels(); - + /// /// Get the parcel at the specified point /// @@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// ILandObject GetLandObject(int localID); - + /// /// Clear the land channel of all parcels. /// @@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Interfaces /// If true, set up a default parcel covering the whole region owned by the estate owner. /// void Clear(bool setupDefaultParcel); - + bool IsForcefulBansAllowed(); void UpdateLandObject(int localID, LandData data); void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient); diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs index af072fe130..f3b850d528 100644 --- a/OpenSim/Framework/ILandObject.cs +++ b/OpenSim/Framework/ILandObject.cs @@ -43,33 +43,33 @@ namespace OpenSim.Framework LandData LandData { get; set; } bool[,] LandBitmap { get; set; } UUID RegionUUID { get; } - + /// /// Prim counts for this land object. /// IPrimCounts PrimCounts { get; set; } - + /// - /// The start point for the land object. This is the northern-most point as one scans land working from + /// The start point for the land object. This is the northern-most point as one scans land working from /// west to east. /// Vector2 StartPoint { get; } - + /// - /// The end point for the land object. This is the southern-most point as one scans land working from + /// The end point for the land object. This is the southern-most point as one scans land working from /// west to east. - /// + /// Vector2 EndPoint { get; } - // a estimation of a parcel center. + // a estimation of a parcel center. Vector2 CenterPoint { get; } - + // get positions Vector2? GetNearestPoint(Vector3 pos); Vector2? GetNearestPointAlongDirection(Vector3 pos, Vector3 pdirection); bool ContainsPoint(int x, int y); - + ILandObject Copy(); void SendLandUpdateToAvatarsOverMe(); @@ -97,16 +97,16 @@ namespace OpenSim.Framework /// /// The bitmap created. bool[,] BasicFullRegionLandBitmap(); - + /// /// Create a square land bitmap. /// /// /// Land co-ordinates are zero indexed. The inputs are treated as points. So if you want to create a bitmap - /// that covers an entire 256 x 256m region apart from a strip of land on the east, then you would need to + /// that covers an entire 256 x 256m region apart from a strip of land on the east, then you would need to /// specify start_x = 0, start_y = 0, end_x = 252 (or anything up to 255), end_y = 255. - /// - /// At the moment, the smallest parcel of land is 4m x 4m, so if the + /// + /// At the moment, the smallest parcel of land is 4m x 4m, so if the /// region is 256 x 256m (the SL size), the bitmap returned will start at (0,0) and end at (63,63). /// The value of the set_value needs to be true to define an active parcel of the given size. /// @@ -117,7 +117,7 @@ namespace OpenSim.Framework /// /// The bitmap created. bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true); - + bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); /// @@ -153,7 +153,7 @@ namespace OpenSim.Framework /// out: This is set if the resultant bitmap is now empty /// out: parcel.AABBMin <x,y,0> /// out: parcel.AABBMax <x,y,0> - /// New parcel bitmap + /// New parcel bitmap bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax); byte[] ConvertLandBitmapToBytes(); @@ -177,7 +177,7 @@ namespace OpenSim.Framework /// /// void SetMediaUrl(string url); - + /// /// Set the music url for this land parcel /// diff --git a/OpenSim/Framework/IPrimCounts.cs b/OpenSim/Framework/IPrimCounts.cs index 3e12348e1b..3b62ad3118 100644 --- a/OpenSim/Framework/IPrimCounts.cs +++ b/OpenSim/Framework/IPrimCounts.cs @@ -35,12 +35,12 @@ namespace OpenSim.Framework /// Parcel owner owned prims /// int Owner { get; } - + /// /// Parcel group owned prims /// int Group { get; } - + /// /// Prims owned by others (not parcel owner or parcel group). /// @@ -48,19 +48,19 @@ namespace OpenSim.Framework /// /// Selected prims - /// - int Selected { get; } - + /// + int Selected { get; } + /// /// Total prims on the parcel. /// int Total { get; } - + /// /// Prims on the simulator that are owned by the parcel owner, even if they are in other parcels. /// int Simulator { get; } - + /// /// Prims per individual users. /// diff --git a/OpenSim/Framework/IRegistryCore.cs b/OpenSim/Framework/IRegistryCore.cs index a94b65d529..cf3ecc0a0a 100644 --- a/OpenSim/Framework/IRegistryCore.cs +++ b/OpenSim/Framework/IRegistryCore.cs @@ -31,7 +31,7 @@ using System.Text; namespace OpenSim.Framework { - public interface IRegistryCore + public interface IRegistryCore { T Get(); void RegisterInterface(T iface); diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index e1b6d1e1ad..37a064fca6 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework Crashed = 2, Starting = 3, }; - + /// /// Indicate what action to take on an object derez request /// @@ -118,7 +118,7 @@ namespace OpenSim.Framework /// /// void RegisterModuleInterface(M mod); - + void StackModuleInterface(M mod); /// diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs index c8424e3691..5534e24eaf 100644 --- a/OpenSim/Framework/ISceneAgent.cs +++ b/OpenSim/Framework/ISceneAgent.cs @@ -81,6 +81,6 @@ namespace OpenSim.Framework /// Direction in which the scene presence is looking. /// /// Will be Vector3.Zero for a child agent. - Vector3 Lookat { get; } + Vector3 Lookat { get; } } } \ No newline at end of file diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs index 139776bb39..d14f3bee2b 100644 --- a/OpenSim/Framework/InventoryFolderImpl.cs +++ b/OpenSim/Framework/InventoryFolderImpl.cs @@ -314,7 +314,7 @@ namespace OpenSim.Framework /// XPath like expression /// /// FIXME: Delimitors which occur in names themselves are not currently escapable. - /// + /// /// /// The path to the required folder. /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index f9fd752370..c359a0cca3 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -34,17 +34,17 @@ namespace OpenSim.Framework /// Inventory Item - contains all the properties associated with an individual inventory piece. /// public class InventoryItemBase : InventoryNodeBase, ICloneable - { + { /// /// The inventory type of the item. This is slightly different from the asset type in some situations. /// - public int InvType - { + public int InvType + { get { return m_invType; } - + set { m_invType = value; @@ -55,13 +55,13 @@ namespace OpenSim.Framework /// /// The folder this item is contained in /// - public UUID Folder - { + public UUID Folder + { get { return m_folder; } - + set { m_folder = value; @@ -72,17 +72,17 @@ namespace OpenSim.Framework /// /// The creator of this item /// - public string CreatorId - { + public string CreatorId + { get { - return m_creatorId; + return m_creatorId; } - + set { m_creatorId = value; - + if ((m_creatorId == null) || !UUID.TryParse(m_creatorId, out m_creatorIdAsUuid)) m_creatorIdAsUuid = UUID.Zero; } @@ -92,7 +92,7 @@ namespace OpenSim.Framework /// /// The CreatorId expressed as a UUID. /// - public UUID CreatorIdAsUuid + public UUID CreatorIdAsUuid { get { @@ -161,13 +161,13 @@ namespace OpenSim.Framework /// /// The description of the inventory item (must be less than 64 characters) /// - public string Description - { + public string Description + { get { return m_description; } - + set { m_description = value; @@ -178,13 +178,13 @@ namespace OpenSim.Framework /// /// /// - public uint NextPermissions - { + public uint NextPermissions + { get { return m_nextPermissions; } - + set { m_nextPermissions = value; @@ -195,13 +195,13 @@ namespace OpenSim.Framework /// /// A mask containing permissions for the current owner (cannot be enforced) /// - public uint CurrentPermissions - { + public uint CurrentPermissions + { get { return m_currentPermissions; } - + set { m_currentPermissions = value; @@ -212,13 +212,13 @@ namespace OpenSim.Framework /// /// /// - public uint BasePermissions - { + public uint BasePermissions + { get { return m_basePermissions; } - + set { m_basePermissions = value; @@ -229,13 +229,13 @@ namespace OpenSim.Framework /// /// /// - public uint EveryOnePermissions - { + public uint EveryOnePermissions + { get { return m_everyonePermissions; } - + set { m_everyonePermissions = value; @@ -246,13 +246,13 @@ namespace OpenSim.Framework /// /// /// - public uint GroupPermissions - { + public uint GroupPermissions + { get { return m_groupPermissions; } - + set { m_groupPermissions = value; @@ -263,13 +263,13 @@ namespace OpenSim.Framework /// /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) /// - public int AssetType - { + public int AssetType + { get { return m_assetType; } - + set { m_assetType = value; @@ -280,13 +280,13 @@ namespace OpenSim.Framework /// /// The UUID of the associated asset on the asset server /// - public UUID AssetID - { + public UUID AssetID + { get { return m_assetID; } - + set { m_assetID = value; @@ -297,13 +297,13 @@ namespace OpenSim.Framework /// /// /// - public UUID GroupID - { + public UUID GroupID + { get { return m_groupID; } - + set { m_groupID = value; @@ -314,13 +314,13 @@ namespace OpenSim.Framework /// /// /// - public bool GroupOwned - { + public bool GroupOwned + { get { return m_groupOwned; } - + set { m_groupOwned = value; @@ -331,13 +331,13 @@ namespace OpenSim.Framework /// /// /// - public int SalePrice - { + public int SalePrice + { get { return m_salePrice; } - + set { m_salePrice = value; @@ -348,13 +348,13 @@ namespace OpenSim.Framework /// /// /// - public byte SaleType - { + public byte SaleType + { get { return m_saleType; } - + set { m_saleType = value; @@ -365,13 +365,13 @@ namespace OpenSim.Framework /// /// /// - public uint Flags - { + public uint Flags + { get { return m_flags; } - + set { m_flags = value; @@ -382,13 +382,13 @@ namespace OpenSim.Framework /// /// /// - public int CreationDate - { + public int CreationDate + { get { return m_creationDate; } - + set { m_creationDate = value; diff --git a/OpenSim/Framework/InventoryNodeBase.cs b/OpenSim/Framework/InventoryNodeBase.cs index 31c3fd1840..9ef36b7bde 100644 --- a/OpenSim/Framework/InventoryNodeBase.cs +++ b/OpenSim/Framework/InventoryNodeBase.cs @@ -41,19 +41,19 @@ namespace OpenSim.Framework { get { return m_name; } set { m_name = value; } - } + } private string m_name = string.Empty; - + /// /// A UUID containing the ID for the inventory node itself /// - public UUID ID + public UUID ID { get { return m_id; } set { m_id = value; } } private UUID m_id; - + /// /// The agent who's inventory this is contained by /// diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index cfefe3e8e6..13d29776c5 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -411,7 +411,7 @@ namespace OpenSim.Framework } /// - /// Determines if people are able to teleport where they please on the parcel or if they + /// Determines if people are able to teleport where they please on the parcel or if they /// get constrainted to a specific point on teleport within the parcel /// public byte LandingType @@ -667,7 +667,7 @@ namespace OpenSim.Framework } /// - /// When teleporting is restricted to a certain point, this is the location + /// When teleporting is restricted to a certain point, this is the location /// that the user will be redirected to /// public Vector3 UserLocation @@ -683,7 +683,7 @@ namespace OpenSim.Framework } /// - /// When teleporting is restricted to a certain point, this is the rotation + /// When teleporting is restricted to a certain point, this is the rotation /// that the user will be positioned /// public Vector3 UserLookAt @@ -699,7 +699,7 @@ namespace OpenSim.Framework } /// - /// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own + /// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own /// the parcel and isn't set to the same 'group' as the parcel. /// public int OtherCleanTime diff --git a/OpenSim/Framework/Lazy.cs b/OpenSim/Framework/Lazy.cs index 91de4bdd1d..ea07d0ecf6 100644 --- a/OpenSim/Framework/Lazy.cs +++ b/OpenSim/Framework/Lazy.cs @@ -14,10 +14,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/OpenSim/Framework/LocklessQueue.cs b/OpenSim/Framework/LocklessQueue.cs index 7ccbba7b55..21b81785c3 100644 --- a/OpenSim/Framework/LocklessQueue.cs +++ b/OpenSim/Framework/LocklessQueue.cs @@ -102,7 +102,7 @@ namespace OpenSim.Framework } else { - item = oldHeadNext.Item; + item = oldHeadNext.Item; haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext); if (haveAdvancedHead) { diff --git a/OpenSim/Framework/MapAndArray.cs b/OpenSim/Framework/MapAndArray.cs index c98d3ccd6f..32d6978fb6 100644 --- a/OpenSim/Framework/MapAndArray.cs +++ b/OpenSim/Framework/MapAndArray.cs @@ -45,9 +45,9 @@ namespace OpenSim.Framework /// Number of values currently stored in the collection public int Count { get { return m_array.Length; } } - /// NOTE: This collection is thread safe. You do not need to - /// acquire a lock to add, remove, or enumerate entries. This - /// synchronization object should only be locked for larger + /// NOTE: This collection is thread safe. You do not need to + /// acquire a lock to add, remove, or enumerate entries. This + /// synchronization object should only be locked for larger /// transactions public object SyncRoot { get { return m_syncRoot; } } @@ -92,7 +92,7 @@ namespace OpenSim.Framework } /// - /// Adds a key/value pair to the collection. This will throw an + /// Adds a key/value pair to the collection. This will throw an /// exception if the key is already present in the collection /// /// Key to add or update @@ -166,7 +166,7 @@ namespace OpenSim.Framework /// Gets a reference to the immutable array of values stored in this /// collection. This array is thread safe for iteration /// - /// A thread safe reference ton an array of all of the stored + /// A thread safe reference ton an array of all of the stored /// values public TValue[] GetArray() { @@ -175,7 +175,7 @@ namespace OpenSim.Framework private void CreateArray() { - // Rebuild the array from the dictionary. This method must be + // Rebuild the array from the dictionary. This method must be // called from inside a lock TValue[] array = new TValue[m_dict.Count]; int i = 0; diff --git a/OpenSim/Framework/MapItemReplyStruct.cs b/OpenSim/Framework/MapItemReplyStruct.cs index c8693ae4d2..348a24079e 100644 --- a/OpenSim/Framework/MapItemReplyStruct.cs +++ b/OpenSim/Framework/MapItemReplyStruct.cs @@ -60,7 +60,7 @@ namespace OpenSim.Framework map["Extra2"] = OSD.FromInteger(Extra2); return map; } - + public void FromOSD(OSDMap map) { x = (uint) map["X"].AsInteger(); diff --git a/OpenSim/Framework/MetricsCollector.cs b/OpenSim/Framework/MetricsCollector.cs index c8f4a33260..391f57e4a7 100644 --- a/OpenSim/Framework/MetricsCollector.cs +++ b/OpenSim/Framework/MetricsCollector.cs @@ -42,23 +42,23 @@ namespace OpenSim.Framework } } - + struct MetricsBucket { public T value; public int count; } - + /// /// Collects metrics in a sliding window. /// /// /// MetricsCollector provides the current Sum of the metrics that it collects. It can easily be extended /// to provide the Average, too. It uses a sliding window to keep these values current. - /// + /// /// This class is not thread-safe. - /// + /// /// Subclass MetricsCollector to have it use a concrete value type. Override the abstract methods. /// public abstract class MetricsCollector diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index 8c2bec6668..e513abd0f6 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs @@ -78,7 +78,7 @@ namespace OpenSim.Framework.Monitoring return sb.ToString(); } - + public virtual string XReport(string uptime, string version) { return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; diff --git a/OpenSim/Framework/Monitoring/Checks/Check.cs b/OpenSim/Framework/Monitoring/Checks/Check.cs index 594386a93f..9a1bd4544a 100644 --- a/OpenSim/Framework/Monitoring/Checks/Check.cs +++ b/OpenSim/Framework/Monitoring/Checks/Check.cs @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Monitoring string category, string container, Func checkFunc, - StatVerbosity verbosity) + StatVerbosity verbosity) { if (ChecksManager.SubCommands.Contains(category)) throw new Exception( @@ -108,9 +108,9 @@ namespace OpenSim.Framework.Monitoring public virtual string ToConsoleString() { return string.Format( - "{0}.{1}.{2} - {3}", - Category, - Container, + "{0}.{1}.{2} - {3}", + Category, + Container, ShortName, Description); } diff --git a/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs b/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs index 40df562a95..e326e8bff0 100644 --- a/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs @@ -39,7 +39,7 @@ namespace OpenSim.Framework.Monitoring /// /// string Report(); - + /// /// Report back collected statistical information in json /// diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs index df6b806b4c..0a39e4b6be 100644 --- a/OpenSim/Framework/Monitoring/JobEngine.cs +++ b/OpenSim/Framework/Monitoring/JobEngine.cs @@ -49,7 +49,7 @@ namespace OpenSim.Framework.Monitoring /// /// Is this engine running? /// - public bool IsRunning { get; private set; } + public bool IsRunning { get; private set; } /// /// The current job that the engine is running. @@ -73,7 +73,7 @@ namespace OpenSim.Framework.Monitoring /// Controls whether we need to warn in the log about exceeding the max queue size. /// /// - /// This is flipped to false once queue max has been exceeded and back to true when it falls below max, in + /// This is flipped to false once queue max has been exceeded and back to true when it falls below max, in /// order to avoid spamming the log with lots of warnings. /// private bool m_warnOverMaxQueue = true; @@ -120,7 +120,7 @@ namespace OpenSim.Framework.Monitoring } public void Stop() - { + { lock (JobLock) { try @@ -150,7 +150,7 @@ namespace OpenSim.Framework.Monitoring /// Make a job. /// /// - /// We provide this method to replace the constructor so that we can later pool job objects if necessary to + /// We provide this method to replace the constructor so that we can later pool job objects if necessary to /// reduce memory churn. Normally one would directly call QueueJob() with parameters anyway. /// /// @@ -304,7 +304,7 @@ namespace OpenSim.Framework.Monitoring CommonId = commonId; Action = action; } - + /// /// Make a job. It needs to be separately queued. /// diff --git a/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs b/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs index 756e4edd83..2ff2014b1a 100644 --- a/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Framework.Monitoring")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs index be4a8b463d..3391240ce5 100644 --- a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs @@ -167,18 +167,18 @@ namespace OpenSim.Framework.Monitoring } MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool, - s => - { - int workerThreads, iocpThreads; - ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); + s => + { + int workerThreads, iocpThreads; + ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); s.Value = workerThreads; }); MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool, - s => - { - int workerThreads, iocpThreads; - ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); + s => + { + int workerThreads, iocpThreads; + ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); s.Value = iocpThreads; }); @@ -193,10 +193,10 @@ namespace OpenSim.Framework.Monitoring } MakeStat( - "HTTPRequestsMade", - "Number of outbound HTTP requests made", - "requests", - ContainerNetwork, + "HTTPRequestsMade", + "Number of outbound HTTP requests made", + "requests", + ContainerNetwork, s => s.Value = WebUtil.RequestNumber, MeasuresOfInterest.AverageChangeOverTime); @@ -294,7 +294,7 @@ namespace OpenSim.Framework.Monitoring }); } - // Notes on performance counters: + // Notes on performance counters: // "How To Read Performance Counters": http://blogs.msdn.com/b/bclteam/archive/2006/06/02/618156.aspx // "How to get the CPU Usage in C#": http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-in-c // "Mono Performance Counters": http://www.mono-project.com/Mono_Performance_Counters diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 08c24095be..88a02973fe 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs @@ -90,17 +90,17 @@ namespace OpenSim.Framework.Monitoring // /// haven't yet been implemented... // /// // public long AssetsInCache { get { return assetsInCache; } } -// +// // /// // /// Currently unused // /// // public long TexturesInCache { get { return texturesInCache; } } -// +// // /// // /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit // /// // public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } -// +// // /// // /// Currently unused // /// @@ -127,7 +127,7 @@ namespace OpenSim.Framework.Monitoring public float PendingUploads { get { return pendingUploads; } } public float ActiveScripts { get { return activeScripts; } } public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } } - + // /// // /// This is the time it took for the last asset request made in response to a cache miss. // /// @@ -177,7 +177,7 @@ namespace OpenSim.Framework.Monitoring // assetsInCache++; // //assetCacheMemoryUsage += asset.Data.Length; // } -// +// // public void RemoveAsset(UUID uuid) // { // assetsInCache--; @@ -204,7 +204,7 @@ namespace OpenSim.Framework.Monitoring // texturesInCache = 0; // textureCacheMemoryUsage = 0; // } -// +// // public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts) // { // assetRequestTimeAfterCacheMiss = ts; @@ -306,7 +306,7 @@ namespace OpenSim.Framework.Monitoring StringBuilder sb = new StringBuilder(Environment.NewLine); // sb.Append("ASSET STATISTICS"); // sb.Append(Environment.NewLine); - + /* sb.Append( string.Format( @@ -342,7 +342,7 @@ Asset service request failures: {3}" + Environment.NewLine, List stats = StatsManager.GetStatsFromEachContainer("clientstack", "ClientLogoutsDueToNoReceives"); sb.AppendFormat( - "Client logouts due to no data receive timeout: {0}\n\n", + "Client logouts due to no data receive timeout: {0}\n\n", stats != null ? stats.Sum(s => s.Value).ToString() : "unknown"); // sb.Append(Environment.NewLine); @@ -443,10 +443,10 @@ Asset service request failures: {3}" + Environment.NewLine, foreach (ProcessThread currentThread in Process.GetCurrentProcess().Threads) { - // A known issue with the current process .Threads property is - // that it can return null threads, thus don't count those as + // A known issue with the current process .Threads property is + // that it can return null threads, thus don't count those as // running threads and prevent the program function from failing - if (currentThread != null && + if (currentThread != null && currentThread.ThreadState == ThreadState.Running) { numberThreadsRunning++; @@ -505,7 +505,7 @@ Asset service request failures: {3}" + Environment.NewLine, "{0:0.##}", numberThreadsRunning)); args["ProcMem"] = OSD.FromString(String.Format("{0:#,###,###.##}", memUsage)); - + return args; } } @@ -531,12 +531,12 @@ Asset service request failures: {3}" + Environment.NewLine, { return m_statsProvider.GetStats(); } - + public string XReport(string uptime, string version) { return ""; } - + public OSDMap OReport(string uptime, string version) { OSDMap ret = new OSDMap(); diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index 916fa53908..2402acd2d1 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs @@ -121,17 +121,17 @@ namespace OpenSim.Framework.Monitoring string container, StatType type, Action pullAction, - StatVerbosity verbosity) + StatVerbosity verbosity) : this( - shortName, - name, - description, - unitName, - category, - container, - type, - MeasuresOfInterest.None, - pullAction, + shortName, + name, + description, + unitName, + category, + container, + type, + MeasuresOfInterest.None, + pullAction, verbosity) { } @@ -227,11 +227,11 @@ namespace OpenSim.Framework.Monitoring { StringBuilder sb = new StringBuilder(); sb.AppendFormat( - "{0}.{1}.{2} : {3}{4}", - Category, - Container, - ShortName, - Value, + "{0}.{1}.{2} : {3}{4}", + Category, + Container, + ShortName, + Value, string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); AppendMeasuresOfInterest(sb); @@ -290,7 +290,7 @@ namespace OpenSim.Framework.Monitoring lock (m_samples) { // m_log.DebugFormat( - // "[STAT]: Samples for {0} are {1}", + // "[STAT]: Samples for {0} are {1}", // Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray())); foreach (double s in m_samples) @@ -326,9 +326,9 @@ namespace OpenSim.Framework.Monitoring if (ComputeMeasuresOfInterest(out lastChangeOverTime, out averageChangeOverTime)) { sb.AppendFormat( - ", {0:0.##}{1}/s, {2:0.##}{3}/s", - lastChangeOverTime, - string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), + ", {0:0.##}{1}/s, {2:0.##}{3}/s", + lastChangeOverTime, + string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), averageChangeOverTime, string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); } diff --git a/OpenSim/Framework/Monitoring/StatsLogger.cs b/OpenSim/Framework/Monitoring/StatsLogger.cs index 15a37aa104..b719af982e 100644 --- a/OpenSim/Framework/Monitoring/StatsLogger.cs +++ b/OpenSim/Framework/Monitoring/StatsLogger.cs @@ -99,13 +99,13 @@ namespace OpenSim.Framework.Monitoring } string path = cmd[2]; - + using (StreamWriter sw = new StreamWriter(path, true)) { foreach (string line in GetReport()) sw.WriteLine(line); - } - + } + MainConsole.Instance.OutputFormat("Stats saved to file {0}", path); } diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 30926d8e7d..55c327656a 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs @@ -274,7 +274,7 @@ namespace OpenSim.Framework.Monitoring { if (!(string.IsNullOrEmpty(pContainerName) || pContainerName == AllSubCommand || pContainerName == contName)) continue; - + OSDMap statMap = new OSDMap(); SortedDictionary theStats = RegisteredStats[catName][contName]; @@ -398,7 +398,7 @@ namespace OpenSim.Framework.Monitoring { if (!TryGetStatParents(stat, out category, out container)) return false; - + if(container != null) { container.Remove(stat.ShortName); diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index ff439f5c1f..9cc61ee62d 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs @@ -96,7 +96,7 @@ namespace OpenSim.Framework.Monitoring FirstTick = Environment.TickCount & Int32.MaxValue; LastTick = FirstTick; - Stat + Stat = new Stat( name, string.Format("Last update of thread {0}", name), diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs index a7a03a0c13..43130f9a0b 100644 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs @@ -36,16 +36,16 @@ namespace OpenSim.Framework.Monitoring /// Manages various work items in the simulator. /// /// - /// Currently, here work can be started + /// Currently, here work can be started /// * As a long-running and monitored thread. /// * In a thread that will never timeout but where the job is expected to eventually complete. /// * In a threadpool thread that will timeout if it takes a very long time to complete (> 10 mins). /// * As a job which will be run in a single-threaded job engine. Such jobs must not incorporate delays (sleeps, /// network waits, etc.). - /// + /// /// This is an evolving approach to better manage the work that OpenSimulator is asked to do from a very diverse /// range of sources (client actions, incoming network, outgoing network calls, etc.). - /// + /// /// Util.FireAndForget is still available to insert jobs in the threadpool, though this is equivalent to /// WorkManager.RunInThreadPool(). /// @@ -122,7 +122,7 @@ namespace OpenSim.Framework.Monitoring thread.Priority = priority; thread.IsBackground = isBackground; thread.Name = name; - + Watchdog.ThreadWatchdogInfo twi = new Watchdog.ThreadWatchdogInfo(thread, timeout, name) { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; @@ -144,7 +144,7 @@ namespace OpenSim.Framework.Monitoring /// Name of the thread public static void RunInThread(WaitCallback callback, object obj, string name, bool log = false) { - if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) + if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) { Culture.SetCurrentCulture(); callback(obj); @@ -169,7 +169,7 @@ namespace OpenSim.Framework.Monitoring } /// - /// Run the callback via a threadpool thread. + /// Run the callback via a threadpool thread. /// /// /// Such jobs may run after some delay but must always complete. @@ -188,17 +188,17 @@ namespace OpenSim.Framework.Monitoring /// /// This differs from direct scheduling (e.g. Util.FireAndForget) in that a job can be run in the job /// engine if it is running, where all jobs are currently performed in sequence on a single thread. This is - /// to prevent observed overload and server freeze problems when there are hundreds of connections which all attempt to + /// to prevent observed overload and server freeze problems when there are hundreds of connections which all attempt to /// perform work at once (e.g. in conference situations). With lower numbers of connections, the small - /// delay in performing jobs in sequence rather than concurrently has not been notiecable in testing, though a future more + /// delay in performing jobs in sequence rather than concurrently has not been notiecable in testing, though a future more /// sophisticated implementation could perform jobs concurrently when the server is under low load. - /// + /// /// However, be advised that some callers of this function rely on all jobs being performed in sequence if any /// jobs are performed in sequence (i.e. if jobengine is active or not). Therefore, expanding the jobengine /// beyond a single thread will require considerable thought. - /// + /// /// Also, any jobs submitted must be guaranteed to complete within a reasonable timeframe (e.g. they cannot - /// incorporate a network delay with a long timeout). At the moment, work that could suffer such issues + /// incorporate a network delay with a long timeout). At the moment, work that could suffer such issues /// should still be run directly with RunInThread(), Util.FireAndForget(), etc. This is another area where /// the job engine could be improved and so CPU utilization improved by better management of concurrency within /// OpenSimulator. @@ -212,10 +212,10 @@ namespace OpenSim.Framework.Monitoring /// If set to true then extra logging is performed. public static void RunJob( string jobType, WaitCallback callback, object obj, string name, - bool canRunInThisThread = false, bool mustNotTimeout = false, + bool canRunInThisThread = false, bool mustNotTimeout = false, bool log = false) { - if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) + if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) { Culture.SetCurrentCulture(); callback(obj); @@ -273,16 +273,16 @@ namespace OpenSim.Framework.Monitoring MainConsole.Instance.Output("Usage: debug jobengine log "); return; } - + // int logLevel; int logLevel = int.Parse(args[3]); // if (ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out logLevel)) - // { + // { JobEngine.LogLevel = logLevel; MainConsole.Instance.OutputFormat("Set debug log level to {0}", JobEngine.LogLevel); // } } - else + else { MainConsole.Instance.OutputFormat("Unrecognized job engine subcommand {0}", subCommand); } diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs index 2e94b0d5b4..93c94463a2 100644 --- a/OpenSim/Framework/NetworkUtil.cs +++ b/OpenSim/Framework/NetworkUtil.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework /// Handles NAT translation in a 'manner of speaking' /// Allows you to return multiple different external /// hostnames depending on the requestors network - /// + /// /// This enables standard port forwarding techniques /// to work correctly with OpenSim. /// @@ -145,7 +145,7 @@ namespace OpenSim.Framework byte[] subnetBytes = subnet.Value.GetAddressBytes(); byte[] localBytes = subnet.Key.GetAddressBytes(); byte[] destBytes = destination.GetAddressBytes(); - + if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length) return null; diff --git a/OpenSim/Framework/OutboundUrlFilter.cs b/OpenSim/Framework/OutboundUrlFilter.cs index baa3647677..ee4707fa8c 100644 --- a/OpenSim/Framework/OutboundUrlFilter.cs +++ b/OpenSim/Framework/OutboundUrlFilter.cs @@ -49,8 +49,8 @@ namespace OpenSim.Framework private List m_blacklistExceptionEndPoints; public OutboundUrlFilter( - string name, - List blacklistNetworks, List blacklistEndPoints, + string name, + List blacklistNetworks, List blacklistEndPoints, List blacklistExceptionNetworks, List blacklistExceptionEndPoints) { Name = name; @@ -79,7 +79,7 @@ namespace OpenSim.Framework if (networkConfig != null) { configBlacklist = networkConfig.GetString("OutboundDisallowForUserScripts", configBlacklist); - configBlacklistExceptions + configBlacklistExceptions = networkConfig.GetString("OutboundDisallowForUserScriptsExcept", configBlacklistExceptions); } @@ -98,7 +98,7 @@ namespace OpenSim.Framework string fullConfigEntry, string filterName, out List networks, out List endPoints) { // Parse blacklist - string[] configBlacklistEntries + string[] configBlacklistEntries = fullConfigEntry.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); configBlacklistEntries = configBlacklistEntries.Select(e => e.Trim()).ToArray(); @@ -129,7 +129,7 @@ namespace OpenSim.Framework if (!Uri.TryCreate("http://" + configEntry, UriKind.Absolute, out configEntryUri)) { m_log.ErrorFormat( - "[OUTBOUND URL FILTER]: EndPoint entry [{0}] is invalid endpoint for {1}", + "[OUTBOUND URL FILTER]: EndPoint entry [{0}] is invalid endpoint for {1}", configEntry, filterName); continue; @@ -184,14 +184,14 @@ namespace OpenSim.Framework foreach (IPEndPoint ep in endPoints) { // m_log.DebugFormat( -// "[OUTBOUND URL FILTER]: Checking [{0}:{1}] against endpoint [{2}]", +// "[OUTBOUND URL FILTER]: Checking [{0}:{1}] against endpoint [{2}]", // addr, port, ep); if (addr.Equals(ep.Address) && port == ep.Port) { // m_log.DebugFormat( // "[OUTBOUND URL FILTER]: Found [{0}:{1}] in endpoint [{2}]", addr, port, ep); - + return true; } } @@ -228,7 +228,7 @@ namespace OpenSim.Framework // m_log.DebugFormat("[OUTBOUND URL FILTER]: Found [{0}] in blacklist for {1}", url, Name); // Check blacklist exceptions - allowed + allowed = OutboundUrlFilter.IsInNetwork( addr, url.Port, m_blacklistExceptionNetworks, m_blacklistExceptionEndPoints, Name); diff --git a/OpenSim/Framework/PluginManager.cs b/OpenSim/Framework/PluginManager.cs index 011709602b..0c94fcb32e 100644 --- a/OpenSim/Framework/PluginManager.cs +++ b/OpenSim/Framework/PluginManager.cs @@ -44,17 +44,17 @@ namespace OpenSim.Framework /// /// Manager for registries and plugins /// - public class PluginManager : SetupService - { - public AddinRegistry PluginRegistry; + public class PluginManager : SetupService + { + public AddinRegistry PluginRegistry; - public PluginManager(AddinRegistry registry): base (registry) + public PluginManager(AddinRegistry registry): base (registry) { - PluginRegistry = registry; + PluginRegistry = registry; - } + } - /// + /// /// Installs the plugin. /// /// @@ -97,14 +97,14 @@ namespace OpenSim.Framework Addin addin = PluginRegistry.GetAddin(aentry.Addin.Id); PluginRegistry.DisableAddin(addin.Id); addin.Enabled = false; - + MainConsole.Instance.Output("Installation Success"); ListInstalledAddins(out res); result = res; return true; - } + } else - { + { MainConsole.Instance.Output("Installation Failed"); result = res; return false; @@ -159,11 +159,11 @@ namespace OpenSim.Framework { Dictionary res = new Dictionary(); - Addin[] addins = GetSortedAddinList("RobustPlugin"); - if(addins.Count() < 1) - { - MainConsole.Instance.Output("Error!"); - } + Addin[] addins = GetSortedAddinList("RobustPlugin"); + if(addins.Count() < 1) + { + MainConsole.Instance.Output("Error!"); + } int count = 0; foreach (Addin addin in addins) { @@ -377,7 +377,7 @@ namespace OpenSim.Framework r["enabled"] = rep.Enabled == true ? true : false; r["name"] = rep.Name; r["url"] = rep.Url; - + res.Add(count.ToString(), r); count++; } @@ -493,7 +493,7 @@ namespace OpenSim.Framework } - + #region Util private void Testing() { @@ -537,15 +537,15 @@ namespace OpenSim.Framework ArrayList xlist = new ArrayList(); ArrayList list = new ArrayList(); - try - { - list.AddRange(PluginRegistry.GetAddins()); - } - catch (Exception) - { - Addin[] x = xlist.ToArray(typeof(Addin)) as Addin[]; - return x; - } + try + { + list.AddRange(PluginRegistry.GetAddins()); + } + catch (Exception) + { + Addin[] x = xlist.ToArray(typeof(Addin)) as Addin[]; + return x; + } foreach (Addin addin in list) { @@ -559,5 +559,5 @@ namespace OpenSim.Framework return addins; } #endregion Util - } + } } diff --git a/OpenSim/Framework/PrimeNumberHelper.cs b/OpenSim/Framework/PrimeNumberHelper.cs index 477c274c3b..5a1b3b2903 100644 --- a/OpenSim/Framework/PrimeNumberHelper.cs +++ b/OpenSim/Framework/PrimeNumberHelper.cs @@ -35,7 +35,7 @@ namespace OpenSim.Framework public static class PrimeNumberHelper { /// - /// Precalculated prime numbers. + /// Precalculated prime numbers. /// private static readonly int[] Primes = new int[] { diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 6a12a45307..29985d2586 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -238,8 +238,8 @@ namespace OpenSim.Framework SculptTexture = prim.Sculpt.SculptTexture; SculptType = (byte)prim.Sculpt.Type; } - else - { + else + { SculptType = (byte)OpenMetaverse.SculptType.None; } } diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs index fec01da4bf..5b9185e5c8 100644 --- a/OpenSim/Framework/PriorityQueue.cs +++ b/OpenSim/Framework/PriorityQueue.cs @@ -57,11 +57,11 @@ namespace OpenSim.Framework private Dictionary m_lookupTable; // internal state used to ensure the deqeues are spread across the priority - // queues "fairly". queuecounts is the amount to pull from each queue in + // queues "fairly". queuecounts is the amount to pull from each queue in // each pass. weighted towards the higher priority queues private uint m_nextQueue = 0; private uint m_countFromQueue = 0; - // first queues are imediate, so no counts + // first queues are imediate, so no counts // private uint[] m_queueCounts = { 0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1 }; private uint[] m_queueCounts = {0, 0, 8, 8, 5, 4, 3, 2, 1, 1, 1, 1}; // this is ava, ava, attach, <10m, 20,40,80,160m,320,640,1280, + @@ -105,7 +105,7 @@ namespace OpenSim.Framework int count = 0; for (int i = 0; i < m_heaps.Length; ++i) count += m_heaps[i].Count; - + return count; } } @@ -170,26 +170,26 @@ namespace OpenSim.Framework return true; } } - + // To get the fair queing, we cycle through each of the - // queues when finding an element to dequeue. + // queues when finding an element to dequeue. // We pull (NumberOfQueues - QueueIndex) items from each queue in order // to give lower numbered queues a higher priority and higher percentage - // of the bandwidth. - + // of the bandwidth. + // Check for more items to be pulled from the current queue if (m_heaps[m_nextQueue].Count > 0 && m_countFromQueue > 0) { m_countFromQueue--; - + MinHeapItem item = m_heaps[m_nextQueue].RemoveMin(); m_lookupTable.Remove(item.Value.Entity.LocalId); timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); value = item.Value; - + return true; } - + // Find the next non-immediate queue with updates in it for (uint i = NumberOfImmediateQueues; i < NumberOfQueues; ++i) { @@ -198,7 +198,7 @@ namespace OpenSim.Framework m_nextQueue = NumberOfImmediateQueues; m_countFromQueue = m_queueCounts[m_nextQueue]; - + if (m_heaps[m_nextQueue].Count > 0) { m_countFromQueue--; @@ -218,7 +218,7 @@ namespace OpenSim.Framework /// /// Reapply the prioritization function to each of the updates currently - /// stored in the priority queues. + /// stored in the priority queues. /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) /// @@ -389,17 +389,17 @@ namespace OpenSim.Framework /// /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) /// - + public string ServerURI { - get { + get { if ( m_serverURI != string.Empty ) { return m_serverURI; } else { return "http://" + m_externalHostName + ":" + m_httpPort + "/"; } - } - set { + } + set { if ( value.EndsWith("/") ) { m_serverURI = value; } else { @@ -749,10 +749,10 @@ namespace OpenSim.Framework m_physPrimMax = config.GetInt("PhysicalPrimMax", 0); allKeys.Remove("PhysicalPrimMax"); - + m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); allKeys.Remove("ClampPrimSize"); - + m_objectCapacity = config.GetInt("MaxPrims", 15000); allKeys.Remove("MaxPrims"); @@ -766,12 +766,12 @@ namespace OpenSim.Framework string mapTileStaticUUID = config.GetString("MaptileStaticUUID", UUID.Zero.ToString()); if (UUID.TryParse(mapTileStaticUUID.Trim(), out m_maptileStaticUUID)) { - config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); + config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); } MaptileStaticFile = config.GetString("MaptileStaticFile", String.Empty); allKeys.Remove("MaptileStaticFile"); - + #endregion AgentCapacity = config.GetInt("MaxAgents", 100); @@ -919,10 +919,10 @@ namespace OpenSim.Framework if (m_physPrimMin > 0) config.Set("PhysicalPrimMax", m_physPrimMin); - + if (m_physPrimMax > 0) config.Set("PhysicalPrimMax", m_physPrimMax); - + config.Set("ClampPrimSize", m_clampPrimSize.ToString()); if (m_objectCapacity > 0) @@ -1038,7 +1038,7 @@ namespace OpenSim.Framework configMember.addConfigurationOption("region_type", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Free form string describing the type of region", String.Empty, true); - + configMember.addConfigurationOption("region_static_maptile", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true); } @@ -1090,7 +1090,7 @@ namespace OpenSim.Framework configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", "15000", true); - + configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max avatars this sim will hold", "100", true); @@ -1307,8 +1307,8 @@ namespace OpenSim.Framework kvp["http_port"] = HttpPort.ToString(); kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); kvp["internal_port"] = InternalEndPoint.Port.ToString(); - // TODO: Remove in next major version - kvp["alternate_ports"] = "False"; + // TODO: Remove in next major version + kvp["alternate_ports"] = "False"; kvp["server_uri"] = ServerURI; return kvp; diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index dec01ea6be..c2947a298b 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -91,7 +91,7 @@ namespace OpenSim.Framework string[] parts = str.Split(','); if (parts.Length != 3) throw new ArgumentException("Invalid string: " + str); - + SpawnPoint sp = new SpawnPoint(); sp.Yaw = float.Parse(parts[0]); sp.Pitch = float.Parse(parts[1]); @@ -105,7 +105,7 @@ namespace OpenSim.Framework public delegate void SaveDelegate(RegionSettings rs); public event SaveDelegate OnSave; - + /// /// These appear to be terrain textures that are shipped with the client. /// @@ -454,24 +454,24 @@ namespace OpenSim.Framework get { return m_LoadedCreationDateTime; } set { m_LoadedCreationDateTime = value; } } - + public String LoadedCreationDate { - get - { + get + { TimeSpan ts = new TimeSpan(0, 0, LoadedCreationDateTime); DateTime stamp = new DateTime(1970, 1, 1) + ts; - return stamp.ToLongDateString(); + return stamp.ToLongDateString(); } } public String LoadedCreationTime { - get - { + get + { TimeSpan ts = new TimeSpan(0, 0, LoadedCreationDateTime); DateTime stamp = new DateTime(1970, 1, 1) + ts; - return stamp.ToLongTimeString(); + return stamp.ToLongTimeString(); } } diff --git a/OpenSim/Framework/RestClient.cs b/OpenSim/Framework/RestClient.cs index 26237deae4..0166d9d37e 100644 --- a/OpenSim/Framework/RestClient.cs +++ b/OpenSim/Framework/RestClient.cs @@ -156,7 +156,7 @@ namespace OpenSim.Framework public void Dispose() { Dispose(true); - GC.SuppressFinalize(this); + GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index e66d5be192..9458625667 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs @@ -44,7 +44,7 @@ namespace OpenSim.Framework Material = -2 } - + #region SL / file extension / content-type conversions /// @@ -175,10 +175,10 @@ namespace OpenSim.Framework new TypeMapping(AssetType.Folder, FolderType.CurrentOutfit, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"), new TypeMapping(AssetType.Folder, FolderType.Outfit, "application/vnd.ll.outfitfolder", "outfitfolder"), new TypeMapping(AssetType.Folder, FolderType.MyOutfits, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"), - + // This next mappping is an asset to inventory item mapping. // Note: LL stores folders as assets of type Folder = 8, and it has a corresponding InventoryType = 8 - // OpenSim doesn't store folders as assets, so this mapping should only be used when parsing things from the viewer to the server + // OpenSim doesn't store folders as assets, so this mapping should only be used when parsing things from the viewer to the server new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"), // OpenSim specific @@ -198,7 +198,7 @@ namespace OpenSim.Framework inventory2Content = new Dictionary(); content2Asset = new Dictionary(); content2Inventory = new Dictionary(); - + foreach (TypeMapping mapping in MAPPINGS) { sbyte assetType = mapping.AssetTypeCode; @@ -226,7 +226,7 @@ namespace OpenSim.Framework } } } - + public static string SLAssetTypeToContentType(int assetType) { string contentType; @@ -406,7 +406,7 @@ namespace OpenSim.Framework if(data[0] == "inv_item") { skipInventoryItem(reader); - } + } else if (line.IndexOf('{') >= 0) { throw new NotANotecardFormatException(reader.LineNumber); @@ -462,7 +462,7 @@ namespace OpenSim.Framework { int length = Int32.Parse(data[2]); notecardString = reader.getBlock(length); - } + } else if (line.IndexOf('{') >= 0) { throw new NotANotecardFormatException(reader.LineNumber); diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs index ab3c285578..9081411129 100644 --- a/OpenSim/Framework/Serialization/ArchiveConstants.cs +++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs @@ -72,12 +72,12 @@ namespace OpenSim.Framework.Serialization /// Path for region settings. /// public const string SETTINGS_PATH = "settings/"; - + /// /// Path for region settings. /// public const string LANDDATA_PATH = "landdata/"; - + /// /// Path for user profiles /// diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index 55640ac6a8..1523fa9e0b 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -106,13 +106,13 @@ namespace OpenSim.Framework.Serialization.External { errors = true; parseExceptionAction(nodeToFill, nodeName, e); - + if (xtr.EOF) { m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to unexpected end of XML"); break; } - + if (++numErrors == 10) { m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to too many parsing errors"); @@ -369,7 +369,7 @@ namespace OpenSim.Framework.Serialization.External break; case XmlNodeType.XmlDeclaration: - // For various reasons, not all serializations have xml declarations (or consistent ones) + // For various reasons, not all serializations have xml declarations (or consistent ones) // and as it's embedded inside a byte stream we don't need it anyway, so ignore. break; diff --git a/OpenSim/Framework/Serialization/External/OspResolver.cs b/OpenSim/Framework/Serialization/External/OspResolver.cs index fa7160f874..a1e9d554bf 100644 --- a/OpenSim/Framework/Serialization/External/OspResolver.cs +++ b/OpenSim/Framework/Serialization/External/OspResolver.cs @@ -35,13 +35,13 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Framework.Serialization { /// - /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for + /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for /// identifying user profiles or supplying a simple name if no profile is available. /// public class OspResolver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public const string OSPA_PREFIX = "ospa:"; public const string OSPA_NAME_KEY = "n"; public const string OSPA_NAME_VALUE_SEPARATOR = " "; @@ -76,7 +76,7 @@ namespace OpenSim.Framework.Serialization return null; } - + /// /// Make an OSPA given a user name /// @@ -89,17 +89,17 @@ namespace OpenSim.Framework.Serialization // m_log.DebugFormat("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName); // System.Console.WriteLine("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName); - + return ospa; } - + /// /// Resolve an osp string into the most suitable internal OpenSim identifier. /// - /// + /// /// In some cases this will be a UUID if a suitable profile exists on the system. In other cases, this may /// just return the same identifier after creating a temporary profile. - /// + /// /// /// /// @@ -111,14 +111,14 @@ namespace OpenSim.Framework.Serialization if (!ospa.StartsWith(OSPA_PREFIX)) { // m_log.DebugFormat("[OSP RESOLVER]: ResolveOspa() got unrecognized format [{0}]", ospa); - return UUID.Zero; + return UUID.Zero; } // m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa); - + string ospaMeat = ospa.Substring(OSPA_PREFIX.Length); string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY); - + foreach (string tuple in ospaTuples) { int tupleSeparatorIndex = tuple.IndexOf(OSPA_PAIR_SEPARATOR); @@ -128,17 +128,17 @@ namespace OpenSim.Framework.Serialization m_log.WarnFormat("[OSP RESOLVER]: Ignoring non-tuple component {0} in OSPA {1}", tuple, ospa); continue; } - + string key = tuple.Remove(tupleSeparatorIndex).Trim(); string value = tuple.Substring(tupleSeparatorIndex + 1).Trim(); - + if (OSPA_NAME_KEY == key) return ResolveOspaName(value, userService); } - + return UUID.Zero; } - + /// /// Hash a profile name into a UUID /// @@ -148,7 +148,7 @@ namespace OpenSim.Framework.Serialization { return new UUID(Utils.MD5(Encoding.Unicode.GetBytes(name)), 0); } - + /// /// Resolve an OSPI name by querying existing persistent user profiles. If there is no persistent user profile /// then a temporary user profile is inserted in the cache. @@ -164,13 +164,13 @@ namespace OpenSim.Framework.Serialization return UUID.Zero; int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR); - + if (nameSeparatorIndex < 0) { m_log.WarnFormat("[OSP RESOLVER]: Ignoring unseparated name {0}", name); return UUID.Zero; } - + string firstName = name.Remove(nameSeparatorIndex).TrimEnd(); string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart(); @@ -178,14 +178,14 @@ namespace OpenSim.Framework.Serialization if (account != null) { // m_log.DebugFormat( -// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}", +// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}", // account.PrincipalID, firstName, lastName); - + return account.PrincipalID; } // else // { -// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name); +// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name); // } // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc @@ -194,11 +194,11 @@ namespace OpenSim.Framework.Serialization tempUserProfile.FirstName = firstName; tempUserProfile.SurName = lastName; tempUserProfile.ID = HashName(tempUserProfile.Name); - + m_log.DebugFormat( "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID); commsManager.UserService.AddTemporaryUserProfile(tempUserProfile); - + return tempUserProfile.ID; */ diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index 19468c3b2a..617c451fe0 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework.Serialization.External { return Deserialize(Encoding.ASCII.GetString(serializedSettings, 0, serializedSettings.Length)); } - + /// /// Deserialize settings /// @@ -60,14 +60,14 @@ namespace OpenSim.Framework.Serialization.External public static RegionSettings Deserialize(string serializedSettings) { RegionSettings settings = new RegionSettings(); - + StringReader sr = new StringReader(serializedSettings); XmlTextReader xtr = new XmlTextReader(sr); - + xtr.ReadStartElement("RegionSettings"); - + xtr.ReadStartElement("General"); - + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { switch (xtr.Name) @@ -113,10 +113,10 @@ namespace OpenSim.Framework.Serialization.External break; } } - + xtr.ReadEndElement(); xtr.ReadStartElement("GroundTextures"); - + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { switch (xtr.Name) @@ -159,10 +159,10 @@ namespace OpenSim.Framework.Serialization.External break; } } - + xtr.ReadEndElement(); xtr.ReadStartElement("Terrain"); - + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { switch (xtr.Name) @@ -212,19 +212,19 @@ namespace OpenSim.Framework.Serialization.External xtr.Close(); sr.Close(); - + return settings; } - + public static string Serialize(RegionSettings settings) { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); - + xtw.WriteStartElement("RegionSettings"); - + xtw.WriteStartElement("General"); xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString()); xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString()); @@ -255,7 +255,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("ElevationHighSE", settings.Elevation2SE.ToString()); xtw.WriteElementString("ElevationHighNE", settings.Elevation2NE.ToString()); xtw.WriteEndElement(); - + xtw.WriteStartElement("Terrain"); xtw.WriteElementString("WaterHeight", settings.WaterHeight.ToString()); xtw.WriteElementString("TerrainRaiseLimit", settings.TerrainRaiseLimit.ToString()); @@ -275,12 +275,12 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("SpawnPoint", sp.ToString()); } xtw.WriteEndElement(); - + xtw.WriteEndElement(); - + xtw.Close(); sw.Close(); - + return sw.ToString(); } } diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index 994cede575..9b02553d3a 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs @@ -36,9 +36,9 @@ using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Services.Interfaces; - + namespace OpenSim.Framework.Serialization.External -{ +{ /// /// Serialize and deserialize user inventory items as an external format. /// @@ -49,14 +49,14 @@ namespace OpenSim.Framework.Serialization.External private static Dictionary> m_InventoryItemXmlProcessors = new Dictionary>(); - #region InventoryItemBase Processor initialization + #region InventoryItemBase Processor initialization static UserInventoryItemSerializer() { m_InventoryItemXmlProcessors.Add("Name", ProcessName); m_InventoryItemXmlProcessors.Add("ID", ProcessID); m_InventoryItemXmlProcessors.Add("InvType", ProcessInvType); m_InventoryItemXmlProcessors.Add("CreatorUUID", ProcessCreatorUUID); - m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID); + m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID); m_InventoryItemXmlProcessors.Add("CreatorData", ProcessCreatorData); m_InventoryItemXmlProcessors.Add("CreationDate", ProcessCreationDate); m_InventoryItemXmlProcessors.Add("Owner", ProcessOwner); @@ -73,7 +73,7 @@ namespace OpenSim.Framework.Serialization.External m_InventoryItemXmlProcessors.Add("GroupID", ProcessGroupID); m_InventoryItemXmlProcessors.Add("GroupOwned", ProcessGroupOwned); } - #endregion + #endregion #region InventoryItemBase Processors private static void ProcessName(InventoryItemBase item, XmlReader reader) @@ -189,7 +189,7 @@ namespace OpenSim.Framework.Serialization.External { return Deserialize(Encoding.ASCII.GetString(serialization, 0, serialization.Length)); } - + /// /// Deserialize settings /// @@ -212,8 +212,8 @@ namespace OpenSim.Framework.Serialization.External //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); return item; - } - + } + public static string Serialize(InventoryItemBase inventoryItem, Dictionary options, IUserAccountService userAccountService) { StringWriter sw = new StringWriter(); @@ -294,11 +294,11 @@ namespace OpenSim.Framework.Serialization.External } writer.WriteEndElement(); - + writer.Close(); sw.Close(); - + return sw.ToString(); - } + } } } diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index c685a157e1..34eaa990cd 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -42,31 +42,31 @@ namespace OpenSim.Framework.Serialization.External { public const int MAJOR_VERSION = 0; public const int MINOR_VERSION = 1; - + public static string Serialize(UUID userID, string firstName, string lastName) { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); - + xtw.WriteStartElement("user_profile"); xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString()); xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); - + xtw.WriteElementString("name", firstName + " " + lastName); xtw.WriteElementString("id", userID.ToString()); xtw.WriteElementString("about", ""); - + // Not sure if we're storing this yet, need to take a look // xtw.WriteElementString("Url", profile.Url); // or, indeed, interests xtw.WriteEndElement(); - + xtw.Close(); sw.Close(); - + return sw.ToString(); } } diff --git a/OpenSim/Framework/Serialization/Properties/AssemblyInfo.cs b/OpenSim/Framework/Serialization/Properties/AssemblyInfo.cs index f2060abfbc..7dfb87b5ef 100644 --- a/OpenSim/Framework/Serialization/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Serialization/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Framework.Serialization")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Framework/Serialization/TarArchiveWriter.cs b/OpenSim/Framework/Serialization/TarArchiveWriter.cs index 2a3bc4805d..a5c3d0ae6e 100644 --- a/OpenSim/Framework/Serialization/TarArchiveWriter.cs +++ b/OpenSim/Framework/Serialization/TarArchiveWriter.cs @@ -113,7 +113,7 @@ namespace OpenSim.Framework.Serialization lock (m_bw) { m_bw.Write(finalZeroPadding); - + m_bw.Flush(); m_bw.Close(); } @@ -149,7 +149,7 @@ namespace OpenSim.Framework.Serialization { // m_log.DebugFormat( // "[TAR ARCHIVE WRITER]: Data for {0} is {1} bytes", filePath, (null == data ? "null" : data.Length.ToString())); - + byte[] header = new byte[512]; // file path field (100) @@ -208,18 +208,18 @@ namespace OpenSim.Framework.Serialization { // Write out header m_bw.Write(header); - + // Write out data // An IOException occurs if we try to write out an empty array in Mono 2.6 if (data.Length > 0) m_bw.Write(data); - + if (data.Length % 512 != 0) { int paddingRequired = 512 - (data.Length % 512); - + //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); - + byte[] padding = new byte[paddingRequired]; m_bw.Write(padding); } diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 541b65830a..5111673fb2 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -71,9 +71,9 @@ namespace OpenSim.Framework.Servers private int m_periodDiagnosticTimerMS = 60 * 60 * 1000; private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); - + /// - /// Random uuid for private data + /// Random uuid for private data /// protected string m_osSecret = String.Empty; @@ -88,7 +88,7 @@ namespace OpenSim.Framework.Servers // Random uuid for private data m_osSecret = UUID.Random().ToString(); } - + private static bool m_NoVerifyCertChain = false; private static bool m_NoVerifyCertHostname = false; @@ -132,10 +132,10 @@ namespace OpenSim.Framework.Servers m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS; m_periodicDiagnosticsTimer.Enabled = true; } - } + } protected override void ShutdownSpecific() - { + { m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); RemovePIDFile(); @@ -145,12 +145,12 @@ namespace OpenSim.Framework.Servers if (!SuppressExit) Environment.Exit(0); } - + /// /// Provides a list of help topics that are available. Overriding classes should append their topics to the /// information returned when the base method is called. /// - /// + /// /// /// A list of strings that represent different help topics on which more information is available /// @@ -176,7 +176,7 @@ namespace OpenSim.Framework.Servers public virtual void Startup() { m_log.Info("[STARTUP]: Beginning startup processing"); - + m_log.Info("[STARTUP]: version: " + m_version + Environment.NewLine); // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and // the clr version number doesn't match the project version number under Mono. @@ -184,7 +184,7 @@ namespace OpenSim.Framework.Servers m_log.InfoFormat( "[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n", Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32"); - + try { StartupSpecific(); @@ -195,18 +195,18 @@ namespace OpenSim.Framework.Servers (e.Message == null || e.Message == String.Empty) ? "Unknown reason":e.Message ); Environment.Exit(1); } - + TimeSpan timeTaken = DateTime.Now - m_startuptime; - + // MainConsole.Instance.OutputFormat( // "PLEASE WAIT FOR LOGINS TO BE ENABLED ON REGIONS ONCE SCRIPTS HAVE STARTED. Non-script portion of startup took {0}m {1}s.", // timeTaken.Minutes, timeTaken.Seconds); } - public string osSecret + public string osSecret { // Secret uuid for the simulator - get { return m_osSecret; } + get { return m_osSecret; } } public string StatReport(IOSHttpRequest httpRequest) @@ -215,8 +215,8 @@ namespace OpenSim.Framework.Servers if (httpRequest.Query.ContainsKey("callback")) { return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");"; - } - else + } + else { return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); } diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 9c6ee9cbf7..516604a648 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -60,7 +60,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// /// This is a pending websocket request before it got an sucessful upgrade response. - /// The consumer must call handler.HandshakeAndUpgrade() to signal to the handler to + /// The consumer must call handler.HandshakeAndUpgrade() to signal to the handler to /// start the connection and optionally provide an origin authentication method. /// /// @@ -106,7 +106,7 @@ namespace OpenSim.Framework.Servers.HttpServer new Dictionary(); protected Dictionary m_WebSocketHandlers = - new Dictionary(); + new Dictionary(); protected uint m_port; protected bool m_ssl; @@ -386,7 +386,7 @@ namespace OpenSim.Framework.Servers.HttpServer return new List(m_rpcHandlers.Keys); } - // JsonRPC + // JsonRPC public bool AddJsonRPCHandler(string method, JsonRPCMethod handler) { lock(jsonRpcHandlers) @@ -588,11 +588,11 @@ namespace OpenSim.Framework.Servers.HttpServer dWebSocketRequestDelegate(req.Url.AbsolutePath, new WebSocketHttpServerHandler(req, context, 8192)); return; } - + OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); // resp.ReuseContext = true; // resp.ReuseContext = false; - HandleRequest(req, resp); + HandleRequest(req, resp); // !!!HACK ALERT!!! // There seems to be a bug in the underlying http code that makes subsequent requests @@ -684,7 +684,7 @@ namespace OpenSim.Framework.Servers.HttpServer LogIncomingToStreamHandler(request, requestHandler); response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. - + if (requestHandler is IStreamedRequestHandler) { IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; @@ -754,16 +754,16 @@ namespace OpenSim.Framework.Servers.HttpServer case "text/html": if (DebugLevel >= 3) LogIncomingToContentTypeHandler(request); - + buffer = HandleHTTPRequest(request, response); break; - + case "application/llsd+xml": case "application/xml+llsd": case "application/llsd+json": if (DebugLevel >= 3) LogIncomingToContentTypeHandler(request); - + buffer = HandleLLSDRequests(request, response); break; @@ -773,7 +773,7 @@ namespace OpenSim.Framework.Servers.HttpServer buffer = HandleJsonRpcRequests(request, response); break; - + case "text/xml": case "application/xml": case "application/json": @@ -790,7 +790,7 @@ namespace OpenSim.Framework.Servers.HttpServer { if (DebugLevel >= 3) LogIncomingToContentTypeHandler(request); - + buffer = HandleLLSDRequests(request, response); } // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); @@ -798,18 +798,18 @@ namespace OpenSim.Framework.Servers.HttpServer { if (DebugLevel >= 3) LogIncomingToContentTypeHandler(request); - + buffer = HandleHTTPRequest(request, response); } else { if (DebugLevel >= 3) LogIncomingToXmlRpcHandler(request); - + // generic login request. buffer = HandleXmlRpcRequests(request, response); } - + break; } } @@ -1093,7 +1093,7 @@ namespace OpenSim.Framework.Servers.HttpServer // private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) // { // agentHandler = null; -// +// // lock (m_agentHandlers) // { // foreach (IHttpAgentHandler handler in m_agentHandlers.Values) @@ -1304,7 +1304,7 @@ namespace OpenSim.Framework.Servers.HttpServer return buffer; } - // JsonRpc (v2.0 only) + // JsonRpc (v2.0 only) // Batch requests not yet supported private byte[] HandleJsonRpcRequests(OSHttpRequest request, OSHttpResponse response) { @@ -1321,7 +1321,7 @@ namespace OpenSim.Framework.Servers.HttpServer jsonRpcResponse.Error.Code = ErrorCode.InternalError; jsonRpcResponse.Error.Message = e.Message; } - + requestStream.Close(); if (jsonRpcRequest != null) @@ -1386,7 +1386,7 @@ namespace OpenSim.Framework.Servers.HttpServer string responseData = string.Empty; responseData = jsonRpcResponse.Serialize(); - + byte[] buffer = Encoding.UTF8.GetBytes(responseData); return buffer; } @@ -1666,7 +1666,7 @@ namespace OpenSim.Framework.Servers.HttpServer } } } - + if (String.IsNullOrEmpty(bestMatch)) { llsdHandler = null; @@ -2029,8 +2029,8 @@ namespace OpenSim.Framework.Servers.HttpServer response.SendChunked = false; response.ContentLength64 = buffer.Length; response.ContentEncoding = Encoding.UTF8; - - + + return buffer; } @@ -2111,7 +2111,7 @@ namespace OpenSim.Framework.Servers.HttpServer throw e; } - m_requestsProcessedStat + m_requestsProcessedStat = new Stat( "HTTPRequestsServed", "Number of inbound HTTP requests processed", @@ -2123,7 +2123,7 @@ namespace OpenSim.Framework.Servers.HttpServer MeasuresOfInterest.AverageChangeOverTime, stat => stat.Value = RequestNumber, StatVerbosity.Debug); - + StatsManager.RegisterStat(m_requestsProcessedStat); } diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs index d4a1ec3172..01d95e916a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs @@ -69,13 +69,13 @@ namespace OpenSim.Framework.Servers.HttpServer { StatsManager.RegisterStat( new Stat( - "requests", - "requests", - "Number of requests received by this service endpoint", - "requests", - "service", - string.Format("{0}:{1}", httpMethod, path), - StatType.Pull, + "requests", + "requests", + "Number of requests received by this service endpoint", + "requests", + "service", + string.Format("{0}:{1}", httpMethod, path), + StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, s => s.Value = RequestsReceived, StatVerbosity.Debug)); diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs index 41aa19b67c..7fc9f0b881 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework.Servers.HttpServer : base(httpMethod, path, name, description) {} protected BaseStreamHandler(string httpMethod, string path, IServiceAuth auth) - : base(httpMethod, path, null, null) + : base(httpMethod, path, null, null) { m_Auth = auth; } @@ -62,7 +62,7 @@ namespace OpenSim.Framework.Servers.HttpServer HttpStatusCode statusCode; if (!m_Auth.Authenticate(httpRequest.Headers, httpResponse.AddHeader, out statusCode)) - { + { httpResponse.StatusCode = (int)statusCode; httpResponse.ContentType = "text/plain"; return new byte[0]; diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs index 1b8854573b..9619e0367e 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs @@ -37,7 +37,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// public abstract class BaseStreamHandlerBasicDOSProtector : BaseRequestHandler, IStreamedRequestHandler { - + private readonly BasicDosProtectorOptions _options; private readonly BasicDOSProtector _dosProtector; @@ -63,7 +63,7 @@ namespace OpenSim.Framework.Servers.HttpServer result = ThrottledRequest(path, request, httpRequest, httpResponse); if (_options.MaxConcurrentSessions > 0) _dosProtector.ProcessEnd(clientstring, endpoint); - + RequestsHandled++; return result; @@ -81,7 +81,7 @@ namespace OpenSim.Framework.Servers.HttpServer return new byte[0]; } - + private string GetRemoteAddr(IOSHttpRequest httpRequest) { string remoteaddr = string.Empty; @@ -101,7 +101,7 @@ namespace OpenSim.Framework.Servers.HttpServer clientstring = GetRemoteAddr(httpRequest); return clientstring; - + } } } diff --git a/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs index cd4b8ffa29..98d33e4537 100644 --- a/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs +++ b/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs @@ -33,7 +33,7 @@ namespace OpenSim.Framework.Servers.HttpServer { private readonly GenericHTTPMethod _normalMethod; private readonly GenericHTTPMethod _throttledMethod; - + private readonly BasicDosProtectorOptions _options; private readonly BasicDOSProtector _dosProtector; @@ -41,7 +41,7 @@ namespace OpenSim.Framework.Servers.HttpServer { _normalMethod = normalMethod; _throttledMethod = throttledMethod; - + _options = options; _dosProtector = new BasicDOSProtector(_options); } @@ -60,7 +60,7 @@ namespace OpenSim.Framework.Servers.HttpServer return process; } - + private string GetRemoteAddr(Hashtable request) { string remoteaddr = ""; diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index d162bc12fb..3a04074b1d 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs @@ -45,26 +45,26 @@ namespace OpenSim.Framework.Servers.HttpServer // // the handlers - it is NOT required to be an actual agent header // // value. // bool AddAgentHandler(string agent, IHttpAgentHandler handler); - + /// /// Add a handler for an HTTP request. /// /// - /// This handler can actually be invoked either as - /// - /// http://:/?method= - /// + /// This handler can actually be invoked either as + /// + /// http://:/?method= + /// /// or - /// + /// /// http://: - /// + /// /// if the method name starts with a slash. For example, AddHTTPHandler("/object/", ...) on a standalone region /// server will register a handler that can be invoked with either - /// + /// /// http://localhost:9000/?method=/object/ - /// + /// /// or - /// + /// /// http://localhost:9000/object/ /// /// In addition, the handler invoked by the HTTP server for any request is the one when best matches the request @@ -87,7 +87,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// handle the LLSD response /// bool AddLLSDHandler(string path, LLSDMethod handler); - + /// /// Add a stream handler to the http server. If the handler already exists, then nothing happens. /// @@ -98,7 +98,7 @@ namespace OpenSim.Framework.Servers.HttpServer bool AddXmlRPCHandler(string method, XmlRpcMethod handler, bool keepAlive); bool AddJsonRPCHandler(string method, JsonRPCMethod handler); - + /// /// Websocket HTTP server handlers. /// @@ -108,7 +108,7 @@ namespace OpenSim.Framework.Servers.HttpServer void RemoveWebSocketHandler(string servicepath); - + /// /// Gets the XML RPC handler for given method name /// @@ -125,7 +125,7 @@ namespace OpenSim.Framework.Servers.HttpServer // /// // /// // bool RemoveAgentHandler(string agent, IHttpAgentHandler handler); - + /// /// Remove an HTTP handler /// @@ -134,15 +134,15 @@ namespace OpenSim.Framework.Servers.HttpServer void RemoveHTTPHandler(string httpMethod, string path); void RemovePollServiceHTTPHandler(string httpMethod, string path); - + bool RemoveLLSDHandler(string path, LLSDMethod handler); - + void RemoveStreamHandler(string httpMethod, string path); void RemoveXmlRPCHandler(string method); void RemoveJsonRPCHandler(string method); - + string GetHTTP404(string host); string GetHTTP500(); diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs index b8541cbe4c..62d92fb1ea 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs @@ -83,7 +83,7 @@ namespace OpenSim.Framework.Servers.HttpServer { void Handle(string path, Stream request, Stream response, IOSHttpRequest httpReqbuest, IOSHttpResponse httpResponse); } - + public interface IGenericHTTPHandler : IRequestHandler { Hashtable Handle(string path, Hashtable request); diff --git a/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs index f3faf4f6d4..411ee3161c 100644 --- a/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs @@ -43,7 +43,7 @@ namespace OpenSim.Framework.Servers.HttpServer public class JsonRpcRequestManager { static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public JsonRpcRequestManager() { } @@ -188,6 +188,6 @@ namespace OpenSim.Framework.Servers.HttpServer return true; } - + } } diff --git a/OpenSim/Framework/Servers/HttpServer/JsonRpcResponse.cs b/OpenSim/Framework/Servers/HttpServer/JsonRpcResponse.cs index 2c50587794..91d284bedf 100644 --- a/OpenSim/Framework/Servers/HttpServer/JsonRpcResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/JsonRpcResponse.cs @@ -144,7 +144,7 @@ namespace OpenSim.Framework.Servers.HttpServer { } - return result; + return result; } } } diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs index 05ec6dc8c4..1a6b8cf5f9 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs @@ -155,11 +155,11 @@ namespace OpenSim.Framework.Servers.HttpServer private string _userAgent; internal IHttpRequest IHttpRequest - { + { get { return _request; } } - internal IHttpClientContext IHttpClientContext + internal IHttpClientContext IHttpClientContext { get { return _context; } } @@ -192,19 +192,19 @@ namespace OpenSim.Framework.Servers.HttpServer // ignore } } - + if (null != req.Headers["content-type"]) _contentType = _request.Headers["content-type"]; if (null != req.Headers["user-agent"]) _userAgent = req.Headers["user-agent"]; - + if (null != req.Headers["remote_addr"]) { try { IPAddress addr = IPAddress.Parse(req.Headers["remote_addr"]); // sometimes req.Headers["remote_port"] returns a comma separated list, so use - // the first one in the list and log it + // the first one in the list and log it string[] strPorts = req.Headers["remote_port"].Split(new char[] { ',' }); if (strPorts.Length > 1) { @@ -216,7 +216,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (FormatException) { - _log.ErrorFormat("[OSHttpRequest]: format exception on addr/port {0}:{1}, ignoring", + _log.ErrorFormat("[OSHttpRequest]: format exception on addr/port {0}:{1}, ignoring", req.Headers["remote_addr"], req.Headers["remote_port"]); } } diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs index 8456654524..8e1b545434 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs @@ -115,7 +115,7 @@ namespace OpenSim.Framework.Servers.HttpServer public bool KeepAlive { - get + get { return _httpResponse.Connection == ConnectionType.KeepAlive; } diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpStatusCodes.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpStatusCodes.cs index a736c8b753..88e3068bc1 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpStatusCodes.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpStatusCodes.cs @@ -91,7 +91,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// 300 Redirect: different presentation forms available, take a pick /// RedirectMultipleChoices = 300, - + /// /// 301 Redirect: requested resource has moved and now lives somewhere else /// diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index a9860ccb3a..a1bc27bc5f 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -48,14 +48,14 @@ namespace OpenSim.Framework.Servers.HttpServer public DropMethod Drop; public UUID Id; public int TimeOutms; - public EventType Type; + public EventType Type; public enum EventType : int { LongPoll = 0, LslHttp = 1, Inventory = 2, - Texture = 3, + Texture = 3, Mesh = 4 } diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 5b4059015d..82c77271c4 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -80,7 +80,7 @@ namespace OpenSim.Framework.Servers.HttpServer startInfo.ThreadPoolName = "PoolService"; m_threadPool = new SmartThreadPool(startInfo); - + } public void Start() @@ -109,7 +109,7 @@ namespace OpenSim.Framework.Servers.HttpServer true, null, 1000 * 60 * 10); - + } diff --git a/OpenSim/Framework/Servers/HttpServer/Properties/AssemblyInfo.cs b/OpenSim/Framework/Servers/HttpServer/Properties/AssemblyInfo.cs index 398179fac2..9b663bac90 100644 --- a/OpenSim/Framework/Servers/HttpServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Servers/HttpServer/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Framework.Servers.HttpServer")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index ad69cd22cb..68073c1164 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs @@ -291,5 +291,5 @@ namespace OpenSim.Framework.Servers.HttpServer serializer.Serialize(xmlWriter, response); } } - } + } } \ No newline at end of file diff --git a/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs b/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs index c2925e33f0..c8af90f75c 100644 --- a/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs @@ -75,7 +75,7 @@ namespace OpenSim.Framework.Servers.HttpServer public event PongDelegate OnPong; /// - /// This is a regular HTTP Request... This may be removed in the future. + /// This is a regular HTTP Request... This may be removed in the future. /// // public event RegularHttpRequestDelegate OnRegularHttpRequest; @@ -93,9 +93,9 @@ namespace OpenSim.Framework.Servers.HttpServer /// When the websocket is closed, this will be fired. /// public event CloseDelegate OnClose; - + /// - /// Set this delegate to allow your module to validate the origin of the + /// Set this delegate to allow your module to validate the origin of the /// Websocket request. Primary line of defense against cross site scripting /// public ValidateHandshake HandshakeValidateMethodOverride = null; @@ -181,7 +181,7 @@ namespace OpenSim.Framework.Servers.HttpServer { throw new InvalidOperationException("The socket has been shutdown"); } - } + } set { if (_networkContext != null && _networkContext.Socket != null) @@ -194,8 +194,8 @@ namespace OpenSim.Framework.Servers.HttpServer } /// - /// This triggers the websocket to start the upgrade process... - /// This is a Generalized Networking 'common sense' helper method. Some people expect to call Start() instead + /// This triggers the websocket to start the upgrade process... + /// This is a Generalized Networking 'common sense' helper method. Some people expect to call Start() instead /// of the more context appropriate HandshakeAndUpgrade() /// public void Start() @@ -261,7 +261,7 @@ namespace OpenSim.Framework.Servers.HttpServer acceptKey = GenerateAcceptKey(websocketKey); string rawaccept = string.Format(HandshakeAcceptText, acceptKey); SendUpgradeSuccess(rawaccept); - + } else @@ -282,7 +282,7 @@ namespace OpenSim.Framework.Servers.HttpServer } /// - /// Generates a handshake response key string based on the client's + /// Generates a handshake response key string based on the client's /// provided key to prove to the client that we're allowing the Websocket /// upgrade of our own free will and we were not coerced into doing it. /// @@ -298,7 +298,7 @@ namespace OpenSim.Framework.Servers.HttpServer SHA1 hashobj = SHA1.Create(); string ret = Convert.ToBase64String(hashobj.ComputeHash(Encoding.UTF8.GetBytes(acceptkey))); hashobj.Clear(); - + return ret; } @@ -310,11 +310,11 @@ namespace OpenSim.Framework.Servers.HttpServer { // Create a new websocket state so we can keep track of data in between network reads. WebSocketState socketState = new WebSocketState() { ReceivedBytes = new List(), Header = WebsocketFrameHeader.HeaderDefault(), FrameComplete = true}; - + byte[] bhandshakeResponse = Encoding.UTF8.GetBytes(pHandshakeResponse); - - + + try { @@ -324,7 +324,7 @@ namespace OpenSim.Framework.Servers.HttpServer } // Begin reading the TCP stream before writing the Upgrade success message to the other side of the stream. _networkContext.Stream.BeginRead(_buffer, 0, _bufferLength, OnReceive, socketState); - + // Write the upgrade handshake success message _networkContext.Stream.Write(bhandshakeResponse, 0, bhandshakeResponse.Length); _networkContext.Stream.Flush(); @@ -345,7 +345,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (ObjectDisposedException) { Close(string.Empty); - } + } } /// @@ -369,7 +369,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// /// This is our ugly Async OnReceive event handler. - /// This chunks the input stream based on the length of the provided buffer and processes out + /// This chunks the input stream based on the length of the provided buffer and processes out /// as many frames as it can. It then moves the unprocessed data to the beginning of the buffer. /// /// Our Async State from beginread @@ -390,7 +390,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (_bufferPosition > _bufferLength) { - // Message too big for chunksize.. not sure how this happened... + // Message too big for chunksize.. not sure how this happened... //Close(string.Empty); } @@ -413,7 +413,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (pheader.PayloadLen > (ulong) _maxPayloadBytes) { Close("Invalid Payload size"); - + return; } if (pheader.PayloadLen > 0) @@ -487,7 +487,7 @@ namespace OpenSim.Framework.Servers.HttpServer _socketState.ReceivedBytes.Clear(); _socketState.ExpectedBytes = 0; // do some processing - } + } } } if (offset > 0) @@ -504,7 +504,7 @@ namespace OpenSim.Framework.Servers.HttpServer } else { - // We can't read the stream anymore... + // We can't read the stream anymore... } } catch (IOException) @@ -533,7 +533,7 @@ namespace OpenSim.Framework.Servers.HttpServer textMessageFrame.Header.Opcode = WebSocketReader.OpCode.Text; textMessageFrame.Header.IsEnd = true; SendSocket(textMessageFrame.ToBytes()); - + } public void SendData(byte[] data) @@ -657,7 +657,7 @@ namespace OpenSim.Framework.Servers.HttpServer SendSocket(pongFrame.ToBytes()); break; case WebSocketReader.OpCode.Pong: - + PongDelegate pongD = OnPong; if (pongD != null) { @@ -701,7 +701,7 @@ namespace OpenSim.Framework.Servers.HttpServer { textD(this, new WebsocketTextEventArgs() { Data = Encoding.UTF8.GetString(psocketState.ReceivedBytes.ToArray()) }); } - + // Send Done Event! } break; @@ -719,7 +719,7 @@ namespace OpenSim.Framework.Servers.HttpServer { if (psocketState.ContinuationFrame.Header.Opcode == WebSocketReader.OpCode.Text) { - // Send Done event + // Send Done event TextDelegate textD = OnText; if (textD != null) { @@ -744,9 +744,9 @@ namespace OpenSim.Framework.Servers.HttpServer break; case WebSocketReader.OpCode.Close: Close(string.Empty); - + break; - + } psocketState.Header.SetDefault(); psocketState.ReceivedBytes.Clear(); @@ -837,12 +837,12 @@ namespace OpenSim.Framework.Servers.HttpServer } /// - /// Attempts to read a header off the provided buffer. Returns true, exports a WebSocketFrameheader, + /// Attempts to read a header off the provided buffer. Returns true, exports a WebSocketFrameheader, /// and an int to move the buffer forward when it reads a header. False when it can't read a header /// /// Bytes read from the stream /// Starting place in the stream to begin trying to read from - /// Lenth in the stream to try and read from. Provided for cases where the + /// Lenth in the stream to try and read from. Provided for cases where the /// buffer's length is larger then the data in it /// Outputs the read WebSocket frame header /// Informs the calling stream to move the buffer forward @@ -897,7 +897,7 @@ namespace OpenSim.Framework.Servers.HttpServer oHeader.PayloadLen = BitConverter.ToUInt16(pBuffer, pOffset + index); index += 2; break; - case 127: // we got more this is a bigger frame + case 127: // we got more this is a bigger frame // 8 bytes - uint64 - most significant bit 0 network byte order minumheadersize += 8; if (length < minumheadersize) @@ -909,7 +909,7 @@ namespace OpenSim.Framework.Servers.HttpServer oHeader.PayloadLen = BitConverter.ToUInt64(pBuffer, pOffset + index); index += 8; break; - + } //oHeader.PayloadLeft = oHeader.PayloadLen; // Start the count in case it's chunked over the network. This is different then frame fragmentation if (oHeader.IsMasked) @@ -937,9 +937,9 @@ namespace OpenSim.Framework.Servers.HttpServer /* * RFC6455 nib 0 1 2 3 4 5 6 7 -byt 0 1 2 3 -dec 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +byt 0 1 2 3 +dec 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) + @@ -963,7 +963,7 @@ dec 0 1 2 3 public static readonly WebSocketFrame DefaultFrame = new WebSocketFrame(){Header = new WebsocketFrameHeader(),WebSocketPayload = new byte[0]}; public WebsocketFrameHeader Header; public byte[] WebSocketPayload; - + public byte[] ToBytes() { Header.PayloadLen = (ulong)WebSocketPayload.Length; @@ -991,7 +991,7 @@ dec 0 1 2 3 public int Mask; /* byt 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+---------------+---------------+ | Octal 1 | Octal 2 | Octal 3 | Octal 4 | +---------------+---------------+---------------+---------------+ @@ -1002,11 +1002,11 @@ byt 0 1 2 3 public UInt64 PayloadLen; //public UInt64 PayloadLeft; - // Payload is X + Y + // Payload is X + Y //public UInt64 ExtensionDataLength; //public UInt64 ApplicationDataLength; public static readonly WebsocketFrameHeader ZeroHeader = WebsocketFrameHeader.HeaderDefault(); - + public void SetDefault() { @@ -1025,16 +1025,16 @@ byt 0 1 2 3 /// /// Returns a byte array representing the Frame header /// - /// This is the frame data payload. The header describes the size of the payload. + /// This is the frame data payload. The header describes the size of the payload. /// If payload is null, a Zero sized payload is assumed /// Returns a byte array representing the frame header public byte[] ToBytes(byte[] payload) { List result = new List(); - + // Squeeze in our opcode and our ending bit. result.Add((byte)((byte)Opcode | (IsEnd?0x80:0x00) )); - + // Again with the three different byte interpretations of size.. //bytesize @@ -1056,7 +1056,7 @@ byt 0 1 2 3 Array.Reverse(payloadLengthByte); result.AddRange(payloadLengthByte); } - + // Only add a payload if it's not null if (payload != null) { @@ -1155,5 +1155,5 @@ byt 0 1 2 3 } - + } diff --git a/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs index f2122080c0..6b2c0ab801 100644 --- a/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs +++ b/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Servers.HttpServer { private readonly XmlRpcMethod _normalMethod; private readonly XmlRpcMethod _throttledMethod; - + private readonly BasicDosProtectorOptions _options; private readonly BasicDOSProtector _dosProtector; @@ -44,7 +44,7 @@ namespace OpenSim.Framework.Servers.HttpServer { _normalMethod = normalMethod; _throttledMethod = throttledMethod; - + _options = options; _dosProtector = new BasicDOSProtector(_options); @@ -87,5 +87,5 @@ namespace OpenSim.Framework.Servers.HttpServer } - + } diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index e9c284c155..29308a983e 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -239,11 +239,11 @@ namespace OpenSim.Framework.Servers { handlers.AppendFormat( "Registered HTTP Handlers for server at {0}:{1}\n", httpServer.ListenIPAddress, httpServer.Port); - + handlers.AppendFormat("* XMLRPC:\n"); foreach (String s in httpServer.GetXmlRpcHandlerKeys()) handlers.AppendFormat("\t{0}\n", s); - + handlers.AppendFormat("* HTTP:\n"); foreach (String s in httpServer.GetHTTPHandlerKeys()) handlers.AppendFormat("\t{0}\n", s); @@ -251,19 +251,19 @@ namespace OpenSim.Framework.Servers handlers.AppendFormat("* HTTP (poll):\n"); foreach (String s in httpServer.GetPollServiceHandlerKeys()) handlers.AppendFormat("\t{0}\n", s); - + handlers.AppendFormat("* JSONRPC:\n"); foreach (String s in httpServer.GetJsonRpcHandlerKeys()) handlers.AppendFormat("\t{0}\n", s); - + // handlers.AppendFormat("* Agent:\n"); // foreach (String s in httpServer.GetAgentHandlerKeys()) // handlers.AppendFormat("\t{0}\n", s); - + handlers.AppendFormat("* LLSD:\n"); foreach (String s in httpServer.GetLLSDHandlerKeys()) handlers.AppendFormat("\t{0}\n", s); - + handlers.AppendFormat("* StreamHandlers ({0}):\n", httpServer.GetStreamHandlerKeys().Count); foreach (String s in httpServer.GetStreamHandlerKeys()) handlers.AppendFormat("\t{0}\n", s); @@ -350,7 +350,7 @@ namespace OpenSim.Framework.Servers { if (port == 0) return Instance; - + if (instance != null && port == Instance.Port) return Instance; diff --git a/OpenSim/Framework/Servers/Properties/AssemblyInfo.cs b/OpenSim/Framework/Servers/Properties/AssemblyInfo.cs index 792c62e2c7..4469e7c36d 100644 --- a/OpenSim/Framework/Servers/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Servers/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Framework.Servers")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 7b806a4a8d..8965e71a34 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -56,7 +56,7 @@ namespace OpenSim.Framework.Servers protected ICommandConsole m_console; protected OpenSimAppender m_consoleAppender; - protected FileAppender m_logFileAppender; + protected FileAppender m_logFileAppender; protected DateTime m_startuptime; protected string m_startupDirectory = Environment.CurrentDirectory; @@ -81,7 +81,7 @@ namespace OpenSim.Framework.Servers { if (File.Exists(path)) m_log.ErrorFormat( - "[SERVER BASE]: Previous pid file {0} still exists on startup. Possibly previously unclean shutdown.", + "[SERVER BASE]: Previous pid file {0} still exists on startup. Possibly previously unclean shutdown.", path); try @@ -103,7 +103,7 @@ namespace OpenSim.Framework.Servers m_log.Warn(string.Format("[SERVER BASE]: Could not create PID file at {0} ", path), e); } } - + protected void RemovePIDFile() { if (m_pidFile != String.Empty) @@ -166,11 +166,11 @@ namespace OpenSim.Framework.Servers { // FIXME: This should be done through an interface rather than casting. m_consoleAppender.Console = (ConsoleBase)m_console; - + // If there is no threshold set then the threshold is effectively everything. if (null == m_consoleAppender.Threshold) m_consoleAppender.Threshold = Level.All; - + Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); } @@ -205,11 +205,11 @@ namespace OpenSim.Framework.Servers "General", false, "show uptime", "show uptime", "Show server uptime", HandleShow); m_console.Commands.AddCommand( - "General", false, "get log level", "get log level", "Get the current console logging level", + "General", false, "get log level", "get log level", "Get the current console logging level", (mod, cmd) => ShowLogLevel()); m_console.Commands.AddCommand( - "General", false, "set log level", "set log level ", + "General", false, "set log level", "set log level ", "Set the console logging level for this session.", HandleSetLogLevel); m_console.Commands.AddCommand( @@ -222,14 +222,14 @@ namespace OpenSim.Framework.Servers "config get [
] []", "Synonym for config show", HandleConfig); - + m_console.Commands.AddCommand( "General", false, "config show", "config show [
] []", - "Show config information", + "Show config information", "If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine + "If a section is given but not a field, then all fields in that section are printed.", - HandleConfig); + HandleConfig); m_console.Commands.AddCommand( "General", false, "config save", @@ -280,7 +280,7 @@ namespace OpenSim.Framework.Servers "debug threadpool status", "Show current debug threadpool parameters.", HandleDebugThreadpoolStatus); - + m_console.Commands.AddCommand( "Debug", false, "debug threadpool level", "debug threadpool level 0.." + Util.MAX_THREADPOOL_LEVEL, @@ -332,7 +332,7 @@ namespace OpenSim.Framework.Servers { WebUtil.SerializeOSDRequestsPerEndpoint = networkConfig.GetBoolean("SerializeOSDRequests", false); } - + m_serverStatsCollector = new ServerStatsCollector(); m_serverStatsCollector.Initialise(configSource); m_serverStatsCollector.Start(); @@ -432,7 +432,7 @@ namespace OpenSim.Framework.Servers ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); Notice("Available worker threads: {0}", workerThreads); - Notice("Available IOCP threads: {0}", iocpThreads); + Notice("Available IOCP threads: {0}", iocpThreads); } private void HandleDebugThreadpoolSet(string module, string[] args) @@ -488,7 +488,7 @@ namespace OpenSim.Framework.Servers fail = true; } } - + if (fail) { Notice("ERROR: Could not set {0} {1} threads to {2}", poolType, bound, newThreads); @@ -582,7 +582,7 @@ namespace OpenSim.Framework.Servers if (cmdparams.Length > 0) { string firstParam = cmdparams[0].ToLower(); - + switch (firstParam) { case "set": @@ -633,12 +633,12 @@ namespace OpenSim.Framework.Servers { Notice("[{0}]", config.Name); foreach (string key in config.GetKeys()) - Notice(" {0} = {1}", key, config.GetString(key)); + Notice(" {0} = {1}", key, config.GetString(key)); } else { Notice( - "config get {0} {1} : {2}", + "config get {0} {1} : {2}", cmdparams[1], cmdparams[2], config.GetString(cmdparams[2])); } } @@ -692,10 +692,10 @@ namespace OpenSim.Framework.Servers } string rawLevel = cmd[3]; - + ILoggerRepository repository = LogManager.GetRepository(); Level consoleLevel = repository.LevelMap[rawLevel]; - + if (consoleLevel != null) m_consoleAppender.Threshold = consoleLevel; else @@ -770,9 +770,9 @@ namespace OpenSim.Framework.Servers protected void ShowInfo() { Notice(GetVersionText()); - Notice("Startup directory: " + m_startupDirectory); + Notice("Startup directory: " + m_startupDirectory); if (null != m_consoleAppender) - Notice(String.Format("Console log level: {0}", m_consoleAppender.Threshold)); + Notice(String.Format("Console log level: {0}", m_consoleAppender.Threshold)); } /// @@ -873,7 +873,7 @@ namespace OpenSim.Framework.Servers public string GetVersionText() { - return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})", + return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})", m_version, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax); } @@ -898,7 +898,7 @@ namespace OpenSim.Framework.Servers foreach (Watchdog.ThreadWatchdogInfo twi in threads) { Thread t = twi.Thread; - + sb.AppendFormat( reportFormat, t.ManagedThreadId, @@ -1005,7 +1005,7 @@ namespace OpenSim.Framework.Servers MainConsole.Instance.OutputFormat("Aborted thread with id {0}", threadId); else MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId); - } + } /// /// Console output is only possible if a console has been established. @@ -1020,13 +1020,13 @@ namespace OpenSim.Framework.Servers m_console.Output(msg); } } - + /// /// Console output is only possible if a console has been established. /// That is something that cannot be determined within this class. So /// all attempts to use the console MUST be verified. /// - /// + /// /// protected void Notice(string format, params object[] components) { diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs index 60533cd960..e5f704381b 100644 --- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs +++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs @@ -92,87 +92,87 @@ namespace OpenSim.Framework.Servers.Tests public class TestHttpRequest: IHttpRequest { private string _uriPath; - public bool BodyIsComplete - { - get { return true; } + public bool BodyIsComplete + { + get { return true; } } - public string[] AcceptTypes - { + public string[] AcceptTypes + { get {return _acceptTypes; } } private string[] _acceptTypes; - public Stream Body - { - get { return _body; } - set { _body = value;} + public Stream Body + { + get { return _body; } + set { _body = value;} } private Stream _body; - public ConnectionType Connection - { + public ConnectionType Connection + { get { return _connection; } set { _connection = value; } } private ConnectionType _connection; - public int ContentLength - { + public int ContentLength + { get { return _contentLength; } set { _contentLength = value; } } private int _contentLength; - public NameValueCollection Headers - { + public NameValueCollection Headers + { get { return _headers; } } private NameValueCollection _headers = new NameValueCollection(); - public string HttpVersion - { + public string HttpVersion + { get { return _httpVersion; } set { _httpVersion = value; } } private string _httpVersion = null; - public string Method - { + public string Method + { get { return _method; } set { _method = value; } } private string _method = null; - public HttpInput QueryString - { + public HttpInput QueryString + { get { return _queryString; } } private HttpInput _queryString = null; - public Uri Uri - { + public Uri Uri + { get { return _uri; } - set { _uri = value; } + set { _uri = value; } } private Uri _uri = null; - public string[] UriParts - { + public string[] UriParts + { get { return _uri.Segments; } } - public HttpParam Param - { - get { return null; } + public HttpParam Param + { + get { return null; } } - public HttpForm Form - { - get { return null; } + public HttpForm Form + { + get { return null; } } - public bool IsAjax - { - get { return false; } + public bool IsAjax + { + get { return false; } } - public RequestCookies Cookies - { - get { return null; } + public RequestCookies Cookies + { + get { return null; } } public TestHttpRequest() {} - public TestHttpRequest(string contentEncoding, string contentType, string userAgent, + public TestHttpRequest(string contentEncoding, string contentType, string userAgent, string remoteAddr, string remotePort, string[] acceptTypes, - ConnectionType connectionType, int contentLength, Uri uri) + ConnectionType connectionType, int contentLength, Uri uri) { _headers["content-encoding"] = contentEncoding; _headers["content-type"] = contentType; @@ -192,7 +192,7 @@ namespace OpenSim.Framework.Servers.Tests { _headers.Add(name, value); } - public int AddToBody(byte[] bytes, int offset, int length) + public int AddToBody(byte[] bytes, int offset, int length) { return 0; } @@ -223,7 +223,7 @@ namespace OpenSim.Framework.Servers.Tests set { _uriPath = value; - + } } @@ -231,7 +231,7 @@ namespace OpenSim.Framework.Servers.Tests public class TestHttpResponse: IHttpResponse { - public Stream Body + public Stream Body { get { return _body; } @@ -239,14 +239,14 @@ namespace OpenSim.Framework.Servers.Tests } private Stream _body; - public string ProtocolVersion - { + public string ProtocolVersion + { get { return _protocolVersion; } set { _protocolVersion = value; } } private string _protocolVersion; - public bool Chunked + public bool Chunked { get { return _chunked; } @@ -254,7 +254,7 @@ namespace OpenSim.Framework.Servers.Tests } private bool _chunked; - public ConnectionType Connection + public ConnectionType Connection { get { return _connection; } @@ -262,7 +262,7 @@ namespace OpenSim.Framework.Servers.Tests } private ConnectionType _connection; - public Encoding Encoding + public Encoding Encoding { get { return _encoding; } @@ -270,7 +270,7 @@ namespace OpenSim.Framework.Servers.Tests } private Encoding _encoding; - public int KeepAlive + public int KeepAlive { get { return _keepAlive; } @@ -278,7 +278,7 @@ namespace OpenSim.Framework.Servers.Tests } private int _keepAlive; - public HttpStatusCode Status + public HttpStatusCode Status { get { return _status; } @@ -286,7 +286,7 @@ namespace OpenSim.Framework.Servers.Tests } private HttpStatusCode _status; - public string Reason + public string Reason { get { return _reason; } @@ -294,7 +294,7 @@ namespace OpenSim.Framework.Servers.Tests } private string _reason; - public long ContentLength + public long ContentLength { get { return _contentLength; } @@ -302,7 +302,7 @@ namespace OpenSim.Framework.Servers.Tests } private long _contentLength; - public string ContentType + public string ContentType { get { return _contentType; } @@ -310,19 +310,19 @@ namespace OpenSim.Framework.Servers.Tests } private string _contentType; - public bool HeadersSent + public bool HeadersSent { get { return _headersSent; } } private bool _headersSent; - public bool Sent + public bool Sent { get { return _sent; } } private bool _sent; - public ResponseCookies Cookies + public ResponseCookies Cookies { get { return _cookies; } } @@ -335,25 +335,25 @@ namespace OpenSim.Framework.Servers.Tests } public void AddHeader(string name, string value) {} - public void Send() + public void Send() { if (!_headersSent) SendHeaders(); if (_sent) throw new InvalidOperationException("stuff already sent"); _sent = true; } - public void SendBody(byte[] buffer, int offset, int count) + public void SendBody(byte[] buffer, int offset, int count) { if (!_headersSent) SendHeaders(); _sent = true; } - public void SendBody(byte[] buffer) + public void SendBody(byte[] buffer) { if (!_headersSent) SendHeaders(); _sent = true; } - public void SendHeaders() + public void SendHeaders() { if (_headersSent) throw new InvalidOperationException("headers already sent"); _headersSent = true; @@ -362,7 +362,7 @@ namespace OpenSim.Framework.Servers.Tests public void Redirect(Uri uri) {} public void Redirect(string url) {} } - + public OSHttpRequest req0; public OSHttpRequest req1; @@ -374,22 +374,22 @@ namespace OpenSim.Framework.Servers.Tests [TestFixtureSetUp] public void Init() { - TestHttpRequest threq0 = new TestHttpRequest("utf-8", "text/xml", "OpenSim Test Agent", "192.168.0.1", "4711", - new string[] {"text/xml"}, - ConnectionType.KeepAlive, 4711, + TestHttpRequest threq0 = new TestHttpRequest("utf-8", "text/xml", "OpenSim Test Agent", "192.168.0.1", "4711", + new string[] {"text/xml"}, + ConnectionType.KeepAlive, 4711, new Uri("http://127.0.0.1/admin/inventory/Dr+Who/Tardis")); threq0.Method = "GET"; threq0.HttpVersion = HttpHelper.HTTP10; - TestHttpRequest threq1 = new TestHttpRequest("utf-8", "text/xml", "OpenSim Test Agent", "192.168.0.1", "4711", - new string[] {"text/xml"}, - ConnectionType.KeepAlive, 4711, + TestHttpRequest threq1 = new TestHttpRequest("utf-8", "text/xml", "OpenSim Test Agent", "192.168.0.1", "4711", + new string[] {"text/xml"}, + ConnectionType.KeepAlive, 4711, new Uri("http://127.0.0.1/admin/inventory/Dr+Who/Tardis?a=0&b=1&c=2")); threq1.Method = "POST"; threq1.HttpVersion = HttpHelper.HTTP11; threq1.Headers["x-wuff"] = "wuffwuff"; threq1.Headers["www-authenticate"] = "go away"; - + req0 = new OSHttpRequest(new TestHttpClientContext(false), threq0); req1 = new OSHttpRequest(new TestHttpClientContext(false), threq1); diff --git a/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs b/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs index 512ac4f722..9126cfb5f4 100644 --- a/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs +++ b/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs @@ -56,7 +56,7 @@ namespace OpenSim.Framework.ServiceAuth { // remove_me = section; m_Username = Util.GetConfigVarFromSections(config, "HttpAuthUsername", new string[] { "Network", section }, string.Empty); - m_Password = Util.GetConfigVarFromSections(config, "HttpAuthPassword", new string[] { "Network", section }, string.Empty); + m_Password = Util.GetConfigVarFromSections(config, "HttpAuthPassword", new string[] { "Network", section }, string.Empty); string str = m_Username + ":" + m_Password; byte[] encData_byte = Util.UTF8.GetBytes(str); diff --git a/OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs b/OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs index a49952c513..79d6ff429b 100644 --- a/OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs +++ b/OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs @@ -56,7 +56,7 @@ namespace OpenSim.Framework.ServiceAuth m_authentications.Remove(auth); } - public void AddAuthorization(NameValueCollection headers) + public void AddAuthorization(NameValueCollection headers) { foreach (IServiceAuth auth in m_authentications) auth.AddAuthorization(headers); diff --git a/OpenSim/Framework/SimStats.cs b/OpenSim/Framework/SimStats.cs index a811187265..f19a270e59 100644 --- a/OpenSim/Framework/SimStats.cs +++ b/OpenSim/Framework/SimStats.cs @@ -32,7 +32,7 @@ namespace OpenSim.Framework { /// /// Enapsulate statistics for a simulator/scene. - /// + /// /// TODO: This looks very much like the OpenMetaverse SimStatsPacket. It should be much more generic stats /// storage. /// @@ -49,7 +49,7 @@ namespace OpenSim.Framework get { return m_regionY; } } private uint m_regionY; - + public SimStatsPacket.RegionBlock RegionBlock { get { return m_regionBlock; } @@ -73,7 +73,7 @@ namespace OpenSim.Framework get { return m_regionFlags; } } private uint m_regionFlags; - + public uint ObjectCapacity { get { return m_objectCapacity; } @@ -85,9 +85,9 @@ namespace OpenSim.Framework get { return regionUUID; } } private UUID regionUUID; - + public SimStats( - uint regionX, uint regionY, uint regionFlags, uint objectCapacity, + uint regionX, uint regionY, uint regionFlags, uint objectCapacity, SimStatsPacket.RegionBlock regionBlock, SimStatsPacket.StatBlock[] statsBlock, SimStatsPacket.StatBlock[] ExtraStatsBlock, UUID pRUUID) { diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index c270d98ee7..223d91f3a6 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs @@ -52,7 +52,7 @@ namespace OpenSim.Framework private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem)); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private Thread LockedByThread; // private string WriterStack; @@ -98,7 +98,7 @@ namespace OpenSim.Framework if (!LockedByThread.IsAlive) { //Locked by dead thread, reset. - m_itemLock = new System.Threading.ReaderWriterLockSlim(); + m_itemLock = new System.Threading.ReaderWriterLockSlim(); } } @@ -146,7 +146,7 @@ namespace OpenSim.Framework // {} m_itemLock.ExitWriteLock(); } - + while (!m_itemLock.TryEnterReadLock(60000)) { m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed."); diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index b195bbe237..1cc32b3407 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -73,7 +73,7 @@ namespace OpenSim.Framework private UUID _loadedID = UUID.Zero; private bool _ownerChanged = false; - + public UUID AssetID { get { return _assetID; diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs index e8ae728b2e..5ad0030ed8 100644 --- a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs +++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs @@ -96,7 +96,7 @@ namespace OpenSim.Framework.Tests VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOOT_SIZE] = 45; - // head + // head VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SIZE] = 255; VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUASH_STRETCH_HEAD] = 0; // head stretch VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SHAPE] = 155; @@ -106,7 +106,7 @@ namespace OpenSim.Framework.Tests VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FACE_SHEAR] = 127; VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOREHEAD_ANGLE] = 104; VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_BROW] = 94; - VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks + VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 122; // lower cheeks VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIGH_CHEEK_BONES] = 130; @@ -232,7 +232,7 @@ namespace OpenSim.Framework.Tests /// /// Test to ensure that the serialization format is the same and the underlying types don't change without notice /// oldSerialization is just a json serialization of the OSDMap packed for the AgentCircuitData. - /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types + /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types /// have changed and are incompatible. /// [Test] @@ -319,7 +319,7 @@ namespace OpenSim.Framework.Tests string str = OSDParser.SerializeJsonString(map); //System.Console.WriteLine(str); map2 = (OSDMap) OSDParser.DeserializeJson(str); - } + } catch (System.NullReferenceException) { //spurious litjson errors :P diff --git a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs index ae132c8c8b..b572afcdea 100644 --- a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs +++ b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs @@ -183,7 +183,7 @@ namespace OpenSim.Framework.Tests resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1); Assert.That(!resp.Authorised); - + resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2); Assert.That(!resp.Authorised); diff --git a/OpenSim/Framework/Tests/AnimationTests.cs b/OpenSim/Framework/Tests/AnimationTests.cs index d8f17d021e..daf8611875 100644 --- a/OpenSim/Framework/Tests/AnimationTests.cs +++ b/OpenSim/Framework/Tests/AnimationTests.cs @@ -84,7 +84,7 @@ namespace OpenSim.Framework.Tests anim4.AnimID = anim2.AnimID; anim4.ObjectID = anim2.ObjectID; anim4.SequenceNum = anim2.SequenceNum; - + Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly."); } } diff --git a/OpenSim/Framework/Tests/CacheTests.cs b/OpenSim/Framework/Tests/CacheTests.cs index c709860a85..a92ff3c036 100644 --- a/OpenSim/Framework/Tests/CacheTests.cs +++ b/OpenSim/Framework/Tests/CacheTests.cs @@ -70,7 +70,7 @@ namespace OpenSim.Framework.Tests Assert.That(citem == null, "Item should not be in Cache"); } - + [Test] public void ExpireItemManually() { @@ -96,7 +96,7 @@ namespace OpenSim.Framework.Tests cachedItem.Store(foo); cache.Store(cacheItemUUID.ToString(), cachedItem); cache.Clear(); - + object citem = cache.Get(cacheItemUUID.ToString()); Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); } diff --git a/OpenSim/Framework/Tests/LocationTest.cs b/OpenSim/Framework/Tests/LocationTest.cs index 3d5d1d275b..5e84026708 100644 --- a/OpenSim/Framework/Tests/LocationTest.cs +++ b/OpenSim/Framework/Tests/LocationTest.cs @@ -85,6 +85,6 @@ namespace OpenSim.Framework.Tests Assert.That(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test"); } - + } } diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs index d8072c7829..bde705690f 100644 --- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs +++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs @@ -110,7 +110,7 @@ namespace OpenSim.Framework.Tests && position2.Center == position1.Center && position2.RegionHandle == position1.RegionHandle && position2.Far == position1.Far - + ,"Copy From ChildAgentDataUpdate failed"); position2 = new AgentPosition(); @@ -148,13 +148,13 @@ namespace OpenSim.Framework.Tests // string time = settings.LoadedCreationTime; Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire"); - + } public void RegionSaveFired(RegionSettings settings) { m_RegionSettingsOnSaveEventFired = true; } - + [Test] public void InventoryItemBaseConstructorTest01() { @@ -164,7 +164,7 @@ namespace OpenSim.Framework.Tests UUID ItemID = UUID.Random(); UUID OwnerID = UUID.Random(); - + InventoryItemBase b2 = new InventoryItemBase(ItemID); Assert.That(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID"); Assert.That(b2.Owner == UUID.Zero, "ID constructor should create an inventory item with Owner = UUID.Zero"); @@ -268,7 +268,7 @@ namespace OpenSim.Framework.Tests Assert.That(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field."); Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field."); } - + [Test] public void AsssetBaseConstructorTest01() { @@ -304,6 +304,6 @@ namespace OpenSim.Framework.Tests Culture.SetCurrentCulture(); Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US"); - } + } } } diff --git a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs index 82e13e5bc4..cc30fb97d6 100644 --- a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs +++ b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs @@ -127,9 +127,9 @@ namespace OpenSim.Framework.Tests int[] nonprimes = { 4, 6, 8, 10, 14, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, - 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462, - 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936, - 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662, + 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462, + 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936, + 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662, 4672, 4678, 4690, 7740, 7752, 7756, 7758, 7788, 7792, 7816, 7822, 7828, 7840, 7852, 7866, 7872, 7876, 7878, 7882, 7900, 7906, 7918 }; diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs index 14b9d2f08a..b3d79eec97 100644 --- a/OpenSim/Framework/Tests/UtilTest.cs +++ b/OpenSim/Framework/Tests/UtilTest.cs @@ -233,7 +233,7 @@ namespace OpenSim.Framework.Tests "application/vnd.ll.clothing", "application/vnd.ll.gesture" }; - + for (int i=0;i public virtual ulong HomeRegion { - get - { + get + { return Util.RegionWorldLocToHandle(Util.RegionToWorldLoc(m_homeRegionX), Util.RegionToWorldLoc(m_homeRegionY)); - // return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize); + // return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize); } - + set { uint regionWorldLocX, regionWorldLocY; @@ -212,7 +212,7 @@ namespace OpenSim.Framework get { return m_surname; } set { m_surname = value; } } - + /// /// The concatentation of the various name components. /// diff --git a/OpenSim/Framework/UserProfiles.cs b/OpenSim/Framework/UserProfiles.cs index 4ed890bc43..7c6a6feaae 100644 --- a/OpenSim/Framework/UserProfiles.cs +++ b/OpenSim/Framework/UserProfiles.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework public byte Flags = 0; public int Price = 0; } - + public class UserProfileProperties { public UUID UserId = UUID.Zero; @@ -68,7 +68,7 @@ namespace OpenSim.Framework public UUID FirstLifeImageId = UUID.Zero; public string FirstLifeText = string.Empty; } - + public class UserProfilePick { public UUID PickId = UUID.Zero; @@ -86,7 +86,7 @@ namespace OpenSim.Framework public int SortOrder = 0; public bool Enabled = false; } - + public class UserProfileNotes { public UUID UserId; @@ -101,7 +101,7 @@ namespace OpenSim.Framework public bool Visible = false; public string EMail = string.Empty; } - + public class UserAccountProperties { public string EmailAddress = string.Empty; @@ -110,13 +110,13 @@ namespace OpenSim.Framework public string Password = string.Empty; public string UserId = string.Empty; } - + public class UserAccountAuth { public string UserId = UUID.Zero.ToString(); public string Password = string.Empty; } - + public class UserAppData { public string TagId = string.Empty; diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 89cf045716..6d679f2c12 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -59,7 +59,7 @@ namespace OpenSim.Framework { [Flags] public enum PermissionMask : uint - { + { None = 0, // folded perms @@ -112,7 +112,7 @@ namespace OpenSim.Framework public STPStartInfo STPStartInfo { get; set; } public WIGStartInfo WIGStartInfo { get; set; } public bool IsIdle { get; set; } - public bool IsShuttingDown { get; set; } + public bool IsShuttingDown { get; set; } public int MaxThreads { get; set; } public int MinThreads { get; set; } public int InUseThreads { get; set; } @@ -230,7 +230,7 @@ namespace OpenSim.Framework public static Encoding UTF8NoBomEncoding = new UTF8Encoding(false); /// - /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) + /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) /// public static UUID BLANK_TEXTURE_UUID = new UUID("5748decc-f629-461c-9a36-a35a221fe21f"); @@ -280,7 +280,7 @@ namespace OpenSim.Framework /// /// A 3d vector /// A new vector which is normalized form of the vector - + public static Vector3 GetNormalizedVector(Vector3 a) { Vector3 v = new Vector3(a.X, a.Y, a.Z); @@ -371,7 +371,7 @@ namespace OpenSim.Framework // Regions are identified with a 'handle' made up of its world coordinates packed into a ulong. // Region handles are based on the coordinate of the region corner with lower X and Y // var regions need more work than this to get that right corner from a generic world position - // this corner must be on a grid point + // this corner must be on a grid point public static ulong RegionWorldLocToHandle(uint X, uint Y) { ulong handle = X & 0xffffff00; // make sure it matchs grid coord points. @@ -450,7 +450,7 @@ namespace OpenSim.Framework string host; uint port = 80; - + string[] parts = inputName.Split(new char[] { ':' }); int indx; if(parts.Length == 0) @@ -470,7 +470,7 @@ namespace OpenSim.Framework else { host = parts[0]; - + if (parts.Length >= 2) { indx = parts[1].IndexOf('/'); @@ -875,8 +875,8 @@ namespace OpenSim.Framework /// New region x-coord /// Old region y-coord /// New region y-coord - /// - public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy, + /// + public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy, int oldsizex, int oldsizey, int newsizex, int newsizey) { // we still need to make sure we see new region 1stNeighbors @@ -1267,7 +1267,7 @@ namespace OpenSim.Framework /// /// Gets the value of a configuration variable by looking into - /// multiple sections in order. The latter sections overwrite + /// multiple sections in order. The latter sections overwrite /// any values previously found. /// /// Type of the variable @@ -1282,7 +1282,7 @@ namespace OpenSim.Framework /// /// Gets the value of a configuration variable by looking into - /// multiple sections in order. The latter sections overwrite + /// multiple sections in order. The latter sections overwrite /// any values previously found. /// /// @@ -1338,7 +1338,7 @@ namespace OpenSim.Framework ConfigSource.ExpandKeyValues(); } } - + public static T ReadSettingsFromIniFile(IConfig config, T settingsClass) { Type settingsType = settingsClass.GetType(); @@ -1449,7 +1449,7 @@ namespace OpenSim.Framework if (File.Exists(configFile)) { - // Merge + // Merge config.Merge(new IniConfigSource(configFile)); config.ExpandKeyValues(); configFilePath = configFile; @@ -1598,7 +1598,7 @@ namespace OpenSim.Framework } memory.Position = 0; - + byte[] compressed = new byte[memory.Length]; memory.Read(compressed, 0, compressed.Length); @@ -1645,7 +1645,7 @@ namespace OpenSim.Framework const int readSize = 256; byte[] buffer = new byte[readSize]; MemoryStream ms = new MemoryStream(); - + int count = inputStream.Read(buffer, 0, readSize); while (count > 0) @@ -1731,10 +1731,10 @@ namespace OpenSim.Framework regionHandle = Utils.BytesToUInt64(bytes); x = Utils.BytesToUInt(bytes, 8) & 0xffff; y = Utils.BytesToUInt(bytes, 12) & 0xffff; - // validation may fail, just reducing the odds of using a real UUID as encoded parcel + // validation may fail, just reducing the odds of using a real UUID as encoded parcel return ( bytes[0] == 0 && bytes[4] == 0 && // handler x,y multiples of 256 bytes[9] < 64 && bytes[13] < 64 && // positions < 16km - bytes[14] == 0 && bytes[15] == 0); + bytes[14] == 0 && bytes[15] == 0); } public static void ParseFakeParcelID(UUID parcelID, out ulong regionHandle, out uint x, out uint y, out uint z) @@ -1757,7 +1757,7 @@ namespace OpenSim.Framework x += rx; y += ry; } - + /// /// Get operating system information if available. Returns only the first 45 characters of information /// @@ -1776,12 +1776,12 @@ namespace OpenSim.Framework // { // os = ReadEtcIssue(); // } -// +// // if (os.Length > 45) // { // os = os.Substring(0, 45); // } - + return os; } @@ -1993,7 +1993,7 @@ namespace OpenSim.Framework vol = vcomps[0]; } } - + string[] comps = path.Split(new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}, StringSplitOptions.RemoveEmptyEntries); // Glob @@ -2095,7 +2095,7 @@ namespace OpenSim.Framework if (!str.EndsWith("\0")) str += "\0"; - + // Because this is UTF-8 encoding and not ASCII, it's possible we // might have gotten an oversized array even after the string trim byte[] data = UTF8.GetBytes(str); @@ -2354,7 +2354,7 @@ namespace OpenSim.Framework throw new NotImplementedException(); } } - + /// /// Additional information about threads in the main thread pool. Used to time how long the /// thread has been running, and abort it if it has timed-out. @@ -2365,7 +2365,7 @@ namespace OpenSim.Framework public string StackTrace { get; set; } private string context; public bool LogThread { get; set; } - + public IWorkItemResult WorkItem { get; set; } public Thread Thread { get; set; } public bool Running { get; set; } @@ -2470,7 +2470,7 @@ namespace OpenSim.Framework public static Dictionary GetFireAndForgetCallsMade() { return new Dictionary(m_fireAndForgetCallsMade); - } + } private static Dictionary m_fireAndForgetCallsMade = new Dictionary(); @@ -2490,7 +2490,7 @@ namespace OpenSim.Framework { FireAndForget(callback, obj, null); } - + public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context) { Interlocked.Increment(ref numTotalThreadFuncsCalled); @@ -2511,19 +2511,19 @@ namespace OpenSim.Framework WaitCallback realCallback; bool loggingEnabled = LogThreadPool > 0; - + long threadFuncNum = Interlocked.Increment(ref nextThreadFuncNum); ThreadInfo threadInfo = new ThreadInfo(threadFuncNum, context); if (FireAndForgetMethod == FireAndForgetMethod.RegressionTest) { // If we're running regression tests, then we want any exceptions to rise up to the test code. - realCallback = - o => - { - Culture.SetCurrentCulture(); - callback(o); - + realCallback = + o => + { + Culture.SetCurrentCulture(); + callback(o); + if (context != null) m_fireAndForgetCallsInProgress[context]--; }; @@ -2666,7 +2666,7 @@ namespace OpenSim.Framework if (stackTrace.Contains("BeginFireQueueEmpty")) return false; } - + return true; } @@ -2679,7 +2679,7 @@ namespace OpenSim.Framework { string src = Environment.StackTrace; string[] lines = src.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - + StringBuilder dest = new StringBuilder(src.Length); bool started = false; @@ -2724,11 +2724,11 @@ namespace OpenSim.Framework /// trace. And pausing another thread can cause a deadlock. This method attempts to /// avoid deadlock by using a short timeout (200ms), after which it gives up and /// returns 'null' instead of the stack trace. - /// + /// /// Take from: http://stackoverflow.com/a/14935378 - /// + /// /// WARNING: this doesn't work in Mono. See https://bugzilla.novell.com/show_bug.cgi?id=571691 - /// + /// /// /// The stack trace, or null if failed to get it private static StackTrace GetStackTrace(Thread targetThread) @@ -2829,7 +2829,7 @@ namespace OpenSim.Framework /// /// Environment.TickCount is an int but it counts all 32 bits so it goes positive /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap - /// for the callers. + /// for the callers. /// This trims it to a 12 day interval so don't let your frame time get too long. /// /// @@ -3186,7 +3186,7 @@ namespace OpenSim.Framework if (parts.Length == 2) return CalcUniversalIdentifier(id, agentsURI, parts[0] + " " + parts[1]); } - + return CalcUniversalIdentifier(id, agentsURI, firstName + " " + lastName); } @@ -3286,10 +3286,10 @@ namespace OpenSim.Framework public virtual int Count { - get - { + get + { lock (m_syncRoot) - return m_highQueue.Count + m_lowQueue.Count; + return m_highQueue.Count + m_lowQueue.Count; } } diff --git a/OpenSim/Framework/VersionInfo.cs b/OpenSim/Framework/VersionInfo.cs index 7bb0351ea1..1e6efe54ef 100644 --- a/OpenSim/Framework/VersionInfo.cs +++ b/OpenSim/Framework/VersionInfo.cs @@ -58,10 +58,10 @@ namespace OpenSim } public const int VERSIONINFO_VERSION_LENGTH = 27; - + /// /// This is the external interface version. It is separate from the OpenSimulator project version. - /// + /// /// /// Commented because it's not used anymore, see below for new /// versioning method. @@ -70,18 +70,18 @@ namespace OpenSim /// /// This rules versioning regarding teleports, and compatibility between simulators in that regard. /// - /// + /// /// /// The protocol version that we will use for outgoing transfers - /// Valid values are - /// "SIMULATION/0.3" + /// Valid values are + /// "SIMULATION/0.3" /// - This is the latest, and it supports teleports to variable-sized regions /// - Older versions can teleport to this one, but only if the destination region /// is 256x256 /// "SIMULATION/0.2" /// - A source simulator which only implements "SIMULATION/0.1" can still teleport here /// - this protocol is more efficient than "SIMULATION/0.1" - /// "SIMULATION/0.1" + /// "SIMULATION/0.1" /// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before. /// public readonly static float SimulationServiceVersionAcceptedMin = 0.3f; diff --git a/OpenSim/Framework/WearableCacheItem.cs b/OpenSim/Framework/WearableCacheItem.cs index 966a6bc290..ccaf69edfd 100644 --- a/OpenSim/Framework/WearableCacheItem.cs +++ b/OpenSim/Framework/WearableCacheItem.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework WearableCacheItem[] retitems = new WearableCacheItem[itemmax]; for (uint i=0;i: {1}",response,e.Message); } - + return result; } - + #endregion JSONRequest #region FormRequest @@ -419,7 +419,7 @@ namespace OpenSim.Framework { return ServiceFormRequest(url,data, 30000); } - + public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) { lock (EndPointLock(url)) @@ -436,7 +436,7 @@ namespace OpenSim.Framework if (DebugLevel >= 3) m_log.DebugFormat("[LOGHTTP]: HTTP OUT {0} ServiceForm '{1}' to {2}", reqnum, method, url); - + string errorMessage = "unknown error"; int tickstart = Util.EnvironmentTickCount(); int tickdata = 0; @@ -451,7 +451,7 @@ namespace OpenSim.Framework request.MaximumAutomaticRedirections = 10; request.ReadWriteTimeout = timeout / 4; request.Headers[OSHeaderRequestID] = reqnum.ToString(); - + if (data != null) { queryString = BuildQueryString(data); @@ -460,7 +460,7 @@ namespace OpenSim.Framework LogOutgoingDetail("SEND", reqnum, queryString); byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString); - + request.ContentLength = buffer.Length; request.ContentType = "application/x-www-form-urlencoded"; using (Stream requestStream = request.GetRequestStream()) @@ -538,7 +538,7 @@ namespace OpenSim.Framework } #endregion FormRequest - + #region Uri /// @@ -591,7 +591,7 @@ namespace OpenSim.Framework } /// - /// Appends a query string to a Uri that may or may not have existing + /// Appends a query string to a Uri that may or may not have existing /// query parameters /// /// Uri to append the query to @@ -643,7 +643,7 @@ namespace OpenSim.Framework } /// - /// + /// /// /// /// @@ -662,12 +662,12 @@ namespace OpenSim.Framework #region Stream /// - /// Copies the contents of one stream to another, starting at the + /// Copies the contents of one stream to another, starting at the /// current position of each stream /// - /// The stream to copy from, at the position + /// The stream to copy from, at the position /// where copying should begin - /// The stream to copy to, at the position where + /// The stream to copy to, at the position where /// bytes should be written /// The maximum bytes to copy /// The total number of bytes copied @@ -811,7 +811,7 @@ namespace OpenSim.Framework /// /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static void MakeRequest(string verb, @@ -909,7 +909,7 @@ namespace OpenSim.Framework // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't // documented in MSDN using (WebResponse response = request.EndGetResponse(res2)) - { + { try { using (Stream respStream = response.GetResponseStream()) @@ -930,7 +930,7 @@ namespace OpenSim.Framework if (e.Response is HttpWebResponse) { using (HttpWebResponse httpResponse = (HttpWebResponse)e.Response) - { + { if (httpResponse.StatusCode != HttpStatusCode.NotFound) { // We don't appear to be handling any other status codes, so log these feailures to that @@ -955,7 +955,7 @@ namespace OpenSim.Framework "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}", verb, requestUrl, e.Message, e.StackTrace); } - + // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); try @@ -968,7 +968,7 @@ namespace OpenSim.Framework "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}", verb, requestUrl, e.Message, e.StackTrace); } - + }, null); } @@ -997,7 +997,7 @@ namespace OpenSim.Framework } } finally - { + { if (buffer != null) buffer.Dispose(); } @@ -1168,7 +1168,7 @@ namespace OpenSim.Framework /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj, int pTimeout) @@ -1191,7 +1191,7 @@ namespace OpenSim.Framework /// /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections) @@ -1210,7 +1210,7 @@ namespace OpenSim.Framework /// /// /// - /// The response. If there was an internal exception or the request timed out, + /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections, IServiceAuth auth) @@ -1375,7 +1375,7 @@ namespace OpenSim.Framework return deserial; } - + public static class XMLResponseHelper { public static TResponse LogAndDeserialize(int reqnum, Stream respStream, long contentLength) @@ -1400,7 +1400,7 @@ namespace OpenSim.Framework } } - + public static class XMLRPCRequester { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -1444,7 +1444,7 @@ namespace OpenSim.Framework { m_log.Error("Error parsing XML-RPC response", e); } - + if (Resp.IsFault) { m_log.DebugFormat( diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index e441cc8066..5cb6a88e94 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -86,9 +86,9 @@ namespace OpenSim if (logConfigFile != String.Empty) { XmlConfigurator.Configure(new System.IO.FileInfo(logConfigFile)); - m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file", + m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file", logConfigFile); - } + } else { XmlConfigurator.Configure(); @@ -104,22 +104,22 @@ namespace OpenSim "[OPENSIM MAIN]: Environment variable MONO_THREADS_PER_CPU is {0}", monoThreadsPerCpu ?? "unset"); // Verify the Threadpool allocates or uses enough worker and IO completion threads - // .NET 2.0, workerthreads default to 50 * numcores - // .NET 3.0, workerthreads defaults to 250 * numcores - // .NET 4.0, workerthreads are dynamic based on bitness and OS resources + // .NET 2.0, workerthreads default to 50 * numcores + // .NET 3.0, workerthreads defaults to 250 * numcores + // .NET 4.0, workerthreads are dynamic based on bitness and OS resources // Max IO Completion threads are 1000 on all 3 CLRs // // Mono 2.10.9 to at least Mono 3.1, workerthreads default to 100 * numcores, iocp threads to 4 * numcores - int workerThreadsMin = 500; - int workerThreadsMax = 1000; // may need further adjustment to match other CLR - int iocpThreadsMin = 1000; - int iocpThreadsMax = 2000; // may need further adjustment to match other CLR + int workerThreadsMin = 500; + int workerThreadsMax = 1000; // may need further adjustment to match other CLR + int iocpThreadsMin = 1000; + int iocpThreadsMax = 2000; // may need further adjustment to match other CLR { int currentMinWorkerThreads, currentMinIocpThreads; System.Threading.ThreadPool.GetMinThreads(out currentMinWorkerThreads, out currentMinIocpThreads); m_log.InfoFormat( - "[OPENSIM MAIN]: Runtime gave us {0} min worker threads and {1} min IOCP threads", + "[OPENSIM MAIN]: Runtime gave us {0} min worker threads and {1} min IOCP threads", currentMinWorkerThreads, currentMinIocpThreads); } @@ -138,30 +138,30 @@ namespace OpenSim m_log.InfoFormat("[OPENSIM MAIN]: Limiting max worker threads to {0}",workerThreads); } - // Increase the number of IOCP threads available. - // Mono defaults to a tragically low number (24 on 6-core / 8GB Fedora 17) - if (iocpThreads < iocpThreadsMin) + // Increase the number of IOCP threads available. + // Mono defaults to a tragically low number (24 on 6-core / 8GB Fedora 17) + if (iocpThreads < iocpThreadsMin) { iocpThreads = iocpThreadsMin; m_log.InfoFormat("[OPENSIM MAIN]: Bumping up max IOCP threads to {0}",iocpThreads); } - // Make sure we don't overallocate IOCP threads and thrash system resources + // Make sure we don't overallocate IOCP threads and thrash system resources if ( iocpThreads > iocpThreadsMax ) { iocpThreads = iocpThreadsMax; m_log.InfoFormat("[OPENSIM MAIN]: Limiting max IOCP completion threads to {0}",iocpThreads); } - // set the resulting worker and IO completion thread counts back to ThreadPool + // set the resulting worker and IO completion thread counts back to ThreadPool if ( System.Threading.ThreadPool.SetMaxThreads(workerThreads, iocpThreads) ) - { - m_log.InfoFormat( + { + m_log.InfoFormat( "[OPENSIM MAIN]: Threadpool set to {0} max worker threads and {1} max IOCP threads", workerThreads, iocpThreads); - } - else - { - m_log.Warn("[OPENSIM MAIN]: Threadpool reconfiguration failed, runtime defaults still in effect."); - } + } + else + { + m_log.Warn("[OPENSIM MAIN]: Threadpool reconfiguration failed, runtime defaults still in effect."); + } // Check if the system is compatible with OpenSimulator. // Ensures that the minimum system requirements are met @@ -179,7 +179,7 @@ namespace OpenSim Culture.SetCurrentCulture(); // Validate that the user has the most basic configuration done - // If not, offer to do the most basic configuration for them warning them along the way of the importance of + // If not, offer to do the most basic configuration for them warning them along the way of the importance of // reading these files. /* m_log.Info("Checking for reguired configuration...\n"); @@ -188,13 +188,13 @@ namespace OpenSim || (File.Exists(Path.Combine(Util.configDir(), "opensim.ini"))) || (File.Exists(Path.Combine(Util.configDir(), "openSim.ini"))) || (File.Exists(Path.Combine(Util.configDir(), "Opensim.ini"))); - + bool StanaloneCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini")); bool StanaloneCommon_lowercased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "standalonecommon.ini")); bool GridCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "GridCommon.ini")); bool GridCommon_lowerCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "gridcommon.ini")); - if ((OpenSim_Ini) + if ((OpenSim_Ini) && ( (StanaloneCommon_ProperCased || StanaloneCommon_lowercased @@ -212,7 +212,7 @@ namespace OpenSim "yes"); if (resp == "yes") { - + if (!(OpenSim_Ini)) { try @@ -312,7 +312,7 @@ namespace OpenSim m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); // load Crash directory config - m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); + m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); if (background) { @@ -320,9 +320,9 @@ namespace OpenSim m_sim.Startup(); } else - { + { m_sim = new OpenSim(configSource); - + m_sim.Startup(); while (true) diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 4f141a6e70..62bd4f4ab6 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -43,10 +43,10 @@ namespace OpenSim public class ConfigurationLoader { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// Various Config settings the region needs to start - /// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor, + /// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor, /// StorageDLL, Storage Connection String, Estate connection String, Client Stack /// Standalone settings. /// @@ -188,7 +188,7 @@ namespace OpenSim { iniFileExists = true; AddIncludes(overrideConfig, overrideSources); - } + } } m_config.Source.Merge(overrideConfig.Source); } @@ -198,7 +198,7 @@ namespace OpenSim { m_log.FatalFormat("[CONFIG]: Could not load any configuration"); Environment.Exit(1); - } + } else if (!iniFileExists) { m_log.FatalFormat("[CONFIG]: Could not load any configuration"); @@ -257,14 +257,14 @@ namespace OpenSim string path = Path.Combine(basepath, chunkWithoutWildcards); path = Path.GetFullPath(path) + chunkWithWildcards; string[] paths = Util.Glob(path); - + // If the include path contains no wildcards, then warn the user that it wasn't found. if (wildcardIndex == -1 && paths.Length == 0) { m_log.WarnFormat("[CONFIG]: Could not find include file {0}", path); } else - { + { foreach (string p in paths) { if (!sources.Contains(p)) @@ -377,7 +377,7 @@ namespace OpenSim m_configSettings.PhysicsEngine = startupConfig.GetString("physics"); m_configSettings.MeshEngineName = startupConfig.GetString("meshing"); - m_configSettings.ClientstackDll + m_configSettings.ClientstackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); } diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index a3fa66cc06..ff3f5d7bb9 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs @@ -43,7 +43,7 @@ namespace OpenSim void Initialise(OpenSimBase openSim); /// - /// Called when the application loading is completed + /// Called when the application loading is completed /// void PostInitialise(); } diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index d9fdcde732..8022b1e587 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -135,7 +135,7 @@ namespace OpenSim { // Wait for a signal to be delivered int index = Mono.Unix.UnixSignal.WaitAny (signals, -1); - + //Mono.Unix.Native.Signum signal = signals [index].Signum; MainConsole.Instance.RunCommand("shutdown"); } @@ -273,17 +273,17 @@ namespace OpenSim m_console.Commands.AddCommand("General", false, "change region", "change region ", - "Change current console region", + "Change current console region", ChangeSelectedRegion); m_console.Commands.AddCommand("Archiving", false, "save xml", "save xml []", - "Save a region's data in XML format", + "Save a region's data in XML format", SaveXml); m_console.Commands.AddCommand("Archiving", false, "save xml2", "save xml2 []", - "Save a region's data in XML2 format", + "Save a region's data in XML2 format", SaveXml2); m_console.Commands.AddCommand("Archiving", false, "load xml", @@ -293,12 +293,12 @@ namespace OpenSim m_console.Commands.AddCommand("Archiving", false, "load xml2", "load xml2 []", - "Load a region's data from XML2 format", + "Load a region's data from XML2 format", LoadXml2); m_console.Commands.AddCommand("Archiving", false, "save prims xml2", "save prims xml2 [ ]", - "Save named prim to XML2", + "Save named prim to XML2", SavePrimsXml2); m_console.Commands.AddCommand("Archiving", false, "load oar", @@ -352,7 +352,7 @@ namespace OpenSim m_console.Commands.AddCommand("Objects", false, "edit scale", "edit scale ", - "Change the scale of a named prim", + "Change the scale of a named prim", HandleEditScale); m_console.Commands.AddCommand("Objects", false, "rotate scene", @@ -379,44 +379,44 @@ namespace OpenSim m_console.Commands.AddCommand("Users", false, "show users", "show users [full]", - "Show user data for users currently on the region", + "Show user data for users currently on the region", "Without the 'full' option, only users actually on the region are shown." + " With the 'full' option child agents of users in neighbouring regions are also shown.", HandleShow); m_console.Commands.AddCommand("Comms", false, "show connections", "show connections", - "Show connection data", + "Show connection data", HandleShow); m_console.Commands.AddCommand("Comms", false, "show circuits", "show circuits", - "Show agent circuit data", + "Show agent circuit data", HandleShow); m_console.Commands.AddCommand("Comms", false, "show pending-objects", "show pending-objects", - "Show # of objects on the pending queues of all scene viewers", + "Show # of objects on the pending queues of all scene viewers", HandleShow); m_console.Commands.AddCommand("General", false, "show modules", "show modules", - "Show module data", + "Show module data", HandleShow); m_console.Commands.AddCommand("Regions", false, "show regions", "show regions", - "Show region data", + "Show region data", HandleShow); - + m_console.Commands.AddCommand("Regions", false, "show ratings", "show ratings", - "Show rating data", + "Show rating data", HandleShow); m_console.Commands.AddCommand("Objects", false, "backup", "backup", - "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", + "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand); m_console.Commands.AddCommand("Regions", false, "create region", @@ -430,22 +430,22 @@ namespace OpenSim m_console.Commands.AddCommand("Regions", false, "restart", "restart", - "Restart the currently selected region(s) in this instance", + "Restart the currently selected region(s) in this instance", RunCommand); m_console.Commands.AddCommand("General", false, "command-script", "command-script