From 26643c4a9d057fd3a9084a71ffad9c8b688900ac Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 25 Oct 2008 01:42:43 +0000 Subject: More plumbing and some wires --- OpenSim/Framework/GroupData.cs | 10 +++++ .../Region/ClientStack/LindenUDP/LLClientView.cs | 52 ++++++++++++++++++++++ OpenSim/Region/Interfaces/IGroupsModule.cs | 4 +- 3 files changed, 65 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/GroupData.cs b/OpenSim/Framework/GroupData.cs index 9626553..3b980e7 100644 --- a/OpenSim/Framework/GroupData.cs +++ b/OpenSim/Framework/GroupData.cs @@ -113,4 +113,14 @@ namespace OpenSim.Framework public UUID RoleID; public UUID MemberID; } + + public struct GroupNoticeData + { + public UUID NoticeID; + public uint Timestamp; + public string FromName; + public string Subject; + public bool HasAttachment; + public byte AssetType; + } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 803dea6..340472c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6809,6 +6809,58 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; + case PacketType.GroupNoticesListRequest: + GroupNoticesListRequestPacket groupNoticesListRequest = + (GroupNoticesListRequestPacket)Pack; + + if (m_GroupsModule != null) + { + GroupNoticeData[] gn = + m_GroupsModule.GroupNoticesListRequest(this, + groupNoticesListRequest.Data.GroupID); + + GroupNoticesListReplyPacket groupNoticesListReply = (GroupNoticesListReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupNoticesListReply); + groupNoticesListReply.AgentData = + new GroupNoticesListReplyPacket.AgentDataBlock(); + groupNoticesListReply.AgentData.AgentID = AgentId; + groupNoticesListReply.AgentData.GroupID = groupNoticesListRequest.Data.GroupID; + + groupNoticesListReply.Data = new GroupNoticesListReplyPacket.DataBlock[gn.Length]; + + int i = 0; + foreach (GroupNoticeData g in gn) + { + groupNoticesListReply.Data[i] = new GroupNoticesListReplyPacket.DataBlock(); + groupNoticesListReply.Data[i].NoticeID = + g.NoticeID; + groupNoticesListReply.Data[i].Timestamp = + g.Timestamp; + groupNoticesListReply.Data[i].FromName = + Utils.StringToBytes(g.FromName); + groupNoticesListReply.Data[i].Subject = + Utils.StringToBytes(g.Subject); + groupNoticesListReply.Data[i].HasAttachment = + g.HasAttachment; + groupNoticesListReply.Data[i].AssetType = + g.AssetType; + i++; + } + + OutPacket(groupNoticesListReply, ThrottleOutPacketType.Task); + } + + break; + case PacketType.GroupNoticeRequest: + GroupNoticeRequestPacket groupNoticeRequest = + (GroupNoticeRequestPacket)Pack; + + if (m_GroupsModule != null) + { + m_GroupsModule.GroupNoticeRequest(this, + groupNoticeRequest.Data.GroupNoticeID); + } + break; + default: m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); break; diff --git a/OpenSim/Region/Interfaces/IGroupsModule.cs b/OpenSim/Region/Interfaces/IGroupsModule.cs index 8565e04..f5193c3 100644 --- a/OpenSim/Region/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Interfaces/IGroupsModule.cs @@ -48,7 +48,9 @@ namespace OpenSim.Region.Interfaces void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); - + + GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); + void GroupNoticeRequest(IClientAPI remoteClient, UUID groupNoticeID); void SendAgentGroupDataUpdate(IClientAPI remoteClient); } } -- cgit v1.1