private static void OnConnectionAdded(object sender, ServerConnectionEventArgs e) { var wb = Workbench.Instance; if (wb.ActiveSiteExplorer == null) { var viewMgr = ServiceRegistry.GetService <ViewContentManager>(); wb.ActiveSiteExplorer = viewMgr.OpenContent(Strings.Content_SiteExplorer, Strings.Content_SiteExplorer, ViewRegion.Left, () => { return(new SiteExplorer()); }); wb.ActiveSiteExplorer.ActiveConnectionChanged += new EventHandler(OnActiveConnectionChanged); var connMgr = ServiceRegistry.GetService <ServerConnectionManager>(); var openMgr = ServiceRegistry.GetService <OpenResourceManager>(); var siteExp = wb.ActiveSiteExplorer; var nav = new ResourceIdNavigator(connMgr, openMgr, viewMgr, siteExp, wb); wb.AddToolbar("Resource ID Bar", nav.NavigatorToolStrip, ToolbarRegion.Top, true); } wb.ActiveSiteExplorer.RefreshModel(e.ConnectionName); var svc = ServiceRegistry.GetService <ServerConnectionManager>(); var conn = svc.GetConnection(e.ConnectionName); LoggingService.Info($"There are now {svc.GetConnectionNames().Count} active connections"); //NOXLATE }
private static void OnConnectionRemoved(object sender, ServerConnectionEventArgs e) { Workbench wb = Workbench.Instance; Debug.Assert(wb.ActiveSiteExplorer != null); var svc = ServiceRegistry.GetService <ServerConnectionManager>(); LoggingService.Info($"There are now {svc.GetConnectionNames().Count} active connections"); //NOXLATE //Debug.Assert(wb.ActiveSiteExplorer.ConnectionName == name); }
/// <summary> /// Handles the <see cref="E:ServerConnectionStarting" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="ServerConnectionEventArgs" /> instance containing the event data.</param> private void OnServerConnectionStarting(object sender, ServerConnectionEventArgs args) { try { args.ConnectionInfo = CurrentServerInfo; ServerConnectionStarting?.Invoke(this, args); } catch { //ignored } }
/// <summary> /// Handles the <see cref="E:ServerConnectionDisconnected" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="ServerConnectionEventArgs" /> instance containing the event data.</param> private void OnServerConnectionDisconnected(object sender, ServerConnectionEventArgs args) { try { args.ConnectionInfo = CurrentServerInfo; PurgeClient(); ServerConnectionDisconnected?.Invoke(this, args); } catch { //ignored } }
/// <summary> /// Handles the <see cref="E:ServerConnectionSucceeded" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="ServerConnectionEventArgs" /> instance containing the event data.</param> public void OnServerConnectionSucceeded(object sender, ServerConnectionEventArgs args) { try { args.ConnectionInfo = CurrentServerInfo; ServerConnectionSucceeded?.Invoke(this, args); HostnameUpdated?.Invoke(this, new HostnameEventArgs() { NewHostname = CurrentServerInfo.Hostname, Timestamp = DateTime.Now }); RequestAuth(CurrentServerInfo.Password); } catch { // ignored } }
private void ExecuteInitialCommand(object sender, ServerConnectionEventArgs e) { e.Player.CommandManager.ProcessCommandForCharacter( CommandFactory.CreateCommandFromAlias("Login"), new string[0]); }
private void server_ChannelClientDisconnected(object sender, ServerConnectionEventArgs args) { // TODO: should auto-reconnect? }
private void server_ChannelClientDisconnected(object sender, ServerConnectionEventArgs args) { }
private void OnConnectionAdded(object sender, ServerConnectionEventArgs e) { UpdateConnectionList(); }
private void _server_ChannelClientConnected(object sender, ServerConnectionEventArgs args) { _server.Receive(256, args.ClientId); }
/// <summary> /// Called when a client disconnects. /// </summary> /// <param name="sender">Object that triggered the event.</param> /// <param name="e">Event arguments.</param> public abstract void Disconnected(object sender, ServerConnectionEventArgs e);
protected virtual void OnConnection(ServerConnectionEventArgs args) { ClientConnected?.Invoke(this, args); }
/// <summary> /// Used when a client disconnects. /// </summary> /// <param name="e">Event arguments containing the client info that disconnected.</param> protected virtual void OnDisconnect(ServerConnectionEventArgs e) { Disconnected?.Invoke(this, e); }
private void server_ChannelClientConnected(object sender, ServerConnectionEventArgs args) { server.Receive(bufferLength, args.ClientId); }
static void PeerDisconnected(object sender, ServerConnectionEventArgs args) { Console.WriteLine("Peer " + args.PeerNode.IpPort + " disconnected"); }