Esempio n. 1
0
        public bool StoreGroup(XGroup group)
        {
            lock (m_groups)
            {
                m_groups[group.groupID] = group.Clone();
            }

            return true;
        }
Esempio n. 2
0
        public XGroup Clone()
        {
            XGroup clone = (XGroup)MemberwiseClone();

            clone.members = new Dictionary <UUID, XGroupMember>();
            clone.notices = new Dictionary <UUID, XGroupNotice>();

            foreach (KeyValuePair <UUID, XGroupMember> kvp in members)
            {
                clone.members[kvp.Key] = kvp.Value.Clone();
            }

            foreach (KeyValuePair <UUID, XGroupNotice> kvp in notices)
            {
                clone.notices[kvp.Key] = kvp.Value.Clone();
            }

            return(clone);
        }
        public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, 
                                int membershipFee, bool openEnrollment, bool allowPublish, 
                                bool maturePublish, UUID founderID)
        {
            XGroup group = new XGroup()
            {
                groupID = UUID.Random(),
                ownerRoleID = UUID.Random(),
                name = name,
                charter = charter,
                showInList = showInList,
                insigniaID = insigniaID,
                membershipFee = membershipFee,
                openEnrollment = openEnrollment,
                allowPublish = allowPublish,
                maturePublish = maturePublish,
                founderID = founderID,
                everyonePowers = (ulong)XmlRpcGroupsServicesConnectorModule.DefaultEveryonePowers,
                ownersPowers = (ulong)XmlRpcGroupsServicesConnectorModule.DefaultOwnerPowers
            };

            if (m_data.StoreGroup(group))
            {
                m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: Created group {0} {1}", group.name, group.groupID);
                return group.groupID;
            }
            else
            {
                m_log.ErrorFormat("[MOCK GROUPS SERVICES CONNECTOR]: Failed to create group {0}", name);
                return UUID.Zero;
            }
        }