private void SetStatus(ConnectionStatus status) { switch (status) { case ConnectionStatus.Connecting: if (Status != ConnectionStatus.Connecting) { Status = ConnectionStatus.Connecting; } break; case ConnectionStatus.Connected: if (Status != ConnectionStatus.Connected) { Status = ConnectionStatus.Connected; MstTimer.Instance.StartCoroutine(Peer.SendDelayedMessages()); OnConnectedEvent?.Invoke(); } break; case ConnectionStatus.Disconnected: if (Status != ConnectionStatus.Disconnected) { Status = ConnectionStatus.Disconnected; OnDisconnectedEvent?.Invoke(); } break; } }
private void OnDisconnected(object sender, OnDisconnectedEventArgs e) { EvtDisconnectedArgs disArgs = new EvtDisconnectedArgs() { }; OnDisconnectedEvent?.Invoke(disArgs); }
public virtual void OnDisconnected(HPacket packet) { IsConnected = false; _entities.Clear(); _wallItems.Clear(); _floorItems.Clear(); if (DisableEventHandlers == false) { try { OnDisconnectedEvent.Invoke(this, packet); } catch { }; //Invoke event handler } }
/// <inheritdoc /> protected override void OnDisconnected() { try { OnDisconnectedEvent?.Invoke(); } catch (Exception ex) { Debug.LogException(ex); } }
public void Disconnect(DisconnectionType disconnectionType = DisconnectionType.Unknown) { if (client_peer != null) { client_peer.Shutdown(); IsConnected = IsConnecting = false; if (disconnectionType != DisconnectionType.Unknown) { OnDisconnected(client_peer.address, client_peer.port, disconnectionType, disconnect_reason); OnDisconnectedEvent?.Invoke(client_peer.address, client_peer.port, disconnectionType, disconnect_reason); } else if (disconnectionType == DisconnectionType.Unknown) { OnDisconnected(client_peer.address, client_peer.port, DisconnectionType.ByUser, string.Empty); OnDisconnectedEvent?.Invoke(client_peer.address, client_peer.port, DisconnectionType.ByUser, string.Empty); } if (RakNet_Peer.debugLevel >= RakDebugLevel.Low) { Debug.Log("[Client] Disconnected... (" + disconnectionType + ")"); } client_peer = null; } }
public override void OnClientDisconnect(NetworkConnection conn) { base.OnClientDisconnect(conn); OnDisconnectedEvent?.Invoke(conn); }
protected void ClientHost_OnDisconnected(object sender, LibRDP.DisconnectEventArgs e) { Logger.Info(e.ErrCode + ", " + e.Reason); OnDisconnectedEvent?.Invoke(sender, e); }
public TCPServer(IPEndPoint endpoint, OnMessageEvent onMessage, OnEstablishedEvent onEstablished, OnDisconnectedEvent onDisconnected) : this(endpoint, onMessage) { OnEstablished = onEstablished; OnDisconnected = onDisconnected; }
private void Disconnected(DisconnectionInfo info) { OnDisconnectedEvent?.Invoke(this, info); }
public Task OnDisconnected(OnDisconnectedEvent theEvent) { return(Task.CompletedTask); }
public override void OnDisconnected(string p0) { OnDisconnectedEvent?.Invoke(this, p0); }