//show possible avatars for selection

    /*void ShowAvatars()
     * {
     *      float x = -3;
     *      var tg = FindObjectOfType<ToggleGroup> ();
     *      var i = 0;
     *
     *      foreach (var obj in PossibleAvatars)
     * {
     *              var o = Instantiate (obj);
     *              o.transform.SetParent(Camera.main.transform);
     *              o.transform.localPosition = new Vector3 (0 + x, 1, 5);
     *              o.name = obj.name;
     *              x += 3;
     *
     *              //Setup toggle
     *              Vector2 v = Camera.main.WorldToScreenPoint (o.transform.position);
     *              var t = Instantiate (TogglePrefab);
     *              t.transform.localPosition = Vector3.zero;
     *              t.transform.position = new Vector3(v.x - 5, v.y - 40, 0);
     *              t.transform.SetParent(tg.transform, true);
     *              t.GetComponent<Toggle>().isOn = i++ == 0;
     *              t.GetComponentInChildren<Text>().text = o.name;
     *              t.GetComponent<Toggle>().group = CharacterToggleGroup;
     *      }
     *
     *      PlayerAvatar = PossibleAvatars [0];
     * }*/


    public void StartGame()
    {
        /*var selectedAvatar = "";
         * foreach (var t in CharacterToggleGroup.ActiveToggles ()) {
         *      selectedAvatar = t.GetComponentInChildren<Text>().text;
         * }
         * foreach (var av in PossibleAvatars.Where(av => av.name == selectedAvatar))
         * {
         *  PlayerAvatar = av;
         * }*/

        if (string.IsNullOrEmpty(PlayerName.text))
        {
            StartCoroutine(HighlightPlayerName());
            return;
        }

        if (!EmailSaver.IsValidEmail(PlayerEmail.text))
        {
            StartCoroutine(HighlightPlayerEmail());
            return;
        }

        PlayerPrefs.SetString("LocalName", PlayerName.text);
        PlayerPrefs.SetString("Email", PlayerEmail.text);
        PlayerPrefs.Save();
        NetworkManager.ArsStartClient();
        enabled = false;
    }
 public EmailServiceController(ILogger <EmailServiceController> logger, EmailSaver emailSaver, IEmailDataReader emailDataReader, EmailSender emailSender)
 {
     _logger          = logger;
     _emailSaver      = emailSaver;
     _emailDataReader = emailDataReader;
     _emailSender     = emailSender;
 }
    private void CmdTellServerMyIdentity(string playerName, string email)
    {
        transform.name       = playerName;
        PlayerUniqueIdentity = playerName;

        EmailSaver.SaveEmail(email);

        if (OnPlayerSetupComplete != null)
        {
            OnPlayerSetupComplete(gameObject);
        }
    }
Esempio n. 4
0
        /// <summary>
        /// This method creates a log internally, builds all necessary/provided data and save it automatically
        /// </summary>
        /// <param name="severity">sev level which ties to db sev level and log4net sev level</param>
        /// <param name="message">informational message to log - this is used when the condition isn't an exception</param>
        /// <param name="loggerInstance">which logger instance to log a message against</param>
        /// <param name="inflightPayload">string representation of the work in flight at them time of the exception</param>
        /// <param name="additionalDataKVP">optional: any additional meta data to be saved (EX cust id, claim id, etc)</param>
        /// <param name="callingMethodParameters">optional: parameter values of the method the log is being called from (EX most useful when used for debugging or exceptions to allow for quick reproduction)</param>
        /// <param name="callingMethod">The method in which log is being called</param>
        public static bool Log(SeverityLevel severity, string message,
                               string loggerInstance, string inflightPayload       = null,
                               Dictionary <string, string> additionalDataKVP       = null,
                               Dictionary <string, string> callingMethodParameters = null,
                               [CallerMemberName] string callingMethod             = "")
        {
            bool retVal;

            try
            {
                Log log = LogBuilder.Log(severity, inflightPayload, callingMethod).AddMessage(message);

                if (additionalDataKVP != null && additionalDataKVP.Any())
                {
                    log = additionalDataKVP.Aggregate(log,
                                                      (current, keyValuePair) => current.AddKVP(keyValuePair.Key, keyValuePair.Value));
                }

                if (callingMethodParameters != null && callingMethodParameters.Any())
                {
                    log = callingMethodParameters.Aggregate(log,
                                                            (current, callingMethodParameter) =>
                                                            current.AddCallingMethodParameter(callingMethodParameter.Key, callingMethodParameter.Value));
                }

                Debug.Assert(log.Verify());

                log.Save(loggerInstance);

                retVal = true;
            }
            catch (Exception caughtEx)
            {
                Log l = LogBuilder.Log(SeverityLevel.Fatal,
                                       "major exception at the log wrapper level", caughtEx, null, null, null, "LogWrapper.Log");

                EmailSaver.EmergencySaveLogProxy(l);
                SystemSaver.EmergencySaveLogProxy(l);

                retVal = false;
            }

            return(retVal);
        }
Esempio n. 5
0
        /// <summary>
        /// This method creates a log and returns the new instance requring the caller to build additional data and manually call the save functionality when ready
        /// </summary>
        /// <param name="severity">sev level which ties to db sev level and log4net sev level</param>
        /// <param name="inflightPayload">string representation of the work in flight at them time of the exception</param>
        /// <param name="callingMethod">The method in which log is being called</param>
        /// <returns>Log instance for manually building up via extensions and saving via extension method</returns>
        public static Log Log(SeverityLevel severity, string inflightPayload = null, [CallerMemberName] string callingMethod = "")
        {
            Log log = null;

            try
            {
                log = new Log(callingMethod, severity, inflightPayload);
            }
            catch (Exception caughtEx)
            {
                Log l = Log(SeverityLevel.Fatal,
                            "major exception at the log wrapper level", caughtEx, null, null, null, "LogBuilder.Log");

                EmailSaver.EmergencySaveLogProxy(l);
                SystemSaver.EmergencySaveLogProxy(l);
            }


            return(log);
        }
 public EmailSaverTest()
 {
     _emailPersister = Substitute.For <IEmailPersister>();
     _emailSaver     = new EmailSaver(_emailPersister);
 }