private void SendMessage(string msg, LevelMsg lvl, [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { string text = template.Replace("%T", lvl.ToString()) .Replace("%D", DateTime.Now.ToShortDateString()) .Replace("%t", DateTime.Now.ToShortTimeString()) .Replace("%F", sourceFilePath) .Replace("%l", sourceLineNumber.ToString()) .Replace("%m", msg + "\r\n"); lock (this) { Console.WriteLine(text); } }
// private IEnumerator LoadAllUpgradeTowerObj(Tower tower, UiType uiType) // { // List<List<GameObject>> thisType = new List<List<GameObject>>(); // for (int i = 0; i < tower.maxLevel; i++) // { // thisType.Add(new List<GameObject>()); // for(tower.tower) // } // } public LevelMsg LoadLevelMsg(int level) { if (_levelMsgDic.ContainsKey(level)) { return(_levelMsgDic[level]); } LevelMsg ls = Resources.Load <LevelMsg>("ScriptableObject/Level/LevelMsg" + level.ToString()); if (ls == null) { throw new NullReferenceException($"本地未包含 LevelMsg{level}"); } _levelMsgDic.Add(level, ls); return(ls); }
private void SendMessage(string msg, LevelMsg lvl, [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { string text = template.Replace("%T", lvl.ToString()) .Replace("%D", DateTime.Now.ToShortDateString()) .Replace("%t", DateTime.Now.ToShortTimeString()) .Replace("%F", sourceFilePath) .Replace("%l", sourceLineNumber.ToString()) .Replace("%m", msg + "\r\n"); lock (this) { message.Body = text; message.Subject = ConfigurationManager.AppSettings["subject"]; // адрес smtp-сервера и порт, с которого будем отправлять письмо SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); // логин и пароль smtp.Credentials = new NetworkCredential(from.Address, ConfigurationManager.AppSettings["fromPassword"]); smtp.EnableSsl = true; smtp.Send(message); } }
public void LoadLevelRes(int level) { List <TowerType> choosedTowerList = new List <TowerType>(); _curLevelMsg = LoadLevelMsg(level); string[] strs = _curLevelMsg.chooseTowers.Split(','); for (int i = 0; i < strs.Length; i++) { if (int.TryParse(strs[i], out int type)) { TowerType towerType = (TowerType)type; if (choosedTowerList.Contains(towerType) || towerType == TowerType.UpGrade || towerType == TowerType.Null) { continue; } choosedTowerList.Add(towerType); } } GameManager.Instance.choosedTowerList = choosedTowerList; StartCoroutine(LoadAllTowerObj(choosedTowerList)); }
public void OnTlfSpeakerLevelEngine(object sender, LevelMsg <LcSpeaker> msg) { _Logger.Trace("Procesando {0}: {1}", EventTopicNames.TlfSpeakerLevelEngine, msg); //El volumen de telefonía por altavoz de LC es diferente del de LC _StateManager.LcSpeaker.LevelTlf = msg.Level; }
public void OnTlfHeadPhonesLevelEngine(object sender, LevelMsg <TlfHeadPhones> msg) { _Logger.Trace("Procesando {0}: {1}", EventTopicNames.TlfHeadPhonesLevelEngine, msg); _StateManager.TlfHeadPhones.Level = msg.Level; }
public void OnLcSpeakerLevelEngine(object sender, LevelMsg <LcSpeaker> msg) { _Logger.Trace("Procesando {0}: {1}", EventTopicNames.LcSpeakerLevelEngine, msg); _StateManager.LcSpeaker.LevelLC = msg.Level; }
public void OnRdHfLevelEngine(object sender, LevelMsg <HfSpeaker> msg) { _Logger.Trace("Procesando {0}: {1}", EventTopicNames.RdHFLevelEngine, msg); _StateManager.HfSpeaker.Level = msg.Level; }