mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
* May fix mantis #4603.
* My local git wants to commit the groups files for line endings, I'm gonna let it do it.
This commit is contained in:
@@ -68,14 +68,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
private string m_groupReadKey = string.Empty;
|
||||
private string m_groupWriteKey = string.Empty;
|
||||
|
||||
private IUserAccountService m_accountService = null;
|
||||
|
||||
// Used to track which agents are have dropped from a group chat session
|
||||
// Should be reset per agent, on logon
|
||||
// TODO: move this to Flotsam XmlRpc Service
|
||||
// SessionID, List<AgentID>
|
||||
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 IUserAccountService m_accountService = null;
|
||||
|
||||
// Used to track which agents are have dropped from a group chat session
|
||||
// Should be reset per agent, on logon
|
||||
// TODO: move this to Flotsam XmlRpc Service
|
||||
// SessionID, List<AgentID>
|
||||
private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>();
|
||||
private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>();
|
||||
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
@@ -111,12 +111,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
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);
|
||||
if ((m_groupsServerURI == null) ||
|
||||
(m_groupsServerURI == string.Empty))
|
||||
{
|
||||
{
|
||||
m_log.ErrorFormat("Please specify a valid URL for GroupsServerURI in OpenSim.ini, [Groups]");
|
||||
m_connectorEnabled = false;
|
||||
return;
|
||||
@@ -766,67 +766,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region GroupSessionTracking
|
||||
|
||||
public void ResetAgentGroupChatSessions(UUID agentID)
|
||||
{
|
||||
foreach (List<UUID> agentList in m_groupsAgentsDroppedFromChatSession.Values)
|
||||
{
|
||||
agentList.Remove(agentID);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
return m_groupsAgentsInvitedToChatSession.ContainsKey(groupID)
|
||||
&& m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID);
|
||||
}
|
||||
|
||||
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
// If we're tracking drops for this group,
|
||||
// and we find them, well... then they've dropped
|
||||
return m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID)
|
||||
&& m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID);
|
||||
}
|
||||
|
||||
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
if (m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
|
||||
{
|
||||
// If not in dropped list, add
|
||||
if (!m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
||||
{
|
||||
m_groupsAgentsDroppedFromChatSession[groupID].Add(agentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
// Add Session Status if it doesn't exist for this session
|
||||
CreateGroupChatSessionTracking(groupID);
|
||||
|
||||
// If nessesary, remove from dropped list
|
||||
if (m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
||||
{
|
||||
m_groupsAgentsDroppedFromChatSession[groupID].Remove(agentID);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateGroupChatSessionTracking(UUID groupID)
|
||||
{
|
||||
if (!m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
|
||||
{
|
||||
m_groupsAgentsDroppedFromChatSession.Add(groupID, new List<UUID>());
|
||||
m_groupsAgentsInvitedToChatSession.Add(groupID, new List<UUID>());
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region GroupSessionTracking
|
||||
|
||||
public void ResetAgentGroupChatSessions(UUID agentID)
|
||||
{
|
||||
foreach (List<UUID> agentList in m_groupsAgentsDroppedFromChatSession.Values)
|
||||
{
|
||||
agentList.Remove(agentID);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
return m_groupsAgentsInvitedToChatSession.ContainsKey(groupID)
|
||||
&& m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID);
|
||||
}
|
||||
|
||||
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
// If we're tracking drops for this group,
|
||||
// and we find them, well... then they've dropped
|
||||
return m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID)
|
||||
&& m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID);
|
||||
}
|
||||
|
||||
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
if (m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
|
||||
{
|
||||
// If not in dropped list, add
|
||||
if (!m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
||||
{
|
||||
m_groupsAgentsDroppedFromChatSession[groupID].Add(agentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
// Add Session Status if it doesn't exist for this session
|
||||
CreateGroupChatSessionTracking(groupID);
|
||||
|
||||
// If nessesary, remove from dropped list
|
||||
if (m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
||||
{
|
||||
m_groupsAgentsDroppedFromChatSession[groupID].Remove(agentID);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateGroupChatSessionTracking(UUID groupID)
|
||||
{
|
||||
if (!m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
|
||||
{
|
||||
m_groupsAgentsDroppedFromChatSession.Add(groupID, new List<UUID>());
|
||||
m_groupsAgentsInvitedToChatSession.Add(groupID, new List<UUID>());
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region XmlRpcHashtableMarshalling
|
||||
private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile)
|
||||
|
||||
Reference in New Issue
Block a user