コード例 #1
0
ファイル: SystemBase.cs プロジェクト: BlackSyc/SCGS
        protected void AddSubsystem(ISubSystem subSystem)
        {
            if (subSystem == null)
            {
                return;
            }

            _subsystems.Add(subSystem);
        }
コード例 #2
0
ファイル: Connection.cs プロジェクト: nullwaves/SheepChat
        /// <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);
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
ファイル: Connection.cs プロジェクト: Hobbitron/WheelMUD
 /// <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;
 }
コード例 #8
0
ファイル: Connection.cs プロジェクト: rmatthews888/WheelMUD
        /// <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;
        }
コード例 #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;
        }
コード例 #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;
            }
        }
コード例 #11
0
 public void AddSubsystem(ISubSystem <ICombatSystem> subSystem)
 {
     base.AddSubsystem(subSystem);
     subSystem.System = this;
 }
コード例 #12
0
ファイル: FubuMvcSystem.cs プロジェクト: stevematney/Serenity
 public void AddSubSystem(ISubSystem subSystem)
 {
     _subSystems.Add(subSystem);
 }
コード例 #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);
 }
コード例 #14
0
ファイル: Engine.cs プロジェクト: darkfriend77/wom
 public void RegisterSubsystem(ISubSystem subSystem)
 {
     SubSystems.Add(subSystem);
 }
コード例 #15
0
ファイル: FacadeBase.cs プロジェクト: sanjug01/Tests
 public FacadeBase(ISubSystem subSystem)
 {
     _subSystem = subSystem;
 }
コード例 #16
0
 /// <summary>
 /// 处理消息
 /// </summary>
 /// <param name="system"></param>
 /// <param name="message"></param>
 public void Handle(ISubSystem system, string message)
 {
     system.Handle(message);
 }
コード例 #17
0
 public void AddSubSystem(string name, ISubSystem subsystem)
 {
     throw new NotImplementedException();
 }
コード例 #18
0
ファイル: SystemBase.cs プロジェクト: BlackSyc/SCGS
 protected void RemoveSubsystem(ISubSystem subSystem)
 {
     _subsystems.Remove(subSystem);
 }
コード例 #19
0
 public void RemoveSubsystem(ISubSystem <ICombatSystem> subSystem)
 {
     base.RemoveSubsystem(subSystem);
     subSystem.System = default;
 }
コード例 #20
0
ファイル: WRMCombat.cs プロジェクト: Hobbitron/WheelMUD
 /// <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)
 {
 }
コード例 #21
0
ファイル: FacadeBase.cs プロジェクト: sanjug01/Tests
 public FacadeBase(ISubSystem subSystem)
 {
     _subSystem = subSystem;
 }
コード例 #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);
 }
コード例 #23
0
ファイル: WRMCombat.cs プロジェクト: rmatthews888/WheelMUD
 /// <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)
 {
 }
コード例 #24
0
 public void RegisterSubSystem(ISubSystem subSystem)
 {
     _internalSystems.Add(subSystem);
     Log.Log("Internal system (subsystem) was registred, name: " + subSystem.SystemName);
 }