Example #1
0
        public List <GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
        {
            Hashtable param = new Hashtable();

            param["GroupID"] = GroupID.ToString();

            Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroupNotices", param);

            List <GroupNoticeData> values = new List <GroupNoticeData>();

            if (!respData.Contains("error"))
            {
                foreach (Hashtable value in respData.Values)
                {
                    GroupNoticeData data = new GroupNoticeData();
                    data.NoticeID      = UUID.Parse((string)value["NoticeID"]);
                    data.Timestamp     = uint.Parse((string)value["Timestamp"]);
                    data.FromName      = (string)value["FromName"];
                    data.Subject       = (string)value["Subject"];
                    data.HasAttachment = false;
                    data.AssetType     = 0;

                    values.Add(data);
                }
            }

            return(values);
        }
        public List <GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID groupID)
        {
            XGroup group = GetXGroup(groupID, null);

            if (group == null)
            {
                return(null);
            }

            List <GroupNoticeData> notices = new List <GroupNoticeData>();

            foreach (XGroupNotice notice in group.notices.Values)
            {
                GroupNoticeData gnd = new GroupNoticeData()
                {
                    NoticeID      = notice.noticeID,
                    Timestamp     = notice.timestamp,
                    FromName      = notice.fromName,
                    Subject       = notice.subject,
                    HasAttachment = notice.hasAttachment,
                    AssetType     = (byte)notice.assetType
                };

                notices.Add(gnd);
            }

            return(notices);
        }
Example #3
0
        public List <GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
        {
            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.ReceiveNotices))
            {
                return(new List <GroupNoticeData>());
            }
            List <GroupNoticeData> AllNotices = new List <GroupNoticeData>();
            List <string>          notice     = data.Query("GroupID", GroupID, "osgroupnotice", "GroupID,Timestamp,FromName,Subject,ItemID,HasAttachment,NoticeID,Message,AssetType,ItemName");

            for (int i = 0; i < notice.Count; i += 10)
            {
                GroupNoticeData GND = new GroupNoticeData();
                GND.NoticeID      = UUID.Parse(notice[i + 6]);
                GND.Timestamp     = uint.Parse(notice[i + 1]);
                GND.FromName      = notice[i + 2];
                GND.Subject       = notice[i + 3];
                GND.HasAttachment = int.Parse(notice[i + 5]) == 1;
                if (GND.HasAttachment)
                {
                    GND.ItemID    = UUID.Parse(notice[i + 4]);
                    GND.AssetType = (byte)int.Parse(notice[i + 8]);
                    GND.ItemName  = notice[i + 9];
                }

                AllNotices.Add(GND);
            }
            return(AllNotices);
        }
Example #4
0
        public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
        {
            List <string>   notice = data.Query("NoticeID", noticeID, "osgroupnotice", "GroupID,Timestamp,FromName,Subject,ItemID,HasAttachment,Message,AssetType,ItemName");
            GroupNoticeData GND    = new GroupNoticeData();

            GND.NoticeID      = noticeID;
            GND.Timestamp     = uint.Parse(notice[1]);
            GND.FromName      = notice[2];
            GND.Subject       = notice[3];
            GND.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();

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

            if (!CheckGroupPermissions(requestingAgentID, info.GroupID, (ulong)GroupPowers.ReceiveNotices))
            {
                return(null);
            }
            return(info);
        }
 public override void FromOSD(OSDMap values)
 {
     noticeData = new GroupNoticeData();
     noticeData.FromOSD((OSDMap)values["noticeData"]);
     GroupID      = values["GroupID"];
     Message      = values["Message"];
     BinaryBucket = values["BinaryBucket"];
 }
        public GroupNoticeData ToGroupNoticeData()
        {
            GroupNoticeData n = new GroupNoticeData();

            n.FromName      = this.FromName;
            n.AssetType     = this.AttachmentType;
            n.HasAttachment = this.HasAttachment;
            n.NoticeID      = this.NoticeID;
            n.Subject       = this.Subject;
            n.Timestamp     = this.Timestamp;

            return(n);
        }
 private 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 GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
        {
            List<string> notice = data.Query("NoticeID", noticeID, "osgroupnotice",
                                             "GroupID,Timestamp,FromName,Subject,ItemID,HasAttachment,Message,AssetType,ItemName");
            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
                                       };

            if (!agentsCanBypassGroupNoticePermsCheck.Contains(requestingAgentID) && !CheckGroupPermissions(requestingAgentID, info.GroupID, (ulong)GroupPowers.ReceiveNotices))
            {
                return null;
            }
            return info;
        }
		public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
        {
            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong)GroupPowers.ReceiveNotices))
                return new List<GroupNoticeData>();
			List<GroupNoticeData> AllNotices = new List<GroupNoticeData>();
            List<string> notice = data.Query("GroupID", GroupID, "osgroupnotice", "GroupID,Timestamp,FromName,Subject,ItemID,HasAttachment,NoticeID,Message,AssetType,ItemName");
            for (int i = 0; i < notice.Count; i += 10)
            {
                GroupNoticeData GND = new GroupNoticeData();
                GND.NoticeID = UUID.Parse(notice[i + 6]);
                GND.Timestamp = uint.Parse(notice[i + 1]);
                GND.FromName = notice[i + 2];
                GND.Subject = notice[i + 3];
                GND.HasAttachment = int.Parse(notice[i + 5]) == 1;
                if (GND.HasAttachment)
                {
                    GND.ItemID = UUID.Parse(notice[i + 4]);
                    GND.AssetType = (byte)int.Parse(notice[i + 8]);
                    GND.ItemName = notice[i + 9];
                }

				AllNotices.Add(GND);
			}
			return AllNotices;
		}
		public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
		{
            List<string> notice = data.Query("NoticeID", noticeID, "osgroupnotice", "GroupID,Timestamp,FromName,Subject,ItemID,HasAttachment,Message,AssetType,ItemName");
			GroupNoticeData GND = new GroupNoticeData();
			GND.NoticeID = noticeID;
			GND.Timestamp = uint.Parse(notice[1]);
			GND.FromName = notice[2];
			GND.Subject = notice[3];
            GND.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();
			info.BinaryBucket = new byte[0];
			info.GroupID = UUID.Parse(notice[0]);
			info.Message = notice[6];
			info.noticeData = GND;

            if (!CheckGroupPermissions(requestingAgentID, info.GroupID, (ulong)GroupPowers.ReceiveNotices))
                return null;
            return info;
		}
Example #11
0
        private 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;
        }
 public GroupNoticeInfo(Dictionary<string, object> values)
 {
     noticeData = new GroupNoticeData(values["noticeData"] as Dictionary<string, object>);
     GroupID = UUID.Parse(values["GroupID"].ToString());
     Message = values["Message"].ToString();
     BinaryBucket = Utils.HexStringToBytes(values["BinaryBucket"].ToString(), true);
 }