예제 #1
0
        public User(IStreamable client, IProtocol protocol, object state)
        {
            State  = state;
            Stream = client;

            _Serialize = protocol.GetSerialize();

            _EnableLock = new object();

            _Peer     = client;
            _Protocol = protocol;



            _Responses = new System.Collections.Concurrent.ConcurrentQueue <ResponsePackage>();
            _Requests  = new System.Collections.Concurrent.ConcurrentQueue <RequestPackage>();
            _Reader    = new PackageReader <RequestPackage>(protocol.GetSerialize());
            _Writer    = new PackageWriter <ResponsePackage>(protocol.GetSerialize());

            _ExternalRequests = new System.Collections.Concurrent.ConcurrentQueue <RequestPackage>();

            _SoulProvider = new SoulProvider(this, this, protocol);

            _Updater = new ThreadUpdater(_AsyncUpdate);
        }
예제 #2
0
 public void Stop()
 {
     if (this._thread != null)
     {
         this._thread.Stop();
         this._thread = null;
     }
     this.StopImpl();
 }
예제 #3
0
 public void RunThread()
 {
     this._frameTimer.Start();
     this._logicTimer.Start();
     this._thread = new ThreadUpdater();
     this._thread.OnInitialize += new VoidFunctionDelegate(this.ThreadLoopImpl);
     this._thread.OnUpdate     += new IntFunctionDelegate(this.Update);
     this._thread.Run();
 }
예제 #4
0
        public UpdatableEntry(OnSpawnUpdatable proviable)
        {
            _Users         = new Utility.Updater();
            _AddBinders    = new System.Collections.Concurrent.ConcurrentQueue <IBinder>();
            _RemoveBinders = new System.Collections.Concurrent.ConcurrentQueue <IUpdatable>();

            _Updater = new Regulus.Remote.ThreadUpdater(_Update);
            _Updater.Start();
            this._Proviable = proviable;
        }
예제 #5
0
 public Service(IBinderProvider entry, IProtocol protocol)
 {
     _Users             = new System.Collections.Generic.List <User>();
     this._Entry        = entry;
     this._Protocol     = protocol;
     _Updater           = new Utility.Updater();
     _Updater.AddEvent += (user) => _Entry.AssignBinder(((User)user).Binder, ((User)user).State);
     _ThreadUpdater     = new ThreadUpdater(_Update);
     _ThreadUpdater.Start();
 }
예제 #6
0
        public TestEnv(T entry)
        {
            Entry = entry;
            IProtocol protocol = Regulus.Remote.Protocol.ProtocolProvider.Create(typeof(T2).Assembly).Single();

            _Service = new Regulus.Remote.Standalone.Service(entry, protocol);
            _Agent   = new Regulus.Remote.Ghost.Agent(protocol);
            _Service.Join(_Agent);


            Queryable = _Agent;

            _AgentUpdater = new ThreadUpdater(_Update);
            _AgentUpdater.Start();
        }