private void RefreshStatus()
        {
            var stats = ET.GetStats();

            var numberOfExceptionsInQueue     = stats.NumberOfExceptionsInQueue;
            var numberOfExceptionsSent        = stats.NumberOfExceptionsSent;
            var numberOfExceptionsInSendQueue = stats.NumberOfExceptionsInSendQueue;

            if (label1.InvokeRequired)
            {
                label1.Invoke(new Action(() =>
                                         label1.Text =
                                             string.Format(
                                                 "Exceptions in local queue: {0}. Exceptions sent {1}. Exceptions in send queue {2}",
                                                 numberOfExceptionsInQueue,
                                                 numberOfExceptionsSent,
                                                 numberOfExceptionsInSendQueue)
                                         ));
            }
            else
            {
                label1.Text = string.Format("Exceptions in queue: {0}. Exceptions sent {1}", numberOfExceptionsInQueue,
                                            numberOfExceptionsSent);
            }
        }
Пример #2
0
 IEnumerator GenerateAsteroid()
 {
     //yield return new WaitForSeconds(10.0f);
     while (gameObject.activeSelf && Solar.Instance.End == false)
     {
         Vector2 dir;
         if (Random.Range(0.0f, 100.0f) < 10.0f && Planete.Planetes.Count > 0 && GameTime > 45.0f)
         {
             dir = new Vector2(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f));
             dir.Normalize();
             GameObject goET = Instantiate(ETPrefab, dir * Random.Range(150.0f, 250.0f), Quaternion.identity);
             ET         et   = goET.GetComponent <ET>();
             et.focus = Planete.Planetes[Random.Range(0, Planete.Planetes.Count)];
         }
         dir = new Vector2(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f));
         dir.Normalize();
         GameObject go       = Instantiate(AsteroidPrefab[Random.Range(0, AsteroidPrefab.Count)], dir * Random.Range(100.0f, 200.0f), Quaternion.identity);
         Asteroid   asteroid = go.GetComponent <Asteroid>();
         asteroid.Big = Random.Range(0.0f, 100.0f) < (5.0f + GameTime / 60.0f) && GameTime > 30.0f;
         if (Planete.Planetes.Count > 0)
         {
             asteroid.dir = (Planete.Planetes[Random.Range(0, Planete.Planetes.Count)].transform.position - go.transform.position).normalized;
         }
         else
         {
             asteroid.dir = -dir;
         }
         float subTime = (GameTime / 30.0f);
         float min     = Mathf.Max(3.0f - subTime, 0.0f);
         float max     = Mathf.Max(6.0f - subTime, 1.0f);
         float timer   = Random.Range(min, max);
         yield return(new WaitForSeconds(timer));
     }
 }
Пример #3
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            ET.Initialize("YOUR_API_KEY");
            ETSettings.SaveExceptionsLocally = true;
            ETSettings.SendMode = ESendMode.OnDemand;

            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;
            }

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();
        }
Пример #4
0
        public static ET CreateET(string userName)
        {
            ET eT = new ET();

            eT.UserName = userName;
            return(eT);
        }
 public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 {
     ET.Initialize("YOUR_API_KEY");
     foreach (ChannelDispatcher channelDispatcher in serviceHostBase.ChannelDispatchers)
     {
         channelDispatcher.ErrorHandlers.Add(this);
     }
 }
Пример #6
0
 private static string CreateErrorMessage(ET errorType, Id errorId,
                                          byte errorColumn, int errorLine)
 {
     string[] codes = SourceCode.Split((char)TT.LF);
     HIDebug.Assert(codes.Length > errorLine);
     return(string.Format(Id.ErrorFormat.ToText(), codes[errorLine],
                          "".PadLeft(errorColumn), errorType, errorId.ToText(), errorLine + 1));
 }
        public void Render(RT src, RT dst, ET currentEffect, bool needsUpdate)
        {
            if (needsUpdate)
            {
                Update(src.width, src.height);
            }

            Begin(src, needsUpdate);
            Canvas();
            switch (currentEffect)
            {
            case ET.SBR: SBR(dst); break;

            case ET.WCR: WCR(dst); break;

            case ET.BF: BF(dst); break;

            case ET.AKF: AKF(dst); break;

            case ET.SNN: SNN(dst); break;

            case ET.FXDoG: FXDoG(dst); break;

            case ET.Outline: Outline(dst); break;

            case ET.Mask: Mask(dst); break;

            case ET.Sobel: Sobel(dst); break;

            case ET.SST: SST(dst); break;

            case ET.TFM: TFM(dst); break;

            case ET.LIC: LIC(dst); break;

            case ET.GBlur: GBlur(dst); break;

            case ET.Sharpen: Sharpen(dst); break;

            case ET.Comp: Complementary(dst); break;

            case ET.Posterize: Posterize(dst); break;

            case ET.SNoise: SNoise(dst); break;

            case ET.FNoise: FNoise(dst); break;

            case ET.VNoise: VNoise(dst); break;

            case ET.Test: Test(dst); break;

            case ET.TestBF: TestBF(dst); break;

            default: Default(dst); break;
            }
            End();
        }
 private static void Main()
 {
     ET.Initialize("YOUR_API_KEY");
     ETSettings.SendMode = ESendMode.OnDemand;
     XmlConfigurator.Configure();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new ExceptionGeneratorForm());
 }
Пример #9
0
    public void StoryPhrases_field()
    {
        string[] temp = new string[] { "", "" };
        switch (num)
        {
        case 1: temp = Dialog_texts.StoryPhrases1.ReturnDialog(); break;

        case 2: temp = Dialog_texts.StoryPhrases2.ReturnDialog(); break;

        case 3: temp = Dialog_texts.StoryPhrases3.ReturnDialog(); break;
        }

        if (temp[0].Equals("") && temp[1].Equals(""))
        {
            WinBG.GetComponent <WinMenuMoney>().NewBlvlAchive();
            //Затемнение и финальный ролик добавляем сюда:

            //
            StoryPhrasesObj.SetActive(false);
        }
        else if (temp[0].Equals(""))
        {
            SetFalseAll();
            GT.SetActive(true);
            GTText.GetComponent <Text>().text = temp[1];
        }
        else if (temp[1].Equals(""))
        {
            SetFalseAll();
            ET.SetActive(true);
            ETText.GetComponent <Text>().text = temp[0];
        }
        else
        {
            SetFalseAll();
            Dialog.SetActive(true);
            bool tmp = temp[1].Substring(0, 4).Equals("@SC@");
            if (!tmp)
            {
                StoryPhrasesGT.SetActive(true);
                StoryPhrasesSC.SetActive(false);
                DialogETText.GetComponent <Text>().text = temp[0];
                DialogGTText.GetComponent <Text>().text = temp[1];
                DialogSCText.GetComponent <Text>().text = "";
            }
            else
            {
                StoryPhrasesGT.SetActive(false);
                StoryPhrasesSC.SetActive(true);
                DialogETText.GetComponent <Text>().text = temp[0];
                DialogGTText.GetComponent <Text>().text = "";
                DialogSCText.GetComponent <Text>().text = temp[1].Substring(4);
            }
        }
    }
Пример #10
0
    private void Start()
    {
        string sceneName = SceneManager.GetActiveScene().name;

        if (sceneName.Substring(3, 1) == "B")
        {
            num = int.Parse(sceneName.Substring(4));
        }

        string[] temp = new string[] { "", "" };

        switch (num)
        {
        case 1: Dialog_texts = new Texts("StoryPhrases1"); temp = Dialog_texts.StoryPhrases1.ReturnDialog(); break;

        case 2: Dialog_texts = new Texts("StoryPhrases2"); temp = Dialog_texts.StoryPhrases2.ReturnDialog(); break;

        case 3: Dialog_texts = new Texts("StoryPhrases3"); temp = Dialog_texts.StoryPhrases3.ReturnDialog(); break;
        }

        if (temp[0].Equals(""))
        {
            SetFalseAll();
            GT.SetActive(true);
            GTText.GetComponent <Text>().text = temp[1];
        }
        else if (temp[1].Equals(""))
        {
            SetFalseAll();
            ET.SetActive(true);
            ETText.GetComponent <Text>().text = temp[0];
        }
        else
        {
            SetFalseAll();
            Dialog.SetActive(true);
            bool tmp = temp[1].Substring(0, 4).Equals("@SC@");
            if (!tmp)
            {
                StoryPhrasesGT.SetActive(true);
                StoryPhrasesSC.SetActive(false);
                DialogETText.GetComponent <Text>().text = temp[0];
                DialogGTText.GetComponent <Text>().text = temp[1];
                DialogSCText.GetComponent <Text>().text = "";
            }
            else
            {
                StoryPhrasesGT.SetActive(false);
                StoryPhrasesSC.SetActive(true);
                DialogETText.GetComponent <Text>().text = temp[0];
                DialogGTText.GetComponent <Text>().text = "";
                DialogSCText.GetComponent <Text>().text = temp[1].Substring(4);
            }
        }
    }
Пример #11
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         throw null;
     }
     catch (Exception oops)
     {
         ET.Publish(oops);
     }
 }
        private void bwSendGazillion_DoWork(object sender, DoWorkEventArgs e)
        {
            _logger.Info("Sending gazillions");

            var backgroundWorker = (BackgroundWorker)sender;

            var sent = 0;

            for (var i = 1; i <= 5; i++)
            {
                if (backgroundWorker.CancellationPending)
                {
                    _logger.Info("BW canceled");
                    return;
                }
                var lastSecond = _stopWatch.Elapsed.Seconds;
                for (var j = 0; j < _maxPerSecond; j++)
                {
                    if (_stopWatch.Elapsed.Seconds > lastSecond)
                    {
                        break;
                    }
                    Exception exception = null;
                    try
                    {
                        RandomException();
                    }
                    catch (Exception oops)
                    {
                        exception = oops;
                    }
                    try
                    {
                        _logger.Info("Calling Publish method");

                        ET.Publish(exception);

                        _logger.Info("Publish");
                        backgroundWorker.ReportProgress(sent++);
                    }
                    catch (Exception oops)
                    {
                        Invoke(new MethodInvoker(() => MessageBox.Show(oops.StackTrace)));
                    }
                }
                while (lastSecond == _stopWatch.Elapsed.Seconds)
                {
                    Thread.Sleep(2);
                }
            }
        }
 private void CheckEnableFlags()
 {
     // いずれのエフェクトにもチェックが付いていないならキャッシュをクリアする
     foreach (ET index in ETypes)
     {
         if (enableFlagIndexer[index])
         {
             return;
         }
     }
     foreach (ET index in ETypes)
     {
         enableFlagCache[(int)index] = false;
     }
     currentEffect = ET.None;
 }
Пример #14
0
        public void GetAnnotationTargetingType()
        {
            RecordAnnotationType annotationValue = null;

            ET et = new ET()
            {
                UserName = "******", ComplexP = new CT {
                    Name = "CT"
                }
            };
            var result = dsc.TryGetAnnotation(
                et,
                RecordAnnotation,
                out annotationValue);

            Assert.True(result);
            Assert.Equal("ET", annotationValue.Name);
            Assert.Equal(1, annotationValue.OtherProperties.Count);
            Assert.Equal("CT", annotationValue.OtherProperties.ElementAt(0));
        }
Пример #15
0
 public void SyncWorldReceive(ET entType, string nodeName)
 {
     switch (entType)
     {
     case ET.PLAYER:
         int id = Convert.ToInt32(nodeName);
         if (id == GetTree().GetNetworkUniqueId())
         {
             _world.StartWorld();
             _id = id;
             AddPlayer(id, true);
             _active = true;
         }
         else
         {
             AddPlayer(id, false);
         }
         break;
     }
 }
Пример #16
0
        public void Test()
        {
            /*
             * unsafe {
             *  m_Demo = new Demo();
             *  //m_Demo.TestArr = new sbyte[1];
             *  m_Demo.TestArr[0] = 37;
             *  m_Data = m_Demo.ToByteArray();
             *
             *  m_DemoTest = m_Demo.ToByteArray().ToStructure<Demo>();
             * }
             */
            var test = new Demo3();

            test.TestArr = new long[5];
            for (int i = 0; i < test.TestArr.Length; i++)
            {
                test.TestArr[i] = 37 + i * 5 + i * i * 2;
            }
            test.m_Vals = new ValT[3];
            for (int i = 0; i < test.m_Vals.Length; i++)
            {
                test.m_Vals[i] = new ValT();
            }
            test.m_F = Core.MathLib.UCL_Random.Instance.NextFloat(2.0f);
            Dictionary <string, int> dic = new Dictionary <string, int>();

            dic.Add("hii", 3);
            dic.Add("No QAQ", 142);
            Debug.LogWarning(dic.UCL_ToString());
            ET e = ET.b;

            Debug.LogWarning(e.UCL_ToString());
            int a = 17;

            Debug.LogWarning(a.UCL_ToString());
            Debug.LogWarning(test.UCL_ToString());

            Debug.LogWarning(test.GetMember("m_F").UCL_ToString());
            Debug.LogWarning(test.GetMember("m_Demo").UCL_ToString());
        }
        private void NextEnableFlags(PE pe, ET nextEffect)
        {
            foreach (ET index in ETypes)
            {
                // 押下されたチェックボックス以外を全て非活性に変更
                if (nextEffect != index)
                {
                    enableFlagCache[(int)index] = enableFlagIndexer[index] = false;
                }
            }

            // 押下された対象がSBRで且つレイヤが無い場合はデフォルトのパラメータを設定する
            if ((nextEffect == ET.SBR) && (pe.SBRParameters.Layers.Length == 0))
            {
                pe.SetDefaultParamsSBR();
            }

            // 押下されたチェックボックスのフラグを活性に変更
            enableFlagCache[(int)nextEffect] = true;
            currentEffect = nextEffect;
        }
Пример #18
0
    public MyProperty SetValue(string s, object v, string index)
    {
        fieldName     = s;
        this.monoName = index;
        if (v is bool)
        {
            boolValue = (bool)v;
            et        = ET.boola;
        }
        else if (v is Color)
        {
            colorValue = (Color)v;
            et         = ET.color;
        }
        else if (v is int)
        {
            intValue = (int)v;
            et       = ET.inta;
        }
        else if (v is float)
        {
            floatValue = (float)v;
            et         = ET.floata;
        }
        else if (v is AnimationCurve)
        {
            animationCurveValue = (AnimationCurve)v;
            et = ET.AnimCurve;
        }
        else
        {
            return(null);
        }

        return(this);
    }
Пример #19
0
        private void BtnSendGazillionClick(object sender, RoutedEventArgs e)
        {
            Exception exception = null;

            try
            {
                RandomException();
            }
            catch (Exception oops)
            {
                exception = oops;
            }

            ET.Publish(exception);

            var etStats = ET.GetStats();

            textBlock1.Text = etStats.NumberOfExceptionsInQueue + " " + etStats.NumberOfExceptionsInSendQueue + " " +
                              etStats.NumberOfExceptionsSent;

            var etExceptions = ET.GetExceptions();

            ET.SendExceptions(etExceptions);
        }
Пример #20
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        Asteroid aste = collision.gameObject.GetComponent <Asteroid>();

        if (aste)
        {
            if (aste.Hit(bulletDamage))
            {
                switch (GameSettings.GameDifficulty)
                {
                case GameSettings.Difficulty.Easy:
                    sender.AddGold(Random.Range(80, 120));
                    break;

                case GameSettings.Difficulty.Normal:
                    sender.AddGold(Random.Range(40, 100));
                    break;

                case GameSettings.Difficulty.Hard:
                    sender.AddGold(Random.Range(20, 120));
                    break;
                }
            }
            else
            {
                switch (GameSettings.GameDifficulty)
                {
                case GameSettings.Difficulty.Easy:
                    sender.AddGold(Random.Range(20, 40));
                    break;

                case GameSettings.Difficulty.Normal:
                    sender.AddGold(Random.Range(0, 20));
                    break;

                case GameSettings.Difficulty.Hard:

                    break;
                }
            }
            Destroy(gameObject);
            return;
        }
        ET et = collision.gameObject.GetComponent <ET>();

        if (et)
        {
            if (et.Hit(bulletDamage))
            {
                switch (GameSettings.GameDifficulty)
                {
                case GameSettings.Difficulty.Easy:
                    sender.AddGold(Random.Range(120, 160));
                    break;

                case GameSettings.Difficulty.Normal:
                    sender.AddGold(Random.Range(80, 140));
                    break;

                case GameSettings.Difficulty.Hard:
                    sender.AddGold(Random.Range(60, 160));
                    break;
                }
            }
            Destroy(gameObject);
            return;
        }
    }
Пример #21
0
 public HIException(ET type, Id message, byte column) :
     base(string.Format(errorMessage, Text, "".PadLeft(column), type, message.ToText()))
 {
     HResult = (int)message;
 }
Пример #22
0
 protected override void paintPicByEt(ET._Worksheet ws)
 {
     if (!string.IsNullOrEmpty(PicInfo.PicPath))
     {
         ET.Pictures pics = (ET.Pictures)ws.Pictures(missing);
         pics.Insert(picInfo.PicPath, missing);
     }
 }
Пример #23
0
 // Lexer에서 예외 발생시 사용하는 생성자
 public HIException(ET errorType, Id errorId, byte errorColumn, int errorLine) :
     base(CreateErrorMessage(errorType, errorId, errorColumn, errorLine))
 {
     HResult    = (int)errorId;
     Data["Id"] = errorId;
 }
Пример #24
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            ET.Initialize("YOUR_API_KEY");
        }
Пример #25
0
 protected virtual void paintPicByEt(ET._Worksheet ws)
 {
 }
Пример #26
0
 // 코드에서 발생한 예외가 아닐시 사용하는 생성자
 public HIException(ET errorType, Id errorId) :
     base(string.Format("{0}: {1}", errorType, errorId.ToText()))
 {
     HResult    = (int)errorId;
     Data["Id"] = errorId;
 }
Пример #27
0
 // Parser에서 예외 발생시 사용하는 생성자
 public HIException(ET errorType, Id errorId, Token token) :
     base(CreateErrorMessage(errorType, errorId, token.Column, token.Line))
 {
     HResult    = (int)errorId;
     Data["Id"] = errorId;
 }
 private void LocalExceptionsForm_Load(object sender, EventArgs e)
 {
     UpdateSendAllBtnState();
     eTExceptionBindingSource.DataSource = ET.GetExceptions();
 }
Пример #29
0
 //[classmethod]
 public static object for_xml_file(Type cls, string path, bool remove_reserved = false)
 {
     return(cls(ET.parse(path), remove_reserved));
 }
        private void bwSend_DoWork(object sender, DoWorkEventArgs e)
        {
            var etExceptions = ET.GetExceptions();

            ET.SendExceptions(etExceptions);
        }
Пример #31
0
 public void AddToETSets(ET eT)
 {
     base.AddObject("ETSets", eT);
 }
Пример #32
0
 public Etype(Type t)
 {
     type  = t;
     etype = new ET();
 }