public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); OSDMap GroupInfoMap = null; if (groupID != UUID.Zero) { if (!SimianGetFirstGenericEntry(groupID, "Group", out groupName, out GroupInfoMap)) { return null; } } else if ((groupName != null) && (groupName != string.Empty)) { if (!SimianGetFirstGenericEntry("Group", groupName, out groupID, out GroupInfoMap)) { return null; } } GroupRecord GroupInfo = new GroupRecord(); GroupInfo.GroupID = groupID; GroupInfo.GroupName = groupName; GroupInfo.Charter = GroupInfoMap["Charter"].AsString(); GroupInfo.ShowInList = GroupInfoMap["ShowInList"].AsBoolean(); GroupInfo.GroupPicture = GroupInfoMap["InsigniaID"].AsUUID(); GroupInfo.MembershipFee = GroupInfoMap["MembershipFee"].AsInteger(); GroupInfo.OpenEnrollment = GroupInfoMap["OpenEnrollment"].AsBoolean(); GroupInfo.AllowPublish = GroupInfoMap["AllowPublish"].AsBoolean(); GroupInfo.MaturePublish = GroupInfoMap["MaturePublish"].AsBoolean(); GroupInfo.FounderID = GroupInfoMap["FounderID"].AsUUID(); GroupInfo.OwnerRoleID = GroupInfoMap["OwnerRoleID"].AsUUID(); return GroupInfo; }
private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile) { GroupRecord group = new GroupRecord(); group.GroupID = UUID.Parse((string)groupProfile["GroupID"]); group.GroupName = groupProfile["Name"].ToString(); if (groupProfile["Charter"] != null) { group.Charter = (string)groupProfile["Charter"]; } group.ShowInList = ((string)groupProfile["ShowInList"]) == "1"; group.GroupPicture = UUID.Parse((string)groupProfile["InsigniaID"]); group.MembershipFee = int.Parse((string)groupProfile["MembershipFee"]); group.OpenEnrollment = ((string)groupProfile["OpenEnrollment"]) == "1"; group.AllowPublish = ((string)groupProfile["AllowPublish"]) == "1"; group.MaturePublish = ((string)groupProfile["MaturePublish"]) == "1"; group.FounderID = UUID.Parse((string)groupProfile["FounderID"]); group.OwnerRoleID = UUID.Parse((string)groupProfile["OwnerRoleID"]); return group; }
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { m_log.DebugFormat( "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", groupID, groupName); XGroup xg = GetXGroup(groupID, groupName); if (xg == null) return null; GroupRecord gr = new GroupRecord() { GroupID = xg.groupID, GroupName = xg.name, AllowPublish = xg.allowPublish, MaturePublish = xg.maturePublish, Charter = xg.charter, FounderID = xg.founderID, // FIXME: group picture storage location unknown MembershipFee = xg.membershipFee, OpenEnrollment = xg.openEnrollment, OwnerRoleID = xg.ownerRoleID, ShowInList = xg.showInList }; return gr; }
private OpenSim.Framework.GroupRecord MapGroupRecordFromResult(Dictionary<string, string> result) { //osgroup.GroupID, osgroup.Name, Charter, InsigniaID, FounderID, MembershipFee, " + //"OpenEnrollment, ShowInList, AllowPublish, MaturePublish, OwnerRoleID OpenSim.Framework.GroupRecord record = new OpenSim.Framework.GroupRecord(); record.GroupID = new UUID(result["GroupID"]); record.GroupName = result["Name"]; record.Charter = result["Charter"]; record.GroupPicture = new UUID(result["InsigniaID"]); record.FounderID = new UUID(result["FounderID"]); record.MembershipFee = Int32.Parse(result["MembershipFee"]); record.OpenEnrollment = result["OpenEnrollment"] == "1"; record.ShowInList = result["ShowInList"] == "1"; record.AllowPublish = result["AllowPublish"] == "1"; record.MaturePublish = result["MaturePublish"] == "1"; record.OwnerRoleID = new UUID(result["OwnerRoleID"]); return record; }
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { m_log.DebugFormat( "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", groupID, groupName); XGroup[] groups; string field, val; if (groupID != UUID.Zero) { field = "groupID"; val = groupID.ToString(); } else { field = "name"; val = groupName; } groups = m_data.GetGroups(field, val); if (groups.Length == 0) return null; XGroup xg = groups[0]; GroupRecord gr = new GroupRecord() { GroupID = xg.groupID, GroupName = xg.name, AllowPublish = xg.allowPublish, MaturePublish = xg.maturePublish, Charter = xg.charter, FounderID = xg.founderID, // FIXME: group picture storage location unknown MembershipFee = xg.membershipFee, OpenEnrollment = xg.openEnrollment, OwnerRoleID = xg.ownerRoleID, ShowInList = xg.showInList }; return gr; }
private InventoryItemBase AddToGroupInventory(IClientAPI remoteClient, GroupRecord group, InventoryItemBase item) { Scene scene = (Scene)remoteClient.Scene; InventoryItemBase itemCopy = scene.InventoryItemForGroup(group.GroupID, remoteClient.AgentId, item.ID); if (itemCopy != null) StoreGroupItem(group.GroupID, itemCopy); return itemCopy; }
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { if (m_debugEnabled) MainConsole.Instance.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", MethodBase.GetCurrentMethod().Name); OSDMap GroupInfoMap = null; if (groupID != UUID.Zero) { if (!SimianGetFirstGenericEntry(groupID, "Group", out groupName, out GroupInfoMap)) { return null; } } else if (!string.IsNullOrEmpty(groupName)) { if (!SimianGetFirstGenericEntry("Group", groupName, out groupID, out GroupInfoMap)) { return null; } } GroupRecord GroupInfo = new GroupRecord { GroupID = groupID, GroupName = groupName, Charter = GroupInfoMap["Charter"].AsString(), ShowInList = GroupInfoMap["ShowInList"].AsBoolean(), GroupPicture = GroupInfoMap["InsigniaID"].AsUUID(), MembershipFee = GroupInfoMap["MembershipFee"].AsInteger(), OpenEnrollment = GroupInfoMap["OpenEnrollment"].AsBoolean(), AllowPublish = GroupInfoMap["AllowPublish"].AsBoolean(), MaturePublish = GroupInfoMap["MaturePublish"].AsBoolean(), FounderID = GroupInfoMap["FounderID"].AsUUID(), OwnerRoleID = GroupInfoMap["OwnerRoleID"].AsUUID() }; return GroupInfo; }
/// <summary> /// Check that the required groups structure is in place. /// </summary> /// <exception cref="GroupsException">Thrown if there is something wrong with the groups setup</exception> public void CheckForRequiredSetup() { if (!WaterWarsConstants.ENABLE_GROUPS) return; if (null == m_groupsModule) { m_groupsModule = m_controller.Scenes[0].RequestModuleInterface<IGroupsModule>(); if (null == m_groupsModule) throw new GroupsSetupException("No groups module present on server"); } if (null == m_groupsMessagingModule) { m_groupsMessagingModule = m_controller.Scenes[0].RequestModuleInterface<IGroupsMessagingModule>(); if (null == m_groupsMessagingModule) throw new GroupsSetupException("No groups messaging module present on server"); } if (null == WaterWarsGroup) WaterWarsGroup = GetGroup(WaterWarsConstants.GROUP_NAME); if (null == WaterWarsAdminGroup) WaterWarsAdminGroup = GetGroup(WaterWarsConstants.ADMIN_GROUP_NAME); m_systemAccount = m_controller.Scenes[0].UserAccountService.GetUserAccount( UUID.Zero, WaterWarsConstants.SYSTEM_PLAYER_FIRST_NAME, WaterWarsConstants.SYSTEM_PLAYER_LAST_NAME); string name = string.Format( "{0} {1}", WaterWarsConstants.SYSTEM_PLAYER_FIRST_NAME, WaterWarsConstants.SYSTEM_PLAYER_LAST_NAME); if (null == m_systemAccount) throw new GroupsSetupException( string.Format( "System player {0} not present. Please create this player before restarting OpenSim", name)); if (!IsPlayerInRequiredGroup(m_systemAccount)) throw new GroupsSetupException( string.Format( "System player {0} is not in group {1}. Please correct this.", name, WaterWarsGroup.GroupName)); }
protected void RecordGroupReference(GroupRecord gr) { m_xtw.WriteStartElement(GroupReferenceElement); m_xtw.WriteAttributeString("name", gr.GroupName); m_xtw.WriteEndElement(); }