public GridInstantMessage(IScene scene, UUID _fromAgentID, string _fromAgentName, UUID _toAgentID, byte _dialog, bool _fromGroup, string _message, UUID _imSessionID, bool _offline, Vector3 _position, byte[] _binaryBucket, bool addTimestamp) { fromAgentID = _fromAgentID.Guid; fromAgentName = _fromAgentName; toAgentID = _toAgentID.Guid; dialog = _dialog; fromGroup = _fromGroup; message = _message; imSessionID = _imSessionID.Guid; if (_offline) { offline = 1; } else { offline = 0; } Position = _position; binaryBucket = _binaryBucket; if (scene != null) { ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID; RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid; } if (addTimestamp) { timestamp = (uint)Util.UnixTimeSinceEpoch(); } }
public static InventoryItemBase GetEmbeddedItem(byte[] data, UUID itemID) { if (data == null || data.Length < 300) { return(null); } string note = Util.UTF8.GetString(data); if (String.IsNullOrWhiteSpace(note)) { return(null); } // waste some time checking rigid versions string version = note.Substring(0, 21); if (!version.Equals("Linden text version 2")) { return(null); } version = note.Substring(24, 25); if (!version.Equals("LLEmbeddedItems version 1")) { return(null); } int indx = note.IndexOf(itemID.ToString(), 100); if (indx < 0) { return(null); } indx = note.IndexOf("permissions", indx, 100); // skip parentID if (indx < 0) { return(null); } string valuestr; indx = getField(note, indx, "base_mask", false, out valuestr); if (indx < 0) { return(null); } if (!uint.TryParse(valuestr, NumberStyles.HexNumber, Culture.NumberFormatInfo, out uint basemask)) { return(null); } indx = getField(note, indx, "owner_mask", false, out valuestr); if (indx < 0) { return(null); } if (!uint.TryParse(valuestr, NumberStyles.HexNumber, Culture.NumberFormatInfo, out uint ownermask)) { return(null); } indx = getField(note, indx, "group_mask", false, out valuestr); if (indx < 0) { return(null); } if (!uint.TryParse(valuestr, NumberStyles.HexNumber, Culture.NumberFormatInfo, out uint groupmask)) { return(null); } indx = getField(note, indx, "everyone_mask", false, out valuestr); if (indx < 0) { return(null); } if (!uint.TryParse(valuestr, NumberStyles.HexNumber, Culture.NumberFormatInfo, out uint everyonemask)) { return(null); } indx = getField(note, indx, "next_owner_mask", false, out valuestr); if (indx < 0) { return(null); } if (!uint.TryParse(valuestr, NumberStyles.HexNumber, Culture.NumberFormatInfo, out uint nextownermask)) { return(null); } indx = getField(note, indx, "creator_id", false, out valuestr); if (indx < 0) { return(null); } if (!UUID.TryParse(valuestr, out UUID creatorID)) { return(null); } indx = getField(note, indx, "owner_id", false, out valuestr); if (indx < 0) { return(null); } if (!UUID.TryParse(valuestr, out UUID ownerID)) { return(null); } int limit = note.Length - indx; if (limit > 120) { limit = 120; } indx = note.IndexOf('}', indx, limit); // last owner if (indx < 0) { return(null); } int curindx = indx; UUID assetID = UUID.Zero; indx = getField(note, indx, "asset_id", false, out valuestr); if (indx < 0) { indx = getField(note, curindx, "shadow_id", false, out valuestr); if (indx < 0) { return(null); } if (!UUID.TryParse(valuestr, out assetID)) { return(null); } assetID = deMoronize(assetID); } else { if (!UUID.TryParse(valuestr, out assetID)) { return(null); } } indx = getField(note, indx, "type", false, out valuestr); if (indx < 0) { return(null); } AssetType assetType = SLAssetName2Type(valuestr); indx = getField(note, indx, "inv_type", false, out valuestr); if (indx < 0) { return(null); } FolderType invType = SLInvName2Type(valuestr); indx = getField(note, indx, "flags", false, out valuestr); if (indx < 0) { return(null); } if (!uint.TryParse(valuestr, NumberStyles.HexNumber, Culture.NumberFormatInfo, out uint flags)) { return(null); } limit = note.Length - indx; if (limit > 120) { limit = 120; } indx = note.IndexOf('}', indx, limit); // skip sale if (indx < 0) { return(null); } indx = getField(note, indx, "name", true, out valuestr); if (indx < 0) { return(null); } string name = valuestr; indx = getField(note, indx, "desc", true, out valuestr); if (indx < 0) { return(null); } string desc = valuestr; InventoryItemBase item = new InventoryItemBase(); item.AssetID = assetID; item.AssetType = (sbyte)assetType; item.BasePermissions = basemask; item.CreationDate = Util.UnixTimeSinceEpoch(); item.CreatorData = ""; item.CreatorId = creatorID.ToString(); item.CurrentPermissions = ownermask; item.Description = desc; item.Flags = flags; item.Folder = UUID.Zero; item.GroupID = UUID.Zero; item.GroupOwned = false; item.GroupPermissions = groupmask; item.InvType = (sbyte)invType; item.Name = name; item.NextPermissions = nextownermask; item.Owner = ownerID; item.SalePrice = 0; item.SaleType = (byte)SaleType.Not; item.ID = UUID.Random(); return(item); }
public void SaveLastMapUUID(UUID mapUUID) { lastMapUUID = mapUUID; lastMapRefresh = Util.UnixTimeSinceEpoch().ToString(); }
public void loadConfigurationOptions() { configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "UUID of Region (Default is recommended, random UUID)", UUID.Random().ToString(), true); configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Region Name", "OpenSim Test", false); configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", ConfigSettings.DefaultRegionHttpPort.ToString(), false); configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow sim to find alternate UDP ports when ports are in use?", "false", true); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Master Avatar UUID", UUID.Zero.ToString(), true); configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked) shouldMasterAvatarDetailsBeAsked); configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked) shouldMasterAvatarDetailsBeAsked); configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked) shouldMasterAvatarDetailsBeAsked); configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Last Map UUID", lastMapUUID.ToString(), true); configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", "0", true); configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", "0", true); configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", "false", true); configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", "0", true); configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", UUID.Zero.ToString(), true); }
public void loadConfigurationOptionsFromMe() { configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE, "UUID of Region (Default is recommended, random UUID)", RegionID.ToString(), true); configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Region Name", RegionName, true); configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", m_regionLocX.ToString(), true); configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", m_regionLocY.ToString(), true); //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", m_internalEndPoint.Address.ToString(), true); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", m_internalEndPoint.Port.ToString(), true); configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow sim to find alternate UDP ports when ports are in use?", m_allow_alternate_ports.ToString(), true); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", m_externalHostName, true); configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true); configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", MasterAvatarFirstName, true); configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", MasterAvatarLastName, true); configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", MasterAvatarSandboxPassword, true); configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Last Map UUID", lastMapUUID.ToString(), true); configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", NonphysPrimMax.ToString(), true); configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", PhysPrimMax.ToString(), true); configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", m_clampPrimSize.ToString(), true); configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", m_objectCapacity.ToString(), true); configMember.addConfigurationOption("region_product", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Type of region, 1=full, 2=ocean/strait, 3=scenic, 4=plus", this.m_product.ToString(), true); configMember.addConfigurationOption("region_access", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Access restrictions, 0=anyone, 1=only Plus users", this.m_productAccess.ToString(), true); configMember.addConfigurationOption("outside_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "The ip address as seen by the outside world", this.OutsideIP, true); }
public GridInstantMessage() { binaryBucket = new byte[0]; timestamp = (uint)Util.UnixTimeSinceEpoch(); }
public void loadConfigurationOptionsFromMe() { configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE, "UUID of Region (Default is recommended, random UUID)", RegionID.ToString(), true); configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Region Name", RegionName, true); configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", m_regionLocX.ToString(), true); configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", m_regionLocY.ToString(), true); //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", m_internalEndPoint.Address.ToString(), true); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", m_internalEndPoint.Port.ToString(), true); configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow sim to find alternate UDP ports when ports are in use?", m_allow_alternate_ports.ToString(), true); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", m_externalHostName, true); configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Last Map UUID", lastMapUUID.ToString(), true); configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); configMember.addConfigurationOption("nonphysical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "Minimum size for nonphysical prims", m_nonphysPrimMin.ToString(), true); configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); configMember.addConfigurationOption("physical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "Minimum size for nonphysical prims", m_physPrimMin.ToString(), true); configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", m_physPrimMax.ToString(), true); configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", m_clampPrimSize.ToString(), true); configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", m_objectCapacity.ToString(), true); configMember.addConfigurationOption("linkset_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max prims an object will hold", m_linksetCapacity.ToString(), true); configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max avatars this sim will hold", m_agentCapacity.ToString(), true); configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", ScopeID.ToString(), true); configMember.addConfigurationOption("region_type", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Free form string describing the type of region", String.Empty, true); configMember.addConfigurationOption("region_static_maptile", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true); }