* May fix mantis #4603.
* My local git wants to commit the groups files for line endings, I'm gonna let it do it.slimupdates
parent
f302224caf
commit
80346ad2e2
|
@ -1012,7 +1012,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
|||
throw new Exception(String.Format("Account {0} {1} already exists", firstname, lastname));
|
||||
|
||||
account = new UserAccount(scopeID, firstname, lastname, email);
|
||||
// REFACTORING PROBLEM: no method to set the password!
|
||||
|
||||
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}",
|
||||
firstname, lastname));
|
||||
|
||||
// Store the password
|
||||
m_app.SceneManager.CurrentOrFirstScene.AuthenticationService.SetPassword(account.PrincipalID, passwd);
|
||||
|
||||
GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID,
|
||||
(int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize));
|
||||
if (home == null)
|
||||
|
|
|
@ -49,9 +49,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
private List<Scene> m_sceneList = new List<Scene>();
|
||||
|
||||
private IMessageTransferModule m_msgTransferModule = null;
|
||||
|
||||
private IGroupsServicesConnector m_groupData = null;
|
||||
private IMessageTransferModule m_msgTransferModule = null;
|
||||
|
||||
private IGroupsServicesConnector m_groupData = null;
|
||||
|
||||
// Config Options
|
||||
private bool m_groupMessagingEnabled = false;
|
||||
|
@ -108,13 +108,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
if (!m_groupMessagingEnabled)
|
||||
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>();
|
||||
|
||||
// No groups module, no groups messaging
|
||||
// No groups module, no groups messaging
|
||||
if (m_groupData == null)
|
||||
{
|
||||
{
|
||||
m_log.Error("[GROUPS-MESSAGING]: Could not get IGroupsServicesConnector, GroupsMessagingModule is now disabled.");
|
||||
Close();
|
||||
m_groupMessagingEnabled = false;
|
||||
|
@ -190,9 +190,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Not really needed, but does confirm that the group exists.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Not really needed, but does confirm that the group exists.
|
||||
/// </summary>
|
||||
public bool StartGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
if (m_debugEnabled)
|
||||
|
@ -201,7 +201,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null);
|
||||
|
||||
if (groupInfo != null)
|
||||
{
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -213,11 +213,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
|
||||
{
|
||||
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))
|
||||
{
|
||||
{
|
||||
if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID))
|
||||
{
|
||||
// Don't deliver messages to people who have dropped this session
|
||||
|
@ -226,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
|
||||
// Copy Message
|
||||
GridInstantMessage msg = new GridInstantMessage();
|
||||
GridInstantMessage msg = new GridInstantMessage();
|
||||
msg.imSessionID = groupID.Guid;
|
||||
msg.fromAgentName = im.fromAgentName;
|
||||
msg.message = im.message;
|
||||
|
@ -259,13 +259,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
}
|
||||
|
||||
#region SimGridEventHandlers
|
||||
|
||||
void OnClientLogin(IClientAPI client)
|
||||
{
|
||||
#region SimGridEventHandlers
|
||||
|
||||
void OnClientLogin(IClientAPI client)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
|
@ -303,28 +303,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
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);
|
||||
|
||||
UUID AgentID = new UUID(msg.fromAgentID);
|
||||
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 GroupID = new UUID(msg.imSessionID);
|
||||
|
||||
switch (msg.dialog)
|
||||
{
|
||||
case (byte)InstantMessageDialog.SessionAdd:
|
||||
case (byte)InstantMessageDialog.SessionAdd:
|
||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
||||
break;
|
||||
|
||||
case (byte)InstantMessageDialog.SessionDrop:
|
||||
case (byte)InstantMessageDialog.SessionDrop:
|
||||
m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID);
|
||||
break;
|
||||
|
||||
case (byte)InstantMessageDialog.SessionSend:
|
||||
if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID)
|
||||
case (byte)InstantMessageDialog.SessionSend:
|
||||
if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID)
|
||||
&& !m_groupData.hasAgentBeenInvitedToGroupChatSession(AgentID, GroupID)
|
||||
)
|
||||
{
|
||||
// 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);
|
||||
|
||||
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");
|
||||
|
||||
// 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);
|
||||
IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>();
|
||||
eq.ChatterboxInvitation(
|
||||
eq.ChatterboxInvitation(
|
||||
GroupID
|
||||
, groupInfo.GroupName
|
||||
, new UUID(msg.fromAgentID)
|
||||
|
@ -357,7 +357,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
, Utils.StringToBytes(groupInfo.GroupName)
|
||||
);
|
||||
|
||||
eq.ChatterBoxSessionAgentListUpdates(
|
||||
eq.ChatterBoxSessionAgentListUpdates(
|
||||
new UUID(GroupID)
|
||||
, new UUID(msg.fromAgentID)
|
||||
, new UUID(msg.toAgentID)
|
||||
|
@ -367,7 +367,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID))
|
||||
{
|
||||
// User hasn't dropped, so they're in the session,
|
||||
|
@ -394,8 +394,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ClientEvents
|
||||
|
||||
#region ClientEvents
|
||||
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
|
||||
{
|
||||
if (m_debugEnabled)
|
||||
|
@ -407,23 +407,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
// Start group IM session
|
||||
if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart))
|
||||
{
|
||||
if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
|
||||
|
||||
UUID GroupID = new UUID(im.imSessionID);
|
||||
UUID AgentID = new UUID(im.fromAgentID);
|
||||
|
||||
{
|
||||
if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
|
||||
|
||||
UUID GroupID = new UUID(im.imSessionID);
|
||||
UUID AgentID = new UUID(im.fromAgentID);
|
||||
|
||||
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
|
||||
|
||||
if (groupInfo != null)
|
||||
{
|
||||
{
|
||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
||||
|
||||
ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, GroupID);
|
||||
|
||||
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
|
||||
queue.ChatterBoxSessionAgentListUpdates(
|
||||
GroupID
|
||||
queue.ChatterBoxSessionAgentListUpdates(
|
||||
GroupID
|
||||
, AgentID
|
||||
, new UUID(im.toAgentID)
|
||||
, false //canVoiceChat
|
||||
|
@ -435,16 +435,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
// Send a message from locally connected client to a group
|
||||
if ((im.dialog == (byte)InstantMessageDialog.SessionSend))
|
||||
{
|
||||
UUID GroupID = new UUID(im.imSessionID);
|
||||
UUID AgentID = new UUID(im.fromAgentID);
|
||||
{
|
||||
UUID GroupID = new UUID(im.imSessionID);
|
||||
UUID AgentID = new UUID(im.fromAgentID);
|
||||
|
||||
if (m_debugEnabled)
|
||||
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
|
||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
||||
|
||||
//If this agent is sending a message, then they want to be in the session
|
||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, 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
|
||||
/// </summary>
|
||||
private IClientAPI GetActiveClient(UUID agentID)
|
||||
{
|
||||
{
|
||||
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
|
||||
|
||||
IClientAPI child = null;
|
||||
|
@ -514,26 +514,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
{
|
||||
ScenePresence user = (ScenePresence)scene.Entities[agentID];
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we didn't find a root, then just return whichever child we found, or null if none
|
||||
if (child == null)
|
||||
{
|
||||
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
|
||||
// If we didn't find a root, then just return whichever child we found, or null if none
|
||||
if (child == null)
|
||||
{
|
||||
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
|
|
@ -175,13 +175,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
// The InstantMessageModule itself doesn't do this,
|
||||
// so lets see if things explode if we don't do it
|
||||
// scene.EventManager.OnClientClosed += OnClientClosed;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_groupsEnabled)
|
||||
|
|
|
@ -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);
|
||||
GroupNoticeInfo GetGroupNotice(UUID RequestingAgentID, UUID noticeID);
|
||||
List<GroupNoticeData> GetGroupNotices(UUID RequestingAgentID, UUID GroupID);
|
||||
|
||||
void ResetAgentGroupChatSessions(UUID agentID);
|
||||
bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID);
|
||||
bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID);
|
||||
void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID);
|
||||
List<GroupNoticeData> GetGroupNotices(UUID RequestingAgentID, UUID GroupID);
|
||||
|
||||
void ResetAgentGroupChatSessions(UUID agentID);
|
||||
bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID);
|
||||
bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID);
|
||||
void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID);
|
||||
void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID);
|
||||
}
|
||||
|
||||
|
|
|
@ -203,12 +203,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 Simian Server for GroupsServerURI in OpenSim.ini, [Groups]");
|
||||
m_connectorEnabled = false;
|
||||
return;
|
||||
|
@ -1000,53 +1000,53 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GroupSessionTracking
|
||||
|
||||
public void ResetAgentGroupChatSessions(UUID agentID)
|
||||
{
|
||||
Dictionary<string, OSDMap> agentSessions;
|
||||
|
||||
if (SimianGetGenericEntries(agentID, "GroupSessionDropped", out agentSessions))
|
||||
{
|
||||
foreach (string GroupID in agentSessions.Keys)
|
||||
{
|
||||
SimianRemoveGenericEntry(agentID, "GroupSessionDropped", GroupID);
|
||||
}
|
||||
}
|
||||
|
||||
if (SimianGetGenericEntries(agentID, "GroupSessionInvited", out agentSessions))
|
||||
{
|
||||
foreach (string GroupID in agentSessions.Keys)
|
||||
{
|
||||
SimianRemoveGenericEntry(agentID, "GroupSessionInvited", GroupID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
OSDMap session;
|
||||
return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
|
||||
}
|
||||
|
||||
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
SimianAddGeneric(agentID, "GroupSessionDropped", groupID.ToString(), new OSDMap());
|
||||
}
|
||||
|
||||
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
SimianAddGeneric(agentID, "GroupSessionInvited", groupID.ToString(), new OSDMap());
|
||||
}
|
||||
|
||||
public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
OSDMap session;
|
||||
return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GroupSessionTracking
|
||||
|
||||
public void ResetAgentGroupChatSessions(UUID agentID)
|
||||
{
|
||||
Dictionary<string, OSDMap> agentSessions;
|
||||
|
||||
if (SimianGetGenericEntries(agentID, "GroupSessionDropped", out agentSessions))
|
||||
{
|
||||
foreach (string GroupID in agentSessions.Keys)
|
||||
{
|
||||
SimianRemoveGenericEntry(agentID, "GroupSessionDropped", GroupID);
|
||||
}
|
||||
}
|
||||
|
||||
if (SimianGetGenericEntries(agentID, "GroupSessionInvited", out agentSessions))
|
||||
{
|
||||
foreach (string GroupID in agentSessions.Keys)
|
||||
{
|
||||
SimianRemoveGenericEntry(agentID, "GroupSessionInvited", GroupID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
OSDMap session;
|
||||
return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
|
||||
}
|
||||
|
||||
public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
SimianAddGeneric(agentID, "GroupSessionDropped", groupID.ToString(), new OSDMap());
|
||||
}
|
||||
|
||||
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
SimianAddGeneric(agentID, "GroupSessionInvited", groupID.ToString(), new OSDMap());
|
||||
}
|
||||
|
||||
public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||
{
|
||||
OSDMap session;
|
||||
return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void EnsureRoleNotSelectedByMember(UUID groupID, UUID roleID, UUID userID)
|
||||
|
@ -1321,8 +1321,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue