Massive tab and trailing space cleanup
parent
e88e2945e9
commit
b16abc8166
OpenSim
Addons
Groups
Properties
OfflineIM
ApplicationPlugins
RegionModulesController
RemoteController
Properties
Capabilities
Handlers
AvatarPickerSearch
GetDisplayNames
Properties
UploadBakedTexture
Properties
ConsoleClient
Properties
Data
MySQL
PGSQL
|
@ -46,7 +46,7 @@ namespace OpenSim.Groups
|
||||||
public string AccessToken;
|
public string AccessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ExtendedGroupMembersData
|
public class ExtendedGroupMembersData
|
||||||
{
|
{
|
||||||
// This is the only difference: this is a string
|
// This is the only difference: this is a string
|
||||||
public string AgentID;
|
public string AgentID;
|
||||||
|
@ -65,7 +65,7 @@ namespace OpenSim.Groups
|
||||||
public UUID RoleID;
|
public UUID RoleID;
|
||||||
// This is the only difference: this is a string
|
// This is the only difference: this is a string
|
||||||
public string MemberID;
|
public string MemberID;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ExtendedGroupNoticeData
|
public struct ExtendedGroupNoticeData
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
if (!m_groupMessagingEnabled)
|
if (!m_groupMessagingEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scene.RegisterModuleInterface<IGroupsMessagingModule>(this);
|
scene.RegisterModuleInterface<IGroupsMessagingModule>(this);
|
||||||
m_sceneList.Add(scene);
|
m_sceneList.Add(scene);
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ namespace OpenSim.Groups
|
||||||
if (m_groupData == null)
|
if (m_groupData == null)
|
||||||
{
|
{
|
||||||
m_log.Error("[Groups.Messaging]: Could not get IGroupsServicesConnector, GroupsMessagingModule is now disabled.");
|
m_log.Error("[Groups.Messaging]: Could not get IGroupsServicesConnector, GroupsMessagingModule is now disabled.");
|
||||||
RemoveRegion(scene);
|
RemoveRegion(scene);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ namespace OpenSim.Groups
|
||||||
m_msgTransferModule = null;
|
m_msgTransferModule = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
{
|
{
|
||||||
get { return null; }
|
get { return null; }
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
m_log.DebugFormat("[Groups.Messaging]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
m_log.DebugFormat("[Groups.Messaging]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||||
|
|
||||||
GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID.ToString(), groupID, null);
|
GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID.ToString(), groupID, null);
|
||||||
|
|
||||||
if (groupInfo != null)
|
if (groupInfo != null)
|
||||||
|
@ -279,7 +279,7 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
SendMessageToGroup(im, groupID, UUID.Zero, null);
|
SendMessageToGroup(im, groupID, UUID.Zero, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendMessageToGroup(
|
public void SendMessageToGroup(
|
||||||
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition)
|
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition)
|
||||||
{
|
{
|
||||||
|
@ -355,9 +355,9 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
if (!sendCondition(member))
|
if (!sendCondition(member))
|
||||||
{
|
{
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
m_log.DebugFormat(
|
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);
|
member.AgentID);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -366,7 +366,7 @@ namespace OpenSim.Groups
|
||||||
else if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID))
|
else if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID))
|
||||||
{
|
{
|
||||||
// Don't deliver messages to people who have dropped this session
|
// 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);
|
m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -414,7 +414,7 @@ namespace OpenSim.Groups
|
||||||
"[Groups.Messaging]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms",
|
"[Groups.Messaging]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms",
|
||||||
groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick);
|
groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region SimGridEventHandlers
|
#region SimGridEventHandlers
|
||||||
|
|
||||||
void OnClientLogin(IClientAPI client)
|
void OnClientLogin(IClientAPI client)
|
||||||
|
@ -445,13 +445,13 @@ namespace OpenSim.Groups
|
||||||
// The instant message module will only deliver messages of dialog types:
|
// The instant message module will only deliver messages of dialog types:
|
||||||
// MessageFromAgent, StartTyping, StopTyping, MessageFromObject
|
// 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
|
// Instant Message Module
|
||||||
|
|
||||||
UUID regionID = new UUID(msg.RegionID);
|
UUID regionID = new UUID(msg.RegionID);
|
||||||
if (m_debugEnabled)
|
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);
|
System.Reflection.MethodBase.GetCurrentMethod().Name, regionID);
|
||||||
|
|
||||||
DebugGridInstantMessage(msg);
|
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);
|
m_log.DebugFormat("[Groups.Messaging]: skipping agent {0} because he has an agent in region of origin", sp.UUID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
m_log.DebugFormat("[Groups.Messaging]: not skipping agent {0}", sp.UUID);
|
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;
|
break;
|
||||||
|
|
||||||
case (byte)InstantMessageDialog.SessionSend:
|
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.
|
// maybe we should deliver it.
|
||||||
IClientAPI client = GetActiveClient(new UUID(msg.toAgentID));
|
IClientAPI client = GetActiveClient(new UUID(msg.toAgentID));
|
||||||
if (client != null)
|
if (client != null)
|
||||||
|
@ -655,7 +655,7 @@ namespace OpenSim.Groups
|
||||||
UUID AgentID = new UUID(im.fromAgentID);
|
UUID AgentID = new UUID(im.fromAgentID);
|
||||||
|
|
||||||
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero.ToString(), GroupID, null);
|
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero.ToString(), GroupID, null);
|
||||||
|
|
||||||
if (groupInfo != null)
|
if (groupInfo != null)
|
||||||
{
|
{
|
||||||
AgentInvitedToGroupChatSession(AgentID.ToString(), GroupID);
|
AgentInvitedToGroupChatSession(AgentID.ToString(), GroupID);
|
||||||
|
@ -681,7 +681,7 @@ namespace OpenSim.Groups
|
||||||
UUID GroupID = new UUID(im.imSessionID);
|
UUID GroupID = new UUID(im.imSessionID);
|
||||||
UUID AgentID = new UUID(im.fromAgentID);
|
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());
|
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
|
//If this agent is sending a message, then they want to be in the session
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace OpenSim.Groups
|
||||||
private List<Scene> m_sceneList = new List<Scene>();
|
private List<Scene> m_sceneList = new List<Scene>();
|
||||||
|
|
||||||
private IMessageTransferModule m_msgTransferModule = null;
|
private IMessageTransferModule m_msgTransferModule = null;
|
||||||
|
|
||||||
private IGroupsServicesConnector m_groupData = null;
|
private IGroupsServicesConnector m_groupData = null;
|
||||||
private IUserManagement m_UserManagement;
|
private IUserManagement m_UserManagement;
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ namespace OpenSim.Groups
|
||||||
if (m_debugEnabled) m_log.Debug("[Groups]: Shutting down Groups module.");
|
if (m_debugEnabled) m_log.Debug("[Groups]: Shutting down Groups module.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
{
|
{
|
||||||
get { return null; }
|
get { return null; }
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
SendAgentGroupDataUpdate(remoteClient, false);
|
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
|
// 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
|
// 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,
|
if (m_groupData.AddGroupNotice(GetRequestingAgentIDStr(remoteClient), GroupID, NoticeID, im.fromAgentName, Subject, Message,
|
||||||
hasAttachment,
|
hasAttachment,
|
||||||
(byte)(item == null ? 0 : item.AssetType),
|
(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 : item.ID,
|
||||||
item == null ? UUID.Zero.ToString() : item.Owner.ToString()))
|
item == null ? UUID.Zero.ToString() : item.Owner.ToString()))
|
||||||
{
|
{
|
||||||
|
@ -463,7 +463,7 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
OnNewGroupNotice(GroupID, NoticeID);
|
OnNewGroupNotice(GroupID, NoticeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send notice out to everyone that wants notices
|
// Send notice out to everyone that wants notices
|
||||||
foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), GroupID))
|
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);
|
m_log.DebugFormat("[Groups]: Giving inventory from {0} to {1}", giver, remoteClient.AgentId);
|
||||||
string message;
|
string message;
|
||||||
InventoryItemBase itemCopy = ((Scene)(remoteClient.Scene)).GiveInventoryItem(remoteClient.AgentId,
|
InventoryItemBase itemCopy = ((Scene)(remoteClient.Scene)).GiveInventoryItem(remoteClient.AgentId,
|
||||||
giver, notice.noticeData.AttachmentItemID, out message);
|
giver, notice.noticeData.AttachmentItemID, out message);
|
||||||
|
|
||||||
if (itemCopy == null)
|
if (itemCopy == null)
|
||||||
|
@ -509,10 +509,10 @@ namespace OpenSim.Groups
|
||||||
remoteClient.SendInventoryItemCreateUpdate(itemCopy, 0);
|
remoteClient.SendInventoryItemCreateUpdate(itemCopy, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interop, received special 210 code for ejecting a group member
|
// Interop, received special 210 code for ejecting a group member
|
||||||
// this only works within the comms servers domain, and won't work hypergrid
|
// 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,
|
// client actually is, and try contacting that region directly to notify them,
|
||||||
// or provide the notification via xmlrpc update queue
|
// or provide the notification via xmlrpc update queue
|
||||||
if ((im.dialog == 210))
|
if ((im.dialog == 210))
|
||||||
|
@ -523,7 +523,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
UUID ejecteeID = new UUID(im.toAgentID);
|
UUID ejecteeID = new UUID(im.toAgentID);
|
||||||
|
|
||||||
im.imSessionID = UUID.Zero.Guid;
|
im.imSessionID = UUID.Zero.Guid;
|
||||||
im.dialog = (byte)InstantMessageDialog.MessageFromAgent;
|
im.dialog = (byte)InstantMessageDialog.MessageFromAgent;
|
||||||
OutgoingInstantMessage(im, ejecteeID);
|
OutgoingInstantMessage(im, ejecteeID);
|
||||||
|
|
||||||
|
@ -577,7 +577,7 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
return m_groupData.GetGroupRecord(UUID.Zero.ToString(), UUID.Zero, name);
|
return m_groupData.GetGroupRecord(UUID.Zero.ToString(), UUID.Zero, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ActivateGroup(IClientAPI remoteClient, UUID groupID)
|
public void ActivateGroup(IClientAPI remoteClient, UUID groupID)
|
||||||
{
|
{
|
||||||
if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
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);
|
m_groupData.SetAgentActiveGroup(GetRequestingAgentIDStr(remoteClient), GetRequestingAgentIDStr(remoteClient), groupID);
|
||||||
|
|
||||||
// Changing active group changes title, active powers, all kinds of things
|
// 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 group info. At a minimum, they should get ScenePresence
|
||||||
// updated with new title.
|
// updated with new title.
|
||||||
SendAgentGroupDataUpdate(remoteClient, true);
|
SendAgentGroupDataUpdate(remoteClient, true);
|
||||||
|
@ -620,10 +620,10 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
public List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID)
|
public List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID)
|
||||||
{
|
{
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[Groups]: GroupMembersRequest called for {0} from client {1}", groupID, remoteClient.Name);
|
"[Groups]: GroupMembersRequest called for {0} from client {1}", groupID, remoteClient.Name);
|
||||||
|
|
||||||
List<GroupMembersData> data = m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), groupID);
|
List<GroupMembersData> data = m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), groupID);
|
||||||
|
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
|
@ -706,7 +706,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID)
|
public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID)
|
||||||
{
|
{
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[Groups]: {0} called with groupID={1}, agentID={2}",
|
"[Groups]: {0} called with groupID={1}, agentID={2}",
|
||||||
System.Reflection.MethodBase.GetCurrentMethod().Name, groupID, agentID);
|
System.Reflection.MethodBase.GetCurrentMethod().Name, groupID, agentID);
|
||||||
|
@ -776,7 +776,7 @@ namespace OpenSim.Groups
|
||||||
}
|
}
|
||||||
|
|
||||||
string reason = string.Empty;
|
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);
|
allowPublish, maturePublish, remoteClient.AgentId, out reason);
|
||||||
|
|
||||||
if (groupID != UUID.Zero)
|
if (groupID != UUID.Zero)
|
||||||
|
@ -823,7 +823,7 @@ namespace OpenSim.Groups
|
||||||
if (membership != null)
|
if (membership != null)
|
||||||
{
|
{
|
||||||
return membership.GroupTitle;
|
return membership.GroupTitle;
|
||||||
}
|
}
|
||||||
return string.Empty;
|
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
|
// 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
|
// the client currently has set active, then we need to do a scene presence update too
|
||||||
// if (m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient)).GroupID == GroupID)
|
// if (m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient)).GroupID == GroupID)
|
||||||
|
|
||||||
SendDataUpdate(remoteClient, true);
|
SendDataUpdate(remoteClient, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -899,7 +899,7 @@ namespace OpenSim.Groups
|
||||||
case 1:
|
case 1:
|
||||||
// Remove
|
// Remove
|
||||||
m_groupData.RemoveAgentFromGroupRole(GetRequestingAgentIDStr(remoteClient), memberID.ToString(), groupID, roleID);
|
m_groupData.RemoveAgentFromGroupRole(GetRequestingAgentIDStr(remoteClient), memberID.ToString(), groupID, roleID);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
m_log.ErrorFormat("[Groups]: {0} does not understand changes == {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, changes);
|
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
|
// Send Message to Ejectee
|
||||||
GridInstantMessage msg = new GridInstantMessage();
|
GridInstantMessage msg = new GridInstantMessage();
|
||||||
|
|
||||||
// if local send a normal message
|
// if local send a normal message
|
||||||
if(ejecteeClient != null)
|
if(ejecteeClient != null)
|
||||||
{
|
{
|
||||||
|
@ -1324,7 +1324,7 @@ namespace OpenSim.Groups
|
||||||
membershipArray = membershipData.ToArray();
|
membershipArray = membershipData.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[Groups]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId);
|
m_log.InfoFormat("[Groups]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId);
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace OpenSim.Groups
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
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<IGroupsServicesConnector>(this);
|
scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
|
||||||
m_Scenes.Add(scene);
|
m_Scenes.Add(scene);
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
m_LocalGroupsConnector = new GroupsServiceLocalConnectorModule(m_Config, m_UserManagement);
|
m_LocalGroupsConnector = new GroupsServiceLocalConnectorModule(m_Config, m_UserManagement);
|
||||||
// Also, if local, create the endpoint for the HGGroupsService
|
// 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<IOfflineIMService>(), scene.RequestModuleInterface<IUserAccountService>());
|
scene.RequestModuleInterface<IOfflineIMService>(), scene.RequestModuleInterface<IUserAccountService>());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ namespace OpenSim.Groups
|
||||||
if (sp is ScenePresence && ((ScenePresence)sp).PresenceType != PresenceType.Npc)
|
if (sp is ScenePresence && ((ScenePresence)sp).PresenceType != PresenceType.Npc)
|
||||||
{
|
{
|
||||||
AgentCircuitData aCircuit = ((ScenePresence)sp).Scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId);
|
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)
|
m_OfflineIM != null && m_Messaging != null)
|
||||||
{
|
{
|
||||||
List<GridInstantMessage> ims = m_OfflineIM.GetMessages(aCircuit.AgentID);
|
List<GridInstantMessage> ims = m_OfflineIM.GetMessages(aCircuit.AgentID);
|
||||||
|
@ -184,12 +184,12 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
#region IGroupsServicesConnector
|
#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)
|
bool allowPublish, bool maturePublish, UUID founderID, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
if (m_UserManagement.IsLocalGridUser(RequestingAgentID))
|
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);
|
membershipFee, openEnrollment, allowPublish, maturePublish, founderID, out reason);
|
||||||
else
|
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)
|
bool openEnrollment, bool allowPublish, bool maturePublish, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
string url = string.Empty;
|
string url = string.Empty;
|
||||||
string name = string.Empty;
|
string name = string.Empty;
|
||||||
if (IsLocal(groupID, out url, out name))
|
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);
|
openEnrollment, allowPublish, maturePublish, out reason);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -374,7 +374,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new List<GroupRoleMembersData>();
|
return new List<GroupRoleMembersData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ namespace OpenSim.Groups
|
||||||
}
|
}
|
||||||
if (agent != null)
|
if (agent != null)
|
||||||
return Util.ProduceUserUniversalIdentifier(agent);
|
return Util.ProduceUserUniversalIdentifier(agent);
|
||||||
|
|
||||||
// we don't know anything about this foreign user
|
// we don't know anything about this foreign user
|
||||||
// try asking the user management module, which may know more
|
// try asking the user management module, which may know more
|
||||||
return m_UserManagement.GetUserUUI(AgentID);
|
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;
|
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))
|
if (Util.ParseUniversalUserIdentifier(uID, out userID, out url, out first, out last, out tmp))
|
||||||
m_UserManagement.AddUser(userID, first, last, url);
|
m_UserManagement.AddUser(userID, first, last, url);
|
||||||
|
|
||||||
return userID;
|
return userID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
m_log.DebugFormat("[Groups.RobustHGConnector]: Starting with config name {0}", m_ConfigName);
|
m_log.DebugFormat("[Groups.RobustHGConnector]: Starting with config name {0}", m_ConfigName);
|
||||||
|
|
||||||
string homeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
string homeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
||||||
new string[] { "Startup", "Hypergrid", m_ConfigName}, string.Empty);
|
new string[] { "Startup", "Hypergrid", m_ConfigName}, string.Empty);
|
||||||
if (homeURI == string.Empty)
|
if (homeURI == string.Empty)
|
||||||
throw new Exception(String.Format("[Groups.RobustHGConnector]: please provide the HomeURI [Startup] or in section {0}", m_ConfigName));
|
throw new Exception(String.Format("[Groups.RobustHGConnector]: please provide the HomeURI [Startup] or in section {0}", m_ConfigName));
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,9 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
public interface IGroupsServicesConnector
|
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 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);
|
bool openEnrollment, bool allowPublish, bool maturePublish, out string reason);
|
||||||
ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName);
|
ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName);
|
||||||
List<DirGroupsReplyData> FindGroups(string RequestingAgentID, string search);
|
List<DirGroupsReplyData> 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.
|
/// If the user is a member of the group then the data structure is returned. If not, then null is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
ExtendedGroupMembershipData GetAgentGroupMembership(string RequestingAgentID, string AgentID, UUID GroupID);
|
ExtendedGroupMembershipData GetAgentGroupMembership(string RequestingAgentID, string AgentID, UUID GroupID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get information about the groups to which a user belongs.
|
/// Get information about the groups to which a user belongs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -87,7 +87,7 @@ namespace OpenSim.Groups
|
||||||
/// </returns>
|
/// </returns>
|
||||||
List<GroupMembershipData> GetAgentGroupMemberships(string RequestingAgentID, string AgentID);
|
List<GroupMembershipData> 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);
|
bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID);
|
||||||
GroupNoticeInfo GetGroupNotice(string RequestingAgentID, UUID noticeID);
|
GroupNoticeInfo GetGroupNotice(string RequestingAgentID, UUID noticeID);
|
||||||
List<ExtendedGroupNoticeData> GetGroupNotices(string RequestingAgentID, UUID GroupID);
|
List<ExtendedGroupNoticeData> GetGroupNotices(string RequestingAgentID, UUID GroupID);
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace OpenSim.Groups
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
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<IGroupsServicesConnector>(this);
|
scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
|
||||||
m_Scenes.Add(scene);
|
m_Scenes.Add(scene);
|
||||||
}
|
}
|
||||||
|
@ -146,16 +146,16 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
#region IGroupsServicesConnector
|
#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)
|
bool allowPublish, bool maturePublish, UUID founderID, out string reason)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[Groups]: Creating group {0}", name);
|
m_log.DebugFormat("[Groups]: Creating group {0}", name);
|
||||||
reason = string.Empty;
|
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);
|
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)
|
bool openEnrollment, bool allowPublish, bool maturePublish, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
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,
|
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)
|
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);
|
hasAttachment, attType, attName, attItemID, attOwnerID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Mono.Addins;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.Addons.Groups")]
|
[assembly: AssemblyTitle("OpenSim.Addons.Groups")]
|
||||||
|
@ -15,8 +15,8 @@ using Mono.Addins;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ using Mono.Addins;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -41,7 +41,7 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.Groups
|
namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
public class GroupsServiceRemoteConnector
|
public class GroupsServiceRemoteConnector
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
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()));
|
m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace OpenSim.Groups
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
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<IGroupsServicesConnector>(this);
|
scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
|
||||||
m_Scenes.Add(scene);
|
m_Scenes.Add(scene);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
#region IGroupsServicesConnector
|
#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)
|
bool allowPublish, bool maturePublish, UUID founderID, out string reason)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[Groups.RemoteConnector]: Creating group {0}", name);
|
m_log.DebugFormat("[Groups.RemoteConnector]: Creating group {0}", name);
|
||||||
|
@ -167,7 +167,7 @@ namespace OpenSim.Groups
|
||||||
return groupID;
|
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)
|
bool openEnrollment, bool allowPublish, bool maturePublish, out string reason)
|
||||||
{
|
{
|
||||||
string r = string.Empty;
|
string r = string.Empty;
|
||||||
|
@ -186,9 +186,9 @@ namespace OpenSim.Groups
|
||||||
if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty))
|
if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return m_CacheWrapper.GetGroupRecord(RequestingAgentID,GroupID,GroupName, delegate
|
return m_CacheWrapper.GetGroupRecord(RequestingAgentID,GroupID,GroupName, delegate
|
||||||
{
|
{
|
||||||
return m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName);
|
return m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID, GroupName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ namespace OpenSim.Groups
|
||||||
m_GroupsService.RemoveAgentToGroupInvite(RequestingAgentID, inviteID);
|
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)
|
bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID)
|
||||||
{
|
{
|
||||||
GroupNoticeInfo notice = new GroupNoticeInfo();
|
GroupNoticeInfo notice = new GroupNoticeInfo();
|
||||||
|
|
|
@ -393,7 +393,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("GroupID") || !request.ContainsKey("RoleID") ||
|
if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("GroupID") || !request.ContainsKey("RoleID") ||
|
||||||
!request.ContainsKey("Name") || !request.ContainsKey("Description") || !request.ContainsKey("Title") ||
|
!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");
|
NullResult(result, "Bad network data");
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -519,11 +519,11 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if (op == "ADD")
|
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()));
|
new UUID(request["GroupID"].ToString()), new UUID(request["RoleID"].ToString()));
|
||||||
|
|
||||||
else if (op == "DELETE")
|
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()));
|
new UUID(request["GroupID"].ToString()), new UUID(request["RoleID"].ToString()));
|
||||||
|
|
||||||
result["RESULT"] = success.ToString();
|
result["RESULT"] = success.ToString();
|
||||||
|
@ -647,8 +647,8 @@ namespace OpenSim.Groups
|
||||||
string op = request["OP"].ToString();
|
string op = request["OP"].ToString();
|
||||||
|
|
||||||
if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID"))
|
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["InviteID"].ToString()), new UUID(request["GroupID"].ToString()),
|
||||||
new UUID(request["RoleID"].ToString()), request["AgentID"].ToString());
|
new UUID(request["RoleID"].ToString()), request["AgentID"].ToString());
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ namespace OpenSim.Groups
|
||||||
}
|
}
|
||||||
else if (op == "GET")
|
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()));
|
new UUID(request["InviteID"].ToString()));
|
||||||
|
|
||||||
if (invite != null)
|
if (invite != null)
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
#endregion
|
#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)
|
bool allowPublish, bool maturePublish, UUID founderID, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
@ -264,7 +264,7 @@ namespace OpenSim.Groups
|
||||||
if (ownerRole != null)
|
if (ownerRole != null)
|
||||||
ownerRoleID = ownerRole.RoleID;
|
ownerRoleID = ownerRole.RoleID;
|
||||||
|
|
||||||
// Check visibility?
|
// Check visibility?
|
||||||
// When we don't want to check visibility, we pass it "all" as the requestingAgentID
|
// When we don't want to check visibility, we pass it "all" as the requestingAgentID
|
||||||
bool checkVisibility = !RequestingAgentID.Equals(UUID.Zero.ToString());
|
bool checkVisibility = !RequestingAgentID.Equals(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
@ -307,20 +307,20 @@ namespace OpenSim.Groups
|
||||||
m.Contribution = Int32.Parse(d.Data["Contribution"]);
|
m.Contribution = Int32.Parse(d.Data["Contribution"]);
|
||||||
m.ListInProfile = d.Data["ListInProfile"] == "1" ? true : false;
|
m.ListInProfile = d.Data["ListInProfile"] == "1" ? true : false;
|
||||||
|
|
||||||
GridUserData gud = m_GridUserService.Get(d.PrincipalID);
|
GridUserData gud = m_GridUserService.Get(d.PrincipalID);
|
||||||
if (gud != null)
|
if (gud != null)
|
||||||
{
|
{
|
||||||
if (bool.Parse(gud.Data["Online"]))
|
if (bool.Parse(gud.Data["Online"]))
|
||||||
{
|
{
|
||||||
m.OnlineStatus = @"Online";
|
m.OnlineStatus = @"Online";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int unixtime = int.Parse(gud.Data["Login"]);
|
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!
|
// 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");
|
m.OnlineStatus = (unixtime == 0) ? @"unknown" : Util.ToDateTime(unixtime).ToString("MM/dd/yyyy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is this person an owner of the group?
|
// Is this person an owner of the group?
|
||||||
m.IsOwner = (rolemembershipsList.Find(r => r.RoleID == ownerRoleID) != null) ? true : false;
|
m.IsOwner = (rolemembershipsList.Find(r => r.RoleID == ownerRoleID) != null) ? true : false;
|
||||||
|
@ -553,8 +553,8 @@ namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
newRoleID = r.RoleID;
|
newRoleID = r.RoleID;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MembershipData member = m_Database.RetrieveMember(GroupID, AgentID);
|
MembershipData member = m_Database.RetrieveMember(GroupID, AgentID);
|
||||||
if (member != null)
|
if (member != null)
|
||||||
|
@ -712,7 +712,7 @@ namespace OpenSim.Groups
|
||||||
m_Database.StoreMember(membership);
|
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)
|
bool hasAttachment, byte attType, string attName, UUID attItemID, string attOwnerID)
|
||||||
{
|
{
|
||||||
// Check perms
|
// Check perms
|
||||||
|
|
|
@ -35,67 +35,67 @@ using OpenSim.Services.Base;
|
||||||
|
|
||||||
namespace OpenSim.Groups
|
namespace OpenSim.Groups
|
||||||
{
|
{
|
||||||
public class GroupsServiceBase : ServiceBase
|
public class GroupsServiceBase : ServiceBase
|
||||||
{
|
{
|
||||||
protected IGroupsData m_Database = null;
|
protected IGroupsData m_Database = null;
|
||||||
protected IGridUserData m_GridUserService = null;
|
protected IGridUserData m_GridUserService = null;
|
||||||
|
|
||||||
public GroupsServiceBase(IConfigSource config, string cName)
|
public GroupsServiceBase(IConfigSource config, string cName)
|
||||||
: base(config)
|
: base(config)
|
||||||
{
|
{
|
||||||
string dllName = String.Empty;
|
string dllName = String.Empty;
|
||||||
string connString = String.Empty;
|
string connString = String.Empty;
|
||||||
string realm = "os_groups";
|
string realm = "os_groups";
|
||||||
string usersRealm = "GridUser";
|
string usersRealm = "GridUser";
|
||||||
string configName = (cName == string.Empty) ? "Groups" : cName;
|
string configName = (cName == string.Empty) ? "Groups" : cName;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Try reading the [DatabaseService] section, if it exists
|
// Try reading the [DatabaseService] section, if it exists
|
||||||
//
|
//
|
||||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||||
if (dbConfig != null)
|
if (dbConfig != null)
|
||||||
{
|
{
|
||||||
if (dllName == String.Empty)
|
if (dllName == String.Empty)
|
||||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||||
if (connString == String.Empty)
|
if (connString == String.Empty)
|
||||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// [Groups] section overrides [DatabaseService], if it exists
|
// [Groups] section overrides [DatabaseService], if it exists
|
||||||
//
|
//
|
||||||
IConfig groupsConfig = config.Configs[configName];
|
IConfig groupsConfig = config.Configs[configName];
|
||||||
if (groupsConfig != null)
|
if (groupsConfig != null)
|
||||||
{
|
{
|
||||||
dllName = groupsConfig.GetString("StorageProvider", dllName);
|
dllName = groupsConfig.GetString("StorageProvider", dllName);
|
||||||
connString = groupsConfig.GetString("ConnectionString", connString);
|
connString = groupsConfig.GetString("ConnectionString", connString);
|
||||||
realm = groupsConfig.GetString("Realm", realm);
|
realm = groupsConfig.GetString("Realm", realm);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// We tried, but this doesn't exist. We can't proceed.
|
// We tried, but this doesn't exist. We can't proceed.
|
||||||
//
|
//
|
||||||
if (dllName.Equals(String.Empty))
|
if (dllName.Equals(String.Empty))
|
||||||
throw new Exception("No StorageProvider configured");
|
throw new Exception("No StorageProvider configured");
|
||||||
|
|
||||||
m_Database = LoadPlugin<IGroupsData>(dllName, new Object[] { connString, realm });
|
m_Database = LoadPlugin<IGroupsData>(dllName, new Object[] { connString, realm });
|
||||||
if (m_Database == null)
|
if (m_Database == null)
|
||||||
throw new Exception("Could not find a storage interface in the given module " + dllName);
|
throw new Exception("Could not find a storage interface in the given module " + dllName);
|
||||||
|
|
||||||
//
|
//
|
||||||
// [GridUserService] section overrides [DatabaseService], if it exists
|
// [GridUserService] section overrides [DatabaseService], if it exists
|
||||||
//
|
//
|
||||||
IConfig usersConfig = config.Configs["GridUserService"];
|
IConfig usersConfig = config.Configs["GridUserService"];
|
||||||
if (usersConfig != null)
|
if (usersConfig != null)
|
||||||
{
|
{
|
||||||
dllName = usersConfig.GetString("StorageProvider", dllName);
|
dllName = usersConfig.GetString("StorageProvider", dllName);
|
||||||
connString = usersConfig.GetString("ConnectionString", connString);
|
connString = usersConfig.GetString("ConnectionString", connString);
|
||||||
usersRealm = usersConfig.GetString("Realm", usersRealm);
|
usersRealm = usersConfig.GetString("Realm", usersRealm);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_GridUserService = LoadPlugin<IGridUserData>(dllName, new Object[] { connString, usersRealm });
|
m_GridUserService = LoadPlugin<IGridUserData>(dllName, new Object[] { connString, usersRealm });
|
||||||
if (m_GridUserService == null)
|
if (m_GridUserService == null)
|
||||||
throw new Exception("Could not find a storage inferface for the given users module " + dllName);
|
throw new Exception("Could not find a storage inferface for the given users module " + dllName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
// Check if it already exists
|
// Check if it already exists
|
||||||
GroupData grec = m_Database.RetrieveGroup(groupID);
|
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()))
|
(grec != null && grec.Data["Location"] != string.Empty && grec.Data["Location"].ToLower() != serviceLocation.ToLower()))
|
||||||
{
|
{
|
||||||
// Create the group
|
// Create the group
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Mono.Addins;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.Addons.OfflineIM")]
|
[assembly: AssemblyTitle("OpenSim.Addons.OfflineIM")]
|
||||||
|
@ -15,8 +15,8 @@ using Mono.Addins;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ using Mono.Addins;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace OpenSim.OfflineIM
|
||||||
break;
|
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()));
|
m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ namespace OpenSim.OfflineIM
|
||||||
{
|
{
|
||||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||||
sendData["UserID"] = userID;
|
sendData["UserID"] = userID;
|
||||||
|
|
||||||
MakeRequest("DELETE", sendData);
|
MakeRequest("DELETE", sendData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace OpenSim.OfflineIM
|
||||||
public bool StoreMessage(GridInstantMessage im, out string reason)
|
public bool StoreMessage(GridInstantMessage im, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
|
||||||
// Check limits
|
// Check limits
|
||||||
UUID principalID = new UUID(im.toAgentID);
|
UUID principalID = new UUID(im.toAgentID);
|
||||||
long count = m_Database.GetCount("PrincipalID", principalID.ToString());
|
long count = m_Database.GetCount("PrincipalID", principalID.ToString());
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
|
m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
|
||||||
Thread.CurrentThread.ManagedThreadId.ToString() +
|
Thread.CurrentThread.ManagedThreadId.ToString() +
|
||||||
")");
|
")");
|
||||||
|
|
||||||
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
||||||
|
|
||||||
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
public class RegionLoaderFileSystem : IRegionLoader
|
public class RegionLoaderFileSystem : IRegionLoader
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private IConfigSource m_configSource;
|
private IConfigSource m_configSource;
|
||||||
|
|
||||||
public void SetIniConfigSource(IConfigSource 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.
|
// Create an empty Regions.ini if there are no existing config files.
|
||||||
if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0)
|
if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0)
|
||||||
{
|
{
|
||||||
new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource);
|
new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource);
|
||||||
iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
|
iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath);
|
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath);
|
||||||
|
|
||||||
List<RegionInfo> regionInfos = new List<RegionInfo>();
|
List<RegionInfo> regionInfos = new List<RegionInfo>();
|
||||||
|
@ -85,16 +85,16 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
foreach (string file in iniFiles)
|
foreach (string file in iniFiles)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
|
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
|
||||||
|
|
||||||
IConfigSource source = new IniConfigSource(file);
|
IConfigSource source = new IniConfigSource(file);
|
||||||
|
|
||||||
foreach (IConfig config in source.Configs)
|
foreach (IConfig config in source.Configs)
|
||||||
{
|
{
|
||||||
RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
|
RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
|
||||||
regionInfos.Add(regionInfo);
|
regionInfos.Add(regionInfo);
|
||||||
|
|
||||||
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
|
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,12 +102,12 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
foreach (string file in configFiles)
|
foreach (string file in configFiles)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
|
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
|
||||||
|
|
||||||
RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource);
|
RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource);
|
||||||
regionInfos.Add(regionInfo);
|
regionInfos.Add(regionInfo);
|
||||||
|
|
||||||
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
|
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Mono.Addins;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.ApplicationPlugins.RegionModulesController")]
|
[assembly: AssemblyTitle("OpenSim.ApplicationPlugins.RegionModulesController")]
|
||||||
|
@ -15,8 +15,8 @@ using Mono.Addins;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ using Mono.Addins;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IApplicationPlugin implementation
|
#region IApplicationPlugin implementation
|
||||||
|
|
||||||
public void Initialise (OpenSimBase openSim)
|
public void Initialise (OpenSimBase openSim)
|
||||||
{
|
{
|
||||||
m_openSim = openSim;
|
m_openSim = openSim;
|
||||||
|
@ -111,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||||
{
|
{
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
"[REGIONMODULES]: From plugin {0}, (version {1}), loaded {2} modules, {3} shared, {4} non-shared {5} unknown",
|
"[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.Key.Version,
|
||||||
loadedModuleData.Value[0] + loadedModuleData.Value[1] + loadedModuleData.Value[2],
|
loadedModuleData.Value[0] + loadedModuleData.Value[1] + loadedModuleData.Value[2],
|
||||||
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
|
#region Region Module interfacesController implementation
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check that the given module is no disabled in the [Modules] section of the config files.
|
/// Check that the given module is no disabled in the [Modules] section of the config files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -293,10 +293,10 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||||
if (className != String.Empty &&
|
if (className != String.Empty &&
|
||||||
node.Type.ToString() != className)
|
node.Type.ToString() != className)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The root of all evil.
|
// The root of all evil.
|
||||||
// This is where we handle adding the modules to scenes when they
|
// This is where we handle adding the modules to scenes when they
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Mono.Addins;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.ApplicationPlugins.RemoteController")]
|
[assembly: AssemblyTitle("OpenSim.ApplicationPlugins.RemoteController")]
|
||||||
|
@ -15,8 +15,8 @@ using Mono.Addins;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ using Mono.Addins;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -575,7 +575,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
}
|
}
|
||||||
|
|
||||||
responseData["success"] = true;
|
responseData["success"] = true;
|
||||||
|
|
||||||
m_log.Info("[RADMIN]: Shutdown Administrator Request complete");
|
m_log.Info("[RADMIN]: Shutdown Administrator Request complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -747,9 +747,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
{
|
{
|
||||||
// No INI setting recorded.
|
// No INI setting recorded.
|
||||||
}
|
}
|
||||||
|
|
||||||
string regionIniPath;
|
string regionIniPath;
|
||||||
|
|
||||||
if (requestData.Contains("region_file"))
|
if (requestData.Contains("region_file"))
|
||||||
{
|
{
|
||||||
// Make sure that the file to be created is in a subdirectory of the region storage directory.
|
// 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(":", "_").
|
region.RegionName.Replace(" ", "_").Replace(":", "_").
|
||||||
Replace("/", "_")));
|
Replace("/", "_")));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
|
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
|
||||||
region.RegionID, regionIniPath);
|
region.RegionID, regionIniPath);
|
||||||
region.SaveRegionToFile("dynamic region", regionIniPath);
|
region.SaveRegionToFile("dynamic region", regionIniPath);
|
||||||
|
@ -782,9 +782,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
{
|
{
|
||||||
region.Persistent = false;
|
region.Persistent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the estate
|
// Set the estate
|
||||||
|
|
||||||
// Check for an existing estate
|
// Check for an existing estate
|
||||||
List<int> estateIDs = m_application.EstateDataService.GetEstates((string) requestData["estate_name"]);
|
List<int> estateIDs = m_application.EstateDataService.GetEstates((string) requestData["estate_name"]);
|
||||||
if (estateIDs.Count < 1)
|
if (estateIDs.Count < 1)
|
||||||
|
@ -795,12 +795,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
// ok, client wants us to use an explicit UUID
|
// ok, client wants us to use an explicit UUID
|
||||||
// regardless of what the avatar name provided
|
// regardless of what the avatar name provided
|
||||||
userID = new UUID((string) requestData["estate_owner_uuid"]);
|
userID = new UUID((string) requestData["estate_owner_uuid"]);
|
||||||
|
|
||||||
// Check that the specified user exists
|
// Check that the specified user exists
|
||||||
Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
|
Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
|
||||||
IUserAccountService accountService = currentOrFirst.UserAccountService;
|
IUserAccountService accountService = currentOrFirst.UserAccountService;
|
||||||
UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, userID);
|
UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, userID);
|
||||||
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
throw new Exception("Specified user was not found.");
|
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.
|
// We need to look up the UUID for the avatar with the provided name.
|
||||||
string ownerFirst = (string) requestData["estate_owner_first"];
|
string ownerFirst = (string) requestData["estate_owner_first"];
|
||||||
string ownerLast = (string) requestData["estate_owner_last"];
|
string ownerLast = (string) requestData["estate_owner_last"];
|
||||||
|
|
||||||
Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
|
Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
|
||||||
IUserAccountService accountService = currentOrFirst.UserAccountService;
|
IUserAccountService accountService = currentOrFirst.UserAccountService;
|
||||||
UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID,
|
UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID,
|
||||||
ownerFirst, ownerLast);
|
ownerFirst, ownerLast);
|
||||||
|
|
||||||
// Check that the specified user exists
|
// Check that the specified user exists
|
||||||
if (user == null)
|
if (user == null)
|
||||||
throw new Exception("Specified user was not found.");
|
throw new Exception("Specified user was not found.");
|
||||||
|
|
||||||
userID = user.PrincipalID;
|
userID = user.PrincipalID;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new Exception("Estate owner details not provided.");
|
throw new Exception("Estate owner details not provided.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new estate with the name provided
|
// Create a new estate with the name provided
|
||||||
region.EstateSettings = m_application.EstateDataService.CreateNewEstate();
|
region.EstateSettings = m_application.EstateDataService.CreateNewEstate();
|
||||||
|
|
||||||
|
@ -852,7 +852,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
throw new Exception("Failed to join estate.");
|
throw new Exception("Failed to join estate.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the region and perform any initial initialization
|
// Create the region and perform any initial initialization
|
||||||
|
|
||||||
IScene newScene;
|
IScene newScene;
|
||||||
|
@ -1159,7 +1159,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
|
|
||||||
// Set home position
|
// Set home position
|
||||||
|
|
||||||
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
|
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
|
||||||
(int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
|
(int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
|
||||||
if (null == home)
|
if (null == home)
|
||||||
{
|
{
|
||||||
|
@ -1389,7 +1389,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
|
|
||||||
if ((null != regionXLocation) && (null != regionYLocation))
|
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));
|
(int)Util.RegionToWorldLoc((uint)regionXLocation), (int)Util.RegionToWorldLoc((uint)regionYLocation));
|
||||||
if (null == home) {
|
if (null == home) {
|
||||||
m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName);
|
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;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
|
m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1608,7 +1608,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
GetSceneFromRegionParams(requestData, responseData, out scene);
|
GetSceneFromRegionParams(requestData, responseData, out scene);
|
||||||
|
|
||||||
string filename = (string) requestData["filename"];
|
string filename = (string) requestData["filename"];
|
||||||
|
|
||||||
bool mergeOar = false;
|
bool mergeOar = false;
|
||||||
bool skipAssets = false;
|
bool skipAssets = false;
|
||||||
|
|
||||||
|
@ -1735,7 +1735,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted;
|
scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted;
|
||||||
|
|
||||||
m_log.InfoFormat(
|
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);
|
scene.Name, filename, requestId);
|
||||||
|
|
||||||
archiver.ArchiveRegion(filename, requestId, options);
|
archiver.ArchiveRegion(filename, requestId, options);
|
||||||
|
@ -2082,8 +2082,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
Hashtable responseData = (Hashtable)response.Value;
|
Hashtable responseData = (Hashtable)response.Value;
|
||||||
// Hashtable requestData = (Hashtable)request.Params[0];
|
// Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
|
|
||||||
m_application.SceneManager.ForEachScene(s =>
|
m_application.SceneManager.ForEachScene(s =>
|
||||||
s.RegionInfo.EstateSettings = m_application.EstateDataService.LoadEstateSettings(s.RegionInfo.RegionID, false)
|
s.RegionInfo.EstateSettings = m_application.EstateDataService.LoadEstateSettings(s.RegionInfo.RegionID, false)
|
||||||
);
|
);
|
||||||
|
|
||||||
responseData["success"] = true;
|
responseData["success"] = true;
|
||||||
|
@ -2815,7 +2815,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
if (destinationFolder.Type != (short)FolderType.Clothing)
|
if (destinationFolder.Type != (short)FolderType.Clothing)
|
||||||
{
|
{
|
||||||
destinationFolder = new InventoryFolderBase();
|
destinationFolder = new InventoryFolderBase();
|
||||||
|
|
||||||
destinationFolder.ID = UUID.Random();
|
destinationFolder.ID = UUID.Random();
|
||||||
destinationFolder.Name = "Clothing";
|
destinationFolder.Name = "Clothing";
|
||||||
destinationFolder.Owner = destination;
|
destinationFolder.Owner = destination;
|
||||||
|
@ -2951,11 +2951,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
{
|
{
|
||||||
sourceFolder = new InventoryFolderBase();
|
sourceFolder = new InventoryFolderBase();
|
||||||
sourceFolder.ID = UUID.Random();
|
sourceFolder.ID = UUID.Random();
|
||||||
if (assetType == FolderType.Clothing)
|
if (assetType == FolderType.Clothing)
|
||||||
{
|
{
|
||||||
sourceFolder.Name = "Clothing";
|
sourceFolder.Name = "Clothing";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sourceFolder.Name = "Body Parts";
|
sourceFolder.Name = "Body Parts";
|
||||||
}
|
}
|
||||||
|
@ -3168,7 +3168,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
|
|
||||||
// Set home position
|
// Set home position
|
||||||
|
|
||||||
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
|
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
|
||||||
(int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
|
(int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
|
||||||
if (null == home) {
|
if (null == home) {
|
||||||
m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]);
|
m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]);
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
|
|
||||||
private CapsHandlers m_capsHandlers;
|
private CapsHandlers m_capsHandlers;
|
||||||
|
|
||||||
private Dictionary<string, PollServiceEventArgs> m_pollServiceHandlers
|
private Dictionary<string, PollServiceEventArgs> m_pollServiceHandlers
|
||||||
= new Dictionary<string, PollServiceEventArgs>();
|
= new Dictionary<string, PollServiceEventArgs>();
|
||||||
|
|
||||||
private Dictionary<string, string> m_externalCapsHandlers = new Dictionary<string, string>();
|
private Dictionary<string, string> m_externalCapsHandlers = new Dictionary<string, string>();
|
||||||
|
@ -160,7 +160,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
public void RegisterPollHandler(string capName, PollServiceEventArgs pollServiceHandler)
|
public void RegisterPollHandler(string capName, PollServiceEventArgs pollServiceHandler)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// 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);
|
// capName, pollServiceHandler.Url, m_agentID, m_regionName);
|
||||||
|
|
||||||
m_pollServiceHandlers.Add(capName, pollServiceHandler);
|
m_pollServiceHandlers.Add(capName, pollServiceHandler);
|
||||||
|
@ -170,7 +170,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
// uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
|
// uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
|
||||||
// string protocol = "http";
|
// string protocol = "http";
|
||||||
// string hostName = m_httpListenerHostName;
|
// string hostName = m_httpListenerHostName;
|
||||||
//
|
//
|
||||||
// if (MainServer.Instance.UseSSL)
|
// if (MainServer.Instance.UseSSL)
|
||||||
// {
|
// {
|
||||||
// hostName = MainServer.Instance.SSLCommonName;
|
// hostName = MainServer.Instance.SSLCommonName;
|
||||||
|
@ -238,7 +238,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
string hostName = m_httpListenerHostName;
|
string hostName = m_httpListenerHostName;
|
||||||
uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
|
uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
|
||||||
string protocol = "http";
|
string protocol = "http";
|
||||||
|
|
||||||
if (MainServer.Instance.UseSSL)
|
if (MainServer.Instance.UseSSL)
|
||||||
{
|
{
|
||||||
hostName = MainServer.Instance.SSLCommonName;
|
hostName = MainServer.Instance.SSLCommonName;
|
||||||
|
|
|
@ -112,9 +112,9 @@ namespace OpenSim.Framework.Capabilities
|
||||||
m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path);
|
m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path);
|
||||||
m_capsHandlers.Remove(idx);
|
m_capsHandlers.Remove(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null == value) return;
|
if (null == value) return;
|
||||||
|
|
||||||
m_capsHandlers[idx] = value;
|
m_capsHandlers[idx] = value;
|
||||||
m_httpListener.AddStreamHandler(value);
|
m_httpListener.AddStreamHandler(value);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
{
|
{
|
||||||
Hashtable caps = new Hashtable();
|
Hashtable caps = new Hashtable();
|
||||||
string protocol = "http://";
|
string protocol = "http://";
|
||||||
|
|
||||||
if (m_useSSL)
|
if (m_useSSL)
|
||||||
protocol = "https://";
|
protocol = "https://";
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
int page_size = (string.IsNullOrEmpty(psize) ? 500 : Int32.Parse(psize));
|
int page_size = (string.IsNullOrEmpty(psize) ? 500 : Int32.Parse(psize));
|
||||||
int page_number = (string.IsNullOrEmpty(pnumber) ? 1 : Int32.Parse(pnumber));
|
int page_number = (string.IsNullOrEmpty(pnumber) ? 1 : Int32.Parse(pnumber));
|
||||||
|
|
||||||
// Full content request
|
// Full content request
|
||||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
||||||
//httpResponse.ContentLength = ??;
|
//httpResponse.ContentLength = ??;
|
||||||
|
|
|
@ -43,7 +43,7 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||||
|
|
||||||
namespace OpenSim.Capabilities.Handlers
|
namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
public class FetchInvDescHandler
|
public class FetchInvDescHandler
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -53,14 +53,14 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
private IScene m_Scene;
|
private IScene m_Scene;
|
||||||
// private object m_fetchLock = new Object();
|
// 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_InventoryService = invService;
|
||||||
m_LibraryService = libService;
|
m_LibraryService = libService;
|
||||||
m_Scene = s;
|
m_Scene = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
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);
|
//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
|
// correctly mark it as a uuid
|
||||||
//
|
//
|
||||||
request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>");
|
request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>");
|
||||||
|
|
||||||
// another hack <integer>1</integer> results in a
|
// another hack <integer>1</integer> results in a
|
||||||
// System.ArgumentException: Object type System.Int32 cannot
|
// System.ArgumentException: Object type System.Int32 cannot
|
||||||
// be converted to target type: System.Boolean
|
// be converted to target type: System.Boolean
|
||||||
//
|
//
|
||||||
request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>");
|
request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>");
|
||||||
request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>");
|
request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>");
|
||||||
|
|
||||||
Hashtable hash = new Hashtable();
|
Hashtable hash = new Hashtable();
|
||||||
try
|
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.ErrorFormat("[WEB FETCH INV DESC HANDLER]: Fetch error: {0}{1}" + e.Message, e.StackTrace);
|
||||||
m_log.Error("Request: " + request);
|
m_log.Error("Request: " + request);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList foldersrequested = (ArrayList)hash["folders"];
|
ArrayList foldersrequested = (ArrayList)hash["folders"];
|
||||||
|
|
||||||
string response = "";
|
string response = "";
|
||||||
string bad_folders_response = "";
|
string bad_folders_response = "";
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ from docs seems this was never a spec
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
|
// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
|
||||||
// {
|
// {
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
// OMG!!! One by one!!! This is fallback code, in case the backend isn't updated
|
// 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.");
|
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)
|
foreach (UUID id in itemIDs)
|
||||||
items[i++] = m_inventoryService.GetItem(m_agentID, id);
|
items[i++] = m_inventoryService.GetItem(m_agentID, id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
|
||||||
string request = "<llsd><map><key>items</key><array><map><key>item_id</key><uuid>";
|
string request = "<llsd><map><key>items</key><array><map><key>item_id</key><uuid>";
|
||||||
request += "10000000-0000-0000-0000-000000000001"; // Notecard 1
|
request += "10000000-0000-0000-0000-000000000001"; // Notecard 1
|
||||||
request += "</uuid></map></array></map></llsd>";
|
request += "</uuid></map></array></map></llsd>";
|
||||||
|
|
||||||
string llsdresponse = handler.FetchInventoryRequest(request, "/FETCH", string.Empty, req, resp);
|
string llsdresponse = handler.FetchInventoryRequest(request, "/FETCH", string.Empty, req, resp);
|
||||||
|
|
||||||
Assert.That(llsdresponse != null, Is.True, "Incorrect null response");
|
Assert.That(llsdresponse != null, Is.True, "Incorrect null response");
|
||||||
|
|
|
@ -140,7 +140,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
|
||||||
string request = "<llsd><map><key>folders</key><array><map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>";
|
string request = "<llsd><map><key>folders</key><array><map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>";
|
||||||
request += m_rootFolderID;
|
request += m_rootFolderID;
|
||||||
request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000000</uuid><key>sort_order</key><integer>1</integer></map></array></map></llsd>";
|
request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000000</uuid><key>sort_order</key><integer>1</integer></map></array></map></llsd>";
|
||||||
|
|
||||||
string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp);
|
string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp);
|
||||||
|
|
||||||
Assert.That(llsdresponse != null, Is.True, "Incorrect null response");
|
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
|
// Make sure that the note card link is included
|
||||||
Assert.That(llsdresponse.Contains("Link to notecard"), Is.True, "Link to notecard is missing");
|
Assert.That(llsdresponse.Contains("Link to notecard"), Is.True, "Link to notecard is missing");
|
||||||
|
|
||||||
//Make sure the notecard item itself is included
|
//Make sure the notecard item itself is included
|
||||||
Assert.That(llsdresponse.Contains("Test Notecard 2"), Is.True, "Notecard 2 item (the source) is missing");
|
Assert.That(llsdresponse.Contains("Test Notecard 2"), Is.True, "Notecard 2 item (the source) is missing");
|
||||||
|
|
||||||
|
|
|
@ -87,12 +87,12 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
OSDMap osdname = new OSDMap();
|
OSDMap osdname = new OSDMap();
|
||||||
if(parts[0] == "Unknown")
|
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));
|
osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2));
|
||||||
}
|
}
|
||||||
else
|
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_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1));
|
||||||
}
|
}
|
||||||
osdname["display_name"] = OSD.FromString(kvp.Value);
|
osdname["display_name"] = OSD.FromString(kvp.Value);
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
if (m_UserManagement == null)
|
if (m_UserManagement == null)
|
||||||
throw new Exception(String.Format("Failed to load UserManagement from {0}; config is {1}", umService, m_ConfigName));
|
throw new Exception(String.Format("Failed to load UserManagement from {0}; config is {1}", umService, m_ConfigName));
|
||||||
|
|
||||||
server.AddStreamHandler(
|
server.AddStreamHandler(
|
||||||
new GetDisplayNamesHandler("/CAPS/agents/", m_UserManagement, "GetDisplayNames", null));
|
new GetDisplayNamesHandler("/CAPS/agents/", m_UserManagement, "GetDisplayNames", null));
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
private IAssetService m_assetService;
|
private IAssetService m_assetService;
|
||||||
|
|
||||||
public const string DefaultFormat = "x-j2c";
|
public const string DefaultFormat = "x-j2c";
|
||||||
|
|
||||||
public GetTextureHandler(IAssetService assService)
|
public GetTextureHandler(IAssetService assService)
|
||||||
{
|
{
|
||||||
m_assetService = assService;
|
m_assetService = assService;
|
||||||
|
@ -83,7 +83,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID))
|
if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID))
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID);
|
// m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID);
|
||||||
|
|
||||||
string[] formats;
|
string[] formats;
|
||||||
if (!string.IsNullOrEmpty(format))
|
if (!string.IsNullOrEmpty(format))
|
||||||
{
|
{
|
||||||
|
@ -129,7 +129,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="httpRequest"></param>
|
/// <param name="httpRequest"></param>
|
||||||
/// <param name="httpResponse"></param>
|
/// <param name="httpResponse"></param>
|
||||||
|
@ -190,7 +190,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
//response = new Hashtable();
|
//response = new Hashtable();
|
||||||
|
|
||||||
|
|
||||||
//WriteTextureData(request,response,null,format);
|
//WriteTextureData(request,response,null,format);
|
||||||
// not found
|
// not found
|
||||||
//m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found");
|
//m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found");
|
||||||
|
@ -287,7 +287,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
response["content_type"] = texture.Metadata.ContentType;
|
response["content_type"] = texture.Metadata.ContentType;
|
||||||
else
|
else
|
||||||
response["content_type"] = "image/" + format;
|
response["content_type"] = "image/" + format;
|
||||||
|
|
||||||
response["bin_response_data"] = texture.Data;
|
response["bin_response_data"] = texture.Data;
|
||||||
response["int_bytes"] = texture.Data.Length;
|
response["int_bytes"] = texture.Data.Length;
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
if (image != null)
|
if (image != null)
|
||||||
image.Dispose();
|
image.Dispose();
|
||||||
|
|
||||||
if(managedImage != null)
|
if(managedImage != null)
|
||||||
managedImage.Clear();
|
managedImage.Clear();
|
||||||
if (imgstream != null)
|
if (imgstream != null)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
@ -44,7 +44,7 @@ using OpenSim.Framework.Servers.HttpServer;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||||
|
|
||||||
namespace OpenSim.Capabilities.Handlers
|
namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
public class GetTextureRobustHandler : BaseStreamHandler
|
public class GetTextureRobustHandler : BaseStreamHandler
|
||||||
|
@ -52,9 +52,9 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private IAssetService m_assetService;
|
private IAssetService m_assetService;
|
||||||
|
|
||||||
public const string DefaultFormat = "x-j2c";
|
public const string DefaultFormat = "x-j2c";
|
||||||
|
|
||||||
// TODO: Change this to a config option
|
// TODO: Change this to a config option
|
||||||
private string m_RedirectURL = null;
|
private string m_RedirectURL = null;
|
||||||
|
|
||||||
|
@ -66,28 +66,28 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
if (m_RedirectURL != null && !m_RedirectURL.EndsWith("/"))
|
if (m_RedirectURL != null && !m_RedirectURL.EndsWith("/"))
|
||||||
m_RedirectURL += "/";
|
m_RedirectURL += "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||||
{
|
{
|
||||||
// Try to parse the texture ID from the request URL
|
// Try to parse the texture ID from the request URL
|
||||||
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
||||||
string textureStr = query.GetOne("texture_id");
|
string textureStr = query.GetOne("texture_id");
|
||||||
string format = query.GetOne("format");
|
string format = query.GetOne("format");
|
||||||
|
|
||||||
//m_log.DebugFormat("[GETTEXTURE]: called {0}", textureStr);
|
//m_log.DebugFormat("[GETTEXTURE]: called {0}", textureStr);
|
||||||
|
|
||||||
if (m_assetService == null)
|
if (m_assetService == null)
|
||||||
{
|
{
|
||||||
m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service");
|
m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service");
|
||||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID textureID;
|
UUID textureID;
|
||||||
if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID))
|
if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID))
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID);
|
// m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID);
|
||||||
|
|
||||||
string[] formats;
|
string[] formats;
|
||||||
if (!string.IsNullOrEmpty(format))
|
if (!string.IsNullOrEmpty(format))
|
||||||
{
|
{
|
||||||
|
@ -98,10 +98,10 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
formats = WebUtil.GetPreferredImageTypes(httpRequest.Headers.Get("Accept"));
|
formats = WebUtil.GetPreferredImageTypes(httpRequest.Headers.Get("Accept"));
|
||||||
if (formats.Length == 0)
|
if (formats.Length == 0)
|
||||||
formats = new string[1] { DefaultFormat }; // default
|
formats = new string[1] { DefaultFormat }; // default
|
||||||
|
|
||||||
}
|
}
|
||||||
// OK, we have an array with preferred formats, possibly with only one entry
|
// OK, we have an array with preferred formats, possibly with only one entry
|
||||||
|
|
||||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||||
foreach (string f in formats)
|
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.Warn("[GETTEXTURE]: Failed to parse a texture_id from GetTexture request: " + httpRequest.Url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}",
|
// "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}",
|
||||||
// textureID, httpResponse.StatusCode, httpResponse.ContentLength);
|
// textureID, httpResponse.StatusCode, httpResponse.ContentLength);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -133,16 +133,16 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
|
// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
|
||||||
AssetBase texture;
|
AssetBase texture;
|
||||||
|
|
||||||
string fullID = textureID.ToString();
|
string fullID = textureID.ToString();
|
||||||
if (format != DefaultFormat)
|
if (format != DefaultFormat)
|
||||||
fullID = fullID + "-" + format;
|
fullID = fullID + "-" + format;
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(m_RedirectURL))
|
if (!String.IsNullOrEmpty(m_RedirectURL))
|
||||||
{
|
{
|
||||||
// Only try to fetch locally cached textures. Misses are redirected
|
// Only try to fetch locally cached textures. Misses are redirected
|
||||||
texture = m_assetService.GetCached(fullID);
|
texture = m_assetService.GetCached(fullID);
|
||||||
|
|
||||||
if (texture != null)
|
if (texture != null)
|
||||||
{
|
{
|
||||||
if (texture.Type != (sbyte)AssetType.Texture)
|
if (texture.Type != (sbyte)AssetType.Texture)
|
||||||
|
@ -166,14 +166,14 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
// try the cache
|
// try the cache
|
||||||
texture = m_assetService.GetCached(fullID);
|
texture = m_assetService.GetCached(fullID);
|
||||||
|
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[GETTEXTURE]: texture was not in the cache");
|
// m_log.DebugFormat("[GETTEXTURE]: texture was not in the cache");
|
||||||
|
|
||||||
// Fetch locally or remotely. Misses return a 404
|
// Fetch locally or remotely. Misses return a 404
|
||||||
texture = m_assetService.Get(textureID.ToString());
|
texture = m_assetService.Get(textureID.ToString());
|
||||||
|
|
||||||
if (texture != null)
|
if (texture != null)
|
||||||
{
|
{
|
||||||
if (texture.Type != (sbyte)AssetType.Texture)
|
if (texture.Type != (sbyte)AssetType.Texture)
|
||||||
|
@ -192,7 +192,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
newTexture.Data = ConvertTextureData(texture, format);
|
newTexture.Data = ConvertTextureData(texture, format);
|
||||||
if (newTexture.Data.Length == 0)
|
if (newTexture.Data.Length == 0)
|
||||||
return false; // !!! Caller try another codec, please!
|
return false; // !!! Caller try another codec, please!
|
||||||
|
|
||||||
newTexture.Flags = AssetFlags.Collectable;
|
newTexture.Flags = AssetFlags.Collectable;
|
||||||
newTexture.Temporary = true;
|
newTexture.Temporary = true;
|
||||||
newTexture.Local = true;
|
newTexture.Local = true;
|
||||||
|
@ -209,17 +209,17 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// not found
|
// not found
|
||||||
// m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found");
|
// m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found");
|
||||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WriteTextureData(IOSHttpRequest request, IOSHttpResponse response, AssetBase texture, string format)
|
private void WriteTextureData(IOSHttpRequest request, IOSHttpResponse response, AssetBase texture, string format)
|
||||||
{
|
{
|
||||||
string range = request.Headers.GetOne("Range");
|
string range = request.Headers.GetOne("Range");
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(range)) // JP2's only
|
if (!String.IsNullOrEmpty(range)) // JP2's only
|
||||||
{
|
{
|
||||||
// Range request
|
// Range request
|
||||||
|
@ -233,7 +233,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}",
|
// "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}",
|
||||||
// texture.ID, start, texture.Data.Length);
|
// texture.ID, start, texture.Data.Length);
|
||||||
|
|
||||||
// Stricly speaking, as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, we should be sending back
|
// 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
|
// 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
|
// 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
|
// 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
|
// 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.
|
// However, if we return PartialContent (or OK) instead, the viewer will display that resolution.
|
||||||
|
|
||||||
// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
||||||
// response.AddHeader("Content-Range", String.Format("bytes */{0}", texture.Data.Length));
|
// response.AddHeader("Content-Range", String.Format("bytes */{0}", texture.Data.Length));
|
||||||
// response.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
// response.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
||||||
|
@ -257,13 +257,13 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
// the rest of the entity.
|
// the rest of the entity.
|
||||||
if (end == -1)
|
if (end == -1)
|
||||||
end = int.MaxValue;
|
end = int.MaxValue;
|
||||||
|
|
||||||
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
|
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
|
||||||
start = Utils.Clamp(start, 0, end);
|
start = Utils.Clamp(start, 0, end);
|
||||||
int len = end - start + 1;
|
int len = end - start + 1;
|
||||||
|
|
||||||
// m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
// 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
|
// Always return PartialContent, even if the range covered the entire data length
|
||||||
// We were accidentally sending back 404 before in this situation
|
// 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
|
// 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;
|
// response.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
||||||
// else
|
// else
|
||||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||||
|
|
||||||
response.ContentLength = len;
|
response.ContentLength = len;
|
||||||
response.ContentType = texture.Metadata.ContentType;
|
response.ContentType = texture.Metadata.ContentType;
|
||||||
response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
|
response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
|
||||||
|
|
||||||
response.Body.Write(texture.Data, start, len);
|
response.Body.Write(texture.Data, start, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
response.ContentType = "image/" + format;
|
response.ContentType = "image/" + format;
|
||||||
response.Body.Write(texture.Data, 0, texture.Data.Length);
|
response.Body.Write(texture.Data, 0, texture.Data.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (response.StatusCode < 200 || response.StatusCode > 299)
|
// if (response.StatusCode < 200 || response.StatusCode > 299)
|
||||||
// m_log.WarnFormat(
|
// m_log.WarnFormat(
|
||||||
// "[GETTEXTURE]: For texture {0} requested range {1} responded {2} with content length {3} (actual {4})",
|
// "[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})",
|
// "[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);
|
// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parse a range header.
|
/// Parse a range header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -327,18 +327,18 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
private bool TryParseRange(string header, out int start, out int end)
|
private bool TryParseRange(string header, out int start, out int end)
|
||||||
{
|
{
|
||||||
start = end = 0;
|
start = end = 0;
|
||||||
|
|
||||||
if (header.StartsWith("bytes="))
|
if (header.StartsWith("bytes="))
|
||||||
{
|
{
|
||||||
string[] rangeValues = header.Substring(6).Split('-');
|
string[] rangeValues = header.Substring(6).Split('-');
|
||||||
|
|
||||||
if (rangeValues.Length == 2)
|
if (rangeValues.Length == 2)
|
||||||
{
|
{
|
||||||
if (!Int32.TryParse(rangeValues[0], out start))
|
if (!Int32.TryParse(rangeValues[0], out start))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string rawEnd = rangeValues[1];
|
string rawEnd = rangeValues[1];
|
||||||
|
|
||||||
if (rawEnd == "")
|
if (rawEnd == "")
|
||||||
{
|
{
|
||||||
end = -1;
|
end = -1;
|
||||||
|
@ -350,27 +350,27 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start = end = 0;
|
start = end = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] ConvertTextureData(AssetBase texture, string format)
|
private byte[] ConvertTextureData(AssetBase texture, string format)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format);
|
m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format);
|
||||||
byte[] data = new byte[0];
|
byte[] data = new byte[0];
|
||||||
|
|
||||||
MemoryStream imgstream = new MemoryStream();
|
MemoryStream imgstream = new MemoryStream();
|
||||||
Bitmap mTexture = null;
|
Bitmap mTexture = null;
|
||||||
ManagedImage managedImage = null;
|
ManagedImage managedImage = null;
|
||||||
Image image = null;
|
Image image = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
|
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
|
||||||
|
|
||||||
imgstream = new MemoryStream();
|
imgstream = new MemoryStream();
|
||||||
|
|
||||||
// Decode image to System.Drawing.Image
|
// Decode image to System.Drawing.Image
|
||||||
if (OpenJPEG.DecodeToImage(texture.Data, out managedImage, out image) && image != null)
|
if (OpenJPEG.DecodeToImage(texture.Data, out managedImage, out image) && image != null)
|
||||||
{
|
{
|
||||||
|
@ -380,7 +380,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
using(EncoderParameters myEncoderParameters = new EncoderParameters())
|
using(EncoderParameters myEncoderParameters = new EncoderParameters())
|
||||||
{
|
{
|
||||||
myEncoderParameters.Param[0] = new EncoderParameter(Encoder.Quality,95L);
|
myEncoderParameters.Param[0] = new EncoderParameter(Encoder.Quality,95L);
|
||||||
|
|
||||||
// Save bitmap to stream
|
// Save bitmap to stream
|
||||||
ImageCodecInfo codec = GetEncoderInfo("image/" + format);
|
ImageCodecInfo codec = GetEncoderInfo("image/" + format);
|
||||||
if (codec != null)
|
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 we encountered an exception, one or more of these will be null
|
||||||
if (mTexture != null)
|
if (mTexture != null)
|
||||||
mTexture.Dispose();
|
mTexture.Dispose();
|
||||||
|
|
||||||
if (image != null)
|
if (image != null)
|
||||||
image.Dispose();
|
image.Dispose();
|
||||||
|
|
||||||
if(managedImage != null)
|
if(managedImage != null)
|
||||||
managedImage.Clear();
|
managedImage.Clear();
|
||||||
|
|
||||||
|
@ -417,10 +417,10 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
imgstream.Dispose();
|
imgstream.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// From msdn
|
// From msdn
|
||||||
private static ImageCodecInfo GetEncoderInfo(String mimeType)
|
private static ImageCodecInfo GetEncoderInfo(String mimeType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.Capabilities.Handlers")]
|
[assembly: AssemblyTitle("OpenSim.Capabilities.Handlers")]
|
||||||
|
@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ using System.Runtime.InteropServices;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
public class UploadBakedTextureHandler
|
public class UploadBakedTextureHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Caps m_HostCapsObj;
|
private Caps m_HostCapsObj;
|
||||||
|
@ -81,7 +81,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
{
|
{
|
||||||
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
||||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
||||||
|
|
||||||
BakedTextureUploader uploader =
|
BakedTextureUploader uploader =
|
||||||
new BakedTextureUploader(capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_HostCapsObj.AgentID);
|
new BakedTextureUploader(capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_HostCapsObj.AgentID);
|
||||||
uploader.OnUpLoad += BakedTextureUploaded;
|
uploader.OnUpLoad += BakedTextureUploaded;
|
||||||
|
@ -127,7 +127,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
asset.Temporary = true;
|
asset.Temporary = true;
|
||||||
asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are
|
asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are
|
||||||
m_assetService.Store(asset);
|
m_assetService.Store(asset);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
// m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
|
// m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle raw uploaded baked texture data.
|
/// Handle raw uploaded baked texture data.
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
public string state;
|
public string state;
|
||||||
public int upload_price;
|
public int upload_price;
|
||||||
public string rsvp;
|
public string rsvp;
|
||||||
|
|
||||||
public LLSDNewFileAngentInventoryVariablePriceReplyResponse()
|
public LLSDNewFileAngentInventoryVariablePriceReplyResponse()
|
||||||
{
|
{
|
||||||
state = "confirm_upload";
|
state = "confirm_upload";
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
{
|
{
|
||||||
public string username;
|
public string username;
|
||||||
public string display_name;
|
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_first_name;
|
||||||
public string legacy_last_name;
|
public string legacy_last_name;
|
||||||
public UUID id;
|
public UUID id;
|
||||||
|
|
|
@ -87,12 +87,12 @@ namespace OpenSim.Framework.Capabilities
|
||||||
[OSDMap]
|
[OSDMap]
|
||||||
public class LLSDInventoryFolderContents
|
public class LLSDInventoryFolderContents
|
||||||
{
|
{
|
||||||
public UUID agent_id;
|
public UUID agent_id;
|
||||||
public int descendents;
|
public int descendents;
|
||||||
public UUID folder_id;
|
public UUID folder_id;
|
||||||
public OSDArray categories = new OSDArray();
|
public OSDArray categories = new OSDArray();
|
||||||
public OSDArray items = new OSDArray();
|
public OSDArray items = new OSDArray();
|
||||||
public UUID owner_id;
|
public UUID owner_id;
|
||||||
public int version;
|
public int version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.Capabilities")]
|
[assembly: AssemblyTitle("OpenSim.Capabilities")]
|
||||||
|
@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ using System.Runtime.InteropServices;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace OpenSim.ConsoleClient
|
||||||
Requester.MakeRequest(requestUrl, requestData, ReadResponses);
|
Requester.MakeRequest(requestUrl, requestData, ReadResponses);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> lines = new List<string>();
|
List<string> lines = new List<string>();
|
||||||
|
|
||||||
foreach (XmlNode part in rootNodeL[0].ChildNodes)
|
foreach (XmlNode part in rootNodeL[0].ChildNodes)
|
||||||
|
@ -202,7 +202,7 @@ namespace OpenSim.ConsoleClient
|
||||||
string[] parts = l.Split(new char[] {':'}, 3);
|
string[] parts = l.Split(new char[] {':'}, 3);
|
||||||
if (parts.Length != 3)
|
if (parts.Length != 3)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (parts[2].StartsWith("+++") || parts[2].StartsWith("-++"))
|
if (parts[2].StartsWith("+++") || parts[2].StartsWith("-++"))
|
||||||
prompt = parts[2];
|
prompt = parts[2];
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
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
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("OpenSim.ConsoleClient")]
|
[assembly: AssemblyTitle("OpenSim.ConsoleClient")]
|
||||||
|
@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// 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
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ using System.Runtime.InteropServices;
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace OpenSim.Data
|
||||||
/// <summary>This function converts a value returned from the database in one of the
|
/// <summary>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
|
/// supported formats into a UUID. This function is not actually DBMS-specific right
|
||||||
/// now
|
/// now
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Data
|
||||||
public Dictionary<string, string> Data;
|
public Dictionary<string, string> Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IAvatarData
|
public interface IAvatarData
|
||||||
{
|
{
|
||||||
AvatarBaseData[] Get(string field, string val);
|
AvatarBaseData[] Get(string field, string val);
|
||||||
bool Store(AvatarBaseData data);
|
bool Store(AvatarBaseData data);
|
||||||
|
|
|
@ -46,14 +46,14 @@ namespace OpenSim.Data
|
||||||
/// <param name="create">If true, then an estate is created if one is not found.</param>
|
/// <param name="create">If true, then an estate is created if one is not found.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
EstateSettings LoadEstateSettings(UUID regionID, bool create);
|
EstateSettings LoadEstateSettings(UUID regionID, bool create);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load estate settings for an estate ID.
|
/// Load estate settings for an estate ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="estateID"></param>
|
/// <param name="estateID"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
EstateSettings LoadEstateSettings(int estateID);
|
EstateSettings LoadEstateSettings(int estateID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new estate.
|
/// Create a new estate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -67,7 +67,7 @@ namespace OpenSim.Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>An empty list if no estates were found.</returns>
|
/// <returns>An empty list if no estates were found.</returns>
|
||||||
List<EstateSettings> LoadEstateSettingsAll();
|
List<EstateSettings> LoadEstateSettingsAll();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Store estate settings.
|
/// Store estate settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -75,7 +75,7 @@ namespace OpenSim.Data
|
||||||
/// This is also called by EstateSettings.Save()</remarks>
|
/// This is also called by EstateSettings.Save()</remarks>
|
||||||
/// <param name="es"></param>
|
/// <param name="es"></param>
|
||||||
void StoreEstateSettings(EstateSettings es);
|
void StoreEstateSettings(EstateSettings es);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get estate IDs.
|
/// Get estate IDs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -88,13 +88,13 @@ namespace OpenSim.Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>An empty list if no estates were found.</returns>
|
/// <returns>An empty list if no estates were found.</returns>
|
||||||
List<int> GetEstatesByOwner(UUID ownerID);
|
List<int> GetEstatesByOwner(UUID ownerID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the IDs of all estates.
|
/// Get the IDs of all estates.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>An empty list if no estates were found.</returns>
|
/// <returns>An empty list if no estates were found.</returns>
|
||||||
List<int> GetEstatesAll();
|
List<int> GetEstatesAll();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Link a region to an estate.
|
/// Link a region to an estate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -102,14 +102,14 @@ namespace OpenSim.Data
|
||||||
/// <param name="estateID"></param>
|
/// <param name="estateID"></param>
|
||||||
/// <returns>true if the link succeeded, false otherwise</returns>
|
/// <returns>true if the link succeeded, false otherwise</returns>
|
||||||
bool LinkRegion(UUID regionID, int estateID);
|
bool LinkRegion(UUID regionID, int estateID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the UUIDs of all the regions in an estate.
|
/// Get the UUIDs of all the regions in an estate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="estateID"></param>
|
/// <param name="estateID"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<UUID> GetRegions(int estateID);
|
List<UUID> GetRegions(int estateID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete an estate
|
/// Delete an estate
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Data
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An interface for connecting to the user grid datastore
|
/// An interface for connecting to the user grid datastore
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGridUserData
|
public interface IGridUserData
|
||||||
{
|
{
|
||||||
GridUserData Get(string userID);
|
GridUserData Get(string userID);
|
||||||
GridUserData[] GetAll(string query);
|
GridUserData[] GetAll(string query);
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace OpenSim.Data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface IGroupsData
|
public interface IGroupsData
|
||||||
{
|
{
|
||||||
// groups table
|
// groups table
|
||||||
bool StoreGroup(GroupData data);
|
bool StoreGroup(GroupData data);
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace OpenSim.Data
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An interface for connecting to the user grid datastore
|
/// An interface for connecting to the user grid datastore
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHGTravelingData
|
public interface IHGTravelingData
|
||||||
{
|
{
|
||||||
HGTravelingData Get(UUID sessionID);
|
HGTravelingData Get(UUID sessionID);
|
||||||
HGTravelingData[] GetSessions(UUID userID);
|
HGTravelingData[] GetSessions(UUID userID);
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface IOfflineIMData
|
public interface IOfflineIMData
|
||||||
{
|
{
|
||||||
OfflineIMData[] Get(string field, string val);
|
OfflineIMData[] Get(string field, string val);
|
||||||
long GetCount(string field, string key);
|
long GetCount(string field, string key);
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Data
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An interface for connecting to the presence datastore
|
/// An interface for connecting to the presence datastore
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPresenceData
|
public interface IPresenceData
|
||||||
{
|
{
|
||||||
bool Store(PresenceData data);
|
bool Store(PresenceData data);
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace OpenSim.Data
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An interface for connecting to the authentication datastore
|
/// An interface for connecting to the authentication datastore
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRegionData
|
public interface IRegionData
|
||||||
{
|
{
|
||||||
RegionData Get(UUID regionID, UUID ScopeID);
|
RegionData Get(UUID regionID, UUID ScopeID);
|
||||||
List<RegionData> Get(string regionName, UUID ScopeID);
|
List<RegionData> Get(string regionName, UUID ScopeID);
|
||||||
|
|
|
@ -38,12 +38,12 @@ namespace OpenSim.Data
|
||||||
public UUID ownerRoleID;
|
public UUID ownerRoleID;
|
||||||
public string name;
|
public string name;
|
||||||
public string charter;
|
public string charter;
|
||||||
public bool showInList;
|
public bool showInList;
|
||||||
public UUID insigniaID;
|
public UUID insigniaID;
|
||||||
public int membershipFee;
|
public int membershipFee;
|
||||||
public bool openEnrollment;
|
public bool openEnrollment;
|
||||||
public bool allowPublish;
|
public bool allowPublish;
|
||||||
public bool maturePublish;
|
public bool maturePublish;
|
||||||
public UUID founderID;
|
public UUID founderID;
|
||||||
public ulong everyonePowers;
|
public ulong everyonePowers;
|
||||||
public ulong ownersPowers;
|
public ulong ownersPowers;
|
||||||
|
|
|
@ -80,10 +80,10 @@ namespace OpenSim.Data
|
||||||
|
|
||||||
/// <summary>Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint.
|
/// <summary>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
|
/// 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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Migration()
|
public Migration()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public Migration(DbConnection conn, Assembly assem, string subtype, string type)
|
public Migration(DbConnection conn, Assembly assem, string subtype, string type)
|
||||||
|
@ -91,7 +91,7 @@ namespace OpenSim.Data
|
||||||
Initialize(conn, assem, type, subtype);
|
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, "");
|
Initialize(conn, assem, type, "");
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ namespace OpenSim.Data
|
||||||
int newversion = kvp.Key;
|
int newversion = kvp.Key;
|
||||||
// we need to up the command timeout to infinite as we might be doing long migrations.
|
// 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.
|
* 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
|
* 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
|
* 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();
|
private delegate void FlushProc();
|
||||||
|
|
||||||
/// <summary>Scans for migration resources in either old-style "scattered" (one file per version)
|
/// <summary>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
|
/// 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
|
/// 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.
|
/// and don't support the ':GO' feature.
|
||||||
|
@ -301,12 +301,12 @@ namespace OpenSim.Data
|
||||||
{
|
{
|
||||||
/* The filename should be '<StoreName>.migrations[.NNN]' where NNN
|
/* The filename should be '<StoreName>.migrations[.NNN]' where NNN
|
||||||
* is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip
|
* 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')
|
* the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql')
|
||||||
* is valid but ignored.
|
* is valid but ignored.
|
||||||
*
|
*
|
||||||
* NOTE that we expect only one 'merged' migration file. If there are several, we take the last one.
|
* 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
|
* 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')
|
* 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 (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
if (sb.Length == 0) continue;
|
if (sb.Length == 0) continue;
|
||||||
if (nVersion > after)
|
if (nVersion > after)
|
||||||
script.Add(sb.ToString());
|
script.Add(sb.ToString());
|
||||||
sb.Length = 0;
|
sb.Length = 0;
|
||||||
continue;
|
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);
|
m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after);
|
||||||
|
|
||||||
return migrations;
|
return migrations;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,8 +329,8 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
m_log.Error(
|
m_log.Error(
|
||||||
string.Format(
|
string.Format(
|
||||||
"[ASSETS DB]: MySql failure fetching asset set from {0}, count {1}. Exception ",
|
"[ASSETS DB]: MySql failure fetching asset set from {0}, count {1}. Exception ",
|
||||||
start, count),
|
start, count),
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,21 +77,21 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||||
|
|
||||||
IDataReader result = cmd.ExecuteReader();
|
IDataReader result = cmd.ExecuteReader();
|
||||||
|
|
||||||
if (result.Read())
|
if (result.Read())
|
||||||
{
|
{
|
||||||
ret.PrincipalID = principalID;
|
ret.PrincipalID = principalID;
|
||||||
|
|
||||||
CheckColumnNames(result);
|
CheckColumnNames(result);
|
||||||
|
|
||||||
foreach (string s in m_ColumnNames)
|
foreach (string s in m_ColumnNames)
|
||||||
{
|
{
|
||||||
if (s == "UUID")
|
if (s == "UUID")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret.Data[s] = result[s].ToString();
|
ret.Data[s] = result[s].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -132,25 +132,25 @@ namespace OpenSim.Data.MySQL
|
||||||
if (!first)
|
if (!first)
|
||||||
update += ", ";
|
update += ", ";
|
||||||
update += "`" + field + "` = ?"+field;
|
update += "`" + field + "` = ?"+field;
|
||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("?"+field, data.Data[field]);
|
cmd.Parameters.AddWithValue("?"+field, data.Data[field]);
|
||||||
}
|
}
|
||||||
|
|
||||||
update += " where UUID = ?principalID";
|
update += " where UUID = ?principalID";
|
||||||
|
|
||||||
cmd.CommandText = update;
|
cmd.CommandText = update;
|
||||||
cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString());
|
cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString());
|
||||||
|
|
||||||
if (ExecuteNonQuery(cmd) < 1)
|
if (ExecuteNonQuery(cmd) < 1)
|
||||||
{
|
{
|
||||||
string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
|
string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
|
||||||
String.Join("`, `", fields) +
|
String.Join("`, `", fields) +
|
||||||
"`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
|
"`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
|
||||||
|
|
||||||
cmd.CommandText = insert;
|
cmd.CommandText = insert;
|
||||||
|
|
||||||
if (ExecuteNonQuery(cmd) < 1)
|
if (ExecuteNonQuery(cmd) < 1)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?"+item, value);
|
cmd.Parameters.AddWithValue("?"+item, value);
|
||||||
cmd.Parameters.AddWithValue("?UUID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?UUID", principalID.ToString());
|
||||||
|
|
||||||
if (ExecuteNonQuery(cmd) > 0)
|
if (ExecuteNonQuery(cmd) > 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||||
cmd.Parameters.AddWithValue("?token", token);
|
cmd.Parameters.AddWithValue("?token", token);
|
||||||
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
||||||
|
|
||||||
if (ExecuteNonQuery(cmd) > 0)
|
if (ExecuteNonQuery(cmd) > 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm);
|
cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm);
|
||||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||||
cmd.Parameters.AddWithValue("?Name", name);
|
cmd.Parameters.AddWithValue("?Name", name);
|
||||||
|
|
||||||
if (ExecuteNonQuery(cmd) > 0)
|
if (ExecuteNonQuery(cmd) > 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,19 +403,19 @@ namespace OpenSim.Data.MySQL
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EstateSettings> LoadEstateSettingsAll()
|
public List<EstateSettings> LoadEstateSettingsAll()
|
||||||
{
|
{
|
||||||
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
||||||
|
|
||||||
List<int> allEstateIds = GetEstatesAll();
|
List<int> allEstateIds = GetEstatesAll();
|
||||||
|
|
||||||
foreach (int estateId in allEstateIds)
|
foreach (int estateId in allEstateIds)
|
||||||
allEstateSettings.Add(LoadEstateSettings(estateId));
|
allEstateSettings.Add(LoadEstateSettings(estateId));
|
||||||
|
|
||||||
return allEstateSettings;
|
return allEstateSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<int> GetEstatesAll()
|
public List<int> GetEstatesAll()
|
||||||
{
|
{
|
||||||
List<int> result = new List<int>();
|
List<int> result = new List<int>();
|
||||||
|
@ -441,7 +441,7 @@ namespace OpenSim.Data.MySQL
|
||||||
dbcon.Close();
|
dbcon.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<int> GetEstates(string search)
|
public List<int> GetEstates(string search)
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySQLFSAssetData()
|
public MySQLFSAssetData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.Data.MySQL
|
||||||
public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
|
public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
|
||||||
{
|
{
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
protected Dictionary<string, FieldInfo> m_Fields =
|
protected Dictionary<string, FieldInfo> m_Fields =
|
||||||
new Dictionary<string, FieldInfo>();
|
new Dictionary<string, FieldInfo>();
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
m_Realm = realm;
|
m_Realm = realm;
|
||||||
m_connectionString = connectionString;
|
m_connectionString = connectionString;
|
||||||
|
|
||||||
if (storeName != String.Empty)
|
if (storeName != String.Empty)
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
|
@ -130,7 +130,7 @@ namespace OpenSim.Data.MySQL
|
||||||
m_Realm, where);
|
m_Realm, where);
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
|
|
||||||
return DoQuery(cmd);
|
return DoQuery(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ namespace OpenSim.Data.MySQL
|
||||||
m_Fields[name].SetValue(row, reader[name]);
|
m_Fields[name].SetValue(row, reader[name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_DataField != null)
|
if (m_DataField != null)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> data =
|
Dictionary<string, string> data =
|
||||||
|
@ -215,9 +215,9 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
string query = String.Format("select * from {0} where {1}",
|
string query = String.Format("select * from {0} where {1}",
|
||||||
m_Realm, where);
|
m_Realm, where);
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
|
|
||||||
return DoQuery(cmd);
|
return DoQuery(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,16 +236,16 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
names.Add(fi.Name);
|
names.Add(fi.Name);
|
||||||
values.Add("?" + fi.Name);
|
values.Add("?" + fi.Name);
|
||||||
|
|
||||||
// Temporarily return more information about what field is unexpectedly null for
|
// 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.
|
// InventoryTransferModule or we may be required to substitute a DBNull here.
|
||||||
if (fi.GetValue(row) == null)
|
if (fi.GetValue(row) == null)
|
||||||
throw new NullReferenceException(
|
throw new NullReferenceException(
|
||||||
string.Format(
|
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));
|
fi.Name, row));
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
|
cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,10 +133,10 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
public bool DeleteMember(UUID groupID, string pricipalID)
|
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 });
|
new string[] { groupID.ToString(), pricipalID });
|
||||||
}
|
}
|
||||||
|
|
||||||
public int MemberCount(UUID groupID)
|
public int MemberCount(UUID groupID)
|
||||||
{
|
{
|
||||||
return (int)m_Membership.GetCount("GroupID", groupID.ToString());
|
return (int)m_Membership.GetCount("GroupID", groupID.ToString());
|
||||||
|
@ -168,7 +168,7 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
public bool DeleteRole(UUID groupID, UUID roleID)
|
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() });
|
new string[] { groupID.ToString(), roleID.ToString() });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsGroupsHandler(string connectionString, string realm, string store)
|
public MySqlGroupsGroupsHandler(string connectionString, string realm, string store)
|
||||||
: base(connectionString, realm, store)
|
: base(connectionString, realm, store)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsMembershipHandler(string connectionString, string realm)
|
public MySqlGroupsMembershipHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsRolesHandler(string connectionString, string realm)
|
public MySqlGroupsRolesHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -405,7 +405,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsRoleMembershipHandler(string connectionString, string realm)
|
public MySqlGroupsRoleMembershipHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsInvitesHandler(string connectionString, string realm)
|
public MySqlGroupsInvitesHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsNoticesHandler(string connectionString, string realm)
|
public MySqlGroupsNoticesHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -475,7 +475,7 @@ namespace OpenSim.Data.MySQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public MySqlGroupsPrincipalsHandler(string connectionString, string realm)
|
public MySqlGroupsPrincipalsHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
// 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)
|
// (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero)
|
||||||
item.CreatorId = reader["creatorID"].ToString();
|
item.CreatorId = reader["creatorID"].ToString();
|
||||||
|
|
||||||
// Be a bit safer in parsing these because the
|
// Be a bit safer in parsing these because the
|
||||||
// database doesn't enforce them to be not null, and
|
// database doesn't enforce them to be not null, and
|
||||||
// the inventory still works if these are weird in the
|
// the inventory still works if these are weird in the
|
||||||
|
@ -453,7 +453,7 @@ namespace OpenSim.Data.MySQL
|
||||||
itemName = item.Name.Substring(0, 64);
|
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");
|
m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length + " to " + itemName.Length + " characters on add item");
|
||||||
}
|
}
|
||||||
|
|
||||||
string itemDesc = item.Description;
|
string itemDesc = item.Description;
|
||||||
if (item.Description.Length > 128)
|
if (item.Description.Length > 128)
|
||||||
{
|
{
|
||||||
|
@ -490,10 +490,10 @@ namespace OpenSim.Data.MySQL
|
||||||
result.Parameters.AddWithValue("?groupID", item.GroupID);
|
result.Parameters.AddWithValue("?groupID", item.GroupID);
|
||||||
result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
|
result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
|
||||||
result.Parameters.AddWithValue("?flags", item.Flags);
|
result.Parameters.AddWithValue("?flags", item.Flags);
|
||||||
|
|
||||||
lock (m_dbLock)
|
lock (m_dbLock)
|
||||||
result.ExecuteNonQuery();
|
result.ExecuteNonQuery();
|
||||||
|
|
||||||
result.Dispose();
|
result.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,7 +630,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (m_dbLock)
|
lock (m_dbLock)
|
||||||
|
@ -860,7 +860,7 @@ namespace OpenSim.Data.MySQL
|
||||||
deleteOneFolder(folderID);
|
deleteOneFolder(folderID);
|
||||||
deleteItemsInFolder(folderID);
|
deleteItemsInFolder(folderID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
|
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
|
||||||
{
|
{
|
||||||
lock (m_dbLock)
|
lock (m_dbLock)
|
||||||
|
|
|
@ -39,16 +39,16 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
/// <summary>This is a MySQL-customized migration processor. The only difference is in how
|
/// <summary>This is a MySQL-customized migration processor. The only difference is in how
|
||||||
/// it executes SQL scripts (using MySqlScript instead of MyCommand)
|
/// it executes SQL scripts (using MySqlScript instead of MyCommand)
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MySqlMigration : Migration
|
public class MySqlMigration : Migration
|
||||||
{
|
{
|
||||||
public MySqlMigration()
|
public MySqlMigration()
|
||||||
: base()
|
: 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)
|
base(conn, assem, subtype, type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand())
|
using (MySqlCommand cmd = new MySqlCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 WEEK", m_Realm);
|
cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 WEEK", m_Realm);
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,9 +66,9 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand())
|
using (MySqlCommand cmd = new MySqlCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
|
cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,10 +85,10 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand())
|
using (MySqlCommand cmd = new MySqlCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
|
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("?SessionID", sessionID.ToString());
|
||||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||||
|
|
||||||
if (ExecuteNonQuery(cmd) == 0)
|
if (ExecuteNonQuery(cmd) == 0)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,7 +410,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(command))
|
using (MySqlCommand cmd = new MySqlCommand(command))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||||
|
|
||||||
return RunCommand(cmd);
|
return RunCommand(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This lock was being used to serialize database operations when the connection was shared, but this has
|
/// 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.
|
/// 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
|
/// 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
|
/// unrelated operations to block each other or unrelated operations on the same tables from blocking each
|
||||||
/// other.
|
/// other.
|
||||||
|
@ -268,7 +268,7 @@ namespace OpenSim.Data.MySQL
|
||||||
public virtual void RemoveObject(UUID obj, UUID regionUUID)
|
public virtual void RemoveObject(UUID obj, UUID regionUUID)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID);
|
// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID);
|
||||||
|
|
||||||
List<UUID> uuids = new List<UUID>();
|
List<UUID> uuids = new List<UUID>();
|
||||||
|
|
||||||
// Formerly, this used to check the region UUID.
|
// Formerly, this used to check the region UUID.
|
||||||
|
@ -509,7 +509,7 @@ namespace OpenSim.Data.MySQL
|
||||||
#region Prim Inventory Loading
|
#region Prim Inventory Loading
|
||||||
|
|
||||||
// Instead of attempting to LoadItems on every prim,
|
// 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
|
// list from DB of all prims which have items and
|
||||||
// LoadItems only on those
|
// LoadItems only on those
|
||||||
List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>();
|
List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>();
|
||||||
|
@ -807,7 +807,7 @@ namespace OpenSim.Data.MySQL
|
||||||
"UserLocationX, UserLocationY, UserLocationZ, " +
|
"UserLocationX, UserLocationY, UserLocationZ, " +
|
||||||
"UserLookAtX, UserLookAtY, UserLookAtZ, " +
|
"UserLookAtX, UserLookAtY, UserLookAtZ, " +
|
||||||
"AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
|
"AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
|
||||||
"MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " +
|
"MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " +
|
||||||
"SeeAVs, AnyAVSounds, GroupAVSounds) values (" +
|
"SeeAVs, AnyAVSounds, GroupAVSounds) values (" +
|
||||||
"?UUID, ?RegionUUID, " +
|
"?UUID, ?RegionUUID, " +
|
||||||
"?LocalLandID, ?Bitmap, ?Name, ?Description, " +
|
"?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", wl.cloudScrollY);
|
||||||
cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
|
cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
|
||||||
cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
|
cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1273,7 +1273,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
SceneObjectPart prim = new SceneObjectPart();
|
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.UUID = DBGuid.FromDB(row["UUID"]);
|
||||||
prim.CreatorIdentification = (string)row["CreatorID"];
|
prim.CreatorIdentification = (string)row["CreatorID"];
|
||||||
prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
|
prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
|
||||||
|
@ -1401,11 +1401,11 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]);
|
prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]);
|
||||||
prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"];
|
prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"];
|
||||||
|
|
||||||
prim.PassTouches = ((sbyte)row["PassTouches"] != 0);
|
prim.PassTouches = ((sbyte)row["PassTouches"] != 0);
|
||||||
prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0);
|
prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0);
|
||||||
prim.LinkNum = (int)row["LinkNumber"];
|
prim.LinkNum = (int)row["LinkNumber"];
|
||||||
|
|
||||||
if (!(row["MediaURL"] is System.DBNull))
|
if (!(row["MediaURL"] is System.DBNull))
|
||||||
prim.MediaUrl = (string)row["MediaURL"];
|
prim.MediaUrl = (string)row["MediaURL"];
|
||||||
|
|
||||||
|
@ -1421,7 +1421,7 @@ namespace OpenSim.Data.MySQL
|
||||||
if (!(row["DynAttrs"] is System.DBNull))
|
if (!(row["DynAttrs"] is System.DBNull))
|
||||||
prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
|
prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
|
||||||
else
|
else
|
||||||
prim.DynAttrs = new DAMap();
|
prim.DynAttrs = new DAMap();
|
||||||
|
|
||||||
if (!(row["KeyframeMotion"] is DBNull))
|
if (!(row["KeyframeMotion"] is DBNull))
|
||||||
{
|
{
|
||||||
|
@ -1543,10 +1543,10 @@ namespace OpenSim.Data.MySQL
|
||||||
newSettings.Covenant = DBGuid.FromDB(row["covenant"]);
|
newSettings.Covenant = DBGuid.FromDB(row["covenant"]);
|
||||||
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
|
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
|
||||||
newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
|
newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
|
||||||
|
|
||||||
if (row["loaded_creation_id"] is DBNull)
|
if (row["loaded_creation_id"] is DBNull)
|
||||||
newSettings.LoadedCreationID = "";
|
newSettings.LoadedCreationID = "";
|
||||||
else
|
else
|
||||||
newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
|
newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
|
||||||
|
|
||||||
newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
|
newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
|
||||||
|
@ -2023,7 +2023,7 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
s.State = (byte)(int)row["State"];
|
s.State = (byte)(int)row["State"];
|
||||||
s.LastAttachPoint = (byte)(int)row["LastAttachPoint"];
|
s.LastAttachPoint = (byte)(int)row["LastAttachPoint"];
|
||||||
|
|
||||||
if (!(row["Media"] is System.DBNull))
|
if (!(row["Media"] is System.DBNull))
|
||||||
s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
|
s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
|
||||||
|
|
||||||
|
@ -2103,13 +2103,13 @@ namespace OpenSim.Data.MySQL
|
||||||
"?flags, ?itemID, ?primID, ?assetID, " +
|
"?flags, ?itemID, ?primID, ?assetID, " +
|
||||||
"?parentFolderID, ?creatorID, ?ownerID, " +
|
"?parentFolderID, ?creatorID, ?ownerID, " +
|
||||||
"?groupID, ?lastOwnerID)";
|
"?groupID, ?lastOwnerID)";
|
||||||
|
|
||||||
foreach (TaskInventoryItem item in items)
|
foreach (TaskInventoryItem item in items)
|
||||||
{
|
{
|
||||||
cmd.Parameters.Clear();
|
cmd.Parameters.Clear();
|
||||||
|
|
||||||
FillItemCommand(cmd, item);
|
FillItemCommand(cmd, item);
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,39 +40,39 @@ namespace OpenSim.Data.MySQL
|
||||||
public class UserProfilesData: IProfilesData
|
public class UserProfilesData: IProfilesData
|
||||||
{
|
{
|
||||||
static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
#region Properites
|
#region Properites
|
||||||
string ConnectionString
|
string ConnectionString
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual Assembly Assembly
|
protected virtual Assembly Assembly
|
||||||
{
|
{
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
#region class Member Functions
|
#region class Member Functions
|
||||||
public UserProfilesData(string connectionString)
|
public UserProfilesData(string connectionString)
|
||||||
{
|
{
|
||||||
ConnectionString = connectionString;
|
ConnectionString = connectionString;
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
|
|
||||||
Migration m = new Migration(dbcon, Assembly, "UserProfiles");
|
Migration m = new Migration(dbcon, Assembly, "UserProfiles");
|
||||||
m.Update();
|
m.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion Member Functions
|
#endregion Member Functions
|
||||||
|
|
||||||
#region Classifieds Queries
|
#region Classifieds Queries
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the classified records.
|
/// Gets the classified records.
|
||||||
|
@ -86,7 +86,7 @@ namespace OpenSim.Data.MySQL
|
||||||
public OSDArray GetClassifiedRecords(UUID creatorId)
|
public OSDArray GetClassifiedRecords(UUID creatorId)
|
||||||
{
|
{
|
||||||
OSDArray data = new OSDArray();
|
OSDArray data = new OSDArray();
|
||||||
|
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id";
|
string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id";
|
||||||
|
@ -102,7 +102,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
OSDMap n = new OSDMap();
|
OSDMap n = new OSDMap();
|
||||||
UUID Id = UUID.Zero;
|
UUID Id = UUID.Zero;
|
||||||
|
|
||||||
string Name = null;
|
string Name = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -124,12 +124,12 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
|
public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
query += "INSERT INTO classifieds (";
|
query += "INSERT INTO classifieds (";
|
||||||
query += "`classifieduuid`,";
|
query += "`classifieduuid`,";
|
||||||
query += "`creatoruuid`,";
|
query += "`creatoruuid`,";
|
||||||
|
@ -173,21 +173,21 @@ namespace OpenSim.Data.MySQL
|
||||||
query += "classifiedflags=?Flags, ";
|
query += "classifiedflags=?Flags, ";
|
||||||
query += "priceforlisting=?ListingPrice, ";
|
query += "priceforlisting=?ListingPrice, ";
|
||||||
query += "snapshotuuid=?SnapshotId";
|
query += "snapshotuuid=?SnapshotId";
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(ad.ParcelName))
|
if(string.IsNullOrEmpty(ad.ParcelName))
|
||||||
ad.ParcelName = "Unknown";
|
ad.ParcelName = "Unknown";
|
||||||
if(ad.ParcelId == null)
|
if(ad.ParcelId == null)
|
||||||
ad.ParcelId = UUID.Zero;
|
ad.ParcelId = UUID.Zero;
|
||||||
if(string.IsNullOrEmpty(ad.Description))
|
if(string.IsNullOrEmpty(ad.Description))
|
||||||
ad.Description = "No Description";
|
ad.Description = "No Description";
|
||||||
|
|
||||||
DateTime epoch = new DateTime(1970, 1, 1);
|
DateTime epoch = new DateTime(1970, 1, 1);
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = DateTime.Now;
|
||||||
TimeSpan epochnow = now - epoch;
|
TimeSpan epochnow = now - epoch;
|
||||||
TimeSpan duration;
|
TimeSpan duration;
|
||||||
DateTime expiration;
|
DateTime expiration;
|
||||||
TimeSpan epochexp;
|
TimeSpan epochexp;
|
||||||
|
|
||||||
if(ad.Flags == 2)
|
if(ad.Flags == 2)
|
||||||
{
|
{
|
||||||
duration = new TimeSpan(7,0,0,0);
|
duration = new TimeSpan(7,0,0,0);
|
||||||
|
@ -202,7 +202,7 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
ad.CreationDate = (int)epochnow.TotalSeconds;
|
ad.CreationDate = (int)epochnow.TotalSeconds;
|
||||||
ad.ExpirationDate = (int)epochexp.TotalSeconds;
|
ad.ExpirationDate = (int)epochexp.TotalSeconds;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -225,7 +225,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?ParcelName", ad.ParcelName.ToString());
|
cmd.Parameters.AddWithValue("?ParcelName", ad.ParcelName.ToString());
|
||||||
cmd.Parameters.AddWithValue("?Flags", ad.Flags.ToString());
|
cmd.Parameters.AddWithValue("?Flags", ad.Flags.ToString());
|
||||||
cmd.Parameters.AddWithValue("?ListingPrice", ad.Price.ToString ());
|
cmd.Parameters.AddWithValue("?ListingPrice", ad.Price.ToString ());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,20 +239,20 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DeleteClassifiedRecord(UUID recordId)
|
public bool DeleteClassifiedRecord(UUID recordId)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "DELETE FROM classifieds WHERE ";
|
query += "DELETE FROM classifieds WHERE ";
|
||||||
query += "classifieduuid = ?recordId";
|
query += "classifieduuid = ?recordId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
|
|
||||||
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?recordId", recordId.ToString());
|
cmd.Parameters.AddWithValue("?recordId", recordId.ToString());
|
||||||
|
@ -268,14 +268,14 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result)
|
public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT * FROM classifieds WHERE ";
|
query += "SELECT * FROM classifieds WHERE ";
|
||||||
query += "classifieduuid = ?AdId";
|
query += "classifieduuid = ?AdId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -284,7 +284,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?AdId", ad.ClassifiedId.ToString());
|
cmd.Parameters.AddWithValue("?AdId", ad.ClassifiedId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
if(reader.Read ())
|
if(reader.Read ())
|
||||||
|
@ -303,7 +303,7 @@ namespace OpenSim.Data.MySQL
|
||||||
ad.SimName = reader.GetString("simname");
|
ad.SimName = reader.GetString("simname");
|
||||||
ad.GlobalPos = reader.GetString("posglobal");
|
ad.GlobalPos = reader.GetString("posglobal");
|
||||||
ad.ParcelName = reader.GetString("parcelname");
|
ad.ParcelName = reader.GetString("parcelname");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -318,16 +318,16 @@ namespace OpenSim.Data.MySQL
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion Classifieds Queries
|
#endregion Classifieds Queries
|
||||||
|
|
||||||
#region Picks Queries
|
#region Picks Queries
|
||||||
public OSDArray GetAvatarPicks(UUID avatarId)
|
public OSDArray GetAvatarPicks(UUID avatarId)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
|
query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
|
||||||
query += "creatoruuid = ?Id";
|
query += "creatoruuid = ?Id";
|
||||||
OSDArray data = new OSDArray();
|
OSDArray data = new OSDArray();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -336,7 +336,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -344,7 +344,7 @@ namespace OpenSim.Data.MySQL
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
OSDMap record = new OSDMap();
|
OSDMap record = new OSDMap();
|
||||||
|
|
||||||
record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"]));
|
record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"]));
|
||||||
record.Add("name",OSD.FromString((string)reader["name"]));
|
record.Add("name",OSD.FromString((string)reader["name"]));
|
||||||
data.Add(record);
|
data.Add(record);
|
||||||
|
@ -361,16 +361,16 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserProfilePick GetPickInfo(UUID avatarId, UUID pickId)
|
public UserProfilePick GetPickInfo(UUID avatarId, UUID pickId)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
UserProfilePick pick = new UserProfilePick();
|
UserProfilePick pick = new UserProfilePick();
|
||||||
|
|
||||||
query += "SELECT * FROM userpicks WHERE ";
|
query += "SELECT * FROM userpicks WHERE ";
|
||||||
query += "creatoruuid = ?CreatorId AND ";
|
query += "creatoruuid = ?CreatorId AND ";
|
||||||
query += "pickuuid = ?PickId";
|
query += "pickuuid = ?PickId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -380,18 +380,18 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?CreatorId", avatarId.ToString());
|
cmd.Parameters.AddWithValue("?CreatorId", avatarId.ToString());
|
||||||
cmd.Parameters.AddWithValue("?PickId", pickId.ToString());
|
cmd.Parameters.AddWithValue("?PickId", pickId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
{
|
{
|
||||||
reader.Read();
|
reader.Read();
|
||||||
|
|
||||||
string description = (string)reader["description"];
|
string description = (string)reader["description"];
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(description))
|
if (string.IsNullOrEmpty(description))
|
||||||
description = "No description given.";
|
description = "No description given.";
|
||||||
|
|
||||||
UUID.TryParse((string)reader["pickuuid"], out pick.PickId);
|
UUID.TryParse((string)reader["pickuuid"], out pick.PickId);
|
||||||
UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId);
|
UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId);
|
||||||
UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId);
|
UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId);
|
||||||
|
@ -419,11 +419,11 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return pick;
|
return pick;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdatePicksRecord(UserProfilePick pick)
|
public bool UpdatePicksRecord(UserProfilePick pick)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "INSERT INTO userpicks VALUES (";
|
query += "INSERT INTO userpicks VALUES (";
|
||||||
query += "?PickId,";
|
query += "?PickId,";
|
||||||
query += "?CreatorId,";
|
query += "?CreatorId,";
|
||||||
|
@ -449,7 +449,7 @@ namespace OpenSim.Data.MySQL
|
||||||
query += "pickuuid=?PickId,";
|
query += "pickuuid=?PickId,";
|
||||||
query += "posglobal=?GlobalPos,";
|
query += "posglobal=?GlobalPos,";
|
||||||
query += "gatekeeper=?Gatekeeper";
|
query += "gatekeeper=?Gatekeeper";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -471,7 +471,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?Gatekeeper",pick.Gatekeeper);
|
cmd.Parameters.AddWithValue("?Gatekeeper",pick.Gatekeeper);
|
||||||
cmd.Parameters.AddWithValue("?SortOrder", pick.SortOrder.ToString ());
|
cmd.Parameters.AddWithValue("?SortOrder", pick.SortOrder.ToString ());
|
||||||
cmd.Parameters.AddWithValue("?Enabled", pick.Enabled.ToString());
|
cmd.Parameters.AddWithValue("?Enabled", pick.Enabled.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -484,24 +484,24 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DeletePicksRecord(UUID pickId)
|
public bool DeletePicksRecord(UUID pickId)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "DELETE FROM userpicks WHERE ";
|
query += "DELETE FROM userpicks WHERE ";
|
||||||
query += "pickuuid = ?PickId";
|
query += "pickuuid = ?PickId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
|
|
||||||
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?PickId", pickId.ToString());
|
cmd.Parameters.AddWithValue("?PickId", pickId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,12 +515,12 @@ namespace OpenSim.Data.MySQL
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion Picks Queries
|
#endregion Picks Queries
|
||||||
|
|
||||||
#region Avatar Notes Queries
|
#region Avatar Notes Queries
|
||||||
public bool GetAvatarNotes(ref UserProfileNotes notes)
|
public bool GetAvatarNotes(ref UserProfileNotes notes)
|
||||||
{ // WIP
|
{ // WIP
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT `notes` FROM usernotes WHERE ";
|
query += "SELECT `notes` FROM usernotes WHERE ";
|
||||||
query += "useruuid = ?Id AND ";
|
query += "useruuid = ?Id AND ";
|
||||||
query += "targetuuid = ?TargetId";
|
query += "targetuuid = ?TargetId";
|
||||||
|
@ -534,7 +534,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", notes.UserId.ToString());
|
cmd.Parameters.AddWithValue("?Id", notes.UserId.ToString());
|
||||||
cmd.Parameters.AddWithValue("?TargetId", notes.TargetId.ToString());
|
cmd.Parameters.AddWithValue("?TargetId", notes.TargetId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -557,12 +557,12 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
|
public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
bool remove;
|
bool remove;
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(note.Notes))
|
if(string.IsNullOrEmpty(note.Notes))
|
||||||
{
|
{
|
||||||
remove = true;
|
remove = true;
|
||||||
|
@ -581,7 +581,7 @@ namespace OpenSim.Data.MySQL
|
||||||
query += "UPDATE ";
|
query += "UPDATE ";
|
||||||
query += "notes=?Notes";
|
query += "notes=?Notes";
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -593,7 +593,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?Notes", note.Notes);
|
cmd.Parameters.AddWithValue("?Notes", note.Notes);
|
||||||
cmd.Parameters.AddWithValue("?TargetId", note.TargetId.ToString ());
|
cmd.Parameters.AddWithValue("?TargetId", note.TargetId.ToString ());
|
||||||
cmd.Parameters.AddWithValue("?UserId", note.UserId.ToString());
|
cmd.Parameters.AddWithValue("?UserId", note.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -605,18 +605,18 @@ namespace OpenSim.Data.MySQL
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion Avatar Notes Queries
|
#endregion Avatar Notes Queries
|
||||||
|
|
||||||
#region Avatar Properties
|
#region Avatar Properties
|
||||||
public bool GetAvatarProperties(ref UserProfileProperties props, ref string result)
|
public bool GetAvatarProperties(ref UserProfileProperties props, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT * FROM userprofile WHERE ";
|
query += "SELECT * FROM userprofile WHERE ";
|
||||||
query += "useruuid = ?Id";
|
query += "useruuid = ?Id";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -625,7 +625,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", props.UserId.ToString());
|
cmd.Parameters.AddWithValue("?Id", props.UserId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -649,7 +649,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[PROFILES_DATA]" +
|
m_log.DebugFormat("[PROFILES_DATA]" +
|
||||||
": No data for {0}", props.UserId);
|
": No data for {0}", props.UserId);
|
||||||
|
|
||||||
props.WebUrl = string.Empty;
|
props.WebUrl = string.Empty;
|
||||||
props.ImageId = UUID.Zero;
|
props.ImageId = UUID.Zero;
|
||||||
props.AboutText = string.Empty;
|
props.AboutText = string.Empty;
|
||||||
|
@ -730,11 +730,11 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
|
public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE userprofile SET ";
|
query += "UPDATE userprofile SET ";
|
||||||
query += "profileURL=?profileURL, ";
|
query += "profileURL=?profileURL, ";
|
||||||
query += "profileImage=?image, ";
|
query += "profileImage=?image, ";
|
||||||
|
@ -742,7 +742,7 @@ namespace OpenSim.Data.MySQL
|
||||||
query += "profileFirstImage=?firstlifeimage,";
|
query += "profileFirstImage=?firstlifeimage,";
|
||||||
query += "profileFirstText=?firstlifetext ";
|
query += "profileFirstText=?firstlifetext ";
|
||||||
query += "WHERE useruuid=?uuid";
|
query += "WHERE useruuid=?uuid";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -756,7 +756,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?firstlifeimage", props.FirstLifeImageId.ToString());
|
cmd.Parameters.AddWithValue("?firstlifeimage", props.FirstLifeImageId.ToString());
|
||||||
cmd.Parameters.AddWithValue("?firstlifetext", props.FirstLifeText);
|
cmd.Parameters.AddWithValue("?firstlifetext", props.FirstLifeText);
|
||||||
cmd.Parameters.AddWithValue("?uuid", props.UserId.ToString());
|
cmd.Parameters.AddWithValue("?uuid", props.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -765,18 +765,18 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[PROFILES_DATA]" +
|
m_log.ErrorFormat("[PROFILES_DATA]" +
|
||||||
": AgentPropertiesUpdate exception {0}", e.Message);
|
": AgentPropertiesUpdate exception {0}", e.Message);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion Avatar Properties
|
#endregion Avatar Properties
|
||||||
|
|
||||||
#region Avatar Interests
|
#region Avatar Interests
|
||||||
public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
|
public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE userprofile SET ";
|
query += "UPDATE userprofile SET ";
|
||||||
query += "profileWantToMask=?WantMask, ";
|
query += "profileWantToMask=?WantMask, ";
|
||||||
query += "profileWantToText=?WantText,";
|
query += "profileWantToText=?WantText,";
|
||||||
|
@ -784,7 +784,7 @@ namespace OpenSim.Data.MySQL
|
||||||
query += "profileSkillsText=?SkillsText, ";
|
query += "profileSkillsText=?SkillsText, ";
|
||||||
query += "profileLanguages=?Languages ";
|
query += "profileLanguages=?Languages ";
|
||||||
query += "WHERE useruuid=?uuid";
|
query += "WHERE useruuid=?uuid";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -798,7 +798,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?SkillsText", up.SkillsText);
|
cmd.Parameters.AddWithValue("?SkillsText", up.SkillsText);
|
||||||
cmd.Parameters.AddWithValue("?Languages", up.Language);
|
cmd.Parameters.AddWithValue("?Languages", up.Language);
|
||||||
cmd.Parameters.AddWithValue("?uuid", up.UserId.ToString());
|
cmd.Parameters.AddWithValue("?uuid", up.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -820,8 +820,8 @@ namespace OpenSim.Data.MySQL
|
||||||
string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id";
|
string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id";
|
||||||
|
|
||||||
// Get classified image assets
|
// Get classified image assets
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -831,7 +831,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`classifieds`"), dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`classifieds`"), dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -850,7 +850,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -862,7 +862,7 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dbcon.Close();
|
dbcon.Close();
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
|
using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -893,7 +893,7 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region User Preferences
|
#region User Preferences
|
||||||
public bool GetUserPreferences(ref UserPreferences pref, ref string result)
|
public bool GetUserPreferences(ref UserPreferences pref, ref string result)
|
||||||
{
|
{
|
||||||
|
@ -987,16 +987,16 @@ namespace OpenSim.Data.MySQL
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion User Preferences
|
#endregion User Preferences
|
||||||
|
|
||||||
#region Integration
|
#region Integration
|
||||||
public bool GetUserAppData(ref UserAppData props, ref string result)
|
public bool GetUserAppData(ref UserAppData props, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT * FROM `userdata` WHERE ";
|
query += "SELECT * FROM `userdata` WHERE ";
|
||||||
query += "UserId = ?Id AND ";
|
query += "UserId = ?Id AND ";
|
||||||
query += "TagId = ?TagId";
|
query += "TagId = ?TagId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
@ -1006,7 +1006,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
cmd.Parameters.AddWithValue("?Id", props.UserId.ToString());
|
cmd.Parameters.AddWithValue("?Id", props.UserId.ToString());
|
||||||
cmd.Parameters.AddWithValue ("?TagId", props.TagId.ToString());
|
cmd.Parameters.AddWithValue ("?TagId", props.TagId.ToString());
|
||||||
|
|
||||||
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.HasRows)
|
if(reader.HasRows)
|
||||||
|
@ -1022,7 +1022,7 @@ namespace OpenSim.Data.MySQL
|
||||||
query += "?TagId,";
|
query += "?TagId,";
|
||||||
query += "?DataKey,";
|
query += "?DataKey,";
|
||||||
query += "?DataVal) ";
|
query += "?DataVal) ";
|
||||||
|
|
||||||
using (MySqlCommand put = new MySqlCommand(query, dbcon))
|
using (MySqlCommand put = new MySqlCommand(query, dbcon))
|
||||||
{
|
{
|
||||||
put.Parameters.AddWithValue("?UserId", props.UserId.ToString());
|
put.Parameters.AddWithValue("?UserId", props.UserId.ToString());
|
||||||
|
@ -1048,16 +1048,16 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SetUserAppData(UserAppData props, ref string result)
|
public bool SetUserAppData(UserAppData props, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE userdata SET ";
|
query += "UPDATE userdata SET ";
|
||||||
query += "TagId = ?TagId, ";
|
query += "TagId = ?TagId, ";
|
||||||
query += "DataKey = ?DataKey, ";
|
query += "DataKey = ?DataKey, ";
|
||||||
query += "DataVal = ?DataVal WHERE ";
|
query += "DataVal = ?DataVal WHERE ";
|
||||||
query += "UserId = ?UserId AND ";
|
query += "UserId = ?UserId AND ";
|
||||||
query += "TagId = ?TagId";
|
query += "TagId = ?TagId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
|
||||||
|
|
|
@ -209,7 +209,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
|
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
|
||||||
m_log.WarnFormat(
|
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);
|
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);
|
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
|
||||||
m_log.WarnFormat(
|
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);
|
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ namespace OpenSim.Data.MySQL
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
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);
|
assetMetadata.ID, assetMetadata.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
return m_Items.Store(item);
|
return m_Items.Store(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DeleteFolders(string field, string val)
|
public bool DeleteFolders(string field, string val)
|
||||||
{
|
{
|
||||||
return m_Folders.Delete(field, val);
|
return m_Folders.Delete(field, val);
|
||||||
|
@ -220,12 +220,12 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||||
cmd.Parameters.AddWithValue("?AssetID", assetID.ToString());
|
cmd.Parameters.AddWithValue("?AssetID", assetID.ToString());
|
||||||
|
|
||||||
using (IDataReader reader = cmd.ExecuteReader())
|
using (IDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
|
|
||||||
int perms = 0;
|
int perms = 0;
|
||||||
|
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]);
|
perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]);
|
||||||
|
|
|
@ -102,19 +102,19 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
return new EstateSettings();
|
return new EstateSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EstateSettings> LoadEstateSettingsAll()
|
public List<EstateSettings> LoadEstateSettingsAll()
|
||||||
{
|
{
|
||||||
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
||||||
allEstateSettings.Add(GetEstate());
|
allEstateSettings.Add(GetEstate());
|
||||||
return allEstateSettings;
|
return allEstateSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<int> GetEstatesAll()
|
public List<int> GetEstatesAll()
|
||||||
{
|
{
|
||||||
List<int> result = new List<int>();
|
List<int> result = new List<int>();
|
||||||
result.Add((int)GetEstate().EstateID);
|
result.Add((int)GetEstate().EstateID);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<int> GetEstates(string search)
|
public List<int> GetEstates(string search)
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
return fdata.PrincipalID == userID.ToString();
|
return fdata.PrincipalID == userID.ToString();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (lst != null)
|
if (lst != null)
|
||||||
{
|
{
|
||||||
lst.ForEach(f =>
|
lst.ForEach(f =>
|
||||||
|
@ -87,14 +87,14 @@ namespace OpenSim.Data.Null
|
||||||
FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
|
FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
|
||||||
if (f2 != null)
|
if (f2 != null)
|
||||||
f.Data["TheirFlags"] = f2.Data["Flags"];
|
f.Data["TheirFlags"] = f2.Data["Flags"];
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}",
|
// "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}",
|
||||||
// f.Friend, f.Data["Flags"], f2 != null ? f.Data["TheirFlags"] : "not found!", f.PrincipalID);
|
// 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);
|
// m_log.DebugFormat("[NULL FRIENDS DATA]: Got {0} friends for {1}", lst.Count, userID);
|
||||||
|
|
||||||
return lst.ToArray();
|
return lst.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ namespace OpenSim.Data.Null
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}",
|
// "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}",
|
||||||
// friend.Friend, friend.Data["Flags"], friend.PrincipalID);
|
// friend.Friend, friend.Data["Flags"], friend.PrincipalID);
|
||||||
|
|
||||||
m_Data.Remove(friend);
|
m_Data.Remove(friend);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Data.Null
|
||||||
public class NullPresenceData : IPresenceData
|
public class NullPresenceData : IPresenceData
|
||||||
{
|
{
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public static NullPresenceData Instance;
|
public static NullPresenceData Instance;
|
||||||
|
|
||||||
Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>();
|
Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>();
|
||||||
|
@ -100,7 +100,7 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (Instance != this)
|
||||||
return Instance.ReportAgent(sessionID, regionID);
|
return Instance.ReportAgent(sessionID, regionID);
|
||||||
|
|
||||||
if (m_presenceData.ContainsKey(sessionID))
|
if (m_presenceData.ContainsKey(sessionID))
|
||||||
{
|
{
|
||||||
m_presenceData[sessionID].RegionID = regionID;
|
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"));
|
// Console.WriteLine("HOME for " + p.UserID + " is " + (p.Data.ContainsKey("HomeRegionID") ? p.Data["HomeRegionID"] : "Not found"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return presences.ToArray();
|
return presences.ToArray();
|
||||||
}
|
}
|
||||||
else if (field == "SessionID")
|
else if (field == "SessionID")
|
||||||
|
@ -172,7 +172,7 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[NULL PRESENCE DATA]: Deleting presence data for field {0} with parameter {1}", field, data);
|
// "[NULL PRESENCE DATA]: Deleting presence data for field {0} with parameter {1}", field, data);
|
||||||
|
|
||||||
if (Instance != this)
|
if (Instance != this)
|
||||||
return Instance.Delete(field, data);
|
return Instance.Delete(field, data);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.Data.Null
|
||||||
public class NullUserAccountData : IUserAccountData
|
public class NullUserAccountData : IUserAccountData
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>();
|
private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>();
|
||||||
private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>();
|
private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>();
|
||||||
private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>();
|
private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>();
|
||||||
|
@ -48,7 +48,7 @@ namespace OpenSim.Data.Null
|
||||||
public NullUserAccountData(string connectionString, string realm)
|
public NullUserAccountData(string connectionString, string realm)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// 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);
|
// connectionString, realm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,12 +65,12 @@ namespace OpenSim.Data.Null
|
||||||
// if (m_log.IsDebugEnabled)
|
// if (m_log.IsDebugEnabled)
|
||||||
// {
|
// {
|
||||||
// m_log.DebugFormat(
|
// 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));
|
// string.Join(", ", fields), string.Join(", ", values));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
UserAccountData[] userAccounts = new UserAccountData[0];
|
UserAccountData[] userAccounts = new UserAccountData[0];
|
||||||
|
|
||||||
List<string> fieldsLst = new List<string>(fields);
|
List<string> fieldsLst = new List<string>(fields);
|
||||||
if (fieldsLst.Contains("PrincipalID"))
|
if (fieldsLst.Contains("PrincipalID"))
|
||||||
{
|
{
|
||||||
|
@ -79,33 +79,33 @@ namespace OpenSim.Data.Null
|
||||||
if (UUID.TryParse(values[i], out id))
|
if (UUID.TryParse(values[i], out id))
|
||||||
if (m_DataByUUID.ContainsKey(id))
|
if (m_DataByUUID.ContainsKey(id))
|
||||||
userAccounts = new UserAccountData[] { m_DataByUUID[id] };
|
userAccounts = new UserAccountData[] { m_DataByUUID[id] };
|
||||||
}
|
}
|
||||||
else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName"))
|
else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName"))
|
||||||
{
|
{
|
||||||
int findex = fieldsLst.IndexOf("FirstName");
|
int findex = fieldsLst.IndexOf("FirstName");
|
||||||
int lindex = fieldsLst.IndexOf("LastName");
|
int lindex = fieldsLst.IndexOf("LastName");
|
||||||
if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex]))
|
if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex]))
|
||||||
{
|
{
|
||||||
userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] };
|
userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fieldsLst.Contains("Email"))
|
else if (fieldsLst.Contains("Email"))
|
||||||
{
|
{
|
||||||
int i = fieldsLst.IndexOf("Email");
|
int i = fieldsLst.IndexOf("Email");
|
||||||
if (m_DataByEmail.ContainsKey(values[i]))
|
if (m_DataByEmail.ContainsKey(values[i]))
|
||||||
userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] };
|
userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] };
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (m_log.IsDebugEnabled)
|
// if (m_log.IsDebugEnabled)
|
||||||
// {
|
// {
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
// foreach (UserAccountData uad in userAccounts)
|
// foreach (UserAccountData uad in userAccounts)
|
||||||
// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID);
|
// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID);
|
||||||
//
|
//
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb);
|
// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return userAccounts;
|
return userAccounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,16 +113,16 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_log.DebugFormat(
|
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());
|
data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode());
|
||||||
|
|
||||||
m_DataByUUID[data.PrincipalID] = data;
|
m_DataByUUID[data.PrincipalID] = data;
|
||||||
m_DataByName[data.FirstName + " " + data.LastName] = data;
|
m_DataByName[data.FirstName + " " + data.LastName] = data;
|
||||||
if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
|
if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
|
||||||
m_DataByEmail[data.Data["Email"]] = data;
|
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);
|
// m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -132,7 +132,7 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query);
|
// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query);
|
||||||
|
|
||||||
string[] words = query.Split(new char[] { ' ' });
|
string[] words = query.Split(new char[] { ' ' });
|
||||||
|
|
||||||
for (int i = 0; i < words.Length; i++)
|
for (int i = 0; i < words.Length; i++)
|
||||||
|
|
|
@ -151,35 +151,35 @@ namespace OpenSim.Data.PGSQL
|
||||||
/// <param name="asset">the asset</param>
|
/// <param name="asset">the asset</param>
|
||||||
override public bool StoreAsset(AssetBase asset)
|
override public bool StoreAsset(AssetBase asset)
|
||||||
{
|
{
|
||||||
|
|
||||||
string sql =
|
string sql =
|
||||||
@"UPDATE assets set name = :name, description = :description, " + "\"assetType\" " + @" = :assetType,
|
@"UPDATE assets set name = :name, description = :description, " + "\"assetType\" " + @" = :assetType,
|
||||||
local = :local, temporary = :temporary, creatorid = :creatorid, data = :data
|
local = :local, temporary = :temporary, creatorid = :creatorid, data = :data
|
||||||
WHERE id=:id;
|
WHERE id=:id;
|
||||||
|
|
||||||
INSERT INTO assets
|
INSERT INTO assets
|
||||||
(id, name, description, " + "\"assetType\" " + @", local,
|
(id, name, description, " + "\"assetType\" " + @", local,
|
||||||
temporary, create_time, access_time, creatorid, asset_flags, data)
|
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
|
: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;
|
string assetName = asset.Name;
|
||||||
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
|
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
|
||||||
{
|
{
|
||||||
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
|
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
|
||||||
m_log.WarnFormat(
|
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);
|
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
string assetDescription = asset.Description;
|
string assetDescription = asset.Description;
|
||||||
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
|
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
|
||||||
{
|
{
|
||||||
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
|
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
|
||||||
m_log.WarnFormat(
|
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);
|
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
List<AssetMetadata> retList = new List<AssetMetadata>(count);
|
List<AssetMetadata> retList = new List<AssetMetadata>(count);
|
||||||
string sql = @" SELECT id, name, description, " + "\"assetType\"" + @", temporary, creatorid
|
string sql = @" SELECT id, name, description, " + "\"assetType\"" + @", temporary, creatorid
|
||||||
FROM assets
|
FROM assets
|
||||||
order by id
|
order by id
|
||||||
limit :stop
|
limit :stop
|
||||||
offset :start;";
|
offset :start;";
|
||||||
|
|
|
@ -145,7 +145,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
updateBuilder.AppendFormat("\"{0}\" = :{0}",field);
|
updateBuilder.AppendFormat("\"{0}\" = :{0}",field);
|
||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("" + field, data.Data[field]));
|
cmd.Parameters.Add(m_database.CreateParameter("" + field, data.Data[field]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
cmd.CommandText = updateBuilder.ToString();
|
cmd.CommandText = updateBuilder.ToString();
|
||||||
cmd.Connection = conn;
|
cmd.Connection = conn;
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("principalID", data.PrincipalID));
|
cmd.Parameters.Add(m_database.CreateParameter("principalID", data.PrincipalID));
|
||||||
|
|
||||||
conn.Open();
|
conn.Open();
|
||||||
if (cmd.ExecuteNonQuery() < 1)
|
if (cmd.ExecuteNonQuery() < 1)
|
||||||
{
|
{
|
||||||
|
@ -195,7 +195,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||||
DoExpire();
|
DoExpire();
|
||||||
|
|
||||||
string sql = "insert into tokens (uuid, token, validity) values (:principalID, :token, :lifetime)";
|
string sql = "insert into tokens (uuid, token, validity) values (:principalID, :token, :lifetime)";
|
||||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
|
using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
IAvatarData
|
IAvatarData
|
||||||
{
|
{
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public PGSQLAvatarData(string connectionString, string realm) :
|
public PGSQLAvatarData(string connectionString, string realm) :
|
||||||
base(connectionString, realm, "Avatar")
|
base(connectionString, realm, "Avatar")
|
||||||
{
|
{
|
||||||
|
|
|
@ -594,7 +594,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
|
|
||||||
public bool DeleteEstate(int estateID)
|
public bool DeleteEstate(int estateID)
|
||||||
{
|
{
|
||||||
// TODO: Implementation!
|
// TODO: Implementation!
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override bool Delete(string principalID, string friend)
|
public override bool Delete(string principalID, string friend)
|
||||||
{
|
{
|
||||||
UUID princUUID = UUID.Zero;
|
UUID princUUID = UUID.Zero;
|
||||||
|
@ -97,7 +97,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
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\" " +
|
" left join {0} as b on a.\"PrincipalID\" = b.\"Friend\" and a.\"Friend\" = b.\"PrincipalID\" " +
|
||||||
" where a.\"PrincipalID\" = :PrincipalID", m_Realm);
|
" where a.\"PrincipalID\" = :PrincipalID", m_Realm);
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID.ToString()));
|
cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID.ToString()));
|
||||||
|
@ -111,6 +111,6 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
return GetFriends(principalID);
|
return GetFriends(principalID);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
: base(connectionString)
|
: base(connectionString)
|
||||||
{
|
{
|
||||||
m_Realm = realm;
|
m_Realm = realm;
|
||||||
|
|
||||||
m_ConnectionString = connectionString;
|
m_ConnectionString = connectionString;
|
||||||
|
|
||||||
if (storeName != String.Empty)
|
if (storeName != String.Empty)
|
||||||
|
@ -104,7 +104,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
m_FieldTypes = new Dictionary<string, string>();
|
m_FieldTypes = new Dictionary<string, string>();
|
||||||
|
|
||||||
string query = string.Format(@"select column_name,data_type
|
string query = string.Format(@"select column_name,data_type
|
||||||
from INFORMATION_SCHEMA.COLUMNS
|
from INFORMATION_SCHEMA.COLUMNS
|
||||||
where table_name = lower('{0}');
|
where table_name = lower('{0}');
|
||||||
|
|
||||||
", m_Realm);
|
", m_Realm);
|
||||||
|
@ -232,7 +232,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
if (reader == null)
|
if (reader == null)
|
||||||
return new T[0];
|
return new T[0];
|
||||||
|
|
||||||
CheckColumnNames(reader);
|
CheckColumnNames(reader);
|
||||||
|
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
|
@ -339,7 +339,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
names.Add(fi.Name);
|
names.Add(fi.Name);
|
||||||
values.Add(":" + fi.Name);
|
values.Add(":" + fi.Name);
|
||||||
// Temporarily return more information about what field is unexpectedly null for
|
// 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.
|
// InventoryTransferModule or we may be required to substitute a DBNull here.
|
||||||
if (fi.GetValue(row) == null)
|
if (fi.GetValue(row) == null)
|
||||||
throw new NullReferenceException(
|
throw new NullReferenceException(
|
||||||
|
@ -395,11 +395,11 @@ namespace OpenSim.Data.PGSQL
|
||||||
}
|
}
|
||||||
string where = String.Join(" AND ", terms.ToArray());
|
string where = String.Join(" AND ", terms.ToArray());
|
||||||
query.AppendFormat(" WHERE {0} ", where);
|
query.AppendFormat(" WHERE {0} ", where);
|
||||||
|
|
||||||
}
|
}
|
||||||
cmd.Connection = conn;
|
cmd.Connection = conn;
|
||||||
cmd.CommandText = query.ToString();
|
cmd.CommandText = query.ToString();
|
||||||
|
|
||||||
conn.Open();
|
conn.Open();
|
||||||
if (cmd.ExecuteNonQuery() > 0)
|
if (cmd.ExecuteNonQuery() > 0)
|
||||||
{
|
{
|
||||||
|
@ -416,7 +416,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
query.Append("\") values (" + String.Join(",", values.ToArray()) + ")");
|
query.Append("\") values (" + String.Join(",", values.ToArray()) + ")");
|
||||||
cmd.Connection = conn;
|
cmd.Connection = conn;
|
||||||
cmd.CommandText = query.ToString();
|
cmd.CommandText = query.ToString();
|
||||||
|
|
||||||
// m_log.WarnFormat("[PGSQLGenericTable]: Inserting into {0} sql {1}", m_Realm, cmd.CommandText);
|
// m_log.WarnFormat("[PGSQLGenericTable]: Inserting into {0} sql {1}", m_Realm, cmd.CommandText);
|
||||||
|
|
||||||
if (conn.State != ConnectionState.Open)
|
if (conn.State != ConnectionState.Open)
|
||||||
|
|
|
@ -37,7 +37,7 @@ using Npgsql;
|
||||||
namespace OpenSim.Data.PGSQL
|
namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
public class PGSQLGroupsData : IGroupsData
|
public class PGSQLGroupsData : IGroupsData
|
||||||
{
|
{
|
||||||
private PGSqlGroupsGroupsHandler m_Groups;
|
private PGSqlGroupsGroupsHandler m_Groups;
|
||||||
private PGSqlGroupsMembershipHandler m_Membership;
|
private PGSqlGroupsMembershipHandler m_Membership;
|
||||||
private PGSqlGroupsRolesHandler m_Roles;
|
private PGSqlGroupsRolesHandler m_Roles;
|
||||||
|
@ -83,17 +83,17 @@ namespace OpenSim.Data.PGSQL
|
||||||
|
|
||||||
public GroupData[] RetrieveGroups(string pattern)
|
public GroupData[] RetrieveGroups(string pattern)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(pattern)) // True for where clause
|
if (string.IsNullOrEmpty(pattern)) // True for where clause
|
||||||
{
|
{
|
||||||
pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100";
|
pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100";
|
||||||
|
|
||||||
return m_Groups.Get(pattern);
|
return m_Groups.Get(pattern);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100";
|
pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100";
|
||||||
|
|
||||||
return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern));
|
return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,10 +138,10 @@ namespace OpenSim.Data.PGSQL
|
||||||
|
|
||||||
public bool DeleteMember(UUID groupID, string pricipalID)
|
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 });
|
new string[] { groupID.ToString(), pricipalID });
|
||||||
}
|
}
|
||||||
|
|
||||||
public int MemberCount(UUID groupID)
|
public int MemberCount(UUID groupID)
|
||||||
{
|
{
|
||||||
return (int)m_Membership.GetCount("GroupID", groupID.ToString());
|
return (int)m_Membership.GetCount("GroupID", groupID.ToString());
|
||||||
|
@ -173,7 +173,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
|
|
||||||
public bool DeleteRole(UUID groupID, UUID roleID)
|
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() });
|
new string[] { groupID.ToString(), roleID.ToString() });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store)
|
public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store)
|
||||||
: base(connectionString, realm, store)
|
: base(connectionString, realm, store)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsMembershipHandler(string connectionString, string realm)
|
public PGSqlGroupsMembershipHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsRolesHandler(string connectionString, string realm)
|
public PGSqlGroupsRolesHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm)
|
public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -425,7 +425,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsInvitesHandler(string connectionString, string realm)
|
public PGSqlGroupsInvitesHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
|
cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,7 +451,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsNoticesHandler(string connectionString, string realm)
|
public PGSqlGroupsNoticesHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
|
cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSqlGroupsPrincipalsHandler(string connectionString, string realm)
|
public PGSqlGroupsPrincipalsHandler(string connectionString, string realm)
|
||||||
: base(connectionString, realm, string.Empty)
|
: base(connectionString, realm, string.Empty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
m_connectionString = connectionString;
|
m_connectionString = connectionString;
|
||||||
database = new PGSQLManager(connectionString);
|
database = new PGSQLManager(connectionString);
|
||||||
|
|
||||||
//New migrations check of store
|
//New migrations check of store
|
||||||
database.CheckMigration(_migrationStore);
|
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
|
/* 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
|
* every found folder, recursively). Inventory code for other DBs has been already rewritten to get ALL
|
||||||
* inventory for a specific user at once.
|
* 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.
|
* be used, so check for that and return an empty list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -264,11 +264,11 @@ namespace OpenSim.Data.PGSQL
|
||||||
/// <param name="folder">Folder to update</param>
|
/// <param name="folder">Folder to update</param>
|
||||||
public void updateInventoryFolder(InventoryFolderBase folder)
|
public void updateInventoryFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
string sql = @"UPDATE inventoryfolders SET ""agentID"" = :agentID,
|
string sql = @"UPDATE inventoryfolders SET ""agentID"" = :agentID,
|
||||||
""parentFolderID"" = :parentFolderID,
|
""parentFolderID"" = :parentFolderID,
|
||||||
""folderName"" = :folderName,
|
""folderName"" = :folderName,
|
||||||
type = :type,
|
type = :type,
|
||||||
version = :version
|
version = :version
|
||||||
WHERE folderID = :folderID";
|
WHERE folderID = :folderID";
|
||||||
|
|
||||||
string folderName = folder.Name;
|
string folderName = folder.Name;
|
||||||
|
@ -337,7 +337,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
cmd.Parameters.Add(database.CreateParameter("parentID", UUID.Zero));
|
cmd.Parameters.Add(database.CreateParameter("parentID", UUID.Zero));
|
||||||
conn.Open();
|
conn.Open();
|
||||||
subFolders = getFolderHierarchy(folderID, cmd);
|
subFolders = getFolderHierarchy(folderID, cmd);
|
||||||
|
|
||||||
|
|
||||||
//Delete all sub-folders
|
//Delete all sub-folders
|
||||||
foreach (InventoryFolderBase f in subFolders)
|
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);
|
m_log.InfoFormat("[INVENTORY DB]: Found no inventory item with ID : {0}", itemID);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -420,24 +420,24 @@ namespace OpenSim.Data.PGSQL
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string sql = @"INSERT INTO inventoryitems
|
string sql = @"INSERT INTO inventoryitems
|
||||||
(""inventoryID"", ""assetID"", ""assetType"", ""parentFolderID"", ""avatarID"", ""inventoryName"",
|
(""inventoryID"", ""assetID"", ""assetType"", ""parentFolderID"", ""avatarID"", ""inventoryName"",
|
||||||
""inventoryDescription"", ""inventoryNextPermissions"", ""inventoryCurrentPermissions"",
|
""inventoryDescription"", ""inventoryNextPermissions"", ""inventoryCurrentPermissions"",
|
||||||
""invType"", ""creatorID"", ""inventoryBasePermissions"", ""inventoryEveryOnePermissions"", ""inventoryGroupPermissions"",
|
""invType"", ""creatorID"", ""inventoryBasePermissions"", ""inventoryEveryOnePermissions"", ""inventoryGroupPermissions"",
|
||||||
""salePrice"", ""SaleType"", ""creationDate"", ""groupID"", ""groupOwned"", flags)
|
""salePrice"", ""SaleType"", ""creationDate"", ""groupID"", ""groupOwned"", flags)
|
||||||
VALUES
|
VALUES
|
||||||
(:inventoryID, :assetID, :assetType, :parentFolderID, :avatarID, :inventoryName, :inventoryDescription,
|
(:inventoryID, :assetID, :assetType, :parentFolderID, :avatarID, :inventoryName, :inventoryDescription,
|
||||||
:inventoryNextPermissions, :inventoryCurrentPermissions, :invType, :creatorID,
|
:inventoryNextPermissions, :inventoryCurrentPermissions, :invType, :creatorID,
|
||||||
:inventoryBasePermissions, :inventoryEveryOnePermissions, :inventoryGroupPermissions, :SalePrice, :SaleType,
|
:inventoryBasePermissions, :inventoryEveryOnePermissions, :inventoryGroupPermissions, :SalePrice, :SaleType,
|
||||||
:creationDate, :groupID, :groupOwned, :flags)";
|
:creationDate, :groupID, :groupOwned, :flags)";
|
||||||
|
|
||||||
string itemName = item.Name;
|
string itemName = item.Name;
|
||||||
if (item.Name.Length > 64)
|
if (item.Name.Length > 64)
|
||||||
{
|
{
|
||||||
itemName = item.Name.Substring(0, 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");
|
m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters");
|
||||||
}
|
}
|
||||||
|
|
||||||
string itemDesc = item.Description;
|
string itemDesc = item.Description;
|
||||||
if (item.Description.Length > 128)
|
if (item.Description.Length > 128)
|
||||||
{
|
{
|
||||||
|
@ -502,25 +502,25 @@ namespace OpenSim.Data.PGSQL
|
||||||
/// <param name="item">Inventory item to update</param>
|
/// <param name="item">Inventory item to update</param>
|
||||||
public void updateInventoryItem(InventoryItemBase item)
|
public void updateInventoryItem(InventoryItemBase item)
|
||||||
{
|
{
|
||||||
string sql = @"UPDATE inventoryitems SET ""assetID"" = :assetID,
|
string sql = @"UPDATE inventoryitems SET ""assetID"" = :assetID,
|
||||||
""assetType"" = :assetType,
|
""assetType"" = :assetType,
|
||||||
""parentFolderID"" = :parentFolderID,
|
""parentFolderID"" = :parentFolderID,
|
||||||
""avatarID"" = :avatarID,
|
""avatarID"" = :avatarID,
|
||||||
""inventoryName"" = :inventoryName,
|
""inventoryName"" = :inventoryName,
|
||||||
""inventoryDescription"" = :inventoryDescription,
|
""inventoryDescription"" = :inventoryDescription,
|
||||||
""inventoryNextPermissions"" = :inventoryNextPermissions,
|
""inventoryNextPermissions"" = :inventoryNextPermissions,
|
||||||
""inventoryCurrentPermissions"" = :inventoryCurrentPermissions,
|
""inventoryCurrentPermissions"" = :inventoryCurrentPermissions,
|
||||||
""invType"" = :invType,
|
""invType"" = :invType,
|
||||||
""creatorID"" = :creatorID,
|
""creatorID"" = :creatorID,
|
||||||
""inventoryBasePermissions"" = :inventoryBasePermissions,
|
""inventoryBasePermissions"" = :inventoryBasePermissions,
|
||||||
""inventoryEveryOnePermissions"" = :inventoryEveryOnePermissions,
|
""inventoryEveryOnePermissions"" = :inventoryEveryOnePermissions,
|
||||||
""inventoryGroupPermissions"" = :inventoryGroupPermissions,
|
""inventoryGroupPermissions"" = :inventoryGroupPermissions,
|
||||||
""salePrice"" = :SalePrice,
|
""salePrice"" = :SalePrice,
|
||||||
""saleType"" = :SaleType,
|
""saleType"" = :SaleType,
|
||||||
""creationDate"" = :creationDate,
|
""creationDate"" = :creationDate,
|
||||||
""groupID"" = :groupID,
|
""groupID"" = :groupID,
|
||||||
""groupOwned"" = :groupOwned,
|
""groupOwned"" = :groupOwned,
|
||||||
flags = :flags
|
flags = :flags
|
||||||
WHERE ""inventoryID"" = :inventoryID";
|
WHERE ""inventoryID"" = :inventoryID";
|
||||||
|
|
||||||
string itemName = item.Name;
|
string itemName = item.Name;
|
||||||
|
@ -529,7 +529,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
itemName = item.Name.Substring(0, 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 on update");
|
m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters on update");
|
||||||
}
|
}
|
||||||
|
|
||||||
string itemDesc = item.Description;
|
string itemDesc = item.Description;
|
||||||
if (item.Description.Length > 128)
|
if (item.Description.Length > 128)
|
||||||
{
|
{
|
||||||
|
|
|
@ -326,7 +326,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
/// <param name="migrationStore">migrationStore.</param>
|
/// <param name="migrationStore">migrationStore.</param>
|
||||||
public void CheckMigration(string migrationStore)
|
public void CheckMigration(string migrationStore)
|
||||||
{
|
{
|
||||||
using (NpgsqlConnection connection = new NpgsqlConnection(connectionString))
|
using (NpgsqlConnection connection = new NpgsqlConnection(connectionString))
|
||||||
{
|
{
|
||||||
connection.Open();
|
connection.Open();
|
||||||
Assembly assem = GetType().Assembly;
|
Assembly assem = GetType().Assembly;
|
||||||
|
|
|
@ -54,8 +54,8 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cmd.CommandText = "select version from migrations where name = '" + type + "' " +
|
cmd.CommandText = "select version from migrations where name = '" + type + "' " +
|
||||||
" order by version desc limit 1"; //Must be
|
" order by version desc limit 1"; //Must be
|
||||||
using (NpgsqlDataReader reader = cmd.ExecuteReader())
|
using (NpgsqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
|
cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
|
||||||
|
|
||||||
ExecuteNonQuery(cmd);
|
ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
PresenceData[] pd = Get("SessionID", sessionID.ToString());
|
PresenceData[] pd = Get("SessionID", sessionID.ToString());
|
||||||
if (pd.Length == 0)
|
if (pd.Length == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (regionID == UUID.Zero)
|
if (regionID == UUID.Zero)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
public bool VerifyAgent(UUID agentId, UUID secureSessionID)
|
public bool VerifyAgent(UUID agentId, UUID secureSessionID)
|
||||||
{
|
{
|
||||||
PresenceData[] ret = Get("SecureSessionID", secureSessionID.ToString());
|
PresenceData[] ret = Get("SecureSessionID", secureSessionID.ToString());
|
||||||
|
|
||||||
if (ret.Length == 0)
|
if (ret.Length == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGSQLRegionData(string connectionString, string realm)
|
public PGSQLRegionData(string connectionString, string realm)
|
||||||
{
|
{
|
||||||
m_Realm = realm;
|
m_Realm = realm;
|
||||||
m_ConnectionString = connectionString;
|
m_ConnectionString = connectionString;
|
||||||
|
@ -77,7 +77,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
m_FieldTypes = new Dictionary<string, string>();
|
m_FieldTypes = new Dictionary<string, string>();
|
||||||
|
|
||||||
string query = string.Format(@"select column_name,data_type
|
string query = string.Format(@"select column_name,data_type
|
||||||
from INFORMATION_SCHEMA.COLUMNS
|
from INFORMATION_SCHEMA.COLUMNS
|
||||||
where table_name = lower('{0}');
|
where table_name = lower('{0}');
|
||||||
|
|
||||||
", m_Realm);
|
", m_Realm);
|
||||||
|
@ -107,7 +107,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
||||||
{
|
{
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName));
|
cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName));
|
||||||
if (scopeID != UUID.Zero)
|
if (scopeID != UUID.Zero)
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
||||||
conn.Open();
|
conn.Open();
|
||||||
return RunCommand(cmd);
|
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("startY", startY));
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("endX", endX));
|
cmd.Parameters.Add(m_database.CreateParameter("endX", endX));
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("endY", endY));
|
cmd.Parameters.Add(m_database.CreateParameter("endY", endY));
|
||||||
if (scopeID != UUID.Zero)
|
if (scopeID != UUID.Zero)
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
||||||
conn.Open();
|
conn.Open();
|
||||||
ret = RunCommand(cmd);
|
ret = RunCommand(cmd);
|
||||||
|
@ -167,7 +167,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
||||||
{
|
{
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("regionID", regionID));
|
cmd.Parameters.Add(m_database.CreateParameter("regionID", regionID));
|
||||||
if (scopeID != UUID.Zero)
|
if (scopeID != UUID.Zero)
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
||||||
conn.Open();
|
conn.Open();
|
||||||
List<RegionData> ret = RunCommand(cmd);
|
List<RegionData> 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("startY", qstartY));
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("endX", endX));
|
cmd.Parameters.Add(m_database.CreateParameter("endX", endX));
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("endY", endY));
|
cmd.Parameters.Add(m_database.CreateParameter("endY", endY));
|
||||||
if (scopeID != UUID.Zero)
|
if (scopeID != UUID.Zero)
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
||||||
conn.Open();
|
conn.Open();
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
|
|
||||||
string update = "update " + m_Realm + " set \"locX\"=:posX, \"locY\"=:posY, \"sizeX\"=:sizeX, \"sizeY\"=:sizeY ";
|
string update = "update " + m_Realm + " set \"locX\"=:posX, \"locY\"=:posY, \"sizeX\"=:sizeX, \"sizeY\"=:sizeY ";
|
||||||
|
|
||||||
foreach (string field in fields)
|
foreach (string field in fields)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -110,11 +110,11 @@ namespace OpenSim.Data.PGSQL
|
||||||
Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>();
|
Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>();
|
||||||
SceneObjectGroup grp = null;
|
SceneObjectGroup grp = null;
|
||||||
|
|
||||||
string sql = @"SELECT *,
|
string sql = @"SELECT *,
|
||||||
CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort
|
CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort
|
||||||
FROM prims
|
FROM prims
|
||||||
LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID""
|
LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID""
|
||||||
WHERE ""RegionUUID"" = :RegionUUID
|
WHERE ""RegionUUID"" = :RegionUUID
|
||||||
ORDER BY ""SceneGroupID"" asc, sort asc, ""LinkNumber"" asc";
|
ORDER BY ""SceneGroupID"" asc, sort asc, ""LinkNumber"" asc";
|
||||||
|
|
||||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
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
|
// 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
|
// 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
|
// 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).
|
// deleted).
|
||||||
if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero)
|
if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
objects[grp.UUID] = grp;
|
objects[grp.UUID] = grp;
|
||||||
|
|
||||||
// Instead of attempting to LoadItems on every prim,
|
// 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
|
// list from DB of all prims which have items and
|
||||||
// LoadItems only on those
|
// LoadItems only on those
|
||||||
List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>();
|
List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>();
|
||||||
|
@ -331,52 +331,52 @@ namespace OpenSim.Data.PGSQL
|
||||||
private void StoreSceneObjectPrim(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
|
private void StoreSceneObjectPrim(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
|
||||||
{
|
{
|
||||||
//Big query to update or insert a new prim.
|
//Big query to update or insert a new prim.
|
||||||
|
|
||||||
string queryPrims = @"
|
string queryPrims = @"
|
||||||
UPDATE prims SET
|
UPDATE prims SET
|
||||||
""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName,
|
""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName,
|
||||||
""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask,
|
""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask,
|
||||||
""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ,
|
""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ,
|
||||||
""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX,
|
""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX,
|
||||||
""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY,
|
""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY,
|
||||||
""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY,
|
""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY,
|
||||||
""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW,
|
""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW,
|
||||||
""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ,
|
""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ,
|
||||||
""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY,
|
""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY,
|
||||||
""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID,
|
""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID,
|
||||||
""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2,
|
""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2,
|
||||||
""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain,
|
""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain,
|
||||||
""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX,
|
""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX,
|
||||||
""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX,
|
""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX,
|
||||||
""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook,
|
""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook,
|
||||||
""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice,
|
""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice,
|
||||||
""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem,
|
""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem,
|
||||||
""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
|
""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
|
||||||
""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs,
|
""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs,
|
||||||
""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution
|
""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution
|
||||||
WHERE ""UUID"" = :UUID ;
|
WHERE ""UUID"" = :UUID ;
|
||||||
|
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
prims (
|
prims (
|
||||||
""UUID"", ""CreationDate"", ""Name"", ""Text"", ""Description"", ""SitName"", ""TouchName"", ""ObjectFlags"", ""OwnerMask"", ""NextOwnerMask"", ""GroupMask"",
|
""UUID"", ""CreationDate"", ""Name"", ""Text"", ""Description"", ""SitName"", ""TouchName"", ""ObjectFlags"", ""OwnerMask"", ""NextOwnerMask"", ""GroupMask"",
|
||||||
""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"",
|
""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"",
|
||||||
""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"",
|
""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"",
|
||||||
""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"",
|
""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"",
|
||||||
""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"",
|
""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"",
|
||||||
""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"",
|
""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"",
|
||||||
""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
|
""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
|
||||||
""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
|
""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
|
||||||
""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
|
""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
|
||||||
""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution""
|
""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution""
|
||||||
) Select
|
) Select
|
||||||
:UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
|
:UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
|
||||||
:EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
|
:EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
|
||||||
:VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ,
|
:VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ,
|
||||||
:RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW,
|
:RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW,
|
||||||
:SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID,
|
:SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID,
|
||||||
:PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX,
|
:PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX,
|
||||||
:OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
|
:OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
|
||||||
:ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
|
:ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
|
||||||
:ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
|
:ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
|
||||||
:PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution
|
:PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution
|
||||||
where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
|
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)
|
private void StoreSceneObjectPrimShapes(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
|
||||||
{
|
{
|
||||||
//Big query to or insert or update primshapes
|
//Big query to or insert or update primshapes
|
||||||
|
|
||||||
string queryPrimShapes = @"
|
string queryPrimShapes = @"
|
||||||
UPDATE primshapes SET
|
UPDATE primshapes SET
|
||||||
""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin,
|
""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin,
|
||||||
""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY,
|
""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY,
|
||||||
""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions,
|
""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions,
|
||||||
""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin,
|
""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin,
|
||||||
""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow,
|
""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow,
|
||||||
""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media
|
""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media
|
||||||
WHERE ""UUID"" = :UUID ;
|
WHERE ""UUID"" = :UUID ;
|
||||||
|
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
primshapes (
|
primshapes (
|
||||||
""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"",
|
""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"",
|
||||||
""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"",
|
""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"",
|
||||||
""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media""
|
""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media""
|
||||||
)
|
)
|
||||||
Select
|
Select
|
||||||
:UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY,
|
:UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY,
|
||||||
:PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin,
|
:PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin,
|
||||||
:ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media
|
:ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media
|
||||||
where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID);
|
where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID);
|
||||||
";
|
";
|
||||||
|
@ -500,7 +500,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
sql =
|
sql =
|
||||||
@"INSERT INTO primitems (
|
@"INSERT INTO primitems (
|
||||||
""itemID"",""primID"",""assetID"",""parentFolderID"",""invType"",""assetType"",""name"",""description"",""creationDate"",""creatorID"",""ownerID"",""lastOwnerID"",""groupID"",
|
""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,
|
VALUES (:itemID,:primID,:assetID,:parentFolderID,:invType,:assetType,:name,:description,:creationDate,:creatorID,:ownerID,
|
||||||
:lastOwnerID,:groupID,:nextPermissions,:currentPermissions,:basePermissions,:everyonePermissions,:groupPermissions,:flags)";
|
:lastOwnerID,:groupID,:nextPermissions,:currentPermissions,:basePermissions,:everyonePermissions,:groupPermissions,:flags)";
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
TerrainData terrData = null;
|
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; ";
|
where ""RegionUUID"" = :RegionUUID order by ""Revision"" desc limit 1; ";
|
||||||
|
|
||||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
||||||
|
@ -577,7 +577,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
TerrainData terrData = null;
|
TerrainData terrData = null;
|
||||||
|
|
||||||
string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from bakedterrain
|
string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from bakedterrain
|
||||||
where ""RegionUUID"" = :RegionUUID; ";
|
where ""RegionUUID"" = :RegionUUID; ";
|
||||||
|
|
||||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
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 ;";
|
string sql = "DELETE FROM regionenvironment WHERE region_id = :region_id ;";
|
||||||
|
|
||||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
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
|
//This method only updates region settings!!! First call LoadRegionSettings to create new region settings in DB
|
||||||
sql =
|
sql =
|
||||||
@"UPDATE regionsettings SET block_terraform = :block_terraform ,block_fly = :block_fly ,allow_damage = :allow_damage
|
@"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
|
,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
|
,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
|
,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_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
|
,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_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
|
,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
|
,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,
|
,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,
|
""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID,
|
||||||
""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID
|
""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID
|
||||||
WHERE ""regionUUID"" = :regionUUID";
|
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,
|
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,
|
terrain_lower_limit,use_estate_sun,fixed_sun,sun_position,covenant,covenant_datetime,sunvectorx, sunvectory, sunvectorz,
|
||||||
""Sandbox"", loaded_creation_datetime, loaded_creation_id
|
""Sandbox"", loaded_creation_datetime, loaded_creation_id
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
(:regionUUID,:block_terraform,:block_fly,:allow_damage,:restrict_pushing,:allow_land_resell,:allow_land_join_divide,
|
(: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,
|
: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,
|
: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,
|
: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 )";
|
:sunvectorz, :Sandbox, :loaded_creation_datetime, :loaded_creation_id )";
|
||||||
|
|
||||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
||||||
|
@ -1626,7 +1626,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
|
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
|
||||||
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
|
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
|
||||||
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
|
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
|
||||||
|
|
||||||
newData.SeeAVs = Convert.ToBoolean(row["SeeAVs"]);
|
newData.SeeAVs = Convert.ToBoolean(row["SeeAVs"]);
|
||||||
newData.AnyAVSounds = Convert.ToBoolean(row["AnyAVSounds"]);
|
newData.AnyAVSounds = Convert.ToBoolean(row["AnyAVSounds"]);
|
||||||
newData.GroupAVSounds = Convert.ToBoolean(row["GroupAVSounds"]);
|
newData.GroupAVSounds = Convert.ToBoolean(row["GroupAVSounds"]);
|
||||||
|
@ -1789,7 +1789,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "")
|
if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "")
|
||||||
prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
|
prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
|
||||||
else
|
else
|
||||||
prim.DynAttrs = new DAMap();
|
prim.DynAttrs = new DAMap();
|
||||||
|
|
||||||
prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]);
|
prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]);
|
||||||
prim.Density = Convert.ToSingle(primRow["Density"]);
|
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("CollisionSound", prim.CollisionSound));
|
||||||
parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
|
parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
|
||||||
|
|
||||||
parameters.Add(_Database.CreateParameter("PassTouches", prim.PassTouches));
|
parameters.Add(_Database.CreateParameter("PassTouches", prim.PassTouches));
|
||||||
|
|
||||||
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
|
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
|
||||||
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
|
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
|
||||||
|
|
||||||
if (prim.DynAttrs.CountNamespaces > 0)
|
if (prim.DynAttrs.CountNamespaces > 0)
|
||||||
parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
|
parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
|
||||||
else
|
else
|
||||||
parameters.Add(_Database.CreateParameter("DynAttrs", null));
|
parameters.Add(_Database.CreateParameter("DynAttrs", null));
|
||||||
|
|
||||||
parameters.Add(_Database.CreateParameter("PhysicsShapeType", prim.PhysicsShapeType));
|
parameters.Add(_Database.CreateParameter("PhysicsShapeType", prim.PhysicsShapeType));
|
||||||
parameters.Add(_Database.CreateParameter("Density", (double)prim.Density));
|
parameters.Add(_Database.CreateParameter("Density", (double)prim.Density));
|
||||||
parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier));
|
parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier));
|
||||||
|
|
|
@ -42,13 +42,13 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
|
||||||
public PGSQLUserAccountData(string connectionString, string realm) :
|
public PGSQLUserAccountData(string connectionString, string realm) :
|
||||||
base(connectionString, realm, "UserAccount")
|
base(connectionString, realm, "UserAccount")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
private string m_Realm;
|
private string m_Realm;
|
||||||
private List<string> m_ColumnNames = null;
|
private List<string> m_ColumnNames = null;
|
||||||
private PGSQLManager m_database;
|
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("principalID", principalID));
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
|
||||||
|
|
||||||
conn.Open();
|
conn.Open();
|
||||||
using (NpgsqlDataReader result = cmd.ExecuteReader())
|
using (NpgsqlDataReader result = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
|
@ -158,8 +158,8 @@ namespace OpenSim.Data.PGSQL
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override bool Store(UserAccountData data)
|
public override bool Store(UserAccountData data)
|
||||||
{
|
{
|
||||||
if (data.Data.ContainsKey("PrincipalID"))
|
if (data.Data.ContainsKey("PrincipalID"))
|
||||||
|
@ -214,7 +214,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
m_log.ErrorFormat("[USER]: ERROR opened update user {0} ", e.Message);
|
m_log.ErrorFormat("[USER]: ERROR opened update user {0} ", e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (conta < 1)
|
if (conta < 1)
|
||||||
{
|
{
|
||||||
|
@ -242,14 +242,14 @@ namespace OpenSim.Data.PGSQL
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool Store(UserAccountData data, UUID principalID, string token)
|
public bool Store(UserAccountData data, UUID principalID, string token)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool SetDataItem(UUID principalID, string item, string value)
|
public bool SetDataItem(UUID principalID, string item, string value)
|
||||||
{
|
{
|
||||||
string sql = string.Format(@"update {0} set {1} = :{1} where ""UUID"" = :UUID", m_Realm, item);
|
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 = "";
|
string sql = "";
|
||||||
UUID scope_id;
|
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 (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
||||||
|
|
|
@ -412,15 +412,15 @@ namespace OpenSim.Data.PGSQL
|
||||||
query = @"WITH upsert AS (
|
query = @"WITH upsert AS (
|
||||||
UPDATE userpicks SET
|
UPDATE userpicks SET
|
||||||
pickuuid = :PickId, creatoruuid = :CreatorId, toppick = :TopPick, parceluuid = :ParcelId,
|
pickuuid = :PickId, creatoruuid = :CreatorId, toppick = :TopPick, parceluuid = :ParcelId,
|
||||||
name = :Name, description = :Desc, snapshotuuid = :SnapshotId, ""user"" = :User,
|
name = :Name, description = :Desc, snapshotuuid = :SnapshotId, ""user"" = :User,
|
||||||
originalname = :Original, simname = :SimName, posglobal = :GlobalPos,
|
originalname = :Original, simname = :SimName, posglobal = :GlobalPos,
|
||||||
sortorder = :SortOrder, enabled = :Enabled
|
sortorder = :SortOrder, enabled = :Enabled
|
||||||
RETURNING * )
|
RETURNING * )
|
||||||
INSERT INTO userpicks (pickuuid,creatoruuid,toppick,parceluuid,name,description,
|
INSERT INTO userpicks (pickuuid,creatoruuid,toppick,parceluuid,name,description,
|
||||||
snapshotuuid,""user"",originalname,simname,posglobal,sortorder,enabled)
|
snapshotuuid,""user"",originalname,simname,posglobal,sortorder,enabled)
|
||||||
SELECT
|
SELECT
|
||||||
:PickId,:CreatorId,:TopPick,:ParcelId,:Name,:Desc,:SnapshotId,:User,
|
:PickId,:CreatorId,:TopPick,:ParcelId,:Name,:Desc,:SnapshotId,:User,
|
||||||
:Original,:SimName,:GlobalPos,:SortOrder,:Enabled
|
:Original,:SimName,:GlobalPos,:SortOrder,:Enabled
|
||||||
WHERE NOT EXISTS (
|
WHERE NOT EXISTS (
|
||||||
SELECT * FROM upsert )";
|
SELECT * FROM upsert )";
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
|
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand(
|
using (NpgsqlCommand cmd = new NpgsqlCommand(
|
||||||
@"SELECT name, description, access_time, ""AssetType"", local, temporary, asset_flags, creatorid, data
|
@"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",
|
JOIN XAssetsData ON XAssetsMeta.hash = XAssetsData.Hash WHERE id=:ID",
|
||||||
dbcon))
|
dbcon))
|
||||||
{
|
{
|
||||||
|
@ -179,7 +179,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
|
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
|
||||||
// int compressedLength = asset.Data.Length;
|
// int compressedLength = asset.Data.Length;
|
||||||
asset.Data = outputStream.ToArray();
|
asset.Data = outputStream.ToArray();
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||||
|
@ -223,16 +223,16 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
assetName = asset.Name.Substring(0, 64);
|
assetName = asset.Name.Substring(0, 64);
|
||||||
m_log.WarnFormat(
|
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);
|
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
string assetDescription = asset.Description;
|
string assetDescription = asset.Description;
|
||||||
if (asset.Description.Length > 64)
|
if (asset.Description.Length > 64)
|
||||||
{
|
{
|
||||||
assetDescription = asset.Description.Substring(0, 64);
|
assetDescription = asset.Description.Substring(0, 64);
|
||||||
m_log.WarnFormat(
|
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);
|
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);
|
where not exists( Select id from XAssetsMeta where id = :ID);
|
||||||
|
|
||||||
update XAssetsMeta
|
update XAssetsMeta
|
||||||
set id = :ID, hash = :Hash, name = :Name, description = :Description,
|
set id = :ID, hash = :Hash, name = :Name, description = :Description,
|
||||||
""AssetType"" = :AssetType, local = :Local, temporary = :Temporary, create_time = :CreateTime,
|
""AssetType"" = :AssetType, local = :Local, temporary = :Temporary, create_time = :CreateTime,
|
||||||
access_time = :AccessTime, asset_flags = :AssetFlags, creatorid = :CreatorID
|
access_time = :AccessTime, asset_flags = :AssetFlags, creatorid = :CreatorID
|
||||||
where id = :ID;
|
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}",
|
m_log.ErrorFormat("[XASSET DB]: PGSQL failure creating asset data {0} with name \"{1}\". Error: {2}",
|
||||||
asset.FullID, asset.Name, e.Message);
|
asset.FullID, asset.Name, e.Message);
|
||||||
|
|
||||||
transaction.Rollback();
|
transaction.Rollback();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
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);
|
assetMetadata.ID, assetMetadata.Name, e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
using(NpgsqlCommand cmd = new NpgsqlCommand(@"SELECT name, description, access_time, ""AssetType"", temporary, id, asset_flags, creatorid
|
using(NpgsqlCommand cmd = new NpgsqlCommand(@"SELECT name, description, access_time, ""AssetType"", temporary, id, asset_flags, creatorid
|
||||||
FROM XAssetsMeta
|
FROM XAssetsMeta
|
||||||
LIMIT :start, :count",dbcon))
|
LIMIT :start, :count",dbcon))
|
||||||
{
|
{
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("start",start));
|
cmd.Parameters.Add(m_database.CreateParameter("start",start));
|
||||||
|
|
|
@ -197,16 +197,16 @@ namespace OpenSim.Data.PGSQL
|
||||||
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
using (NpgsqlCommand cmd = new NpgsqlCommand())
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
|
cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
|
||||||
from inventoryitems
|
from inventoryitems
|
||||||
where ""avatarID"" = :PrincipalID
|
where ""avatarID"" = :PrincipalID
|
||||||
and ""assetID"" = :AssetID
|
and ""assetID"" = :AssetID
|
||||||
group by ""assetID"" ", m_Realm);
|
group by ""assetID"" ", m_Realm);
|
||||||
*/
|
*/
|
||||||
cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
|
cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
|
||||||
from inventoryitems
|
from inventoryitems
|
||||||
where ""avatarID""::uuid = :PrincipalID
|
where ""avatarID""::uuid = :PrincipalID
|
||||||
and ""assetID"" = :AssetID
|
and ""assetID"" = :AssetID
|
||||||
group by ""assetID"" ");
|
group by ""assetID"" ");
|
||||||
|
|
||||||
cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID));
|
cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID));
|
||||||
|
|
|
@ -138,7 +138,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
|
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
|
||||||
m_log.WarnFormat(
|
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);
|
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);
|
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
|
||||||
m_log.WarnFormat(
|
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);
|
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace OpenSim.Data.SQLite
|
||||||
public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData
|
public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private string m_Realm;
|
private string m_Realm;
|
||||||
private List<string> m_ColumnNames;
|
private List<string> m_ColumnNames;
|
||||||
private int m_LastExpire;
|
private int m_LastExpire;
|
||||||
|
@ -223,7 +223,7 @@ namespace OpenSim.Data.SQLite
|
||||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||||
DoExpire();
|
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'))"))
|
"', '" + token + "', datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes'))"))
|
||||||
{
|
{
|
||||||
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
||||||
|
@ -238,7 +238,7 @@ namespace OpenSim.Data.SQLite
|
||||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||||
DoExpire();
|
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')"))
|
" minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')"))
|
||||||
{
|
{
|
||||||
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace OpenSim.Data.SQLite
|
||||||
IDataReader r = null;
|
IDataReader r = null;
|
||||||
|
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
names.Remove("EstateID");
|
names.Remove("EstateID");
|
||||||
|
|
||||||
string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
|
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);
|
return DoLoad(cmd, UUID.Zero, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EstateSettings> LoadEstateSettingsAll()
|
public List<EstateSettings> LoadEstateSettingsAll()
|
||||||
{
|
{
|
||||||
List<EstateSettings> estateSettings = new List<EstateSettings>();
|
List<EstateSettings> estateSettings = new List<EstateSettings>();
|
||||||
|
|
||||||
List<int> estateIds = GetEstatesAll();
|
List<int> estateIds = GetEstatesAll();
|
||||||
foreach (int estateId in estateIds)
|
foreach (int estateId in estateIds)
|
||||||
estateSettings.Add(LoadEstateSettings(estateId));
|
estateSettings.Add(LoadEstateSettings(estateId));
|
||||||
|
|
||||||
return estateSettings;
|
return estateSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<int> GetEstatesAll()
|
public List<int> GetEstatesAll()
|
||||||
{
|
{
|
||||||
List<int> result = new List<int>();
|
List<int> result = new List<int>();
|
||||||
|
@ -442,7 +442,7 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
r.Close();
|
r.Close();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<int> GetEstatesByOwner(UUID ownerID)
|
public List<int> GetEstatesByOwner(UUID ownerID)
|
||||||
|
|
|
@ -189,7 +189,7 @@ namespace OpenSim.Data.SQLite
|
||||||
m_Fields[name].SetValue(row, reader[name]);
|
m_Fields[name].SetValue(row, reader[name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_DataField != null)
|
if (m_DataField != null)
|
||||||
{
|
{
|
||||||
Dictionary<string, string> data =
|
Dictionary<string, string> data =
|
||||||
|
@ -268,7 +268,7 @@ namespace OpenSim.Data.SQLite
|
||||||
public virtual bool Delete(string field, string key)
|
public virtual bool Delete(string field, string key)
|
||||||
{
|
{
|
||||||
return Delete(new string[] { field }, new string[] { key });
|
return Delete(new string[] { field }, new string[] { key });
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool Delete(string[] fields, string[] keys)
|
public virtual bool Delete(string[] fields, string[] keys)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// 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") {}
|
: base(connectionString, realm, "GridUserStore") {}
|
||||||
|
|
||||||
public new GridUserData Get(string userID)
|
public new GridUserData Get(string userID)
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// 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") {}
|
: base(connectionString, realm, "HGTravelStore") {}
|
||||||
|
|
||||||
public HGTravelingData Get(UUID sessionID)
|
public HGTravelingData Get(UUID sessionID)
|
||||||
|
|
|
@ -707,7 +707,7 @@ namespace OpenSim.Data.SQLite
|
||||||
DataRow[] primsForRegion = prims.Select(byRegion);
|
DataRow[] primsForRegion = prims.Select(byRegion);
|
||||||
// m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
|
// 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)
|
foreach (DataRow primRow in primsForRegion)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -733,12 +733,12 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneObjectGroup group = new SceneObjectGroup(prim);
|
SceneObjectGroup group = new SceneObjectGroup(prim);
|
||||||
|
|
||||||
createdObjects.Add(group.UUID, group);
|
createdObjects.Add(group.UUID, group);
|
||||||
retvals.Add(group);
|
retvals.Add(group);
|
||||||
LoadItems(prim);
|
LoadItems(prim);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -1298,7 +1298,7 @@ namespace OpenSim.Data.SQLite
|
||||||
createCol(prims, "VolumeDetect", typeof(Int16));
|
createCol(prims, "VolumeDetect", typeof(Int16));
|
||||||
|
|
||||||
createCol(prims, "MediaURL", typeof(String));
|
createCol(prims, "MediaURL", typeof(String));
|
||||||
|
|
||||||
createCol(prims, "AttachedPosX", typeof(Double));
|
createCol(prims, "AttachedPosX", typeof(Double));
|
||||||
createCol(prims, "AttachedPosY", typeof(Double));
|
createCol(prims, "AttachedPosY", typeof(Double));
|
||||||
createCol(prims, "AttachedPosZ", 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());
|
// m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
|
||||||
prim.MediaUrl = (string)row["MediaURL"];
|
prim.MediaUrl = (string)row["MediaURL"];
|
||||||
}
|
}
|
||||||
|
|
||||||
prim.AttachedPos = new Vector3(
|
prim.AttachedPos = new Vector3(
|
||||||
Convert.ToSingle(row["AttachedPosX"]),
|
Convert.ToSingle(row["AttachedPosX"]),
|
||||||
Convert.ToSingle(row["AttachedPosY"]),
|
Convert.ToSingle(row["AttachedPosY"]),
|
||||||
|
@ -1806,7 +1806,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType());
|
//m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType());
|
||||||
prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
|
prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
prim.DynAttrs = new DAMap();
|
prim.DynAttrs = new DAMap();
|
||||||
|
@ -1818,7 +1818,7 @@ namespace OpenSim.Data.SQLite
|
||||||
prim.Friction = Convert.ToSingle(row["Friction"]);
|
prim.Friction = Convert.ToSingle(row["Friction"]);
|
||||||
prim.Restitution = Convert.ToSingle(row["Restitution"]);
|
prim.Restitution = Convert.ToSingle(row["Restitution"]);
|
||||||
|
|
||||||
|
|
||||||
if (!(row["KeyframeMotion"] is DBNull))
|
if (!(row["KeyframeMotion"] is DBNull))
|
||||||
{
|
{
|
||||||
Byte[] data = (byte[])row["KeyframeMotion"];
|
Byte[] data = (byte[])row["KeyframeMotion"];
|
||||||
|
@ -2532,7 +2532,7 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
if (!(row["Media"] is System.DBNull))
|
if (!(row["Media"] is System.DBNull))
|
||||||
s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
|
s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
else
|
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]);
|
m_Realm, scopeID.ToString(), words[0], words[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,43 +46,43 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private SqliteConnection m_connection;
|
private SqliteConnection m_connection;
|
||||||
private string m_connectionString;
|
private string m_connectionString;
|
||||||
|
|
||||||
private Dictionary<string, FieldInfo> m_FieldMap =
|
private Dictionary<string, FieldInfo> m_FieldMap =
|
||||||
new Dictionary<string, FieldInfo>();
|
new Dictionary<string, FieldInfo>();
|
||||||
|
|
||||||
protected virtual Assembly Assembly
|
protected virtual Assembly Assembly
|
||||||
{
|
{
|
||||||
get { return GetType().Assembly; }
|
get { return GetType().Assembly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public SQLiteUserProfilesData()
|
public SQLiteUserProfilesData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public SQLiteUserProfilesData(string connectionString)
|
public SQLiteUserProfilesData(string connectionString)
|
||||||
{
|
{
|
||||||
Initialise(connectionString);
|
Initialise(connectionString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(string connectionString)
|
public void Initialise(string connectionString)
|
||||||
{
|
{
|
||||||
if (Util.IsWindows())
|
if (Util.IsWindows())
|
||||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
m_connectionString = connectionString;
|
m_connectionString = connectionString;
|
||||||
|
|
||||||
m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString);
|
m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString);
|
||||||
|
|
||||||
m_connection = new SqliteConnection(m_connectionString);
|
m_connection = new SqliteConnection(m_connectionString);
|
||||||
m_connection.Open();
|
m_connection.Open();
|
||||||
|
|
||||||
Migration m = new Migration(m_connection, Assembly, "UserProfiles");
|
Migration m = new Migration(m_connection, Assembly, "UserProfiles");
|
||||||
m.Update();
|
m.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string[] FieldList
|
private string[] FieldList
|
||||||
{
|
{
|
||||||
get { return new List<string>(m_FieldMap.Keys).ToArray(); }
|
get { return new List<string>(m_FieldMap.Keys).ToArray(); }
|
||||||
|
@ -123,7 +123,7 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.Close();
|
reader.Close();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
|
public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
|
||||||
|
@ -162,21 +162,21 @@ namespace OpenSim.Data.SQLite
|
||||||
query += ":ParcelName,";
|
query += ":ParcelName,";
|
||||||
query += ":Flags,";
|
query += ":Flags,";
|
||||||
query += ":ListingPrice ) ";
|
query += ":ListingPrice ) ";
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(ad.ParcelName))
|
if(string.IsNullOrEmpty(ad.ParcelName))
|
||||||
ad.ParcelName = "Unknown";
|
ad.ParcelName = "Unknown";
|
||||||
if(ad.ParcelId == null)
|
if(ad.ParcelId == null)
|
||||||
ad.ParcelId = UUID.Zero;
|
ad.ParcelId = UUID.Zero;
|
||||||
if(string.IsNullOrEmpty(ad.Description))
|
if(string.IsNullOrEmpty(ad.Description))
|
||||||
ad.Description = "No Description";
|
ad.Description = "No Description";
|
||||||
|
|
||||||
DateTime epoch = new DateTime(1970, 1, 1);
|
DateTime epoch = new DateTime(1970, 1, 1);
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = DateTime.Now;
|
||||||
TimeSpan epochnow = now - epoch;
|
TimeSpan epochnow = now - epoch;
|
||||||
TimeSpan duration;
|
TimeSpan duration;
|
||||||
DateTime expiration;
|
DateTime expiration;
|
||||||
TimeSpan epochexp;
|
TimeSpan epochexp;
|
||||||
|
|
||||||
if(ad.Flags == 2)
|
if(ad.Flags == 2)
|
||||||
{
|
{
|
||||||
duration = new TimeSpan(7,0,0,0);
|
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(":ParcelName", ad.ParcelName.ToString());
|
||||||
cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString());
|
cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString());
|
||||||
cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ());
|
cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,17 +227,17 @@ namespace OpenSim.Data.SQLite
|
||||||
public bool DeleteClassifiedRecord(UUID recordId)
|
public bool DeleteClassifiedRecord(UUID recordId)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "DELETE FROM classifieds WHERE ";
|
query += "DELETE FROM classifieds WHERE ";
|
||||||
query += "classifieduuid = :ClasifiedId";
|
query += "classifieduuid = :ClasifiedId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString());
|
cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,17 +254,17 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT * FROM classifieds WHERE ";
|
query += "SELECT * FROM classifieds WHERE ";
|
||||||
query += "classifieduuid = :AdId";
|
query += "classifieduuid = :AdId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString());
|
cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader())
|
using (reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
if(reader.Read ())
|
if(reader.Read ())
|
||||||
|
@ -299,24 +299,24 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
|
query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
|
||||||
query += "creatoruuid = :Id";
|
query += "creatoruuid = :Id";
|
||||||
OSDArray data = new OSDArray();
|
OSDArray data = new OSDArray();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader())
|
using (reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
OSDMap record = new OSDMap();
|
OSDMap record = new OSDMap();
|
||||||
|
|
||||||
record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"]));
|
record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"]));
|
||||||
record.Add("name",OSD.FromString((string)reader["name"]));
|
record.Add("name",OSD.FromString((string)reader["name"]));
|
||||||
data.Add(record);
|
data.Add(record);
|
||||||
|
@ -336,11 +336,11 @@ namespace OpenSim.Data.SQLite
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
UserProfilePick pick = new UserProfilePick();
|
UserProfilePick pick = new UserProfilePick();
|
||||||
|
|
||||||
query += "SELECT * FROM userpicks WHERE ";
|
query += "SELECT * FROM userpicks WHERE ";
|
||||||
query += "creatoruuid = :CreatorId AND ";
|
query += "creatoruuid = :CreatorId AND ";
|
||||||
query += "pickuuid = :PickId";
|
query += "pickuuid = :PickId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -348,17 +348,17 @@ namespace OpenSim.Data.SQLite
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString());
|
cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString());
|
||||||
cmd.Parameters.AddWithValue(":PickId", pickId.ToString());
|
cmd.Parameters.AddWithValue(":PickId", pickId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader())
|
using (reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
|
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
string description = (string)reader["description"];
|
string description = (string)reader["description"];
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(description))
|
if (string.IsNullOrEmpty(description))
|
||||||
description = "No description given.";
|
description = "No description given.";
|
||||||
|
|
||||||
UUID.TryParse((string)reader["pickuuid"], out pick.PickId);
|
UUID.TryParse((string)reader["pickuuid"], out pick.PickId);
|
||||||
UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId);
|
UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId);
|
||||||
UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId);
|
UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId);
|
||||||
|
@ -385,7 +385,7 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdatePicksRecord(UserProfilePick pick)
|
public bool UpdatePicksRecord(UserProfilePick pick)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "INSERT OR REPLACE INTO userpicks (";
|
query += "INSERT OR REPLACE INTO userpicks (";
|
||||||
|
@ -416,7 +416,7 @@ namespace OpenSim.Data.SQLite
|
||||||
query += ":GlobalPos,";
|
query += ":GlobalPos,";
|
||||||
query += ":SortOrder,";
|
query += ":SortOrder,";
|
||||||
query += ":Enabled) ";
|
query += ":Enabled) ";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -456,10 +456,10 @@ namespace OpenSim.Data.SQLite
|
||||||
public bool DeletePicksRecord(UUID pickId)
|
public bool DeletePicksRecord(UUID pickId)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "DELETE FROM userpicks WHERE ";
|
query += "DELETE FROM userpicks WHERE ";
|
||||||
query += "pickuuid = :PickId";
|
query += "pickuuid = :PickId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -479,15 +479,15 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetAvatarNotes(ref UserProfileNotes notes)
|
public bool GetAvatarNotes(ref UserProfileNotes notes)
|
||||||
{
|
{
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT `notes` FROM usernotes WHERE ";
|
query += "SELECT `notes` FROM usernotes WHERE ";
|
||||||
query += "useruuid = :Id AND ";
|
query += "useruuid = :Id AND ";
|
||||||
query += "targetuuid = :TargetId";
|
query += "targetuuid = :TargetId";
|
||||||
OSDArray data = new OSDArray();
|
OSDArray data = new OSDArray();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -495,7 +495,7 @@ namespace OpenSim.Data.SQLite
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString());
|
cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString());
|
||||||
cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString());
|
cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
|
@ -514,10 +514,10 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
|
public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
bool remove;
|
bool remove;
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(note.Notes))
|
if(string.IsNullOrEmpty(note.Notes))
|
||||||
{
|
{
|
||||||
remove = true;
|
remove = true;
|
||||||
|
@ -533,7 +533,7 @@ namespace OpenSim.Data.SQLite
|
||||||
query += ":TargetId,";
|
query += ":TargetId,";
|
||||||
query += ":Notes )";
|
query += ":Notes )";
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -544,7 +544,7 @@ namespace OpenSim.Data.SQLite
|
||||||
cmd.Parameters.AddWithValue(":Notes", note.Notes);
|
cmd.Parameters.AddWithValue(":Notes", note.Notes);
|
||||||
cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ());
|
cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ());
|
||||||
cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString());
|
cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -561,7 +561,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT * FROM userprofile WHERE ";
|
query += "SELECT * FROM userprofile WHERE ";
|
||||||
query += "useruuid = :Id";
|
query += "useruuid = :Id";
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
|
cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -611,7 +611,7 @@ namespace OpenSim.Data.SQLite
|
||||||
props.Language = string.Empty;
|
props.Language = string.Empty;
|
||||||
props.PublishProfile = false;
|
props.PublishProfile = false;
|
||||||
props.PublishMature = false;
|
props.PublishMature = false;
|
||||||
|
|
||||||
query = "INSERT INTO userprofile (";
|
query = "INSERT INTO userprofile (";
|
||||||
query += "useruuid, ";
|
query += "useruuid, ";
|
||||||
query += "profilePartner, ";
|
query += "profilePartner, ";
|
||||||
|
@ -659,7 +659,7 @@ namespace OpenSim.Data.SQLite
|
||||||
put.Parameters.AddWithValue(":profileAboutText", props.AboutText);
|
put.Parameters.AddWithValue(":profileAboutText", props.AboutText);
|
||||||
put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString());
|
put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString());
|
||||||
put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText);
|
put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText);
|
||||||
|
|
||||||
put.ExecuteNonQuery();
|
put.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -668,9 +668,9 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
|
public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE userprofile SET ";
|
query += "UPDATE userprofile SET ";
|
||||||
query += "profileURL=:profileURL, ";
|
query += "profileURL=:profileURL, ";
|
||||||
query += "profileImage=:image, ";
|
query += "profileImage=:image, ";
|
||||||
|
@ -678,7 +678,7 @@ namespace OpenSim.Data.SQLite
|
||||||
query += "profileFirstImage=:firstlifeimage,";
|
query += "profileFirstImage=:firstlifeimage,";
|
||||||
query += "profileFirstText=:firstlifetext ";
|
query += "profileFirstText=:firstlifetext ";
|
||||||
query += "WHERE useruuid=:uuid";
|
query += "WHERE useruuid=:uuid";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
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(":firstlifeimage", props.FirstLifeImageId.ToString());
|
||||||
cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText);
|
cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText);
|
||||||
cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString());
|
cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -698,16 +698,16 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[PROFILES_DATA]" +
|
m_log.ErrorFormat("[PROFILES_DATA]" +
|
||||||
": AgentPropertiesUpdate exception {0}", e.Message);
|
": AgentPropertiesUpdate exception {0}", e.Message);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
|
public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE userprofile SET ";
|
query += "UPDATE userprofile SET ";
|
||||||
query += "profileWantToMask=:WantMask, ";
|
query += "profileWantToMask=:WantMask, ";
|
||||||
query += "profileWantToText=:WantText,";
|
query += "profileWantToText=:WantText,";
|
||||||
|
@ -715,7 +715,7 @@ namespace OpenSim.Data.SQLite
|
||||||
query += "profileSkillsText=:SkillsText, ";
|
query += "profileSkillsText=:SkillsText, ";
|
||||||
query += "profileLanguages=:Languages ";
|
query += "profileLanguages=:Languages ";
|
||||||
query += "WHERE useruuid=:uuid";
|
query += "WHERE useruuid=:uuid";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -727,7 +727,7 @@ namespace OpenSim.Data.SQLite
|
||||||
cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText);
|
cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText);
|
||||||
cmd.Parameters.AddWithValue(":Languages", up.Language);
|
cmd.Parameters.AddWithValue(":Languages", up.Language);
|
||||||
cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString());
|
cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -741,17 +741,17 @@ namespace OpenSim.Data.SQLite
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool UpdateUserPreferences(ref UserPreferences pref, ref string result)
|
public bool UpdateUserPreferences(ref UserPreferences pref, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE usersettings SET ";
|
query += "UPDATE usersettings SET ";
|
||||||
query += "imviaemail=:ImViaEmail, ";
|
query += "imviaemail=:ImViaEmail, ";
|
||||||
query += "visible=:Visible, ";
|
query += "visible=:Visible, ";
|
||||||
query += "email=:EMail ";
|
query += "email=:EMail ";
|
||||||
query += "WHERE useruuid=:uuid";
|
query += "WHERE useruuid=:uuid";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -761,7 +761,7 @@ namespace OpenSim.Data.SQLite
|
||||||
cmd.Parameters.AddWithValue(":Visible", pref.Visible);
|
cmd.Parameters.AddWithValue(":Visible", pref.Visible);
|
||||||
cmd.Parameters.AddWithValue(":EMail", pref.EMail);
|
cmd.Parameters.AddWithValue(":EMail", pref.EMail);
|
||||||
cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString());
|
cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString());
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -779,20 +779,20 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT imviaemail,visible,email FROM ";
|
query += "SELECT imviaemail,visible,email FROM ";
|
||||||
query += "usersettings WHERE ";
|
query += "usersettings WHERE ";
|
||||||
query += "useruuid = :Id";
|
query += "useruuid = :Id";
|
||||||
|
|
||||||
OSDArray data = new OSDArray();
|
OSDArray data = new OSDArray();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString());
|
cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.Read())
|
if(reader.Read())
|
||||||
|
@ -805,13 +805,13 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
query = "INSERT INTO usersettings VALUES ";
|
query = "INSERT INTO usersettings VALUES ";
|
||||||
query += "(:Id,'false','false', :Email)";
|
query += "(:Id,'false','false', :Email)";
|
||||||
|
|
||||||
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
put.Parameters.AddWithValue(":Id", pref.UserId.ToString());
|
put.Parameters.AddWithValue(":Id", pref.UserId.ToString());
|
||||||
put.Parameters.AddWithValue(":Email", pref.EMail);
|
put.Parameters.AddWithValue(":Email", pref.EMail);
|
||||||
put.ExecuteNonQuery();
|
put.ExecuteNonQuery();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -831,11 +831,11 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "SELECT * FROM `userdata` WHERE ";
|
query += "SELECT * FROM `userdata` WHERE ";
|
||||||
query += "UserId = :Id AND ";
|
query += "UserId = :Id AND ";
|
||||||
query += "TagId = :TagId";
|
query += "TagId = :TagId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -843,7 +843,7 @@ namespace OpenSim.Data.SQLite
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
|
cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
|
||||||
cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString());
|
cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.Read())
|
if(reader.Read())
|
||||||
|
@ -858,7 +858,7 @@ namespace OpenSim.Data.SQLite
|
||||||
query += ":TagId,";
|
query += ":TagId,";
|
||||||
query += ":DataKey,";
|
query += ":DataKey,";
|
||||||
query += ":DataVal) ";
|
query += ":DataVal) ";
|
||||||
|
|
||||||
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
put.Parameters.AddWithValue(":Id", props.UserId.ToString());
|
put.Parameters.AddWithValue(":Id", props.UserId.ToString());
|
||||||
|
@ -882,16 +882,16 @@ namespace OpenSim.Data.SQLite
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public bool SetUserAppData(UserAppData props, ref string result)
|
public bool SetUserAppData(UserAppData props, ref string result)
|
||||||
{
|
{
|
||||||
string query = string.Empty;
|
string query = string.Empty;
|
||||||
|
|
||||||
query += "UPDATE userdata SET ";
|
query += "UPDATE userdata SET ";
|
||||||
query += "TagId = :TagId, ";
|
query += "TagId = :TagId, ";
|
||||||
query += "DataKey = :DataKey, ";
|
query += "DataKey = :DataKey, ";
|
||||||
query += "DataVal = :DataVal WHERE ";
|
query += "DataVal = :DataVal WHERE ";
|
||||||
query += "UserId = :UserId AND ";
|
query += "UserId = :UserId AND ";
|
||||||
query += "TagId = :TagId";
|
query += "TagId = :TagId";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
|
@ -918,17 +918,17 @@ namespace OpenSim.Data.SQLite
|
||||||
IDataReader reader = null;
|
IDataReader reader = null;
|
||||||
OSDArray data = new OSDArray();
|
OSDArray data = new OSDArray();
|
||||||
string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id";
|
string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id";
|
||||||
|
|
||||||
// Get classified image assets
|
// Get classified image assets
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
while(reader.Read())
|
while(reader.Read())
|
||||||
|
@ -942,7 +942,7 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.Read())
|
if(reader.Read())
|
||||||
|
@ -951,14 +951,14 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id";
|
query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id";
|
||||||
|
|
||||||
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
|
||||||
|
|
||||||
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if(reader.Read())
|
if(reader.Read())
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue