aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
diff options
context:
space:
mode:
authorCharles Krinke2009-04-29 22:31:00 +0000
committerCharles Krinke2009-04-29 22:31:00 +0000
commit8944ab910cc8f62dc6ce567046a92e50b1e2813f (patch)
treeb8042c6ff8bd2598280368cf87d535f8a22af362 /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
parentCatch another j2k decode exception that can be caused by a bad asset (diff)
downloadopensim-SC_OLD-8944ab910cc8f62dc6ce567046a92e50b1e2813f.zip
opensim-SC_OLD-8944ab910cc8f62dc6ce567046a92e50b1e2813f.tar.gz
opensim-SC_OLD-8944ab910cc8f62dc6ce567046a92e50b1e2813f.tar.bz2
opensim-SC_OLD-8944ab910cc8f62dc6ce567046a92e50b1e2813f.tar.xz
Thank you kindly, MCortez for a patch that:
The attached patch provides the necessary infrastructure to support security and authentication features of the xmlrpc server. * Read/Write keys for accessing a Group's xmlrpc service. * Requiring user session verification for write operations.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs163
1 files changed, 96 insertions, 67 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
index d941118..a7ef40a 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
@@ -61,7 +61,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
61 61
62 private bool m_disableKeepAlive = false; 62 private bool m_disableKeepAlive = false;
63 63
64 public XmlRpcGroupDataProvider(string serviceURL, bool disableKeepAlive) 64 private string m_groupReadKey = string.Empty;
65 private string m_groupWriteKey = string.Empty;
66
67 public XmlRpcGroupDataProvider(string serviceURL, bool disableKeepAlive, string groupReadKey, string groupWriteKey)
65 { 68 {
66 m_serviceURL = serviceURL.Trim(); 69 m_serviceURL = serviceURL.Trim();
67 m_disableKeepAlive = disableKeepAlive; 70 m_disableKeepAlive = disableKeepAlive;
@@ -71,12 +74,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
71 { 74 {
72 throw new Exception("Please specify a valid ServiceURL for XmlRpcGroupDataProvider in OpenSim.ini, [Groups], XmlRpcServiceURL"); 75 throw new Exception("Please specify a valid ServiceURL for XmlRpcGroupDataProvider in OpenSim.ini, [Groups], XmlRpcServiceURL");
73 } 76 }
77
78 m_groupReadKey = groupReadKey;
79 m_groupWriteKey = groupWriteKey;
74 } 80 }
75 81
76 /// <summary> 82 /// <summary>
77 /// 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. 83 /// 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.
78 /// </summary> 84 /// </summary>
79 public UUID CreateGroup(string name, string charter, bool showInList, UUID insigniaID, 85 public UUID CreateGroup(GroupRequestID requestID, string name, string charter, bool showInList, UUID insigniaID,
80 int membershipFee, bool openEnrollment, bool allowPublish, 86 int membershipFee, bool openEnrollment, bool allowPublish,
81 bool maturePublish, UUID founderID) 87 bool maturePublish, UUID founderID)
82 { 88 {
@@ -145,7 +151,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
145 | GroupPowers.VoteOnProposal; 151 | GroupPowers.VoteOnProposal;
146 param["OwnersPowers"] = ((ulong)OwnerPowers).ToString(); 152 param["OwnersPowers"] = ((ulong)OwnerPowers).ToString();
147 153
148 Hashtable respData = XmlRpcCall("groups.createGroup", param); 154
155
156
157 Hashtable respData = XmlRpcCall(requestID, "groups.createGroup", param);
149 158
150 if (respData.Contains("error")) 159 if (respData.Contains("error"))
151 { 160 {
@@ -157,7 +166,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
157 return UUID.Parse((string)respData["GroupID"]); 166 return UUID.Parse((string)respData["GroupID"]);
158 } 167 }
159 168
160 public void UpdateGroup(UUID groupID, string charter, bool showInList, 169 public void UpdateGroup(GroupRequestID requestID, UUID groupID, string charter, bool showInList,
161 UUID insigniaID, int membershipFee, bool openEnrollment, 170 UUID insigniaID, int membershipFee, bool openEnrollment,
162 bool allowPublish, bool maturePublish) 171 bool allowPublish, bool maturePublish)
163 { 172 {
@@ -171,10 +180,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
171 param["AllowPublish"] = allowPublish == true ? 1 : 0; 180 param["AllowPublish"] = allowPublish == true ? 1 : 0;
172 param["MaturePublish"] = maturePublish == true ? 1 : 0; 181 param["MaturePublish"] = maturePublish == true ? 1 : 0;
173 182
174 XmlRpcCall("groups.updateGroup", param); 183 XmlRpcCall(requestID, "groups.updateGroup", param);
175 } 184 }
176 185
177 public void AddGroupRole(UUID groupID, UUID roleID, string name, string description, 186 public void AddGroupRole(GroupRequestID requestID, UUID groupID, UUID roleID, string name, string description,
178 string title, ulong powers) 187 string title, ulong powers)
179 { 188 {
180 Hashtable param = new Hashtable(); 189 Hashtable param = new Hashtable();
@@ -185,19 +194,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
185 param["Title"] = title; 194 param["Title"] = title;
186 param["Powers"] = powers.ToString(); 195 param["Powers"] = powers.ToString();
187 196
188 XmlRpcCall("groups.addRoleToGroup", param); 197 XmlRpcCall(requestID, "groups.addRoleToGroup", param);
189 } 198 }
190 199
191 public void RemoveGroupRole(UUID groupID, UUID roleID) 200 public void RemoveGroupRole(GroupRequestID requestID, UUID groupID, UUID roleID)
192 { 201 {
193 Hashtable param = new Hashtable(); 202 Hashtable param = new Hashtable();
194 param["GroupID"] = groupID.ToString(); 203 param["GroupID"] = groupID.ToString();
195 param["RoleID"] = roleID.ToString(); 204 param["RoleID"] = roleID.ToString();
196 205
197 XmlRpcCall("groups.removeRoleFromGroup", param); 206 XmlRpcCall(requestID, "groups.removeRoleFromGroup", param);
198 } 207 }
199 208
200 public void UpdateGroupRole(UUID groupID, UUID roleID, string name, string description, 209 public void UpdateGroupRole(GroupRequestID requestID, UUID groupID, UUID roleID, string name, string description,
201 string title, ulong powers) 210 string title, ulong powers)
202 { 211 {
203 Hashtable param = new Hashtable(); 212 Hashtable param = new Hashtable();
@@ -217,10 +226,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
217 } 226 }
218 param["Powers"] = powers.ToString(); 227 param["Powers"] = powers.ToString();
219 228
220 XmlRpcCall("groups.updateGroupRole", param); 229 XmlRpcCall(requestID, "groups.updateGroupRole", param);
221 } 230 }
222 231
223 public GroupRecord GetGroupRecord(UUID GroupID, string GroupName) 232 public GroupRecord GetGroupRecord(GroupRequestID requestID, UUID GroupID, string GroupName)
224 { 233 {
225 Hashtable param = new Hashtable(); 234 Hashtable param = new Hashtable();
226 if (GroupID != UUID.Zero) 235 if (GroupID != UUID.Zero)
@@ -232,8 +241,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
232 param["Name"] = GroupName.ToString(); 241 param["Name"] = GroupName.ToString();
233 } 242 }
234 243
235 244 Hashtable respData = XmlRpcCall(requestID, "groups.getGroup", param);
236 Hashtable respData = XmlRpcCall("groups.getGroup", param);
237 245
238 if (respData.Contains("error")) 246 if (respData.Contains("error"))
239 { 247 {
@@ -241,15 +249,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
241 } 249 }
242 250
243 return GroupProfileHashtableToGroupRecord(respData); 251 return GroupProfileHashtableToGroupRecord(respData);
252
244 } 253 }
245 254
246 public GroupProfileData GetMemberGroupProfile(UUID GroupID, UUID AgentID) 255 public GroupProfileData GetMemberGroupProfile(GroupRequestID requestID, UUID GroupID, UUID AgentID)
247 { 256 {
248 Hashtable param = new Hashtable(); 257 Hashtable param = new Hashtable();
249 param["GroupID"] = GroupID.ToString(); 258 param["GroupID"] = GroupID.ToString();
250 259
251 260 Hashtable respData = XmlRpcCall(requestID, "groups.getGroup", param);
252 Hashtable respData = XmlRpcCall("groups.getGroup", param);
253 261
254 if (respData.Contains("error")) 262 if (respData.Contains("error"))
255 { 263 {
@@ -257,13 +265,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
257 return new GroupProfileData(); 265 return new GroupProfileData();
258 } 266 }
259 267
260 GroupMembershipData MemberInfo = GetAgentGroupMembership(AgentID, GroupID); 268 GroupMembershipData MemberInfo = GetAgentGroupMembership(requestID, AgentID, GroupID);
261 GroupProfileData MemberGroupProfile = GroupProfileHashtableToGroupProfileData(respData); 269 GroupProfileData MemberGroupProfile = GroupProfileHashtableToGroupProfileData(respData);
262 270
263 MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle; 271 MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle;
264 MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; 272 MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
265 273
266 return MemberGroupProfile; 274 return MemberGroupProfile;
275
267 } 276 }
268 277
269 private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile) 278 private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile)
@@ -314,26 +323,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
314 return group; 323 return group;
315 } 324 }
316 325
317 public void SetAgentActiveGroup(UUID AgentID, UUID GroupID) 326 public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
318 { 327 {
319 Hashtable param = new Hashtable(); 328 Hashtable param = new Hashtable();
320 param["AgentID"] = AgentID.ToString(); 329 param["AgentID"] = AgentID.ToString();
321 param["GroupID"] = GroupID.ToString(); 330 param["GroupID"] = GroupID.ToString();
322 331
323 XmlRpcCall("groups.setAgentActiveGroup", param); 332 XmlRpcCall(requestID, "groups.setAgentActiveGroup", param);
324 } 333 }
325 334
326 public void SetAgentActiveGroupRole(UUID AgentID, UUID GroupID, UUID RoleID) 335 public void SetAgentActiveGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
327 { 336 {
328 Hashtable param = new Hashtable(); 337 Hashtable param = new Hashtable();
329 param["AgentID"] = AgentID.ToString(); 338 param["AgentID"] = AgentID.ToString();
330 param["GroupID"] = GroupID.ToString(); 339 param["GroupID"] = GroupID.ToString();
331 param["SelectedRoleID"] = RoleID.ToString(); 340 param["SelectedRoleID"] = RoleID.ToString();
332 341
333 XmlRpcCall("groups.setAgentGroupInfo", param); 342 XmlRpcCall(requestID, "groups.setAgentGroupInfo", param);
334 } 343 }
335 344
336 public void SetAgentGroupInfo(UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile) 345 public void SetAgentGroupInfo(GroupRequestID requestID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile)
337 { 346 {
338 Hashtable param = new Hashtable(); 347 Hashtable param = new Hashtable();
339 param["AgentID"] = AgentID.ToString(); 348 param["AgentID"] = AgentID.ToString();
@@ -341,10 +350,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
341 param["AcceptNotices"] = AcceptNotices ? "1" : "0"; 350 param["AcceptNotices"] = AcceptNotices ? "1" : "0";
342 param["ListInProfile"] = ListInProfile ? "1" : "0"; 351 param["ListInProfile"] = ListInProfile ? "1" : "0";
343 352
344 XmlRpcCall("groups.setAgentGroupInfo", param); 353 XmlRpcCall(requestID, "groups.setAgentGroupInfo", param);
354
345 } 355 }
346 356
347 public void AddAgentToGroupInvite(UUID inviteID, UUID groupID, UUID roleID, UUID agentID) 357 public void AddAgentToGroupInvite(GroupRequestID requestID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
348 { 358 {
349 Hashtable param = new Hashtable(); 359 Hashtable param = new Hashtable();
350 param["InviteID"] = inviteID.ToString(); 360 param["InviteID"] = inviteID.ToString();
@@ -352,15 +362,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
352 param["RoleID"] = roleID.ToString(); 362 param["RoleID"] = roleID.ToString();
353 param["GroupID"] = groupID.ToString(); 363 param["GroupID"] = groupID.ToString();
354 364
355 XmlRpcCall("groups.addAgentToGroupInvite", param); 365 XmlRpcCall(requestID, "groups.addAgentToGroupInvite", param);
366
356 } 367 }
357 368
358 public GroupInviteInfo GetAgentToGroupInvite(UUID inviteID) 369 public GroupInviteInfo GetAgentToGroupInvite(GroupRequestID requestID, UUID inviteID)
359 { 370 {
360 Hashtable param = new Hashtable(); 371 Hashtable param = new Hashtable();
361 param["InviteID"] = inviteID.ToString(); 372 param["InviteID"] = inviteID.ToString();
362 373
363 Hashtable respData = XmlRpcCall("groups.getAgentToGroupInvite", param); 374 Hashtable respData = XmlRpcCall(requestID, "groups.getAgentToGroupInvite", param);
364 375
365 if (respData.Contains("error")) 376 if (respData.Contains("error"))
366 { 377 {
@@ -376,59 +387,60 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
376 return inviteInfo; 387 return inviteInfo;
377 } 388 }
378 389
379 public void RemoveAgentToGroupInvite(UUID inviteID) 390 public void RemoveAgentToGroupInvite(GroupRequestID requestID, UUID inviteID)
380 { 391 {
381 Hashtable param = new Hashtable(); 392 Hashtable param = new Hashtable();
382 param["InviteID"] = inviteID.ToString(); 393 param["InviteID"] = inviteID.ToString();
383 394
384 XmlRpcCall("groups.removeAgentToGroupInvite", param); 395 XmlRpcCall(requestID, "groups.removeAgentToGroupInvite", param);
385 } 396 }
386 397
387 public void AddAgentToGroup(UUID AgentID, UUID GroupID, UUID RoleID) 398 public void AddAgentToGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
388 { 399 {
389 Hashtable param = new Hashtable(); 400 Hashtable param = new Hashtable();
390 param["AgentID"] = AgentID.ToString(); 401 param["AgentID"] = AgentID.ToString();
391 param["GroupID"] = GroupID.ToString(); 402 param["GroupID"] = GroupID.ToString();
392 param["RoleID"] = RoleID.ToString(); 403 param["RoleID"] = RoleID.ToString();
393 404
394 XmlRpcCall("groups.addAgentToGroup", param); 405 XmlRpcCall(requestID, "groups.addAgentToGroup", param);
395 } 406 }
396 407
397 public void RemoveAgentFromGroup(UUID AgentID, UUID GroupID) 408 public void RemoveAgentFromGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
398 { 409 {
399 Hashtable param = new Hashtable(); 410 Hashtable param = new Hashtable();
400 param["AgentID"] = AgentID.ToString(); 411 param["AgentID"] = AgentID.ToString();
401 param["GroupID"] = GroupID.ToString(); 412 param["GroupID"] = GroupID.ToString();
402 413
403 XmlRpcCall("groups.removeAgentFromGroup", param); 414 XmlRpcCall(requestID, "groups.removeAgentFromGroup", param);
404 } 415 }
405 416
406 public void AddAgentToGroupRole(UUID AgentID, UUID GroupID, UUID RoleID) 417 public void AddAgentToGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
407 { 418 {
408 Hashtable param = new Hashtable(); 419 Hashtable param = new Hashtable();
409 param["AgentID"] = AgentID.ToString(); 420 param["AgentID"] = AgentID.ToString();
410 param["GroupID"] = GroupID.ToString(); 421 param["GroupID"] = GroupID.ToString();
411 param["RoleID"] = RoleID.ToString(); 422 param["RoleID"] = RoleID.ToString();
412 423
413 XmlRpcCall("groups.addAgentToGroupRole", param); 424 XmlRpcCall(requestID, "groups.addAgentToGroupRole", param);
414 } 425 }
415 426
416 public void RemoveAgentFromGroupRole(UUID AgentID, UUID GroupID, UUID RoleID) 427 public void RemoveAgentFromGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
417 { 428 {
418 Hashtable param = new Hashtable(); 429 Hashtable param = new Hashtable();
419 param["AgentID"] = AgentID.ToString(); 430 param["AgentID"] = AgentID.ToString();
420 param["GroupID"] = GroupID.ToString(); 431 param["GroupID"] = GroupID.ToString();
421 param["RoleID"] = RoleID.ToString(); 432 param["RoleID"] = RoleID.ToString();
422 433
423 XmlRpcCall("groups.removeAgentFromGroupRole", param); 434 XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param);
424 } 435 }
425 436
426 public List<DirGroupsReplyData> FindGroups(string search) 437
438 public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search)
427 { 439 {
428 Hashtable param = new Hashtable(); 440 Hashtable param = new Hashtable();
429 param["Search"] = search; 441 param["Search"] = search;
430 442
431 Hashtable respData = XmlRpcCall("groups.findGroups", param); 443 Hashtable respData = XmlRpcCall(requestID, "groups.findGroups", param);
432 444
433 List<DirGroupsReplyData> findings = new List<DirGroupsReplyData>(); 445 List<DirGroupsReplyData> findings = new List<DirGroupsReplyData>();
434 446
@@ -450,13 +462,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
450 return findings; 462 return findings;
451 } 463 }
452 464
453 public GroupMembershipData GetAgentGroupMembership(UUID AgentID, UUID GroupID) 465 public GroupMembershipData GetAgentGroupMembership(GroupRequestID requestID, UUID AgentID, UUID GroupID)
454 { 466 {
455 Hashtable param = new Hashtable(); 467 Hashtable param = new Hashtable();
456 param["AgentID"] = AgentID.ToString(); 468 param["AgentID"] = AgentID.ToString();
457 param["GroupID"] = GroupID.ToString(); 469 param["GroupID"] = GroupID.ToString();
458 470
459 Hashtable respData = XmlRpcCall("groups.getAgentGroupMembership", param); 471 Hashtable respData = XmlRpcCall(requestID, "groups.getAgentGroupMembership", param);
460 472
461 if (respData.Contains("error")) 473 if (respData.Contains("error"))
462 { 474 {
@@ -468,12 +480,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
468 return data; 480 return data;
469 } 481 }
470 482
471 public GroupMembershipData GetAgentActiveMembership(UUID AgentID) 483 public GroupMembershipData GetAgentActiveMembership(GroupRequestID requestID, UUID AgentID)
472 { 484 {
473 Hashtable param = new Hashtable(); 485 Hashtable param = new Hashtable();
474 param["AgentID"] = AgentID.ToString(); 486 param["AgentID"] = AgentID.ToString();
475 487
476 Hashtable respData = XmlRpcCall("groups.getAgentActiveMembership", param); 488 Hashtable respData = XmlRpcCall(requestID, "groups.getAgentActiveMembership", param);
477 489
478 if (respData.Contains("error")) 490 if (respData.Contains("error"))
479 { 491 {
@@ -483,12 +495,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
483 return HashTableToGroupMembershipData(respData); 495 return HashTableToGroupMembershipData(respData);
484 } 496 }
485 497
486 public List<GroupMembershipData> GetAgentGroupMemberships(UUID AgentID) 498
499 public List<GroupMembershipData> GetAgentGroupMemberships(GroupRequestID requestID, UUID AgentID)
487 { 500 {
488 Hashtable param = new Hashtable(); 501 Hashtable param = new Hashtable();
489 param["AgentID"] = AgentID.ToString(); 502 param["AgentID"] = AgentID.ToString();
490 503
491 Hashtable respData = XmlRpcCall("groups.getAgentGroupMemberships", param); 504 Hashtable respData = XmlRpcCall(requestID, "groups.getAgentGroupMemberships", param);
492 505
493 List<GroupMembershipData> memberships = new List<GroupMembershipData>(); 506 List<GroupMembershipData> memberships = new List<GroupMembershipData>();
494 507
@@ -503,13 +516,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
503 return memberships; 516 return memberships;
504 } 517 }
505 518
506 public List<GroupRolesData> GetAgentGroupRoles(UUID AgentID, UUID GroupID) 519 public List<GroupRolesData> GetAgentGroupRoles(GroupRequestID requestID, UUID AgentID, UUID GroupID)
507 { 520 {
508 Hashtable param = new Hashtable(); 521 Hashtable param = new Hashtable();
509 param["AgentID"] = AgentID.ToString(); 522 param["AgentID"] = AgentID.ToString();
510 param["GroupID"] = GroupID.ToString(); 523 param["GroupID"] = GroupID.ToString();
511 524
512 Hashtable respData = XmlRpcCall("groups.getAgentRoles", param); 525 Hashtable respData = XmlRpcCall(requestID, "groups.getAgentRoles", param);
513 526
514 List<GroupRolesData> Roles = new List<GroupRolesData>(); 527 List<GroupRolesData> Roles = new List<GroupRolesData>();
515 528
@@ -531,14 +544,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
531 } 544 }
532 545
533 return Roles; 546 return Roles;
547
548
534 } 549 }
535 550
536 public List<GroupRolesData> GetGroupRoles(UUID GroupID) 551 public List<GroupRolesData> GetGroupRoles(GroupRequestID requestID, UUID GroupID)
537 { 552 {
538 Hashtable param = new Hashtable(); 553 Hashtable param = new Hashtable();
539 param["GroupID"] = GroupID.ToString(); 554 param["GroupID"] = GroupID.ToString();
540 555
541 Hashtable respData = XmlRpcCall("groups.getGroupRoles", param); 556 Hashtable respData = XmlRpcCall(requestID, "groups.getGroupRoles", param);
542 557
543 List<GroupRolesData> Roles = new List<GroupRolesData>(); 558 List<GroupRolesData> Roles = new List<GroupRolesData>();
544 559
@@ -561,6 +576,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
561 } 576 }
562 577
563 return Roles; 578 return Roles;
579
564 } 580 }
565 581
566 private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) 582 private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData)
@@ -598,12 +614,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
598 return data; 614 return data;
599 } 615 }
600 616
601 public List<GroupMembersData> GetGroupMembers(UUID GroupID) 617 public List<GroupMembersData> GetGroupMembers(GroupRequestID requestID, UUID GroupID)
602 { 618 {
603 Hashtable param = new Hashtable(); 619 Hashtable param = new Hashtable();
604 param["GroupID"] = GroupID.ToString(); 620 param["GroupID"] = GroupID.ToString();
605 621
606 Hashtable respData = XmlRpcCall("groups.getGroupMembers", param); 622 Hashtable respData = XmlRpcCall(requestID, "groups.getGroupMembers", param);
607 623
608 List<GroupMembersData> members = new List<GroupMembersData>(); 624 List<GroupMembersData> members = new List<GroupMembersData>();
609 625
@@ -628,14 +644,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
628 } 644 }
629 645
630 return members; 646 return members;
647
631 } 648 }
632 649
633 public List<GroupRoleMembersData> GetGroupRoleMembers(UUID GroupID) 650 public List<GroupRoleMembersData> GetGroupRoleMembers(GroupRequestID requestID, UUID GroupID)
634 { 651 {
635 Hashtable param = new Hashtable(); 652 Hashtable param = new Hashtable();
636 param["GroupID"] = GroupID.ToString(); 653 param["GroupID"] = GroupID.ToString();
637 654
638 Hashtable respData = XmlRpcCall("groups.getGroupRoleMembers", param); 655 Hashtable respData = XmlRpcCall(requestID, "groups.getGroupRoleMembers", param);
639 656
640 List<GroupRoleMembersData> members = new List<GroupRoleMembersData>(); 657 List<GroupRoleMembersData> members = new List<GroupRoleMembersData>();
641 658
@@ -651,16 +668,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
651 members.Add(data); 668 members.Add(data);
652 } 669 }
653 } 670 }
654
655 return members; 671 return members;
656 } 672 }
657 673
658 public List<GroupNoticeData> GetGroupNotices(UUID GroupID) 674 public List<GroupNoticeData> GetGroupNotices(GroupRequestID requestID, UUID GroupID)
659 { 675 {
660 Hashtable param = new Hashtable(); 676 Hashtable param = new Hashtable();
661 param["GroupID"] = GroupID.ToString(); 677 param["GroupID"] = GroupID.ToString();
662 678
663 Hashtable respData = XmlRpcCall("groups.getGroupNotices", param); 679 Hashtable respData = XmlRpcCall(requestID, "groups.getGroupNotices", param);
664 680
665 List<GroupNoticeData> values = new List<GroupNoticeData>(); 681 List<GroupNoticeData> values = new List<GroupNoticeData>();
666 682
@@ -679,16 +695,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
679 values.Add(data); 695 values.Add(data);
680 } 696 }
681 } 697 }
682
683 return values; 698 return values;
699
684 } 700 }
685 701 public GroupNoticeInfo GetGroupNotice(GroupRequestID requestID, UUID noticeID)
686 public GroupNoticeInfo GetGroupNotice(UUID noticeID)
687 { 702 {
688 Hashtable param = new Hashtable(); 703 Hashtable param = new Hashtable();
689 param["NoticeID"] = noticeID.ToString(); 704 param["NoticeID"] = noticeID.ToString();
690 705
691 Hashtable respData = XmlRpcCall("groups.getGroupNotice", param); 706 Hashtable respData = XmlRpcCall(requestID, "groups.getGroupNotice", param);
692 707
693 708
694 if (respData.Contains("error")) 709 if (respData.Contains("error"))
@@ -714,8 +729,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
714 729
715 return data; 730 return data;
716 } 731 }
717 732 public void AddGroupNotice(GroupRequestID requestID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
718 public void AddGroupNotice(UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
719 { 733 {
720 string binBucket = OpenMetaverse.Utils.BytesToHexString(binaryBucket, ""); 734 string binBucket = OpenMetaverse.Utils.BytesToHexString(binaryBucket, "");
721 735
@@ -728,11 +742,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
728 param["BinaryBucket"] = binBucket; 742 param["BinaryBucket"] = binBucket;
729 param["TimeStamp"] = ((uint)Util.UnixTimeSinceEpoch()).ToString(); 743 param["TimeStamp"] = ((uint)Util.UnixTimeSinceEpoch()).ToString();
730 744
731 XmlRpcCall("groups.addGroupNotice", param); 745 XmlRpcCall(requestID, "groups.addGroupNotice", param);
732 } 746 }
733 747
734 private Hashtable XmlRpcCall(string function, Hashtable param) 748 private Hashtable XmlRpcCall(GroupRequestID requestID, string function, Hashtable param)
735 { 749 {
750 if (requestID == null)
751 {
752 requestID = new GroupRequestID();
753 }
754 param.Add("RequestingAgentID", requestID.AgentID.ToString());
755 param.Add("RequestingAgentUserService", requestID.UserServiceURL);
756 param.Add("RequestingSessionID", requestID.SessionID.ToString());
757
758
759 param.Add("ReadKey", m_groupReadKey);
760 param.Add("WriteKey", m_groupWriteKey);
761
762
736 IList parameters = new ArrayList(); 763 IList parameters = new ArrayList();
737 parameters.Add(param); 764 parameters.Add(param);
738 765
@@ -758,9 +785,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
758 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); 785 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
759 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); 786 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
760 787
761 foreach (KeyValuePair<object, object> kvp in param) 788
789 foreach (string key in param.Keys)
762 { 790 {
763 m_log.WarnFormat("[XMLRPCGROUPDATA]: {0} :: {1}", kvp.Key.ToString(), kvp.Value.ToString()); 791 m_log.WarnFormat("[XMLRPCGROUPDATA]: {0} :: {1}", key, param[key].ToString());
764 } 792 }
765 793
766 Hashtable respData = new Hashtable(); 794 Hashtable respData = new Hashtable();
@@ -817,6 +845,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
817 845
818 } 846 }
819 } 847 }
848
820 } 849 }
821 850
822 public class GroupNoticeInfo 851 public class GroupNoticeInfo