Esempio n. 1
0
        protected void AddSubsystem(ISubSystem subSystem)
        {
            if (subSystem == null)
            {
                return;
            }

            _subsystems.Add(subSystem);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        /// <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;
        }
Esempio n. 5
0
        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);
        }
Esempio n. 7
0
 /// <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;
 }
Esempio n. 8
0
        /// <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;
        }
Esempio n. 9
0
        /// <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;
        }
Esempio n. 10
0
        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;
            }
        }
Esempio n. 11
0
 public void AddSubsystem(ISubSystem <ICombatSystem> subSystem)
 {
     base.AddSubsystem(subSystem);
     subSystem.System = this;
 }
Esempio n. 12
0
 public void AddSubSystem(ISubSystem subSystem)
 {
     _subSystems.Add(subSystem);
 }
Esempio n. 13
0
 /// <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);
 }
Esempio n. 14
0
 public void RegisterSubsystem(ISubSystem subSystem)
 {
     SubSystems.Add(subSystem);
 }
Esempio n. 15
0
 public FacadeBase(ISubSystem subSystem)
 {
     _subSystem = subSystem;
 }
Esempio n. 16
0
 /// <summary>
 /// 处理消息
 /// </summary>
 /// <param name="system"></param>
 /// <param name="message"></param>
 public void Handle(ISubSystem system, string message)
 {
     system.Handle(message);
 }
Esempio n. 17
0
 public void AddSubSystem(string name, ISubSystem subsystem)
 {
     throw new NotImplementedException();
 }
Esempio n. 18
0
 protected void RemoveSubsystem(ISubSystem subSystem)
 {
     _subsystems.Remove(subSystem);
 }
Esempio n. 19
0
 public void RemoveSubsystem(ISubSystem <ICombatSystem> subSystem)
 {
     base.RemoveSubsystem(subSystem);
     subSystem.System = default;
 }
Esempio n. 20
0
 /// <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)
 {
 }
Esempio n. 21
0
 public FacadeBase(ISubSystem subSystem)
 {
     _subSystem = subSystem;
 }
Esempio n. 22
0
 /// <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);
 }
Esempio n. 23
0
 /// <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)
 {
 }
Esempio n. 24
0
 public void RegisterSubSystem(ISubSystem subSystem)
 {
     _internalSystems.Add(subSystem);
     Log.Log("Internal system (subsystem) was registred, name: " + subSystem.SystemName);
 }