diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs | 87 |
1 files changed, 69 insertions, 18 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs index bc05b0f..4867c01 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs | |||
@@ -55,6 +55,9 @@ using OpenSim.Services.Interfaces; | |||
55 | * UserID -> Group -> ActiveGroup | 55 | * UserID -> Group -> ActiveGroup |
56 | * + GroupID | 56 | * + GroupID |
57 | * | 57 | * |
58 | * UserID -> GroupSessionDropped -> GroupID | ||
59 | * UserID -> GroupSessionInvited -> GroupID | ||
60 | * | ||
58 | * UserID -> GroupMember -> GroupID | 61 | * UserID -> GroupMember -> GroupID |
59 | * + SelectedRoleID [UUID] | 62 | * + SelectedRoleID [UUID] |
60 | * + AcceptNotices [bool] | 63 | * + AcceptNotices [bool] |
@@ -63,6 +66,7 @@ using OpenSim.Services.Interfaces; | |||
63 | * | 66 | * |
64 | * UserID -> GroupRole[GroupID] -> RoleID | 67 | * UserID -> GroupRole[GroupID] -> RoleID |
65 | * | 68 | * |
69 | * | ||
66 | * GroupID -> Group -> GroupName | 70 | * GroupID -> Group -> GroupName |
67 | * + Charter | 71 | * + Charter |
68 | * + ShowInList | 72 | * + ShowInList |
@@ -159,7 +163,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
159 | 163 | ||
160 | private bool m_connectorEnabled = false; | 164 | private bool m_connectorEnabled = false; |
161 | 165 | ||
162 | private string m_serviceURL = string.Empty; | 166 | private string m_groupsServerURI = string.Empty; |
163 | 167 | ||
164 | private bool m_debugEnabled = false; | 168 | private bool m_debugEnabled = false; |
165 | 169 | ||
@@ -199,13 +203,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
199 | return; | 203 | return; |
200 | } | 204 | } |
201 | 205 | ||
202 | m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name); | 206 | m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name); |
203 | 207 | ||
204 | m_serviceURL = groupsConfig.GetString("XmlRpcServiceURL", string.Empty); | 208 | m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); |
205 | if ((m_serviceURL == null) || | 209 | if ((m_groupsServerURI == null) || |
206 | (m_serviceURL == string.Empty)) | 210 | (m_groupsServerURI == string.Empty)) |
207 | { | 211 | { |
208 | m_log.ErrorFormat("Please specify a valid Simian Server URL for XmlRpcServiceURL in OpenSim.ini, [Groups]"); | 212 | m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]"); |
209 | m_connectorEnabled = false; | 213 | m_connectorEnabled = false; |
210 | return; | 214 | return; |
211 | } | 215 | } |
@@ -653,7 +657,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
653 | }; | 657 | }; |
654 | 658 | ||
655 | 659 | ||
656 | OSDMap response = WebUtil.PostToService(m_serviceURL, requestArgs); | 660 | OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs); |
657 | if (response["Success"].AsBoolean() && response["Entries"] is OSDArray) | 661 | if (response["Success"].AsBoolean() && response["Entries"] is OSDArray) |
658 | { | 662 | { |
659 | OSDArray entryArray = (OSDArray)response["Entries"]; | 663 | OSDArray entryArray = (OSDArray)response["Entries"]; |
@@ -996,9 +1000,55 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
996 | SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice); | 1000 | SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice); |
997 | 1001 | ||
998 | } | 1002 | } |
1003 | #endregion | ||
1004 | |||
1005 | #region GroupSessionTracking | ||
1006 | |||
1007 | public void ResetAgentGroupChatSessions(UUID agentID) | ||
1008 | { | ||
1009 | Dictionary<string, OSDMap> agentSessions; | ||
1010 | |||
1011 | if (SimianGetGenericEntries(agentID, "GroupSessionDropped", out agentSessions)) | ||
1012 | { | ||
1013 | foreach (string GroupID in agentSessions.Keys) | ||
1014 | { | ||
1015 | SimianRemoveGenericEntry(agentID, "GroupSessionDropped", GroupID); | ||
1016 | } | ||
1017 | } | ||
1018 | |||
1019 | if (SimianGetGenericEntries(agentID, "GroupSessionInvited", out agentSessions)) | ||
1020 | { | ||
1021 | foreach (string GroupID in agentSessions.Keys) | ||
1022 | { | ||
1023 | SimianRemoveGenericEntry(agentID, "GroupSessionInvited", GroupID); | ||
1024 | } | ||
1025 | } | ||
1026 | } | ||
1027 | |||
1028 | public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) | ||
1029 | { | ||
1030 | OSDMap session; | ||
1031 | return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session); | ||
1032 | } | ||
1033 | |||
1034 | public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID) | ||
1035 | { | ||
1036 | SimianAddGeneric(agentID, "GroupSessionDropped", groupID.ToString(), new OSDMap()); | ||
1037 | } | ||
1038 | |||
1039 | public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID) | ||
1040 | { | ||
1041 | SimianAddGeneric(agentID, "GroupSessionInvited", groupID.ToString(), new OSDMap()); | ||
1042 | } | ||
1043 | |||
1044 | public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID) | ||
1045 | { | ||
1046 | OSDMap session; | ||
1047 | return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session); | ||
1048 | } | ||
1049 | |||
999 | #endregion | 1050 | #endregion |
1000 | 1051 | ||
1001 | |||
1002 | private void EnsureRoleNotSelectedByMember(UUID groupID, UUID roleID, UUID userID) | 1052 | private void EnsureRoleNotSelectedByMember(UUID groupID, UUID roleID, UUID userID) |
1003 | { | 1053 | { |
1004 | if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 1054 | if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
@@ -1036,7 +1086,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1036 | }; | 1086 | }; |
1037 | 1087 | ||
1038 | 1088 | ||
1039 | OSDMap Response = WebUtil.PostToService(m_serviceURL, RequestArgs); | 1089 | OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs); |
1040 | if (Response["Success"].AsBoolean()) | 1090 | if (Response["Success"].AsBoolean()) |
1041 | { | 1091 | { |
1042 | return true; | 1092 | return true; |
@@ -1063,7 +1113,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1063 | }; | 1113 | }; |
1064 | 1114 | ||
1065 | 1115 | ||
1066 | OSDMap Response = WebUtil.PostToService(m_serviceURL, RequestArgs); | 1116 | OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs); |
1067 | if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray) | 1117 | if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray) |
1068 | { | 1118 | { |
1069 | OSDArray entryArray = (OSDArray)Response["Entries"]; | 1119 | OSDArray entryArray = (OSDArray)Response["Entries"]; |
@@ -1103,7 +1153,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1103 | }; | 1153 | }; |
1104 | 1154 | ||
1105 | 1155 | ||
1106 | OSDMap Response = WebUtil.PostToService(m_serviceURL, RequestArgs); | 1156 | OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs); |
1107 | if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray) | 1157 | if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray) |
1108 | { | 1158 | { |
1109 | OSDArray entryArray = (OSDArray)Response["Entries"]; | 1159 | OSDArray entryArray = (OSDArray)Response["Entries"]; |
@@ -1144,7 +1194,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1144 | }; | 1194 | }; |
1145 | 1195 | ||
1146 | 1196 | ||
1147 | OSDMap Response = WebUtil.PostToService(m_serviceURL, RequestArgs); | 1197 | OSDMap Response = WebUtil.PostToService(m_groupsServerURI, RequestArgs); |
1148 | if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray) | 1198 | if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray) |
1149 | { | 1199 | { |
1150 | OSDArray entryArray = (OSDArray)Response["Entries"]; | 1200 | OSDArray entryArray = (OSDArray)Response["Entries"]; |
@@ -1184,7 +1234,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1184 | 1234 | ||
1185 | 1235 | ||
1186 | 1236 | ||
1187 | OSDMap response = WebUtil.PostToService(m_serviceURL, requestArgs); | 1237 | OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs); |
1188 | if (response["Success"].AsBoolean() && response["Entries"] is OSDArray) | 1238 | if (response["Success"].AsBoolean() && response["Entries"] is OSDArray) |
1189 | { | 1239 | { |
1190 | maps = new Dictionary<string, OSDMap>(); | 1240 | maps = new Dictionary<string, OSDMap>(); |
@@ -1222,7 +1272,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1222 | 1272 | ||
1223 | 1273 | ||
1224 | 1274 | ||
1225 | OSDMap response = WebUtil.PostToService(m_serviceURL, requestArgs); | 1275 | OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs); |
1226 | if (response["Success"].AsBoolean() && response["Entries"] is OSDArray) | 1276 | if (response["Success"].AsBoolean() && response["Entries"] is OSDArray) |
1227 | { | 1277 | { |
1228 | maps = new Dictionary<UUID, OSDMap>(); | 1278 | maps = new Dictionary<UUID, OSDMap>(); |
@@ -1260,7 +1310,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1260 | }; | 1310 | }; |
1261 | 1311 | ||
1262 | 1312 | ||
1263 | OSDMap response = WebUtil.PostToService(m_serviceURL, requestArgs); | 1313 | OSDMap response = WebUtil.PostToService(m_groupsServerURI, requestArgs); |
1264 | if (response["Success"].AsBoolean()) | 1314 | if (response["Success"].AsBoolean()) |
1265 | { | 1315 | { |
1266 | return true; | 1316 | return true; |
@@ -1271,7 +1321,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1271 | return false; | 1321 | return false; |
1272 | } | 1322 | } |
1273 | } | 1323 | } |
1274 | #endregion | 1324 | #endregion |
1325 | |||
1275 | } | 1326 | } |
1276 | 1327 | ||
1277 | } | 1328 | } |