Наследование: System.EventArgs
Пример #1
0
        /// <summary>Raises the GridRegion event</summary>
        /// <param name="e">A GridRegionEventArgs object containing the
        /// data sent by simulator</param>
        protected virtual void OnGridRegion(GridRegionEventArgs e)
        {
            EventHandler <GridRegionEventArgs> handler = m_GridRegion;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #2
0
        internal void Grid_GridRegion(object o, GridRegionEventArgs args)
        {
            lock (RegionsKnown)
            {
                GridRegion newRegion = args.Region;

                if (RegionsKnown.ContainsKey(newRegion.RegionHandle))
                {
                    return;
                }
                else
                {
                    m_log.DebugFormat(
                        "[BOT MANAGER]: Adding {0} {1} to known regions", newRegion.Name, newRegion.RegionHandle);
                    RegionsKnown[newRegion.RegionHandle] = newRegion;
                }
            }
        }
Пример #3
0
 /// <summary>Raises the GridRegion event</summary>
 /// <param name="e">A GridRegionEventArgs object containing the
 /// data sent by simulator</param>
 protected virtual void OnGridRegion(GridRegionEventArgs e)
 {
     EventHandler<GridRegionEventArgs> handler = m_GridRegion;
     if (handler != null)
         handler(this, e);
 }
Пример #4
0
        void Grid_GridRegion(object sender, GridRegionEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Grid_GridRegion(sender, e)));
                return;
            }

            if (e.Region.RegionHandle == targetRegionHandle)
            {
                txtRegion.Text = e.Region.Name;
                btnTeleport.Enabled = true;
                targetRegionHandle = 0;
            }

            if (!string.IsNullOrEmpty(txtRegion.Text)
                && e.Region.Name.ToLower().Contains(txtRegion.Text.ToLower())
                && !lstRegions.Items.ContainsKey(e.Region.Name))
            {
                ListViewItem item = new ListViewItem(e.Region.Name);
                item.Tag = e.Region;
                item.Name = e.Region.Name;
                lstRegions.Items.Add(item);
            }

            regionHandles[e.Region.Name] = Utils.UIntsToLong((uint)e.Region.X, (uint)e.Region.Y);
        }
Пример #5
0
        void Grid_GridRegion(object sender, GridRegionEventArgs e)
        {
            lock (MainClass.win.grid_regions)
            {
                if (!MainClass.win.grid_regions.ContainsKey(e.Region.RegionHandle))
                {
                    MainClass.win.grid_regions.Add(e.Region.RegionHandle, e.Region);
                }
            }

            Gtk.Application.Invoke(delegate {

            Logger.Log("Got grid region for :"+e.Region.Name+" ("+e.Region.RegionHandle.ToString()+")", Helpers.LogLevel.Debug);

            if (e.Region.RegionHandle == MainClass.client.Network.CurrentSim.Handle && requested==true)
            {
                requested = false;
                cx = (uint)e.Region.X;
                cy = (uint)e.Region.Y;
                Logger.Log("Requesting neighbour grid "+(e.Region.X - 1).ToString()+","+(e.Region.Y - 1).ToString()+(e.Region.X + 1).ToString()+(e.Region.Y + 1).ToString(), Helpers.LogLevel.Debug);
                MainClass.client.Grid.RequestMapBlocks(GridLayerType.Objects, (ushort)(e.Region.X - 1), (ushort)(e.Region.Y - 1), (ushort)(e.Region.X + 1), (ushort)(e.Region.Y + 1), false);
            }

            int col = (int)2 - (((int)cx + (int)1) - (int)e.Region.X); //FFS
            int row = (((int)cy + (int)1) - (int)e.Region.Y);

            if (row < 0 || row > 2)
                return;
            if (col < 0 || col > 2)
                return;

            Logger.Log("We found ("+row.ToString()+","+col.ToString()+")",Helpers.LogLevel.Debug);

            int index = (row * 3) + col;

            Gtk.Tooltips name = new Gtk.Tooltips();
            name.SetTip(maps[index], e.Region.Name, "");
            name.Enable();
            regions[index]=e.Region;

            maps[index].SetGridRegion( e.Region.RegionHandle);

            });
        }
Пример #6
0
        void Grid_GridRegion(object sender, GridRegionEventArgs e)
        {
            Logger.Log(" *** New grid region data ", Helpers.LogLevel.Info);

        }
Пример #7
0
 void Grid_GridRegion(object sender, GridRegionEventArgs e)
 {
     needRepaint = true;
     regions[e.Region.RegionHandle] = e.Region;
     if (!UseExternalTiles
         && e.Region.Access != SimAccess.NonExistent
         && e.Region.MapImageID != UUID.Zero
         && !tileRequests.Contains(e.Region.RegionHandle)
         && !regionTiles.ContainsKey(e.Region.RegionHandle))
         DownloadRegionTile(e.Region.RegionHandle, e.Region.MapImageID);
 }
Пример #8
0
        //Separate thread
        private void Grid_OnGridRegion(object sender, GridRegionEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Grid_OnGridRegion(sender, e)));
                return;
            }

            BeginInvoke(new MethodInvoker(delegate()
            {
                RegionSearchResult(e.Region);
            }));
        }
Пример #9
0
        void Grid_GridRegion(object sender, GridRegionEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Grid_GridRegion(sender, e)));
                return;
            }

            RegionSearchResultItem item = new RegionSearchResultItem(instance, e.Region, lbxRegionSearch);
            int index = lbxRegionSearch.Items.Add(item);
            item.ListIndex = index;
            if (lbxRegionSearch.Items.Count == 1)
            {
                lbxRegionSearch.SelectedItem = item;
                lbxRegionSearch_DoubleClick(this, new EventArgs());
            }
        }
Пример #10
0
 void Grid_GridRegion(object sender, GridRegionEventArgs e)
 {
     lock (MainClass.win.grid_regions)
     {
     if(!grid_regions.ContainsKey(e.Region.RegionHandle))
         grid_regions.Add(e.Region.RegionHandle, e.Region);
     }
 }
Пример #11
0
 public virtual void Grid_OnGridRegion(object sender, GridRegionEventArgs e) { OnEvent("On-Grid-Region", paramNamesOnGridRegion, paramTypesOnGridRegion, e); }
Пример #12
0
        public override void Grid_OnGridRegion(object sender, GridRegionEventArgs e)
        {
            var region = e.Region;
            SimRegion R = SimRegion.GetRegion(region.RegionHandle, client);
            if (R != null)
            {
                R.GridInfo = region;
                R.TheWorldSystem = this;
                R.RegionMaster = client;
            }

            // base.Grid_OnGridRegion(region);
        }