コード例 #1
0
        public bool Init()
        {
            length = myRenderer.bounds.size.x;

            if (length <= 0.0f)
            {
                return(false);
            }

            length *= 1.0f - intersectionAmount;

            var cloneOffset = length / transform.localScale.x;

            var leftClone  = CreateChildClone(-cloneOffset);
            var rightClone = CreateChildClone(cloneOffset);

            leftClone.transform.SetParent(transform, false);
            rightClone.transform.SetParent(transform, false);

            InitializedEvent?.Invoke(this, new ScrollEventArgs {
                PositionX = startPos.x, Offset = length
            });

            return(true);
        }
コード例 #2
0
        public bool Start(string[] args)
        {
            if (Running)
            {
                throw new Exception("Server is already running");
            }
            log.WriteLine();
            log.WriteLine("   = Minecraft Server \"obsidian\" =");
            log.WriteLine();
            if (!ParseParameters(args))
            {
                return(false);
            }
            Commands.Init();
            lua.errorLog = "error.log";
            Log("Using initfile '" + initfile + "'.");
            if (!lua.Start(initfile))
            {
                return(false);
            }
            string error;

            Log("", false); Groups.Load(Commands, out error); Log("");
            if (error != null)
            {
                Log("Error: " + error); return(false);
            }
            Log("", false); Accounts.Load(Groups); Log("");
            if (level == null)
            {
                Log("Error: No level loaded.");
                return(false);
            }
            level.server = this;
            if (!listener.Start(port))
            {
                Log("Error: Server creation failed, port " + port + " already in use?");
                return(false);
            }
            Log("Server is running on port " + port + ".");
            InitializedEvent.Raise(this);
            heartbeat.Start(1000 * 55);
            if (heartbeat.Send())
            {
                File.WriteAllText("externalurl.txt", heartbeat.url);
                Log("URL saved to externalurl.txt.\n  " + heartbeat.url);
            }
            updateThread.Start();
            Queue.Start();
            return(true);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: xxftapv/RDCMan
 private static void StartMessageLoop()
 {
     try {
         if (MainForm.Create() != null)
         {
             Log.Init();
             _appContext = new ApplicationContext(TheForm);
             Application.Run(_appContext);
         }
     }
     finally {
         InitializedEvent.Set();
     }
 }
        async Task <Unit> IRequestHandler <InitializedEvent, Unit> .Handle(InitializedEvent request, CancellationToken cancellationToken)
        {
            await DebugAdapterEventingHelper.Run(
                _initializedDelegates,
                (handler, ct) => handler(this, ClientSettings, ServerSettings, ct),
                _initializedHandlers.Union(_collection.Select(z => z.Handler).OfType <IOnDebugAdapterClientInitialized>()),
                (handler, ct) => handler.OnInitialized(this, ClientSettings, ServerSettings, ct),
                _concurrency,
                cancellationToken
                );

            _initializedComplete.OnNext(request);
            _initializedComplete.OnCompleted();
            return(Unit.Value);
        }
コード例 #5
0
        public IEnumerator InitializeRoutine()
        {
            repositoriesBase.CreateAllRepositories();
            interactorsBase.CreateAllInteractors();
            yield return(null);

            repositoriesBase.SendOnCreateToAllRepositories();
            interactorsBase.SendOnCreateToAllInteractors();
            yield return(null);

            repositoriesBase.InitializeAllRepositories();
            interactorsBase.InitializeAllInteractors();
            yield return(null);

            repositoriesBase.SendOnStartToAllRepositories();
            interactorsBase.SendOnStartToAllInteractors();
            InitializedEvent?.Invoke();
        }
コード例 #6
0
 Task <Unit> IRequestHandler <InitializedEvent, Unit> .Handle(InitializedEvent request, CancellationToken cancellationToken)
 {
     _initializedComplete.OnNext(request);
     _initializedComplete.OnCompleted();
     return(Unit.Task);
 }
コード例 #7
0
        /// <summary>
        /// <para>This event indicates that the debug adapter is ready to accept configuration requests (e.g. SetBreakpointsRequest, SetExceptionBreakpointsRequest).</para>
        /// <para>A debug adapter is expected to send this event when it is ready to accept configuration requests (but not before the ‘initialize’ request has finished).</para>
        /// <para>The sequence of events/requests is as follows:</para>
        /// <list type="bullet">
        /// <item><description>adapters sends ‘initialized’ event (after the ‘initialize’ request has returned)</description></item>
        /// <item><description>frontend sends zero or more ‘setBreakpoints’ requests</description></item>
        /// <item><description>frontend sends one ‘setFunctionBreakpoints’ request</description></item>
        /// <item><description>frontend sends a ‘setExceptionBreakpoints’ request if one or more ‘exceptionBreakpointFilters’ have been defined (or if ‘supportsConfigurationDoneRequest’ is not defined or false)</description></item>
        /// <item><description>frontend sends other future configuration requests</description></item>
        /// <item><description>frontend sends one ‘configurationDone’ request to indicate the end of the configuration.</description></item>
        /// </list>
        /// </summary>
        public static void SendInitializedEvent(this ProtocolServer server)
        {
            InitializedEvent initializedEvent = new InitializedEvent();

            server.SendMessage(initializedEvent);
        }
コード例 #8
0
 protected override void Initialize()
 {
     InitializeEvent.Set();
     InitializedEvent.WaitOne(TimeoutDelay);
     ThrowIfCancellationRequested();
 }
 public abstract Task <Unit> Handle(InitializedEvent request, CancellationToken cancellationToken);
コード例 #10
0
 public static void SendInitialized(this IDebugClient mediator, InitializedEvent @event)
 {
     mediator.SendNotification(EventNames.Initialized, @event);
 }
 protected override void Initialize()
 {
     InitializeEvent.Set();
     InitializedEvent.WaitOne(TimeoutDelay);
 }
コード例 #12
0
 public void OnInitialized()
 {
     InitializedEvent?.Invoke();
 }
コード例 #13
0
ファイル: PlotHost.cs プロジェクト: ShT3ch/CompExp
 public void Initialize()
 {
     Main              = CreateForm("Main");
     Main.Visible      = false;
     Main.Invalidated += (sender, args) => InitializedEvent.Set();
 }
コード例 #14
0
 private void InitializeFuelLevel(InitializedEvent initEvent)
 {
     _maxFuelLevel    = initEvent.MaxFuelLevel;
     FuelSlider.value = initEvent.CurrentFuelLevel / initEvent.MaxFuelLevel;
 }