Esempio n. 1
0
        /// <summary>
        /// Get as <see cref="PioneerLog"/> object pre-populated with details parsed
        /// from the ASP.NET Core environment.
        /// </summary>
        public static PioneerLogEcs GetTubEcsDetail(string message,
                                                    LevelEnum level,
                                                    HttpContext context = null,
                                                    Dictionary <string, object> additionalInfo = null)
        {
            var detail = new PioneerLogEcs
            {
                Timestamp  = DateTime.UtcNow,
                Message    = message,
                CustomInfo = additionalInfo,
                Labels     = new PioneerLogLabels
                {
                    ApplicationName         = Configuration.ApplicationName,
                    ApplicationLayer        = Configuration.ApplicationLayer,
                    ApplicationLayerVersion = Configuration.ApplicationLayerVersion
                },
                Event = new PioneerLogEvent
                {
                    Dataset = level.ToString()
                },
                Host = new PioneerLogHost
                {
                    Hostname = Dns.GetHostName(),
                    Host     = Environment.MachineName
                },
                Log = new PioneerLogLog
                {
                    File = new PioneerLogLogFile
                    {
                        Path = @"logs\pioneer-logs-" + level.ToString().ToLower() + "-timestamp-.log"
                    }
                },
                Tracing = new PioneerLogTracing
                {
                    Transaction = new PioneerLogTracingTransaction
                    {
                        Id = IsNullOrEmpty(CorrelationId) ? Guid.NewGuid().ToString() : CorrelationId
                    }
                }
            };

            if (context == null)
            {
                return(detail);
            }

            GetUserData(detail, context);
            GetRequestData(detail, context);

            return(detail);
        }
        public static Level CreateLevel(LevelEnum level, GameCanvas playGrid, Player player)
        {
            _playGrid = playGrid;
            _player   = player;
            string className = "kipschieten.Levels." + level.ToString();

            Type t = Type.GetType(className);

            return(Activator.CreateInstance(t, _playGrid, _player) as Level);
        }
Esempio n. 3
0
 public void Log(string message, LevelEnum level, DateTime time)
 {
     using (TPALoggerContext context = new TPALoggerContext())
     {
         context.Logs.Add(new DatabaseLogs
         {
             Message = message,
             Time    = time,
             Level   = level.ToString()
         });
         context.SaveChanges();
     }
 }
Esempio n. 4
0
    private void Awake()
    {
        if (!LevelManager.IsLevelUnlocked(associatedLevel))
        {
            Debug.Log("Not unlocked " + associatedLevel.ToString()); // TODO change color or so
            gameObject.SetActive(false);                             // TODO rework into make nonclickable
        }
        else
        {
            Init(); // Only init if object is active

            switch (LevelManager.GetLevelStarCount(associatedLevel))
            {
            case 0:
                if (LevelManager.IsLevelCompleted(associatedLevel))
                {
                    glowLight.intensity = 600.0F;
                    SetCrystalMaterialAndGlow(Resources.Load <Material>("UI/LevelSelectScreen/GreenGlow"));
                    glowLight.color = crystal.GetComponent <Renderer>().material.GetColor("_BaseColor");
                }
                break;

            case 1:
                glowLight.intensity = 700.0F;
                SetCrystalMaterialAndGlow(Resources.Load <Material>("UI/LevelSelectScreen/BlueGlow"));
                leftStar.SetActive(true);
                break;

            case 2:
                glowLight.intensity = 800.0F;
                SetCrystalMaterialAndGlow(Resources.Load <Material>("UI/LevelSelectScreen/PurpleGlow"));
                leftStar.SetActive(true);
                centerStar.SetActive(true);
                break;

            case 3:
                glowLight.intensity = 1000.0F;

                SetCrystalMaterialAndGlow(Resources.Load <Material>("UI/LevelSelectScreen/OrangeGlow"));
                leftStar.SetActive(true);
                centerStar.SetActive(true);
                rightStar.SetActive(true);
                break;
            }
        }
    }
Esempio n. 5
0
 public void LoadThisLevel()
 {
     level = ApplicationController.ac.levels[levelEnum];
     if (level.isLocked) // go to shop
     {
         foreach (GameObject g in toDisableWhenGoToShop)
         {
             g.SetActive(false);
         }
         shopPanel.SetActive(true);
     }
     // load intro scene if the level has one
     else if (level.introScene != null)
     {
         SceneLoader.LoadSceneWithLoadingScreen(level.introScene);
     }
     // load level
     else
     {
         SceneLoader.LoadSceneWithLoadingScreen(levelEnum.ToString());
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Write in trace an exception occured <c>exception</c> with the message in parameter with the <c>level</c> as level
 /// </summary>
 /// <param name="level">Level log to use instead of default</param>
 /// <param name="exception">Exception to be written</param>
 /// <param name="message">message to be logged</param>
 public void Log(LevelEnum level, Exception exception, object message)
 {
     Trace.Write(FormatMessage(message), level.ToString());
     Trace.Write(exception, Level.ToString());
 }
Esempio n. 7
0
 /// <summary>
 /// Write in trace <c>message</c> with the <c>level</c> as level
 /// </summary>
 /// <param name="level">Level log to use instead of default</param>
 /// <param name="message">message to be logged</param>
 public void Log(LevelEnum level, object message)
 {
     Trace.Write(FormatMessage(message), level.ToString());
 }
Esempio n. 8
0
 void LoadLevel()
 {
     SceneLoader.LoadSceneWithLoadingScreen(levelToLoad.ToString());
 }
 public void SetLevelInfo(LevelEnum le)
 {
     warningText.text = "You have selected Level " + le.ToString();
 }
 public void Log(string message, LevelEnum level, DateTime time)
 {
     _traceListener.WriteLine(message + " (" + time + ")", level.ToString());
     _traceListener.Flush();
 }
Esempio n. 11
0
 public Level GetLevel(LevelEnum level)
 {
     return((Level)typeof(Level).GetField(level.ToString(), BindingFlags.Public | BindingFlags.Static).GetValue(null));
 }
Esempio n. 12
0
 public void LoadLevel()
 {
     pd.Pause();
     SceneLoader.LoadSceneWithLoadingScreen(levelToLoad.ToString());
 }