more cleanup

0.6.5-rc1
Dr Scofield 2009-04-22 18:00:59 +00:00
parent d2bf957b13
commit d455d579d0
4 changed files with 65 additions and 72 deletions

View File

@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
osGroup.GroupName = "OpenSimulator Testing";
osGroup.GroupPowers =
(uint)(GroupPowers.AllowLandmark |
GroupPowers.AllowSetHome);
GroupPowers.AllowSetHome);
m_GroupMap[opensimulatorGroupID] = osGroup;
}
m_SceneList.Add(scene);
@ -96,8 +96,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClientClosed += OnClientClosed;
scene.EventManager.OnIncomingInstantMessage +=
OnGridInstantMessage;
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
}
public void PostInitialise()
@ -152,7 +151,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
}
private void OnAgentDataUpdateRequest(IClientAPI remoteClient,
UUID AgentID, UUID SessionID)
UUID AgentID, UUID SessionID)
{
UUID ActiveGroupID;
string ActiveGroupName;
@ -168,8 +167,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
ActiveGroupPowers = osGroup.GroupPowers;
remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname,
lastname, ActiveGroupPowers, ActiveGroupName,
ActiveGroupTitle);
lastname, ActiveGroupPowers, ActiveGroupName,
ActiveGroupTitle);
}
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)

View File

@ -52,7 +52,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private string m_serviceURL = string.Empty;
public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | GroupPowers.Accountable | GroupPowers.JoinChat | GroupPowers.AllowVoiceChat | GroupPowers.ReceiveNotices | GroupPowers.StartProposal | GroupPowers.VoteOnProposal;
public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
GroupPowers.Accountable |
GroupPowers.JoinChat |
GroupPowers.AllowVoiceChat |
GroupPowers.ReceiveNotices |
GroupPowers.StartProposal |
GroupPowers.VoteOnProposal;
private bool m_disableKeepAlive = false;
@ -73,7 +79,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
/// <summary>
/// Create a Group, including Everyone and Owners Role, place FounderID in both groups, select Owner as selected role, and newly created group as agent's active role.
/// </summary>
public UUID CreateGroup(string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID)
public UUID CreateGroup(string name, string charter, bool showInList, UUID insigniaID,
int membershipFee, bool openEnrollment, bool allowPublish,
bool maturePublish, UUID founderID)
{
UUID GroupID = UUID.Random();
UUID OwnerRoleID = UUID.Random();
@ -140,9 +148,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
| GroupPowers.VoteOnProposal;
param["OwnersPowers"] = ((ulong)OwnerPowers).ToString();
Hashtable respData = XmlRpcCall("groups.createGroup", param);
if (respData.Contains("error"))
@ -155,7 +160,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return UUID.Parse((string)respData["GroupID"]);
}
public void UpdateGroup(UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish)
public void UpdateGroup(UUID groupID, string charter, bool showInList,
UUID insigniaID, int membershipFee, bool openEnrollment,
bool allowPublish, bool maturePublish)
{
Hashtable param = new Hashtable();
param["GroupID"] = groupID.ToString();
@ -170,7 +177,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
XmlRpcCall("groups.updateGroup", param);
}
public void AddGroupRole(UUID groupID, UUID roleID, string name, string description, string title, ulong powers)
public void AddGroupRole(UUID groupID, UUID roleID, string name, string description,
string title, ulong powers)
{
Hashtable param = new Hashtable();
param["GroupID"] = groupID.ToString();
@ -193,7 +201,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
public void UpdateGroupRole(UUID groupID, UUID roleID, string name, string description, string title, ulong powers)
public void UpdateGroupRole(UUID groupID, UUID roleID, string name, string description,
string title, ulong powers)
{
Hashtable param = new Hashtable();
param["GroupID"] = groupID.ToString();
@ -479,11 +488,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (respData.Contains("error"))
{
return null;
}
return null;
}
return HashTableToGroupMembershipData(respData);
}
}
public List<GroupMembershipData> GetAgentGroupMemberships(UUID AgentID)
@ -533,8 +542,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
return Roles;
}
public List<GroupRolesData> GetGroupRoles(UUID GroupID)
@ -565,7 +572,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
return Roles;
}
private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData)
@ -633,7 +639,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
return members;
}
public List<GroupRoleMembersData> GetGroupRoleMembers(UUID GroupID)
@ -647,15 +652,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (!respData.Contains("error"))
{
foreach (Hashtable membership in respData.Values)
{
GroupRoleMembersData data = new GroupRoleMembersData();
data.MemberID = new UUID((string)membership["AgentID"]);
data.RoleID = new UUID((string)membership["RoleID"]);
members.Add(data);
}
foreach (Hashtable membership in respData.Values)
{
GroupRoleMembersData data = new GroupRoleMembersData();
data.MemberID = new UUID((string)membership["AgentID"]);
data.RoleID = new UUID((string)membership["RoleID"]);
members.Add(data);
}
}
return members;
}
@ -697,8 +702,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (!respData.Contains("error"))
{
return null;
}
return null;
}
GroupNoticeInfo data = new GroupNoticeInfo();
data.GroupID = UUID.Parse((string)respData["GroupID"]);
@ -799,11 +804,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
foreach (string line in lines)
{
m_log.ErrorFormat("[GROUPDATA] {0}", line);
}
}
}
}
}
public class GroupNoticeInfo

View File

@ -229,31 +229,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Force? open the group session dialog???
IEventQueue eq = m_ActiveClients[msg.toAgentID].Scene.RequestModuleInterface<IEventQueue>();
eq.ChatterboxInvitation(
GroupID
, GroupInfo.GroupName
, new UUID(msg.fromAgentID)
, msg.message, new UUID(msg.toAgentID)
, msg.fromAgentName
, msg.dialog
, msg.timestamp
, msg.offline==1
, (int)msg.ParentEstateID
, msg.Position
, 1
, new UUID(msg.imSessionID)
, msg.fromGroup
, Utils.StringToBytes(GroupInfo.GroupName)
);
GroupID,
GroupInfo.GroupName,
new UUID(msg.fromAgentID),
msg.message, new UUID(msg.toAgentID),
msg.fromAgentName,
msg.dialog,
msg.timestamp,
msg.offline == 1,
(int)msg.ParentEstateID,
msg.Position,
1,
new UUID(msg.imSessionID),
msg.fromGroup,
Utils.StringToBytes(GroupInfo.GroupName));
eq.ChatterBoxSessionAgentListUpdates(
new UUID(GroupID)
, new UUID(msg.fromAgentID)
, new UUID(msg.toAgentID)
, false //canVoiceChat
, false //isModerator
, false //text mute
);
new UUID(GroupID),
new UUID(msg.fromAgentID),
new UUID(msg.toAgentID),
false, //canVoiceChat
false, //isModerator
false); //text mute
}
}
}
@ -285,13 +282,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
queue.ChatterBoxSessionAgentListUpdates(
new UUID(GroupID)
, new UUID(im.fromAgentID)
, new UUID(im.toAgentID)
, false //canVoiceChat
, false //isModerator
, false //text mute
);
new UUID(GroupID),
new UUID(im.fromAgentID),
new UUID(im.toAgentID),
false, //canVoiceChat
false, //isModerator
false); //text mute
}
}
@ -373,12 +369,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
msg.ParentEstateID = im.ParentEstateID;
msg.Position = im.Position;
msg.RegionID = im.RegionID;
msg.binaryBucket = new byte[1] { 0 };
msg.binaryBucket = new byte[1]{0};
foreach (GroupMembersData member in m_GroupsModule.GroupMembersRequest(null, groupID))
{
msg.toAgentID = member.AgentID.Guid;
m_MsgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
m_MsgTransferModule.SendInstantMessage(msg, delegate(bool success) {});
}
}
@ -402,14 +398,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
bodyMap.Add("success", OSD.FromBoolean(true));
bodyMap.Add("session_info", sessionMap);
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
if (queue != null)
{
queue.Enqueue(EventQueueHelper.buildEvent("ChatterBoxSessionStartReply", bodyMap), remoteClient.AgentId);
}
}
@ -428,6 +422,5 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_log.WarnFormat("[GROUPS-MESSAGING] IM: binaryBucket({0})", OpenMetaverse.Utils.BytesToHexString(im.binaryBucket, "BinaryBucket"));
}
}
}
}

View File

@ -155,13 +155,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return;
}
m_sceneList.Add(scene);
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnClientClosed += OnClientClosed;
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
}
public void RemoveRegion(Scene scene)