protected void AddSubsystem(ISubSystem subSystem) { if (subSystem == null) { return; } _subsystems.Add(subSystem); }
/// <summary> /// Default constructor for a new connection to the server. /// </summary> /// <param name="socket">Socket that is connecting</param> /// <param name="connectionHost">Server hosting the connection</param> public Connection(Socket socket, ISubSystem connectionHost) { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); this.socket = socket; this.connectionHost = connectionHost; ID = Guid.NewGuid().ToString(); CurrentIPAddress = ((IPEndPoint)socket.RemoteEndPoint).Address; Data = new byte[1]; //this.Send(IACSLE); }
public virtual void AddSubSystem(String key, ISubSystem subsystem) { if (key == null) { throw new ArgumentNullException("key"); } if (subsystem == null) { throw new ArgumentNullException("facility"); } subsystem.Init(this); subsystems[key] = subsystem; }
/// <summary>Initializes a new instance of the <see cref="Connection"/> class.</summary> /// <param name="socket">The socket upon which this connection is to be based.</param> /// <param name="connectionHost">The system hosting this connection.</param> public Connection(Socket socket, ISubSystem connectionHost) { Buffer = new StringBuilder(); OutputBuffer = new OutputBuffer(); Data = new byte[1]; TerminalOptions = new TerminalOptions(); this.socket = socket; var remoteEndPoint = (IPEndPoint)this.socket.RemoteEndPoint; CurrentIPAddress = remoteEndPoint.Address; ID = Guid.NewGuid().ToString(); TelnetCodeHandler = new TelnetCodeHandler(this); this.connectionHost = connectionHost; }
public virtual void AddSubSystem(String name, ISubSystem subsystem) { if (name == null) { throw new ArgumentNullException("name"); } if (subsystem == null) { throw new ArgumentNullException("subsystem"); } subsystem.Init(this); subsystems[name] = subsystem; }
/// <summary> /// Get the registered settings sub system /// </summary> /// <param name="kernel">Current <see cref="IKernelInternal" /> instance</param> /// <returns>Settings subsystem</returns> public static SettingsSubSystem GetSettingsSubSystem(this IKernelInternal kernel) { ISubSystem subSystem = kernel.GetSubSystem(SettingsSubSystem.SubSystemKey); if (subSystem != null) { return((SettingsSubSystem)subSystem); } SettingsSubSystem newSubSystem = new SettingsSubSystem(); kernel.AddSubSystem(SettingsSubSystem.SubSystemKey, newSubSystem); return(newSubSystem); }
/// <summary> /// Initializes a new instance of the Connection class. /// </summary> /// <param name="socket">The socket upon which this connection is to be based.</param> /// <param name="connectionHost">The system hosting this connection.</param> public Connection(Socket socket, ISubSystem connectionHost) { this.Buffer = new StringBuilder(); this.OutputBuffer = new OutputBuffer(); this.Data = new byte[1]; this.Terminal = new Terminal(); this.socket = socket; var remoteEndPoint = (IPEndPoint)this.socket.RemoteEndPoint; this.CurrentIPAddress = remoteEndPoint.Address; this.ID = Guid.NewGuid().ToString(); this.TelnetCodeHandler = new TelnetCodeHandler(this); // @@@ TODO: Paging row size should be dynamic; this WAS called BufferLength in // discussion: http://www.wheelmud.net/Forums/tabid/59/aft/1600/Default.aspx this.PagingRowLimit = 40; this.connectionHost = connectionHost; }
/// <summary>Initializes a new instance of the <see cref="Connection"/> class.</summary> /// <param name="socket">The socket upon which this connection is to be based.</param> /// <param name="connectionHost">The system hosting this connection.</param> public Connection(Socket socket, ISubSystem connectionHost) { this.Buffer = new StringBuilder(); this.OutputBuffer = new OutputBuffer(); this.Data = new byte[1]; this.Terminal = new Terminal(); this.socket = socket; var remoteEndPoint = (IPEndPoint)this.socket.RemoteEndPoint; this.CurrentIPAddress = remoteEndPoint.Address; this.ID = Guid.NewGuid().ToString(); this.TelnetCodeHandler = new TelnetCodeHandler(this); // TODO: Paging row size should be dynamic from Telnet (NAWS?) or a player-chosen override. // (This used to be called BufferLength in old discussions.) this.PagingRowLimit = 40; this.connectionHost = connectionHost; }
public virtual void AddSubSystem(string name, ISubSystem subsystem) { if (name == null) { throw new ArgumentNullException(nameof(name)); } if (subsystem == null) { throw new ArgumentNullException(nameof(subsystem)); } subsystem.Init(this); subsystems[name] = subsystem; if (name == SubSystemConstants.ConversionManagerKey) { ConversionSubSystem = (IConversionManager)subsystem; } else if (name == SubSystemConstants.NamingKey) { NamingSubSystem = (INamingSubSystem)subsystem; } }
public void AddSubsystem(ISubSystem <ICombatSystem> subSystem) { base.AddSubsystem(subSystem); subSystem.System = this; }
public void AddSubSystem(ISubSystem subSystem) { _subSystems.Add(subSystem); }
/// <summary>Allows the sub system host to receive an update when subscribed to this system.</summary> /// <param name="sender">The sender of the update.</param> /// <param name="msg">The message to be sent.</param> public void UpdateSubSystemHost(ISubSystem sender, string msg) { this.host.UpdateSystemHost(this, msg); }
public void RegisterSubsystem(ISubSystem subSystem) { SubSystems.Add(subSystem); }
public FacadeBase(ISubSystem subSystem) { _subSystem = subSystem; }
/// <summary> /// 处理消息 /// </summary> /// <param name="system"></param> /// <param name="message"></param> public void Handle(ISubSystem system, string message) { system.Handle(message); }
public void AddSubSystem(string name, ISubSystem subsystem) { throw new NotImplementedException(); }
protected void RemoveSubsystem(ISubSystem subSystem) { _subsystems.Remove(subSystem); }
public void RemoveSubsystem(ISubSystem <ICombatSystem> subSystem) { base.RemoveSubsystem(subSystem); subSystem.System = default; }
/// <summary>Allows the sub system host to receive an update when subscribed to this system.</summary> /// <param name="sender">The sender of the update.</param> /// <param name="message">The message to send to the host.</param> public void UpdateSubSystemHost(ISubSystem sender, string message) { }
/// <summary> /// Allows the sub system host to receive an update when subscribed to this system. /// </summary> /// <param name="sender">The sender of the update.</param> /// <param name="msg">The message to be sent.</param> public void UpdateSubSystemHost(ISubSystem sender, string msg) { this.host.UpdateSystemHost(this, msg); }
public void RegisterSubSystem(ISubSystem subSystem) { _internalSystems.Add(subSystem); Log.Log("Internal system (subsystem) was registred, name: " + subSystem.SystemName); }