aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-10-24 14:53:13 +0000
committerMelanie Thielker2008-10-24 14:53:13 +0000
commit6775b7d02d01f42439e2b3cfa8fd862e0a586599 (patch)
treec0d5ea2fbbc50257950d563daff958afe54abe26
parentFixed a floating point error accumulation that was causing missing end faces ... (diff)
downloadopensim-SC-6775b7d02d01f42439e2b3cfa8fd862e0a586599.zip
opensim-SC-6775b7d02d01f42439e2b3cfa8fd862e0a586599.tar.gz
opensim-SC-6775b7d02d01f42439e2b3cfa8fd862e0a586599.tar.bz2
opensim-SC-6775b7d02d01f42439e2b3cfa8fd862e0a586599.tar.xz
Lotsa plumming :)
-rw-r--r--OpenSim/Framework/GroupData.cs57
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs255
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs2
-rw-r--r--OpenSim/Region/Interfaces/IGroupsModule.cs45
-rw-r--r--prebuild.xml1
5 files changed, 358 insertions, 2 deletions
diff --git a/OpenSim/Framework/GroupData.cs b/OpenSim/Framework/GroupData.cs
index 66b1875..76034c0 100644
--- a/OpenSim/Framework/GroupData.cs
+++ b/OpenSim/Framework/GroupData.cs
@@ -52,6 +52,61 @@ namespace OpenSim.Framework
52 // 52 //
53 public bool AcceptNotices = true; 53 public bool AcceptNotices = true;
54 public int Contribution = 0; 54 public int Contribution = 0;
55 public uint GroupPowers = 0; 55 public ulong GroupPowers = 0;
56 public bool Active = false;
57 public UUID ActiveRole = UUID.Zero;
58 }
59
60 public struct GroupTitlesData
61 {
62 public string Name;
63 public UUID UUID;
64 public bool Selected;
65 }
66
67 public struct GroupProfileData
68 {
69 public UUID GroupID;
70 public string Name;
71 public string Charter;
72 public bool ShowInList;
73 public string MemberTitle;
74 public ulong PowersMask;
75 public UUID InsigniaID;
76 public UUID FounderID;
77 public int MembershipFee;
78 public bool OpenEnrollment;
79 public int Money;
80 public int GroupMembershipCount;
81 public int GroupRolesCount;
82 public bool AllowPublish;
83 public bool MaturePublish;
84 public UUID OwnerRole;
85 }
86
87 public struct GroupMembersData
88 {
89 public UUID AgentID;
90 public int Contribution;
91 public string OnlineStatus;
92 public ulong AgentPowers;
93 public string Title;
94 public bool IsOwner;
95 }
96
97 public struct GroupRolesData
98 {
99 public UUID RoleID;
100 public string Name;
101 public string Title;
102 public string Description;
103 public ulong Powers;
104 public int Members;
105 }
106
107 public struct GroupRoleMembersData
108 {
109 public UUID RoleID;
110 public UUID MemberID;
56 } 111 }
57} 112}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6801310..207f221 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -41,6 +41,7 @@ using OpenSim.Framework;
41using OpenSim.Framework.Communications.Cache; 41using OpenSim.Framework.Communications.Cache;
42using OpenSim.Framework.Statistics; 42using OpenSim.Framework.Statistics;
43using OpenSim.Region.ClientStack.LindenUDP; 43using OpenSim.Region.ClientStack.LindenUDP;
44using OpenSim.Region.Interfaces;
44using OpenSim.Region.Environment.Scenes; 45using OpenSim.Region.Environment.Scenes;
45using Timer = System.Timers.Timer; 46using Timer = System.Timers.Timer;
46 47
@@ -6483,6 +6484,260 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6483 } 6484 }
6484 break; 6485 break;
6485 6486
6487 case PacketType.ActivateGroup:
6488 ActivateGroupPacket activateGroupPacket = (ActivateGroupPacket)Pack;
6489 IGroupsModule grps = m_scene.RequestModuleInterface<IGroupsModule>();
6490 if (grps != null)
6491 {
6492 grps.ActivateGroup(this, activateGroupPacket.AgentData.GroupID);
6493 }
6494 break;
6495
6496 case PacketType.GroupTitlesRequest:
6497 GroupTitlesRequestPacket groupTitlesRequest =
6498 (GroupTitlesRequestPacket)Pack;
6499
6500 IGroupsModule grps2 = m_scene.RequestModuleInterface<IGroupsModule>();
6501 if (grps2 != null)
6502 {
6503 GroupTitlesReplyPacket groupTitlesReply = (GroupTitlesReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupTitlesReply);
6504
6505 groupTitlesReply.AgentData =
6506 new GroupTitlesReplyPacket.AgentDataBlock();
6507
6508 groupTitlesReply.AgentData.AgentID = AgentId;
6509 groupTitlesReply.AgentData.GroupID =
6510 groupTitlesRequest.AgentData.GroupID;
6511
6512 groupTitlesReply.AgentData.RequestID =
6513 groupTitlesRequest.AgentData.RequestID;
6514
6515 List<GroupTitlesData> titles =
6516 grps2.GroupTitlesRequest(this,
6517 groupTitlesRequest.AgentData.GroupID);
6518
6519 groupTitlesReply.GroupData =
6520 new GroupTitlesReplyPacket.
6521 GroupDataBlock[titles.Count];
6522
6523 int i = 0;
6524 foreach (GroupTitlesData d in titles)
6525 {
6526 groupTitlesReply.GroupData[i] =
6527 new GroupTitlesReplyPacket.
6528 GroupDataBlock();
6529
6530 groupTitlesReply.GroupData[i].Title =
6531 Utils.StringToBytes(d.Name);
6532 groupTitlesReply.GroupData[i].RoleID =
6533 d.UUID;
6534 groupTitlesReply.GroupData[i].Selected =
6535 d.Selected;
6536 i++;
6537 }
6538
6539 OutPacket(groupTitlesReply, ThrottleOutPacketType.Task);
6540 }
6541 break;
6542
6543 case PacketType.GroupProfileRequest:
6544 GroupProfileRequestPacket groupProfileRequest =
6545 (GroupProfileRequestPacket)Pack;
6546
6547 IGroupsModule grps3 = m_scene.RequestModuleInterface<IGroupsModule>();
6548 if (grps3 != null)
6549 {
6550 GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply);
6551
6552 groupProfileReply.AgentData = new GroupProfileReplyPacket.AgentDataBlock();
6553 groupProfileReply.GroupData = new GroupProfileReplyPacket.GroupDataBlock();
6554 groupProfileReply.AgentData.AgentID = AgentId;
6555
6556 GroupProfileData d = grps3.GroupProfileRequest(this,
6557 groupProfileRequest.GroupData.GroupID);
6558
6559 groupProfileReply.GroupData.GroupID = d.GroupID;
6560 groupProfileReply.GroupData.Name = Utils.StringToBytes(d.Name);
6561 groupProfileReply.GroupData.Charter = Utils.StringToBytes(d.Charter);
6562 groupProfileReply.GroupData.ShowInList = d.ShowInList;
6563 groupProfileReply.GroupData.MemberTitle = Utils.StringToBytes(d.MemberTitle);
6564 groupProfileReply.GroupData.PowersMask = d.PowersMask;
6565 groupProfileReply.GroupData.InsigniaID = d.InsigniaID;
6566 groupProfileReply.GroupData.FounderID = d.FounderID;
6567 groupProfileReply.GroupData.MembershipFee = d.MembershipFee;
6568 groupProfileReply.GroupData.OpenEnrollment = d.OpenEnrollment;
6569 groupProfileReply.GroupData.Money = d.Money;
6570 groupProfileReply.GroupData.GroupMembershipCount = d.GroupMembershipCount;
6571 groupProfileReply.GroupData.GroupRolesCount = d.GroupRolesCount;
6572 groupProfileReply.GroupData.AllowPublish = d.AllowPublish;
6573 groupProfileReply.GroupData.MaturePublish = d.MaturePublish;
6574 groupProfileReply.GroupData.OwnerRole = d.OwnerRole;
6575
6576 OutPacket(groupProfileReply, ThrottleOutPacketType.Task);
6577 }
6578 break;
6579
6580 case PacketType.GroupMembersRequest:
6581 GroupMembersRequestPacket groupMembersRequestPacket =
6582 (GroupMembersRequestPacket)Pack;
6583
6584 IGroupsModule grps4 = m_scene.RequestModuleInterface<IGroupsModule>();
6585 List<GroupMembersData> members =
6586 grps4.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID);
6587
6588 if (grps4 != null)
6589 {
6590 GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply);
6591
6592 groupMembersReply.AgentData =
6593 new GroupMembersReplyPacket.AgentDataBlock();
6594 groupMembersReply.GroupData =
6595 new GroupMembersReplyPacket.GroupDataBlock();
6596 groupMembersReply.MemberData =
6597 new GroupMembersReplyPacket.MemberDataBlock[
6598 members.Count];
6599
6600 groupMembersReply.AgentData.AgentID = AgentId;
6601 groupMembersReply.GroupData.GroupID =
6602 groupMembersRequestPacket.GroupData.GroupID;
6603 groupMembersReply.GroupData.RequestID =
6604 groupMembersRequestPacket.GroupData.RequestID;
6605 groupMembersReply.GroupData.MemberCount = members.Count;
6606
6607 int i = 0;
6608 foreach (GroupMembersData m in members)
6609 {
6610 groupMembersReply.MemberData[i] =
6611 new GroupMembersReplyPacket.MemberDataBlock();
6612 groupMembersReply.MemberData[i].AgentID =
6613 m.AgentID;
6614 groupMembersReply.MemberData[i].Contribution =
6615 m.Contribution;
6616 groupMembersReply.MemberData[i].OnlineStatus =
6617 Utils.StringToBytes(m.OnlineStatus);
6618 groupMembersReply.MemberData[i].AgentPowers =
6619 m.AgentPowers;
6620 groupMembersReply.MemberData[i].Title =
6621 Utils.StringToBytes(m.Title);
6622 groupMembersReply.MemberData[i].IsOwner =
6623 m.IsOwner;
6624 i++;
6625 }
6626
6627 OutPacket(groupMembersReply, ThrottleOutPacketType.Task);
6628 }
6629 break;
6630
6631 case PacketType.GroupRoleDataRequest:
6632 GroupRoleDataRequestPacket groupRolesRequest =
6633 (GroupRoleDataRequestPacket)Pack;
6634
6635 IGroupsModule grps5 = m_scene.RequestModuleInterface<IGroupsModule>();
6636 if (grps5 != null)
6637 {
6638 GroupRoleDataReplyPacket groupRolesReply = (GroupRoleDataReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleDataReply);
6639
6640 groupRolesReply.AgentData =
6641 new GroupRoleDataReplyPacket.AgentDataBlock();
6642
6643 groupRolesReply.AgentData.AgentID = AgentId;
6644
6645 groupRolesReply.GroupData =
6646 new GroupRoleDataReplyPacket.
6647 GroupDataBlock();
6648
6649 groupRolesReply.GroupData.GroupID =
6650 groupRolesRequest.GroupData.GroupID;
6651
6652 groupRolesReply.GroupData.RequestID =
6653 groupRolesRequest.GroupData.RequestID;
6654
6655 List<GroupRolesData> titles =
6656 grps5.GroupRoleDataRequest(this,
6657 groupRolesRequest.GroupData.GroupID);
6658
6659 groupRolesReply.GroupData.RoleCount =
6660 titles.Count;
6661
6662 groupRolesReply.RoleData =
6663 new GroupRoleDataReplyPacket.
6664 RoleDataBlock[titles.Count];
6665
6666 int i = 0;
6667 foreach (GroupRolesData d in titles)
6668 {
6669 groupRolesReply.RoleData[i] =
6670 new GroupRoleDataReplyPacket.
6671 RoleDataBlock();
6672
6673 groupRolesReply.RoleData[i].RoleID =
6674 d.RoleID;
6675 groupRolesReply.RoleData[i].Name =
6676 Utils.StringToBytes(d.Name);
6677 groupRolesReply.RoleData[i].Title =
6678 Utils.StringToBytes(d.Title);
6679 groupRolesReply.RoleData[i].Description =
6680 Utils.StringToBytes(d.Description);
6681 groupRolesReply.RoleData[i].Powers =
6682 d.Powers;
6683 groupRolesReply.RoleData[i].Members =
6684 (uint)d.Members;
6685
6686 i++;
6687 }
6688
6689Console.WriteLine(groupRolesReply.ToString());
6690 OutPacket(groupRolesReply, ThrottleOutPacketType.Task);
6691 }
6692 break;
6693
6694 case PacketType.GroupRoleMembersRequest:
6695 GroupRoleMembersRequestPacket groupRoleMembersRequest =
6696 (GroupRoleMembersRequestPacket)Pack;
6697
6698 IGroupsModule grps6 = m_scene.RequestModuleInterface<IGroupsModule>();
6699 if (grps6 != null)
6700 {
6701 GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply);
6702 groupRoleMembersReply.AgentData =
6703 new GroupRoleMembersReplyPacket.AgentDataBlock();
6704 groupRoleMembersReply.AgentData.AgentID =
6705 AgentId;
6706 groupRoleMembersReply.AgentData.GroupID =
6707 groupRoleMembersRequest.GroupData.GroupID;
6708 groupRoleMembersReply.AgentData.RequestID =
6709 groupRoleMembersRequest.GroupData.RequestID;
6710
6711 List<GroupRoleMembersData> mappings =
6712 grps6.GroupRoleMembersRequest(this,
6713 groupRoleMembersRequest.GroupData.GroupID);
6714
6715 groupRoleMembersReply.AgentData.TotalPairs =
6716 (uint)mappings.Count;
6717
6718 groupRoleMembersReply.MemberData =
6719 new GroupRoleMembersReplyPacket.
6720 MemberDataBlock[mappings.Count];
6721
6722 int i = 0;
6723 foreach (GroupRoleMembersData d in mappings)
6724 {
6725 groupRoleMembersReply.MemberData[i] =
6726 new GroupRoleMembersReplyPacket.
6727 MemberDataBlock();
6728
6729 groupRoleMembersReply.MemberData[i].RoleID =
6730 d.RoleID;
6731 groupRoleMembersReply.MemberData[i].MemberID =
6732 d.MemberID;
6733 i++;
6734 }
6735
6736
6737 OutPacket(groupRoleMembersReply, ThrottleOutPacketType.Task);
6738 }
6739 break;
6740
6486 default: 6741 default:
6487 m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); 6742 m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
6488 break; 6743 break;
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
index 0bb3c32..1824134 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
162 { 162 {
163 UUID ActiveGroupID; 163 UUID ActiveGroupID;
164 string ActiveGroupName; 164 string ActiveGroupName;
165 uint ActiveGroupPowers; 165 ulong ActiveGroupPowers;
166 166
167 string firstname = remoteClient.FirstName; 167 string firstname = remoteClient.FirstName;
168 string lastname = remoteClient.LastName; 168 string lastname = remoteClient.LastName;
diff --git a/OpenSim/Region/Interfaces/IGroupsModule.cs b/OpenSim/Region/Interfaces/IGroupsModule.cs
new file mode 100644
index 0000000..17daf3e
--- /dev/null
+++ b/OpenSim/Region/Interfaces/IGroupsModule.cs
@@ -0,0 +1,45 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using OpenSim.Framework;
31using OpenMetaverse;
32
33namespace OpenSim.Region.Interfaces
34{
35 public interface IGroupsModule
36 {
37 void ActivateGroup(IClientAPI remoteClient, UUID groupID);
38 List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID);
39 List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID);
40 List<GroupRolesData> GroupRoleDataRequest(IClientAPI remoteClient, UUID groupID);
41 List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID);
42 GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID);
43
44 }
45}
diff --git a/prebuild.xml b/prebuild.xml
index 961a56e..438736e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -960,6 +960,7 @@
960 <Reference name="OpenMetaverse.dll"/> 960 <Reference name="OpenMetaverse.dll"/>
961 <Reference name="OpenSim.Region.Environment"/> 961 <Reference name="OpenSim.Region.Environment"/>
962 <Reference name="OpenSim.Framework"/> 962 <Reference name="OpenSim.Framework"/>
963 <Reference name="OpenSim.Region.Interfaces"/>
963 <Reference name="OpenSim.Data"/> 964 <Reference name="OpenSim.Data"/>
964 <Reference name="OpenSim.Framework.Servers"/> 965 <Reference name="OpenSim.Framework.Servers"/>
965 <Reference name="OpenSim.Framework.Console"/> 966 <Reference name="OpenSim.Framework.Console"/>