Exemple #1
0
 public void onClientDisconnect(object o, ClientDisconnectEventArgs e)
 {
     if (RemoteIP == e.RemoteIP)
     {
         MessageBox.Show(ClientName + " has been disconnected from the server");
         this.Close();
     }
 }
Exemple #2
0
        /// <summary>
        /// Times the capture.
        /// </summary>
        /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
        protected void TimeCapture(ClientDisconnectEventArgs e)
        {
            var clientDatabaseId = Repository.Client.GetClientDatabaseIdByClientId(e.ClientId);

            if (clientDatabaseId.HasValue)
            {
                Repository.Client.CaptureTime(clientDatabaseId.Value, null, Repository.Static.Now);
            }
        }
Exemple #3
0
 /// <summary>
 /// Static method that is invoked when a client is disconnected.
 /// </summary>
 static void OnClientDisconnect(ClientDisconnectEventArgs e)
 {
     // Remove the client from the list if he's
     // disconnected from the chat
     if (PeopleInChat.Contains(e.Client))
     {
         PeopleInChat.Remove(e.Client);
     }
 }
Exemple #4
0
 /// <summary>
 /// Invoked when a client is disconnected.
 /// </summary>
 private void OnClientDisconnect(ClientDisconnectEventArgs e)
 {
     this.Enqueue(() =>
     {
         if (!Service.IsStopping)
         {
             this.Remove(e.Client);
         }
     });
 }
Exemple #5
0
        public frmDisconnected(ClientDisconnectEventArgs e)
        {
            InitializeComponent();

            //this.instance = instance;
            //netcom = this.instance.Netcom;
            AddNetcomEvents();

            lblMessage.Text = e.Message;
        }
Exemple #6
0
 public void onClientDisconnect(object o, ClientDisconnectEventArgs e)
 {
     for (int i = 0; i < listView3.Items.Count; i++)
     {
         if (listView3.Items[i].SubItems[3].Text == e.RemoteIP)
         {
             listView3.Items.RemoveAt(i);
         }
     }
 }
Exemple #7
0
 /// <summary>
 /// Handles the ClientDisconnect event of the Notifications control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
 public void Notifications_ClientDisconnect(object sender, ClientDisconnectEventArgs e)
 {
     try
     {
         ManagerFactory.Invoke(e);
     }
     catch (Exception ex)
     {
         LogService.Error(ex.ToString());
     }
 }
Exemple #8
0
        private void Disconnect()
        {
            ClientDisconnectEventArgs e1 = new ClientDisconnectEventArgs(_socket.RemoteEndPoint.ToString());

            ClientDisconnectEvent.OnClientDisconnect(e1);

            settings.ClientsConnected--;
            Logger.AddLog(new LogInfo("Client disconnected", _socket.RemoteEndPoint.ToString().Split(':')[0]));

            _socket.Disconnect(false);
            if (DisconnectHandle != null)
            {
                DisconnectHandle(this);
            }
            MaxConnections.Disconnect(_socket.RemoteEndPoint);
        }
Exemple #9
0
        public void ClientDisconnected_DisconnectedRaised()
        {
            var server = new TestChannelServer <ITestContract>(TntBuilder.UseContract <ITestContract, TestContractMock>());

            server.StartListening();
            ClientDisconnectEventArgs <ITestContract, TestChannel> disconnectedConnection = null;

            server.Disconnected += (sender, args) => disconnectedConnection = args;
            var clientChannel   = new TestChannel();
            var proxyConnection = TntBuilder.UseContract <ITestContract>().UseChannel(clientChannel).Build();
            var pair            = server.TestListener.ImmitateAccept(clientChannel);

            pair.Disconnect();

            Assert.IsNotNull(disconnectedConnection, "Disconnect not raised");
        }
Exemple #10
0
 private void netcom_ClientDisconnected(object sender, ClientDisconnectEventArgs e)
 {
     CleanUp();
 }
Exemple #11
0
		/// <summary>
		/// 游戏服务器断开事件函数
		/// </summary>
		public void GameServerDisconnected(object sender, ClientDisconnectEventArgs e)
		{
			lock (_gameServerList.SyncRoot)
			{
				foreach (GameServer server in _gameServerList)
				{
					lock (server)
					{
						if (server.ConnectionId == e.ConnectionId)
						{
							if (server.IsConnected)
							{
								server.OnDisconnected();
								//return;
                            }
						}
					}
				}
			}

			//TODO 需要记录未知的断开
		}
Exemple #12
0
 /// <summary>
 /// Determines whether this instance can invoke the specified e.
 /// </summary>
 /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
 /// <returns>
 ///   <c>true</c> if this instance can invoke the specified e; otherwise, <c>false</c>.
 /// </returns>
 public override bool CanInvoke(ClientDisconnectEventArgs e)
 {
     return(true);
 }
Exemple #13
0
 /// <summary>
 /// Invokes the specified e.
 /// </summary>
 /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
 public virtual void Invoke(ClientDisconnectEventArgs e)
 {
     Manager.Where(m => m.CanInvoke(e)).ForEach(m => m.Invoke(e));
 }
Exemple #14
0
 /// <summary>
 /// Invokes the specified e.
 /// </summary>
 /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
 public override void Invoke(ClientDisconnectEventArgs e)
 {
     TimeCapture(e);
 }
 public void onClientDisconnect(object o, ClientDisconnectEventArgs e)
 {
     Speak("A client has been disconnected");
 }
Exemple #16
0
 public void client_onClientDisconnect(object o, ClientDisconnectEventArgs e)
 {
     Client_Log("Client is disconnected from " + e.RemoteIP + ":" + e.Port.ToString());
 }
Exemple #17
0
 /// <summary>
 /// Invokes the specified e.
 /// </summary>
 /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
 public virtual void Invoke(ClientDisconnectEventArgs e)
 {
 }
Exemple #18
0
 /// <summary>
 /// Determines whether this instance can invoke the specified e.
 /// </summary>
 /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param>
 /// <returns>
 ///   <c>true</c> if this instance can invoke the specified e; otherwise, <c>false</c>.
 /// </returns>
 public virtual bool CanInvoke(ClientDisconnectEventArgs e)
 {
     return(false);
 }
Exemple #19
0
 private static void Server_OnDisconnect(object sender, ClientDisconnectEventArgs e)
 {
     dic.Remove(e.Session.IP);
 }
Exemple #20
0
 private static void ClientLeft_Disconnected(object sender, ClientDisconnectEventArgs e)
 {
     ClientLeft(e.ClientId);
 }
 public void client_onClientDisconnect(object o, ClientDisconnectEventArgs e)
 {
     Client_Log("Client is disconnected from " + e.RemoteIP + ":" + e.Port.ToString());
 }