Revert "Thank you, mcortez, for a patch to address showing users in group list"
This reverts commit 69ef95693a
.
remotes/origin/0.6.7-post-fixes
parent
70358ddb8d
commit
0cb012aae5
|
@ -281,10 +281,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
//GroupMembershipData[] avatarGroups = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(remoteClient), avatarID).ToArray();
|
||||
GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID);
|
||||
GroupMembershipData[] avatarGroups = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(remoteClient), avatarID).ToArray();
|
||||
remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups);
|
||||
}
|
||||
|
||||
|
@ -488,7 +485,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
bucket[18] = 0; //dunno
|
||||
}
|
||||
|
||||
|
||||
m_groupData.AddGroupNotice(GetClientGroupRequestID(remoteClient), GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket);
|
||||
if (OnNewGroupNotice != null)
|
||||
{
|
||||
|
@ -498,20 +494,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
// Send notice out to everyone that wants notices
|
||||
foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetClientGroupRequestID(remoteClient), GroupID))
|
||||
{
|
||||
if (m_debugEnabled)
|
||||
{
|
||||
UserProfileData targetUserProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(member.AgentID);
|
||||
if (targetUserProfile != null)
|
||||
{
|
||||
m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUserProfile.Name, member.AcceptNotices);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, member.AgentID, member.AcceptNotices);
|
||||
}
|
||||
}
|
||||
|
||||
if (member.AcceptNotices)
|
||||
if (member.AcceptNotices)
|
||||
{
|
||||
// Build notice IIM
|
||||
GridInstantMessage msg = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice);
|
||||
|
@ -631,6 +614,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
List<GroupMembersData> data = m_groupData.GetGroupMembers(GetClientGroupRequestID(remoteClient), groupID);
|
||||
if (m_debugEnabled)
|
||||
{
|
||||
foreach (GroupMembersData member in data)
|
||||
{
|
||||
m_log.DebugFormat("[GROUPS]: {0} {1}", member.AgentID, member.Title);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
|
@ -642,6 +632,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID);
|
||||
|
||||
if (m_debugEnabled)
|
||||
{
|
||||
foreach (GroupRolesData member in data)
|
||||
{
|
||||
m_log.DebugFormat("[GROUPS]: {0} {1}", member.Title, member.Members);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
@ -652,6 +650,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID);
|
||||
|
||||
if (m_debugEnabled)
|
||||
{
|
||||
foreach (GroupRoleMembersData member in data)
|
||||
{
|
||||
m_log.DebugFormat("[GROUPS]: Av: {0} Role: {1}", member.MemberID, member.RoleID);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
|
||||
|
@ -802,7 +808,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
// Security Checks are handled in the Groups Service.
|
||||
// TODO: Security Checks?
|
||||
|
||||
GroupRequestID grID = GetClientGroupRequestID(remoteClient);
|
||||
|
||||
|
@ -819,11 +825,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
case OpenMetaverse.GroupRoleUpdate.UpdateAll:
|
||||
case OpenMetaverse.GroupRoleUpdate.UpdateData:
|
||||
case OpenMetaverse.GroupRoleUpdate.UpdatePowers:
|
||||
if (m_debugEnabled)
|
||||
{
|
||||
GroupPowers gp = (GroupPowers)powers;
|
||||
m_log.DebugFormat("[GROUPS]: Role ({0}) updated with Powers ({1}) ({2})", name, powers.ToString(), gp.ToString());
|
||||
}
|
||||
m_groupData.UpdateGroupRole(grID, groupID, roleID, name, description, title, powers);
|
||||
break;
|
||||
|
||||
|
@ -1194,16 +1195,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
foreach (GroupMembershipData membership in data)
|
||||
{
|
||||
if (remoteClient.AgentId != dataForAgentID)
|
||||
{
|
||||
if (!membership.ListInProfile)
|
||||
{
|
||||
// If we're sending group info to remoteclient about another agent,
|
||||
// filter out groups the other agent doesn't want to share.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
OSDMap GroupDataMap = new OSDMap(6);
|
||||
OSDMap NewGroupDataMap = new OSDMap(1);
|
||||
|
||||
|
@ -1290,46 +1281,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
// to the core Groups Stub
|
||||
remoteClient.SendGroupMembership(new GroupMembershipData[0]);
|
||||
|
||||
GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, dataForAgentID);
|
||||
SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipArray);
|
||||
remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipArray);
|
||||
GroupMembershipData[] membershipData = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(remoteClient), dataForAgentID).ToArray();
|
||||
|
||||
}
|
||||
SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipData);
|
||||
remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipData);
|
||||
|
||||
/// <summary>
|
||||
/// Get a list of groups memberships for the agent that are marked "ListInProfile"
|
||||
/// </summary>
|
||||
/// <param name="dataForAgentID"></param>
|
||||
/// <returns></returns>
|
||||
private GroupMembershipData[] GetProfileListedGroupMemberships(IClientAPI requestingClient, UUID dataForAgentID)
|
||||
{
|
||||
List<GroupMembershipData> membershipData = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(requestingClient), dataForAgentID);
|
||||
GroupMembershipData[] membershipArray;
|
||||
|
||||
if (requestingClient.AgentId != dataForAgentID)
|
||||
{
|
||||
Predicate<GroupMembershipData> showInProfile = delegate(GroupMembershipData membership)
|
||||
{
|
||||
return membership.ListInProfile;
|
||||
};
|
||||
|
||||
membershipArray = membershipData.FindAll(showInProfile).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
membershipArray = membershipData.ToArray();
|
||||
}
|
||||
|
||||
if (m_debugEnabled)
|
||||
{
|
||||
m_log.InfoFormat("[GROUPS]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId);
|
||||
foreach (GroupMembershipData membership in membershipArray)
|
||||
{
|
||||
m_log.InfoFormat("[GROUPS]: {0} :: {1} - {2}", dataForAgentID, membership.GroupName, membership.GroupTitle);
|
||||
}
|
||||
}
|
||||
|
||||
return membershipArray;
|
||||
}
|
||||
|
||||
private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle)
|
||||
|
|
|
@ -855,8 +855,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
IList parameters = new ArrayList();
|
||||
parameters.Add(param);
|
||||
|
||||
ConfigurableKeepAliveXmlRpcRequest req;
|
||||
req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive);
|
||||
XmlRpcRequest req;
|
||||
if (!m_disableKeepAlive)
|
||||
{
|
||||
req = new XmlRpcRequest(function, parameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
// This seems to solve a major problem on some windows servers
|
||||
req = new NoKeepAliveXmlRpcRequest(function, parameters);
|
||||
}
|
||||
|
||||
XmlRpcResponse resp = null;
|
||||
|
||||
|
@ -866,15 +874,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
|
||||
m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
|
||||
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
|
||||
|
||||
foreach( string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None))
|
||||
{
|
||||
m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine);
|
||||
}
|
||||
|
||||
foreach (string key in param.Keys)
|
||||
{
|
||||
|
@ -959,24 +961,20 @@ namespace Nwc.XmlRpc
|
|||
using System.Reflection;
|
||||
|
||||
/// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
|
||||
public class ConfigurableKeepAliveXmlRpcRequest : XmlRpcRequest
|
||||
public class NoKeepAliveXmlRpcRequest : XmlRpcRequest
|
||||
{
|
||||
private Encoding _encoding = new ASCIIEncoding();
|
||||
private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
|
||||
private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
|
||||
private bool _disableKeepAlive = true;
|
||||
|
||||
public string RequestResponse = String.Empty;
|
||||
|
||||
/// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary>
|
||||
/// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request
|
||||
/// should be directed to.</param>
|
||||
/// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param>
|
||||
public ConfigurableKeepAliveXmlRpcRequest(String methodName, IList parameters, bool disableKeepAlive)
|
||||
public NoKeepAliveXmlRpcRequest(String methodName, IList parameters)
|
||||
{
|
||||
MethodName = methodName;
|
||||
_params = parameters;
|
||||
_disableKeepAlive = disableKeepAlive;
|
||||
}
|
||||
|
||||
/// <summary>Send the request to the server.</summary>
|
||||
|
@ -991,7 +989,7 @@ namespace Nwc.XmlRpc
|
|||
request.Method = "POST";
|
||||
request.ContentType = "text/xml";
|
||||
request.AllowWriteStreamBuffering = true;
|
||||
request.KeepAlive = !_disableKeepAlive;
|
||||
request.KeepAlive = false;
|
||||
|
||||
Stream stream = request.GetRequestStream();
|
||||
XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
|
||||
|
@ -1002,17 +1000,7 @@ namespace Nwc.XmlRpc
|
|||
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||
StreamReader input = new StreamReader(response.GetResponseStream());
|
||||
|
||||
string inputXml = input.ReadToEnd();
|
||||
XmlRpcResponse resp;
|
||||
try
|
||||
{
|
||||
resp = (XmlRpcResponse)_deserializer.Deserialize(inputXml);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
RequestResponse = inputXml;
|
||||
throw e;
|
||||
}
|
||||
XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input);
|
||||
input.Close();
|
||||
response.Close();
|
||||
return resp;
|
||||
|
|
Loading…
Reference in New Issue