Пример #1
0
    // Use this for initialization
    private void Start()
    {
        var caPath = Path.Combine(Application.streamingAssetsPath, "ca.crt");

        Crash.CrashFunction(caPath);
        Debug.Log("Unity did not crash");
    }
Пример #2
0
        protected override void Run()
        {
            try
            {
                while (running)
                {
                    if (Logged) //If logged
                    {
                        BeforeCommand();

                        var cmd = Console.ReadLine();
                        Shell.cmdIntr.CommandManager._CommandManger(cmd);
                        //Console.WriteLine();
                    }
                    else
                    {
                        Login.LoginForm();
                    }
                }
            }
            catch (Exception ex)
            {
                running = false;
                Crash.StopKernel(ex);
            }
        }
Пример #3
0
        private void Drums_KeyPress(object sender, KeyPressEventArgs e)
        {
            switch (e.KeyChar.ToString())
            {
            case "1":
                Bass.PerformClick();
                break;

            case "2":
                Snare.PerformClick();
                break;

            case "3":
                FloorTom.PerformClick();
                break;

            case "4":
                Tom1.PerformClick();
                break;

            case "5":
                Tom2.PerformClick();
                break;

            case "6":
                Crash.PerformClick();
                break;

            case "0":
                Hats.PerformClick();
                break;
            }
        }
Пример #4
0
        public ActionResult AddCrash(Crash crash)
        {
            DB.CreateCrash(crash);

            Session["RedirectGildId"] = crash.GildId;
            return(RedirectToAction("Index"));
        }
Пример #5
0
    public static Crash Do(GameObject sub, Vector3 mag, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        Crash crash = (Crash)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.Crash);

        crash.Start(sub, mag, dur, delay, startDel, del);
        return(crash);
    }
Пример #6
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            var gpstate = GamePad.GetState(PlayerIndex.One);
            var kbstate = Keyboard.GetState();

            // This line will for now remain, but may have to leave once the editor is really getting to move
            if (Main.DoQuit || (kbstate.IsKeyDown(Keys.Q) && (kbstate.IsKeyDown(Keys.LeftControl) || kbstate.IsKeyDown(Keys.RightControl))))
            {
                Main.Me.SaveMap();
                Exit();
            }

            // TODO: Add your update logic here
            var mstate = Mouse.GetState();

            MX = mstate.X;
            MY = mstate.Y;
#if TeddyCrashout
            try {
#endif
            if (Current != null)
            {
                Current.Update(this, gameTime, mstate, gpstate, kbstate);
            }
#if TeddyCrashout
        }

        catch (System.Exception ex) {
            Crash.Error(this, $"U-Flow Error:\n{ex.Message}\n\nTraceback:\n{ex.StackTrace}\n\nTarget:\n{ex.TargetSite}\n\nSource:\n{ex.Source}\n\nIf you see this message you very likely fell victim to a bug!\n\nPlease go to my issue tracker and report it, if it hasn't been done before.\nhttps://github.com/TrickyGameTools/TeddyBear/issues\n\nThank you!");
        }
#endif
            base.Update(gameTime);
        }
Пример #7
0
        public void LogMessage(string applicationKey, Message message)
        {
            var application = _applicationRepository.GetByKey(applicationKey);

            if (application == null)
            {
                return;
            }

            var error = new Crash
            {
                AdditionalInformation = message.AdditionalInformation,
                InnerException        = message.InnerException,
                LogLevel    = message.LogLevel,
                Message     = message.MessageText,
                StackTrace  = message.StackTrace,
                Timestamp   = DateTime.Now,
                Version     = message.Version,
                Application = application
            };

            error = RunHandlers(error);

            _crashRepository.Save(error);
        }
Пример #8
0
        /// <summary>
        /// Send to Api async
        /// </summary>
        /// <param name="name">Any Name</param>
        /// <returns></returns>
        public async Task SendAsync(string name)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(name))
                {
                    return;
                }

                if (_list.Count == 0)
                {
                    return;
                }

                var n = new Crash()
                {
                    AppGuidId = _appGuidId,
                    Date      = DateTime.Now.ToUniversalTime(),
                    Items     = new List <CrashItem>(_list),
                    Name      = name
                };

                var json = Newtonsoft.Json.JsonConvert.SerializeObject(n);

                if (await SendToApi(json) == false)
                {
                    SaveToFileSystem(json);
                }
            }
            catch (Exception)
            {
            }
        }
Пример #9
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            //SB.Begin();
            SB.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null, null);
#if TeddyCrashout
            try {
#endif
            if (Current != null)
            {
                Current.Draw(this, gameTime);
            }
#if TeddyCrashout
        }

        catch (System.Exception ex) {
            Crash.Error(this, $"D-Flow Error:\n{ex.Message}\n\nTraceback:\n{ex.StackTrace}\n\nTarget:\n{ex.TargetSite}\n\nSource:\n{ex.Source}\n\nIf you see this message you very likely fell victim to a bug!\n\nPlease go to my issue tracker and report it, if it hasn't been done before.\nhttps://github.com/TrickyGameTools/TeddyBear/issues\n\nThank you!");
        }
#endif
            DrawTex(MousePointer, MX, MY);
            SB.End();

            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
Пример #10
0
        private static void FillCrashRepos(Crash crash)
        {
            if (crash != null)
            {
                crash.Role = DB.GetRole(crash.Role.WorkerId);

                if (crash.Role != null)
                {
                    crash.GildRepo = DB.GetGildRepo(crash.Role.GildIds);
                }
                else
                {
                    crash.Role = new Role()
                    {
                        WorkerName = "УЗ удалена"
                    };
                    var crashGildId = DB.GetGildIdByEquipmentId(crash.EquipmentId);
                    crash.GildRepo = DB.GetGildRepo(new List <int>()
                    {
                        crashGildId
                    });
                }

                crash.FoundryRepo   = DB.GetFoundryRepo();
                crash.SectorRepo    = DB.GetSectorRepo(crash.GildId);
                crash.EquipmentRepo = DB.GetEquipmentRepo(crash.SectorRepo);
            }
        }
Пример #11
0
        protected override void Run()
        {
            try
            {
                //Sys.Thread TBAR = new Sys.Thread(TaskBar);

                while (running)
                {
                    if (Logged) //If logged
                    {
                        //TBAR.Start();
                        BeforeCommand();

                        AConsole.writecommand = true;

                        var cmd = Console.ReadLine();
                        //TBAR.Stop();
                        CommandManager._CommandManger(cmd);
                        //Console.WriteLine();
                    }
                    else
                    {
                        Login.LoginForm();
                    }
                }
            }
            catch (Exception ex)
            {
                running = false;
                Crash.StopKernel(ex);
            }
        }
Пример #12
0
 void Awake() {
     S = this;
     materials = Utils.GetAllMaterials(gameObject);
     originalColors = new Color[materials.Length];
     for (int i = 0; i < materials.Length; i++) {
         originalColors[i] = materials[i].color;
     }
 }
        private int GetErrorHash(Crash crash)
        {
            var stackTrace = crash.StackTrace ?? "";

            var result = stackTrace.GetHashCode();

            return(result);
        }
Пример #14
0
        public void Save_SummaryRecord_MatchesSummary()
        {
            CrashMapper crashMapper   = new CrashMapper(this.client, this.database);
            Guid        applicationId = Guid.NewGuid();

            CrashSummary expected = new CrashSummary()
            {
                ApplicationId = applicationId,
                Count         = 2,
                Date          = date,
                PlatformId    = platform,
                Version       = version
            };

            Crash crash = new Crash()
            {
                ApplicationId       = applicationId,
                DeviceId            = Guid.NewGuid(),
                SessionId           = Guid.NewGuid(),
                DateCreatedOnDevice = dateCreatedOnDevice,
                Date        = date,
                DateCreated = DateTime.Now,
                Version     = version,
                PlatformId  = platform
            };

            CrashSummary summary = new CrashSummary(crash);

            crashMapper.Save(summary);

            Crash crash2 = new Crash()
            {
                ApplicationId       = applicationId,
                DeviceId            = Guid.NewGuid(),
                SessionId           = Guid.NewGuid(),
                DateCreatedOnDevice = dateCreatedOnDevice,
                Date        = date,
                DateCreated = DateTime.Now,
                Version     = version,
                PlatformId  = platform
            };

            CrashSummary summary2 = new CrashSummary(crash2);

            crashMapper.Save(summary2);

            IMongoQuery query = Query.And
                                (
                Query <CrashSummary> .EQ <DateTime>(mem => mem.Date, date),
                Query <CrashSummary> .EQ <Guid>(mem => mem.ApplicationId, applicationId),
                Query <CrashSummary> .EQ <string>(mem => mem.Version, version),
                Query <CrashSummary> .EQ <PlatformType>(mem => mem.PlatformId, platform)
                                );

            CrashSummary actual = this.GetCollection <CrashSummary>().FindOne(query);

            actual.ShouldHave().AllPropertiesBut(x => x.Id).EqualTo(expected);
        }
Пример #15
0
 public void Die(string character)
 {
     Crash.Play();
     GameController.GetComponent <GameControl>().Die();
     anim1.SetTrigger("isDead");
     anim2.SetTrigger("isDead");
     BubbleController.GetComponent <BubbleManager>().Bubble(character);
     Halo();
 }
Пример #16
0
        public void Accident()
        {
            Random   random   = new Random();
            double   distance = random.NextDouble() * 100;
            double   place    = Math.Min(distance, random.NextDouble() * 100);
            TimeSpan time     = new TimeSpan(0, 0, (int)place * 1000 / 40);

            Crash?.Invoke(distance, time, place);
        }
Пример #17
0
    private void OnParticleCollision(GameObject other)
    {
        Crash c = other.GetComponent <Crash>();

        if (other.gameObject.tag == "Clone" && c != null)
        {
            c.OnCrash();
        }
    }
Пример #18
0
    //private Transform[] balls;
    //private Rigidbody[] ballss;

    private void Start()
    {
        m_Rigidbody   = gameObject.GetComponent <Rigidbody>();
        m_Transform   = gameObject.GetComponent <Transform>();
        n_Crash       = gameObject.GetComponent <Crash>();
        p             = gameObject.transform.position;
        ballGenerater = ballFather.GetComponent <BallGenerater>();
        check         = floor.GetComponent <Check>();
    }
Пример #19
0
 public void AddShip(Crash c)
 {
     ships.Add(c);
     goalNum = ships.Count / 5 + 1;
     goalNum = Mathf.Min(3, goalNum);
     if (goalNum > currGoals.Count)
     {
         SpawnGoal();
     }
 }
Пример #20
0
        public Crash Process(Crash crash)
        {
            var appVersion = crash.Version;

            ISourceMapProvider providerOnVersion = _sourceMapProvider.GetByApplicationVersion(crash.Application.Key, appVersion);

            crash.StackTrace = _stackTraceBeautifier.Beautify(providerOnVersion, crash.StackTrace);

            return(crash);
        }
Пример #21
0
        public void CallingWriteWithNullForNonNullableConverts()
        {
            // Arrange
            var target  = new Crash();
            var adapter = CreateAdapter(target);

            // Act & Assert
            Assert.Equal(0, target.CallCount);
            adapter.Write("Bar", new { baz = (int?)null });
            Assert.Equal(1, target.CallCount);
            Assert.Equal(0, target.Baz);
        }
Пример #22
0
 public void VisitCrash(Crash crash)
 {
     Task.Factory.StartNew(() => {
         IPuppetMasterService server = this.GetServerService(crash.ProcessName);
         try {
             server.Crash();
         } catch (SocketException) {
             // It will receive socket exception if successful.
             this.servers.TryRemove(crash.ProcessName, out _);
         }
     });
 }
Пример #23
0
        private static void RemoveCrashedEquipmentFromRepo(Crash crash)
        {
            var activeCrashes = DB.GetActiveCrashes(crash.GildId);

            if (activeCrashes != null)
            {
                foreach (var ac in activeCrashes)
                {
                    crash.EquipmentRepo.RemoveAll(x => x.Id == ac.EquipmentId);
                }
            }
        }
Пример #24
0
 private void ButtonWebsiteClick(object sender, EventArgs e)
 {
     try
     {
         System.Diagnostics.Process.Start("http://www.spark.co.nz");
     } catch (Exception ex)
     {
         var crash = new Crash(ex);
         crash.ShowDialog();
         Environment.Exit(0);
     }
 }
        /// <summary>
        /// Create call stack pattern and either insert into database or match to existing.
        /// Update Associate Buggs.
        /// </summary>
        /// <param name="newCrash"></param>
        private void BuildPattern(Crash newCrash)
        {
            var callstack = new CallStackContainer(newCrash);

            newCrash.Module = callstack.GetModuleName();
            if (newCrash.PatternId == null)
            {
                var patternList = new List <string>();

                try
                {
                    foreach (var entry in callstack.CallStackEntries.Take(CallStackContainer.MaxLinesToParse))
                    {
                        FunctionCall currentFunctionCall;

                        var csEntry      = entry;
                        var functionCall = _unitOfWork.FunctionRepository.First(f => f.Call == csEntry.FunctionName);
                        if (functionCall != null)
                        {
                            currentFunctionCall = functionCall;
                        }
                        else
                        {
                            currentFunctionCall = new FunctionCall {
                                Call = csEntry.FunctionName
                            };
                            _unitOfWork.FunctionRepository.Save(currentFunctionCall);
                            _unitOfWork.Save();
                        }

                        patternList.Add(currentFunctionCall.Id.ToString());
                    }

                    newCrash.Pattern = string.Join("+", patternList);
                }
                catch (Exception ex)
                {
                    var messageBuilder = new StringBuilder();
                    FLogger.Global.WriteException("Build Pattern exception: " + ex.Message.ToString(CultureInfo.InvariantCulture));
                    messageBuilder.AppendLine("Exception was:");
                    messageBuilder.AppendLine(ex.ToString());
                    while (ex.InnerException != null)
                    {
                        ex = ex.InnerException;
                        messageBuilder.AppendLine(ex.ToString());
                    }

                    _slackWriter.Write("Build Pattern Exception : " + ex.Message.ToString(CultureInfo.InvariantCulture));
                    throw;
                }
            }
        }
Пример #26
0
        public ActionResult CrashGild(Crash crash)
        {
            if (crash.Role == null)
            {
                return(RedirectToAction("Index"));
            }

            crash.Role.ActiveGild = crash.GildId;
            crash.SectorRepo      = DB.GetSectorRepo(crash.GildId);
            crash.EquipmentRepo   = DB.GetEquipmentRepo(crash.SectorRepo).Where(x => x.Active).ToList();
            RemoveCrashedEquipmentFromRepo(crash);
            return(View("Index", crash));
        }
        private void PostNotification(Crash crash)
        {
            var emailNotification = new EmailNotification
            {
                CreatedAt  = DateTime.Now,
                IsPending  = true,
                Message    = BuildMessageBody(crash),
                Subject    = $"[CrashReport] New crash",
                Recepients = _recepients
            };

            _emailNotificationRepository.Save(emailNotification);
        }
Пример #28
0
    private void OnCollisionEnter(Collision collision)
    {
        //TODO ORI: SendCrash:
        if (collision.gameObject.CompareTag("barrel"))
        {
            Crash crash = new Crash();
            crash.position         = collision.gameObject.transform.position;
            crash.collision_obj_id = collision.gameObject.GetComponent <Obstacle>().barrel_uid;
            crash.current_lap      = currentLap;

            EventManager.OnCrash(crash);
        }
    }
        public Crash Process(Crash crash)
        {
            var problem = crash.Problem;

            if (problem.Status != EProblemStatus.Deployed)
            {
                return(crash);
            }

            crash.Problem.Status = EProblemStatus.Repeated;

            return(crash);
        }
Пример #30
0
        public async Task <IActionResult> Post([FromBody] Crash crash)
        {
            var result = await _cosmosDbService.AddItemAsync(crash);

            if (result == true)
            {
                return(Created(crash.id, crash.ToString()));
            }
            else
            {
                return(BadRequest());
            }
        }
Пример #31
0
        void BuildPattern(Crash CrashInstance)
        {
            List <string> Pattern = new List <string>();

            // Get an array of callstack items
            CallStackContainer CallStack = new CallStackContainer(CrashInstance);

            CallStack.bDisplayFunctionNames = true;

            if (CrashInstance.Pattern == null)
            {
                // Set the module based on the modules in the callstack
                CrashInstance.Module = CallStack.GetModuleName();
                try
                {
                    using (FAutoScopedLogTimer LogTimer = new FAutoScopedLogTimer(this.GetType().ToString() + "(Id=" + CrashInstance.Id + ")"))
                    {
                        foreach (CallStackEntry Entry in CallStack.CallStackEntries.Take(64))
                        {
                            FunctionCall CurrentFunctionCall = new FunctionCall();

                            if (FunctionCalls.Where(f => f.Call == Entry.FunctionName).Count() > 0)
                            {
                                CurrentFunctionCall = FunctionCalls.Where(f => f.Call == Entry.FunctionName).First();
                            }
                            else
                            {
                                CurrentFunctionCall      = new FunctionCall();
                                CurrentFunctionCall.Call = Entry.FunctionName;
                                FunctionCalls.InsertOnSubmit(CurrentFunctionCall);
                            }

                            //CrashRepository.Context.SubmitChanges();

                            Pattern.Add(CurrentFunctionCall.Id.ToString());
                        }

                        //CrashInstance.Pattern = "+";
                        CrashInstance.Pattern = string.Join("+", Pattern);
                        // We need something like this +1+2+3+5+ for searching for exact pattern like +5+
                        //CrashInstance.Pattern += "+";

                        CrashRepository.Context.SubmitChanges();
                    }
                }
                catch (Exception Ex)
                {
                    FLogger.WriteEvent("Exception in BuildPattern: " + Ex.ToString());
                }
            }
        }
 /// <summary>
 /// Add a new crash to the data store
 /// </summary>
 /// <param name="entity"></param>
 public void Save(Crash entity)
 {
     _entityContext.Crashes.Add(entity);
 }
 /// <summary>
 /// Remove a crash from the data store
 /// </summary>
 /// <param name="entity"></param>
 public void Delete(Crash entity)
 {
     _entityContext.Crashes.Remove(entity);
 }
Пример #34
0
    void Awake() {
        S = this;
		checkpoint = transform.position;
        currentRotation = transform.rotation;
    }
        /// <summary>
        /// Update an existing crash
        /// </summary>
        /// <param name="entity"></param>
        public void Update(Crash entity)
        {
            var set = _entityContext.Set<Crash>();
            var entry = set.Local.SingleOrDefault(f => f.Id == entity.Id);

            if (entry != null)
            {
                var attachedFeature = _entityContext.Entry(entry);
                attachedFeature.CurrentValues.SetValues(entity);
                attachedFeature.State = EntityState.Modified;
            }
            else
            {
                _entityContext.Crashes.Attach(entity);
                _entityContext.Entry(entity).State = EntityState.Modified;
            }
        }