* May fix mantis #4603.

* My local git wants to commit the groups files for line endings, I'm gonna let it do it.
slimupdates
Diva Canto 2010-04-05 19:56:03 -07:00
parent f302224caf
commit 80346ad2e2
6 changed files with 200 additions and 198 deletions

View File

@ -1012,7 +1012,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
throw new Exception(String.Format("Account {0} {1} already exists", firstname, lastname)); throw new Exception(String.Format("Account {0} {1} already exists", firstname, lastname));
account = new UserAccount(scopeID, firstname, lastname, email); account = new UserAccount(scopeID, firstname, lastname, email);
// REFACTORING PROBLEM: no method to set the password!
bool success = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.StoreUserAccount(account); bool success = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.StoreUserAccount(account);
@ -1020,6 +1019,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
throw new Exception(String.Format("failed to create new user {0} {1}", throw new Exception(String.Format("failed to create new user {0} {1}",
firstname, lastname)); firstname, lastname));
// Store the password
m_app.SceneManager.CurrentOrFirstScene.AuthenticationService.SetPassword(account.PrincipalID, passwd);
GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID, GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID,
(int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize));
if (home == null) if (home == null)

View File

@ -49,9 +49,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
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;
// Config Options // Config Options
private bool m_groupMessagingEnabled = false; private bool m_groupMessagingEnabled = false;
@ -108,13 +108,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (!m_groupMessagingEnabled) if (!m_groupMessagingEnabled)
return; return;
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
m_groupData = scene.RequestModuleInterface<IGroupsServicesConnector>(); m_groupData = scene.RequestModuleInterface<IGroupsServicesConnector>();
// No groups module, no groups messaging // No groups module, no groups messaging
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.");
Close(); Close();
m_groupMessagingEnabled = false; m_groupMessagingEnabled = false;
@ -190,9 +190,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
#endregion #endregion
/// <summary> /// <summary>
/// Not really needed, but does confirm that the group exists. /// Not really needed, but does confirm that the group exists.
/// </summary> /// </summary>
public bool StartGroupChatSession(UUID agentID, UUID groupID) public bool StartGroupChatSession(UUID agentID, UUID groupID)
{ {
if (m_debugEnabled) if (m_debugEnabled)
@ -201,7 +201,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null); GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null);
if (groupInfo != null) if (groupInfo != null)
{ {
return true; return true;
} }
else else
@ -213,11 +213,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public void SendMessageToGroup(GridInstantMessage im, UUID groupID) public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
{ {
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);
foreach (GroupMembersData member in m_groupData.GetGroupMembers(UUID.Zero, groupID)) foreach (GroupMembersData member in m_groupData.GetGroupMembers(UUID.Zero, groupID))
{ {
if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID))
{ {
// Don't deliver messages to people who have dropped this session // Don't deliver messages to people who have dropped this session
@ -226,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
// Copy Message // Copy Message
GridInstantMessage msg = new GridInstantMessage(); GridInstantMessage msg = new GridInstantMessage();
msg.imSessionID = groupID.Guid; msg.imSessionID = groupID.Guid;
msg.fromAgentName = im.fromAgentName; msg.fromAgentName = im.fromAgentName;
msg.message = im.message; msg.message = im.message;
@ -259,13 +259,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
} }
#region SimGridEventHandlers #region SimGridEventHandlers
void OnClientLogin(IClientAPI client) void OnClientLogin(IClientAPI client)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name);
} }
private void OnNewClient(IClientAPI client) private void OnNewClient(IClientAPI client)
@ -303,28 +303,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private void ProcessMessageFromGroupSession(GridInstantMessage msg) private void ProcessMessageFromGroupSession(GridInstantMessage msg)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Session message from {0} going to agent {1}", msg.fromAgentName, msg.toAgentID); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Session message from {0} going to agent {1}", msg.fromAgentName, msg.toAgentID);
UUID AgentID = new UUID(msg.fromAgentID); UUID AgentID = new UUID(msg.fromAgentID);
UUID GroupID = new UUID(msg.imSessionID); UUID GroupID = new UUID(msg.imSessionID);
switch (msg.dialog) switch (msg.dialog)
{ {
case (byte)InstantMessageDialog.SessionAdd: case (byte)InstantMessageDialog.SessionAdd:
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID); m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
break; break;
case (byte)InstantMessageDialog.SessionDrop: case (byte)InstantMessageDialog.SessionDrop:
m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID); m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID);
break; break;
case (byte)InstantMessageDialog.SessionSend: case (byte)InstantMessageDialog.SessionSend:
if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID) if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID)
&& !m_groupData.hasAgentBeenInvitedToGroupChatSession(AgentID, GroupID) && !m_groupData.hasAgentBeenInvitedToGroupChatSession(AgentID, GroupID)
) )
{ {
// Agent not in session and hasn't dropped from session // Agent not in session and hasn't dropped from session
// Add them to the session for now, and Invite them // Add them to the session for now, and Invite them
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID); m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
UUID toAgentID = new UUID(msg.toAgentID); UUID toAgentID = new UUID(msg.toAgentID);
@ -336,10 +336,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Sending chatterbox invite instant message"); if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Sending chatterbox invite instant message");
// Force? open the group session dialog??? // Force? open the group session dialog???
// and simultanously deliver the message, so we don't need to do a seperate client.SendInstantMessage(msg); // and simultanously deliver the message, so we don't need to do a seperate client.SendInstantMessage(msg);
IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>(); IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>();
eq.ChatterboxInvitation( eq.ChatterboxInvitation(
GroupID GroupID
, groupInfo.GroupName , groupInfo.GroupName
, new UUID(msg.fromAgentID) , new UUID(msg.fromAgentID)
@ -357,7 +357,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
, Utils.StringToBytes(groupInfo.GroupName) , Utils.StringToBytes(groupInfo.GroupName)
); );
eq.ChatterBoxSessionAgentListUpdates( eq.ChatterBoxSessionAgentListUpdates(
new UUID(GroupID) new UUID(GroupID)
, new UUID(msg.fromAgentID) , new UUID(msg.fromAgentID)
, new UUID(msg.toAgentID) , new UUID(msg.toAgentID)
@ -367,7 +367,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
); );
} }
} }
} }
else if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID)) else if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID))
{ {
// User hasn't dropped, so they're in the session, // User hasn't dropped, so they're in the session,
@ -394,8 +394,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
#endregion #endregion
#region ClientEvents #region ClientEvents
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
{ {
if (m_debugEnabled) if (m_debugEnabled)
@ -407,23 +407,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Start group IM session // Start group IM session
if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart)) if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart))
{ {
if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID); if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
UUID GroupID = new UUID(im.imSessionID); UUID GroupID = new UUID(im.imSessionID);
UUID AgentID = new UUID(im.fromAgentID); UUID AgentID = new UUID(im.fromAgentID);
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null); GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
if (groupInfo != null) if (groupInfo != null)
{ {
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID); m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, GroupID); ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, GroupID);
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>(); IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
queue.ChatterBoxSessionAgentListUpdates( queue.ChatterBoxSessionAgentListUpdates(
GroupID GroupID
, AgentID , AgentID
, new UUID(im.toAgentID) , new UUID(im.toAgentID)
, false //canVoiceChat , false //canVoiceChat
@ -435,16 +435,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Send a message from locally connected client to a group // Send a message from locally connected client to a group
if ((im.dialog == (byte)InstantMessageDialog.SessionSend)) if ((im.dialog == (byte)InstantMessageDialog.SessionSend))
{ {
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
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID); m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
SendMessageToGroup(im, GroupID); SendMessageToGroup(im, GroupID);
} }
} }
@ -501,7 +501,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
/// Try to find an active IClientAPI reference for agentID giving preference to root connections /// Try to find an active IClientAPI reference for agentID giving preference to root connections
/// </summary> /// </summary>
private IClientAPI GetActiveClient(UUID agentID) private IClientAPI GetActiveClient(UUID agentID)
{ {
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID); if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
IClientAPI child = null; IClientAPI child = null;
@ -514,26 +514,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
ScenePresence user = (ScenePresence)scene.Entities[agentID]; ScenePresence user = (ScenePresence)scene.Entities[agentID];
if (!user.IsChildAgent) if (!user.IsChildAgent)
{ {
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", user.ControllingClient.Name); if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", user.ControllingClient.Name);
return user.ControllingClient; return user.ControllingClient;
} }
else else
{ {
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", user.ControllingClient.Name); if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", user.ControllingClient.Name);
child = user.ControllingClient; child = user.ControllingClient;
} }
} }
} }
// If we didn't find a root, then just return whichever child we found, or null if none // If we didn't find a root, then just return whichever child we found, or null if none
if (child == null) if (child == null)
{ {
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID); if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
} }
else else
{ {
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name); if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
} }
return child; return child;
} }

View File

@ -175,13 +175,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
// The InstantMessageModule itself doesn't do this, // The InstantMessageModule itself doesn't do this,
// so lets see if things explode if we don't do it // so lets see if things explode if we don't do it
// scene.EventManager.OnClientClosed += OnClientClosed; // scene.EventManager.OnClientClosed += OnClientClosed;
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
if (!m_groupsEnabled) if (!m_groupsEnabled)

View File

@ -70,12 +70,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
void AddGroupNotice(UUID RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket); void AddGroupNotice(UUID RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket);
GroupNoticeInfo GetGroupNotice(UUID RequestingAgentID, UUID noticeID); GroupNoticeInfo GetGroupNotice(UUID RequestingAgentID, UUID noticeID);
List<GroupNoticeData> GetGroupNotices(UUID RequestingAgentID, UUID GroupID); List<GroupNoticeData> GetGroupNotices(UUID RequestingAgentID, UUID GroupID);
void ResetAgentGroupChatSessions(UUID agentID); void ResetAgentGroupChatSessions(UUID agentID);
bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID); bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID);
bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID); bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID);
void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID); void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID);
void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID); void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID);
} }

View File

@ -203,12 +203,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return; return;
} }
m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
if ((m_groupsServerURI == null) || if ((m_groupsServerURI == null) ||
(m_groupsServerURI == string.Empty)) (m_groupsServerURI == string.Empty))
{ {
m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]"); m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]");
m_connectorEnabled = false; m_connectorEnabled = false;
return; return;
@ -1000,53 +1000,53 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice); SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice);
} }
#endregion #endregion
#region GroupSessionTracking #region GroupSessionTracking
public void ResetAgentGroupChatSessions(UUID agentID) public void ResetAgentGroupChatSessions(UUID agentID)
{ {
Dictionary<string, OSDMap> agentSessions; Dictionary<string, OSDMap> agentSessions;
if (SimianGetGenericEntries(agentID, "GroupSessionDropped", out agentSessions)) if (SimianGetGenericEntries(agentID, "GroupSessionDropped", out agentSessions))
{ {
foreach (string GroupID in agentSessions.Keys) foreach (string GroupID in agentSessions.Keys)
{ {
SimianRemoveGenericEntry(agentID, "GroupSessionDropped", GroupID); SimianRemoveGenericEntry(agentID, "GroupSessionDropped", GroupID);
} }
} }
if (SimianGetGenericEntries(agentID, "GroupSessionInvited", out agentSessions)) if (SimianGetGenericEntries(agentID, "GroupSessionInvited", out agentSessions))
{ {
foreach (string GroupID in agentSessions.Keys) foreach (string GroupID in agentSessions.Keys)
{ {
SimianRemoveGenericEntry(agentID, "GroupSessionInvited", GroupID); SimianRemoveGenericEntry(agentID, "GroupSessionInvited", GroupID);
} }
} }
} }
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
{ {
OSDMap session; OSDMap session;
return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session); return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
} }
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID) public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
{ {
SimianAddGeneric(agentID, "GroupSessionDropped", groupID.ToString(), new OSDMap()); SimianAddGeneric(agentID, "GroupSessionDropped", groupID.ToString(), new OSDMap());
} }
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID) public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
{ {
SimianAddGeneric(agentID, "GroupSessionInvited", groupID.ToString(), new OSDMap()); SimianAddGeneric(agentID, "GroupSessionInvited", groupID.ToString(), new OSDMap());
} }
public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID) public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
{ {
OSDMap session; OSDMap session;
return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session); return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
} }
#endregion #endregion
private void EnsureRoleNotSelectedByMember(UUID groupID, UUID roleID, UUID userID) private void EnsureRoleNotSelectedByMember(UUID groupID, UUID roleID, UUID userID)
@ -1321,8 +1321,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return false; return false;
} }
} }
#endregion #endregion
} }
} }

View File

@ -68,14 +68,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private string m_groupReadKey = string.Empty; private string m_groupReadKey = string.Empty;
private string m_groupWriteKey = string.Empty; private string m_groupWriteKey = string.Empty;
private IUserAccountService m_accountService = null; private IUserAccountService m_accountService = null;
// Used to track which agents are have dropped from a group chat session // Used to track which agents are have dropped from a group chat session
// Should be reset per agent, on logon // Should be reset per agent, on logon
// TODO: move this to Flotsam XmlRpc Service // TODO: move this to Flotsam XmlRpc Service
// SessionID, List<AgentID> // SessionID, List<AgentID>
private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>(); private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>();
private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>(); private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>();
#region IRegionModuleBase Members #region IRegionModuleBase Members
@ -111,12 +111,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return; return;
} }
m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name);
m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
if ((m_groupsServerURI == null) || if ((m_groupsServerURI == null) ||
(m_groupsServerURI == string.Empty)) (m_groupsServerURI == string.Empty))
{ {
m_log.ErrorFormat("Please specify a valid URL for GroupsServerURI in OpenSim.ini, [Groups]"); m_log.ErrorFormat("Please specify a valid URL for GroupsServerURI in OpenSim.ini, [Groups]");
m_connectorEnabled = false; m_connectorEnabled = false;
return; return;
@ -766,67 +766,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
#endregion #endregion
#region GroupSessionTracking #region GroupSessionTracking
public void ResetAgentGroupChatSessions(UUID agentID) public void ResetAgentGroupChatSessions(UUID agentID)
{ {
foreach (List<UUID> agentList in m_groupsAgentsDroppedFromChatSession.Values) foreach (List<UUID> agentList in m_groupsAgentsDroppedFromChatSession.Values)
{ {
agentList.Remove(agentID); agentList.Remove(agentID);
} }
} }
public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID) public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
{ {
// If we're tracking this group, and we can find them in the tracking, then they've been invited // If we're tracking this group, and we can find them in the tracking, then they've been invited
return m_groupsAgentsInvitedToChatSession.ContainsKey(groupID) return m_groupsAgentsInvitedToChatSession.ContainsKey(groupID)
&& m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID); && m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID);
} }
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
{ {
// If we're tracking drops for this group, // If we're tracking drops for this group,
// and we find them, well... then they've dropped // and we find them, well... then they've dropped
return m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID) return m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID)
&& m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID); && m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID);
} }
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID) public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
{ {
if (m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID)) if (m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
{ {
// If not in dropped list, add // If not in dropped list, add
if (!m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID)) if (!m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
{ {
m_groupsAgentsDroppedFromChatSession[groupID].Add(agentID); m_groupsAgentsDroppedFromChatSession[groupID].Add(agentID);
} }
} }
} }
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID) public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
{ {
// Add Session Status if it doesn't exist for this session // Add Session Status if it doesn't exist for this session
CreateGroupChatSessionTracking(groupID); CreateGroupChatSessionTracking(groupID);
// If nessesary, remove from dropped list // If nessesary, remove from dropped list
if (m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID)) if (m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
{ {
m_groupsAgentsDroppedFromChatSession[groupID].Remove(agentID); m_groupsAgentsDroppedFromChatSession[groupID].Remove(agentID);
} }
} }
private void CreateGroupChatSessionTracking(UUID groupID) private void CreateGroupChatSessionTracking(UUID groupID)
{ {
if (!m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID)) if (!m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
{ {
m_groupsAgentsDroppedFromChatSession.Add(groupID, new List<UUID>()); m_groupsAgentsDroppedFromChatSession.Add(groupID, new List<UUID>());
m_groupsAgentsInvitedToChatSession.Add(groupID, new List<UUID>()); m_groupsAgentsInvitedToChatSession.Add(groupID, new List<UUID>());
} }
} }
#endregion #endregion
#region XmlRpcHashtableMarshalling #region XmlRpcHashtableMarshalling
private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile) private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile)