/// <summary> /// Constructor. /// </summary> public SecondLife() { Network = new NetworkManager(this); Parcels = new ParcelManager(this); Self = new MainAvatar(this); Avatars = new AvatarManager(this); Grid = new GridManager(this); Objects = new ObjectManager(this); Groups = new GroupManager(this); Debug = true; }
/// <summary> /// Default constructor /// </summary> public SecondLife() { // These are order-dependant Network = new NetworkManager(this); Settings = new Settings(this); Parcels = new ParcelManager(this); Self = new MainAvatar(this); Avatars = new AvatarManager(this); Grid = new GridManager(this); Objects = new ObjectManager(this); Groups = new GroupManager(this); Assets = new AssetManager(this); Images = new ImageManager(this); Inventory = new InventoryManager(this); Throttle = new AgentThrottle(this); }
/// <summary> /// Default constructor /// </summary> public SecondLife() { // These are order-dependant Network = new NetworkManager(this); Settings = new Settings(this); Parcels = new ParcelManager(this); Self = new AgentManager(this); Avatars = new AvatarManager(this); Friends = new FriendsManager(this); Grid = new GridManager(this); Objects = new ObjectManager(this); Groups = new GroupManager(this); Assets = new AssetManager(this); Appearance = new AppearanceManager(this, Assets); Inventory = new InventoryManager(this); Directory = new DirectoryManager(this); Terrain = new TerrainManager(this); Sound = new SoundManager(this); Throttle = new AgentThrottle(this); }
private void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID, bool snapSelection) { // Check if this is for a simulator we're concerned with if (!active_sims.Contains(parcel.Simulator)) return; // Warn about parcel property request errors and bail out if (result == ParcelManager.ParcelResult.NoData) { Client.Log("ParcelDownloader received a NoData response, sequenceID " + sequenceID, Helpers.LogLevel.Warning); return; } // Warn about unexpected data and bail out if (!ParcelMarked.ContainsKey(parcel.Simulator)) { Client.Log("ParcelDownloader received unexpected parcel data for " + parcel.Simulator, Helpers.LogLevel.Warning); return; } int x, y, index, bit; int[,] markers = ParcelMarked[parcel.Simulator]; // Add this parcel to the dictionary of LocalID -> Parcel mappings lock (Parcels[parcel.Simulator]) if (!Parcels[parcel.Simulator].ContainsKey(parcel.LocalID)) Parcels[parcel.Simulator][parcel.LocalID] = parcel; // Request the access list for this parcel Client.Parcels.AccessListRequest(parcel.Simulator, parcel.LocalID, ParcelManager.AccessList.Both, 0); // Mark this area as downloaded for (y = 0; y < 64; y++) { for (x = 0; x < 64; x++) { if (markers[y, x] == 0) { index = (y * 64) + x; bit = index % 8; index >>= 3; if ((parcel.Bitmap[index] & (1 << bit)) != 0) markers[y, x] = parcel.LocalID; } } } // Request parcel information for the next missing area for (y = 0; y < 64; y++) { for (x = 0; x < 64; x++) { if (markers[y, x] == 0) { Client.Parcels.PropertiesRequest(parcel.Simulator, (y + 1) * 4.0f, (x + 1) * 4.0f, y * 4.0f, x * 4.0f, 0, false); return; } } } // If we get here, there are no more zeroes in the markers map lock (active_sims) { active_sims.Remove(parcel.Simulator); if (OnParcelsDownloaded != null) { // This map is complete, fire callback try { OnParcelsDownloaded(parcel.Simulator, Parcels[parcel.Simulator], markers); } catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); } } } }
//Separate thread private void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID, bool snapSelection) { StringBuilder sb = new StringBuilder(); sb.Append("Parcel: "); sb.Append(parcel.Name); if ((parcel.Flags & Parcel.ParcelFlags.AllowFly) != Parcel.ParcelFlags.AllowFly) sb.Append(" (no fly)"); if ((parcel.Flags & Parcel.ParcelFlags.CreateObjects) != Parcel.ParcelFlags.CreateObjects) sb.Append(" (no build)"); if ((parcel.Flags & Parcel.ParcelFlags.AllowOtherScripts) != Parcel.ParcelFlags.AllowOtherScripts) sb.Append(" (no scripts)"); if ((parcel.Flags & Parcel.ParcelFlags.RestrictPushObject) == Parcel.ParcelFlags.RestrictPushObject) sb.Append(" (no push)"); if ((parcel.Flags & Parcel.ParcelFlags.AllowDamage) == Parcel.ParcelFlags.AllowDamage) sb.Append(" (damage)"); BeginInvoke(new MethodInvoker(delegate() { tlblParcel.Text = sb.ToString(); })); }
public void Parcels_OnParcelProperties(Parcel parcel, ParcelManager.ParcelResult result, int sequenceID, bool snapSelection) { if(result == ParcelManager.ParcelResult.NoData) { Hashtable message = new Hashtable(); message.Add("MessageType", "ParcelPropertiesFailed"); message.Add("LocalID", parcel.LocalID); message.Add("SequenceID", sequenceID); enqueue(message); } else { Hashtable message = new Hashtable(); message.Add("MessageType", "ParcelProperties"); message.Add("SequenceID", sequenceID); message.Add("LocalID", parcel.LocalID); message.Add("AABBMax", parcel.AABBMax); message.Add("AABBMin", parcel.AABBMin); message.Add("AccessList", parcel.AccessList); message.Add("Area", parcel.Area); message.Add("AuctionID", parcel.AuctionID); message.Add("AuthBuyerID", parcel.AuthBuyerID); message.Add("Category", parcel.Category); message.Add("ClaimDate", parcel.ClaimDate); message.Add("ClaimPrice", parcel.ClaimPrice); message.Add("Desc", parcel.Desc); message.Add("Dwell", parcel.Dwell); message.Add("Flags", (uint)parcel.Flags); message.Add("GroupID", parcel.GroupID); message.Add("GroupPrims", parcel.GroupPrims); message.Add("IsGroupOwned", parcel.IsGroupOwned); message.Add("LandingType", parcel.LandingType); message.Add("MaxPrims", parcel.MaxPrims); message.Add("MediaAutoScale", parcel.MediaAutoScale); message.Add("MediaDesc", parcel.MediaDesc); message.Add("MediaHeight", parcel.MediaHeight); message.Add("MediaID", parcel.MediaID); message.Add("MediaLoop", parcel.MediaLoop); message.Add("MediaType", parcel.MediaType); message.Add("MediaURL", parcel.MediaURL); message.Add("MediaWidth", parcel.MediaWidth); message.Add("MusicURL", parcel.MusicURL); message.Add("Name", parcel.Name); message.Add("ObscureMedia", parcel.ObscureMedia); message.Add("ObscureMusic", parcel.ObscureMusic); message.Add("OtherCleanTime", parcel.OtherCleanTime); message.Add("OtherPrims", parcel.OtherPrims); message.Add("OwnerPrims", parcel.OwnerPrims); message.Add("OwnerID", parcel.OwnerID); message.Add("PrimBonus", parcel.ParcelPrimBonus); message.Add("PassHours", parcel.PassHours); message.Add("PassPrice", parcel.PassPrice); message.Add("PublicCount", parcel.PublicCount); message.Add("RegionDenyAgeUnverified", parcel.RegionDenyAgeUnverified); message.Add("RegionDenyAnonymous", parcel.RegionDenyAnonymous); message.Add("RegionPushOverride", parcel.RegionPushOverride); message.Add("RentPrice", parcel.RentPrice); message.Add("SalePrice", parcel.SalePrice); message.Add("SelectedPrims", parcel.SelectedPrims); message.Add("SelfCount", parcel.SelfCount); message.Add("SimWideMaxPrims", parcel.SimWideMaxPrims); message.Add("SimWideTotalPrims", parcel.SimWideTotalPrims); message.Add("SnapshotID", parcel.SnapshotID); message.Add("Status", parcel.Status); message.Add("TotalPrims", parcel.TotalPrims); message.Add("UserLocation", parcel.UserLocation); message.Add("UserLookAt", parcel.UserLookAt); enqueue(message); } }