Inheritance: Universe.Framework.Modules.IDataTransferable
 public override void FromOSD(OSDMap values)
 {
     noticeData = new GroupNoticeData();
     noticeData.FromOSD((OSDMap)values["noticeData"]);
     GroupID = values["GroupID"];
     Message = values["Message"];
     BinaryBucket = values["BinaryBucket"];
 }
 static GroupNoticeData GroupNoticeQueryResult2GroupNoticeData(List<string> result)
 {
     GroupNoticeData GND = new GroupNoticeData
                               {
                                   GroupID = UUID.Parse(result[0]),
                                   NoticeID = UUID.Parse(result[6]),
                                   Timestamp = uint.Parse(result[1]),
                                   FromName = result[2],
                                   Subject = result[3],
                                   HasAttachment = int.Parse(result[5]) == 1
                               };
     if (GND.HasAttachment)
     {
         GND.ItemID = UUID.Parse(result[4]);
         GND.AssetType = (byte) int.Parse(result[8]);
         GND.ItemName = result[9];
     }
     return GND;
 }
        public GroupNoticeData GetGroupNoticeData(UUID requestingAgentID, UUID noticeID)
        {
            if (m_doRemoteOnly) {
                object remoteValue = DoRemote (requestingAgentID, noticeID);
                return remoteValue != null ? (GroupNoticeData)remoteValue : null;
            }

            QueryFilter filter = new QueryFilter();
            filter.andFilters["NoticeID"] = noticeID;
            string[] fields = new string[9]
                                  {
                                      "GroupID",
                                      "Timestamp",
                                      "FromName",
                                      "Subject",
                                      "ItemID",
                                      "HasAttachment",
                                      "Message",
                                      "AssetType",
                                      "ItemName"
                                  };
            List<string> notice = GD.Query(fields, _NOTICEREALM, filter, null, null, null);

            if (notice.Count != fields.Length)
                return null;

            GroupNoticeData GND = new GroupNoticeData
                                      {
                                          GroupID = UUID.Parse(notice[0]),
                                          NoticeID = noticeID,
                                          Timestamp = uint.Parse(notice[1]),
                                          FromName = notice[2],
                                          Subject = notice[3],
                                          HasAttachment = int.Parse(notice[5]) == 1
                                      };
            if (GND.HasAttachment)
            {
                GND.ItemID = UUID.Parse(notice[4]);
                GND.AssetType = (byte) int.Parse(notice[7]);
                GND.ItemName = notice[8];
            }

            return GND;
        }
        public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
        {
            if (m_doRemoteOnly) {
                object remoteValue = DoRemote (requestingAgentID, noticeID);
                return remoteValue != null ? (GroupNoticeInfo)remoteValue : null;
            }

            QueryFilter filter = new QueryFilter();
            filter.andFilters["NoticeID"] = noticeID;
            string[] fields = new string[9]
                                  {
                                      "GroupID",
                                      "Timestamp",
                                      "FromName",
                                      "Subject",
                                      "ItemID",
                                      "HasAttachment",
                                      "Message",
                                      "AssetType",
                                      "ItemName"
                                  };
            List<string> notice = GD.Query(fields, _NOTICEREALM, filter, null, null, null);

            if (notice.Count != fields.Length)
                return null;

            GroupNoticeData GND = new GroupNoticeData
                                      {
                                          NoticeID = noticeID,
                                          Timestamp = uint.Parse(notice[1]),
                                          FromName = notice[2],
                                          Subject = notice[3],
                                          HasAttachment = int.Parse(notice[5]) == 1
                                      };
            if (GND.HasAttachment)
            {
                GND.ItemID = UUID.Parse(notice[4]);
                GND.AssetType = (byte) int.Parse(notice[7]);
                GND.ItemName = notice[8];
            }

            GroupNoticeInfo info = new GroupNoticeInfo
                                       {
                                           BinaryBucket = new byte[0],
                                           GroupID = UUID.Parse(notice[0]),
                                           Message = notice[6],
                                           noticeData = GND
                                       };

            return (!agentsCanBypassGroupNoticePermsCheck.Contains(requestingAgentID) &&
                    !CheckGroupPermissions(requestingAgentID, info.GroupID, (ulong) GroupPowers.ReceiveNotices))
                       ? null
                       : info;
        }
Exemplo n.º 5
0
        byte[] CreateBitBucketForGroupAttachment(GroupNoticeData groupNoticeData, UUID groupID)
        {
            int i = 20;
            i += groupNoticeData.ItemName.Length;
            byte[] bitbucket = new byte[i];
            groupID.ToBytes(bitbucket, 2);
            byte[] name = Utils.StringToBytes(" " + groupNoticeData.ItemName);
            Array.ConstrainedCopy(name, 0, bitbucket, 18, name.Length);
            //Utils.Int16ToBytes((short)item.AssetType, bitbucket, 0);
            bitbucket[0] = 1; // 0 for no attachment, 1 for attachment
            bitbucket[1] = groupNoticeData.AssetType; // Asset type

            return bitbucket;
        }