Parcel (subdivided simulator lots) subsystem
コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="row"></param>
 /// <param name="entry"></param>
 /// <param name="parcelID"></param>
 private void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, UUID parcelID)
 {
     row["LandUUID"] = parcelID.ToString();
     row["AccessUUID"] = entry.AgentID.ToString();
     row["Flags"] = entry.Flags;
 }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="row"></param>
 /// <param name="entry"></param>
 /// <param name="parcelID"></param>
 private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID)
 {
     cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString());
     cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString());
     cmd.Parameters.AddWithValue("Flags", entry.Flags);
 }
コード例 #3
0
        /// <summary>
        /// Creates the land access parameters.
        /// </summary>
        /// <param name="parcelAccessEntry">parcel access entry.</param>
        /// <param name="parcelID">parcel ID.</param>
        /// <returns></returns>
        private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, UUID parcelID)
        {
            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(_Database.CreateParameter("LandUUID", parcelID));
            parameters.Add(_Database.CreateParameter("AccessUUID", parcelAccessEntry.AgentID));
            parameters.Add(_Database.CreateParameter("Flags", parcelAccessEntry.Flags));

            return parameters.ToArray();
        }
コード例 #4
0
ファイル: GridClient.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // 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);

            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };
        }
コード例 #5
0
ファイル: Utilities.cs プロジェクト: RavenB/gridsearch
        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)
            {
                Logger.Log("ParcelDownloader received a NoData response, sequenceID " + sequenceID,
                    Helpers.LogLevel.Warning, Client);
                return;
            }

            // Warn about unexpected data and bail out
            if (!ParcelMarked.ContainsKey(parcel.Simulator))
            {
                Logger.Log("ParcelDownloader received unexpected parcel data for " + parcel.Simulator,
                    Helpers.LogLevel.Warning, Client);
                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) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // Initialise SmartThreadPool when using mono
            if (Type.GetType("Mono.Runtime") != null)
            {
                WorkPool.Init(true);
            }

            // These are order-dependant
            Network = new NetworkManager(this);
            Settings = new Settings(this);
            Parcels = new ParcelManager(this);
            Self = new AgentManager(this);
            Avatars = new AvatarManager(this);
            Estate = new EstateTools(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);
            Inventory = new InventoryManager(this);
            Directory = new DirectoryManager(this);
            Terrain = new TerrainManager(this);
            Sound = new SoundManager(this);
            Throttle = new AgentThrottle(this);
            Stats = new OpenMetaverse.Stats.UtilizationStatistics();
        }
コード例 #7
0
ファイル: GridClient.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            // These are order-dependant
            Log = new LoggerInstance();
            Network = new NetworkManager(Log);
            Terrain = new TerrainManager(Log, Network);
            Parcels = new ParcelManager(Log, Network, Terrain);
            Self = new AgentManager(Log, Network, Grid);
            Avatars = new AvatarManager(Log, Network);
            Friends = new FriendsManager(Log, Network, Inventory, Self, Avatars);
            Grid = new GridManager(Log, Network);
            Objects = new ObjectManager(Log, Network, Self);
            Groups = new GroupManager(Log, Network, Self);
            Assets = new AssetManager(Log, Network);
            Estate = new EstateTools(Log, Network, Assets);
            Appearance = new AppearanceManager(Log, Network, Inventory, Assets, Objects, Self);
            Inventory = new InventoryManager(Log, Network, Self, Assets);
            Directory = new DirectoryManager(Log, Network);
            Sound = new SoundManager(Log, Network, Self);
            Throttle = new AgentThrottle(Network);

            Settings = new Settings(this);
            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };

            Network.RegisterLoginResponseCallback(
                delegate(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData)
                {
                    if (loginSuccess) Log.BotName = replyData.FirstName + " " + replyData.LastName;
                });
        }
コード例 #8
0
ファイル: GridClient.cs プロジェクト: GwynethLlewelyn/restbot
 /// <summary>
 /// Default constructor
 /// </summary>
 public GridClient()
 {
     // These are order-dependant
     Network = new NetworkManager(this);
     Settings = new Settings(this);
     Parcels = new ParcelManager(this);
     Self = new AgentManager(this);
     Avatars = new AvatarManager(this);
     Estate = new EstateTools(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);
     Inventory = new InventoryManager(this);
     Directory = new DirectoryManager(this);
     Terrain = new TerrainManager(this);
     Sound = new SoundManager(this);
     Throttle = new AgentThrottle(this);
     Stats = new OpenMetaverse.Stats.UtilizationStatistics();
 }
コード例 #9
0
ファイル: GridClient.cs プロジェクト: 3di/3di-viewer-rei-libs
        /// <summary>
        /// Default constructor
        /// </summary>
        public GridClient()
        {
            #if USE_SMART_THREAD_POOL
            ThreadPool = new SmartThreadPool(-1, 25);
            #endif
            // These are order-dependant
            #if USE_SMART_THREAD_POOL
            Network = new NetworkManager(this, ThreadPool);
            #else
            Network = new NetworkManager(this);
            #endif
            Settings = new Settings(this);
            #if USE_SMART_THREAD_POOL
            Parcels = new ParcelManager(this, ThreadPool);
            #else
            Parcels = new ParcelManager(this);
            #endif
            Self = new AgentManager(this);
            Avatars = new AvatarManager(this);
            Friends = new FriendsManager(this);
            Grid = new GridManager(this);
            Objects = new ObjectManager(this);
            Groups = new GroupManager(this);
            #if USE_SMART_THREAD_POOL
            Assets = new AssetManager(this, ThreadPool);
            #else
            Assets = new AssetManager(this);
            #endif
            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);

            //if (Settings.ENABLE_INVENTORY_STORE)
            //    InventoryStore = new Inventory(Inventory);
            //if (Settings.ENABLE_LIBRARY_STORE)
            //    LibraryStore = new Inventory(Inventory);

            //Inventory.OnSkeletonsReceived +=
            //    delegate(InventoryManager manager)
            //    {
            //        if (Settings.ENABLE_INVENTORY_STORE)
            //            InventoryStore.InitializeFromSkeleton(Inventory.InventorySkeleton);
            //        if (Settings.ENABLE_LIBRARY_STORE)
            //            LibraryStore.InitializeFromSkeleton(Inventory.LibrarySkeleton);
            //    };
        }