示例#1
0
        private void Network_SimDisconnected(object sender, SimDisconnectedEventArgs e)
        {
            try
            {
                if (InvokeRequired)
                {
                    if (!instance.MonoRuntime || IsHandleCreated)
                        BeginInvoke(new MethodInvoker(() => Network_SimDisconnected(sender, e)));
                    return;
                }
                lock (agentSimHandle)
                {
                    var h = e.Simulator.Handle;
                    List<UUID> remove = new List<UUID>();
                    foreach (var uh in agentSimHandle)
                    {
                        if (uh.Value == h)
                        {
                            remove.Add(uh.Key);
                        }
                    }
                    if (remove.Count == 0) return;
                    lvwObjects.BeginUpdate();
                    try
                    {
                        foreach (UUID key in remove)
                        {
                            agentSimHandle.Remove(key);
                            try
                            {
                                lvwObjects.Items.RemoveByKey("" + key);
                            }
                            catch (Exception)
                            {

                            }
                        }
                    }
                    finally
                    {
                        lvwObjects.EndUpdate();
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.DebugLog("Failed to update radar: " + ex.ToString());
            }
        }
示例#2
0
 public void Network_SimDisconnected(object sender, SimDisconnectedEventArgs args)
 {
     m_log.DebugFormat(
         "[BOT]: Bot {0} disconnected from region {1} at {2}", Name, args.Simulator.Name, args.Simulator.IPEndPoint);
 }
 ///<summary>Raises the SimDisconnected Event</summary>
 /// <param name="e">A SimDisconnectedEventArgs object containing
 /// the data sent from the simulator</param>
 protected virtual void OnSimDisconnected(SimDisconnectedEventArgs e)
 {
     EventHandler<SimDisconnectedEventArgs> handler = m_SimDisconnected;
     if (handler != null)
         handler(this, e);
 }
示例#4
0
        void Network_SimDisconnected(object sender, SimDisconnectedEventArgs e)
        {
            Logger.Log("Sim disconnected from " + e.Simulator.Name + " Reason " + e.Reason, Helpers.LogLevel.Info);
            if (client.Network.CurrentSim == e.Simulator)
            {
                Logger.Log("*** BONED WE HAVE BEEN BOOTED ***", Helpers.LogLevel.Error);

                if (connected == true)
                {
                    connected = false;
                    client.Network.Logout(); //force logout to clean up libomv
                }
            }
        }
示例#5
0
 void Network_OnSimDisconnected(object sender, SimDisconnectedEventArgs e)
 {
     var simulator = e.Simulator;
     var reason = e.Reason;
     SendNetworkEvent("On-Sim-Disconnected", this, simulator, reason);
     if (simulator == Network.CurrentSim)
     {
         EnsureConnectedCheck(reason);
     }
 }
示例#6
0
 public virtual void Network_OnSimDisconnected(object sender, SimDisconnectedEventArgs e) { OnEvent("On-Sim-Disconnected", paramNamesOnSimDisconnected, paramTypesOnSimDisconnected, e); }
        public override void Network_OnSimDisconnected(object sender, SimDisconnectedEventArgs e)
        {
            var simulator = e.Simulator;
            var reason = e.Reason;
            base.Network_OnSimDisconnected(sender, e);
            RemoveSim(simulator);
            SimRegion.GetRegion(simulator).RemoveSim(simulator);
            LeaveSimulator(simulator);

            if (simulator == client.Network.CurrentSim)
                PropertyQueue.AddFirst(() =>
                                           {
                                               Debug("CLOSE for region " + simulator);
                                               //client.Login();
                                           }
                    );
        }
示例#8
0
 void Network_SimDisconnected(object sender, SimDisconnectedEventArgs e)
 {
     lock (e.Simulator.ObjectsAvatars)
     {
         e.Simulator.AvatarPositions.ForEach(delegate (KeyValuePair <UUID,Vector3> kvp)
         {
             if (kvp.Value != null && kvp.Key != UUID.Zero)
             {
                 lock (av_tree)
                 {
                     if (av_tree.ContainsKey(kvp.Key))
                     {
                         Gtk.TreeIter iter = av_tree[kvp.Key];
                         store.Remove(ref iter);
                         av_tree.Remove(kvp.Key);
                     }
                 }
             }
         });
     }
 }