static void LogCSV() { string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string playerCsvPath = Path.Combine(exePath, "player.csv"); string matchCsvPath = Path.Combine(exePath, "match.csv"); StringBuilder csv = new StringBuilder(); if (!File.Exists(playerCsvPath)) { csv.AppendLine(PlayerStat.GetFieldNames()); } csv.AppendLine(playerStat.ToString()); File.AppendAllText(playerCsvPath, csv.ToString()); csv.Clear(); if (!File.Exists(matchCsvPath)) { csv.AppendLine(MatchStat.GetFieldNames()); } foreach (MatchStat m in friendlyList) { csv.AppendLine(m.ToString()); } foreach (MatchStat m in enemyList) { csv.AppendLine(m.ToString()); } File.AppendAllText(matchCsvPath, csv.ToString()); }
static void LogCSV() { StringBuilder csv = new StringBuilder(); if (!File.Exists("player.csv")) { csv.AppendLine(PlayerStat.GetFieldNames()); } csv.AppendLine(playerStat.ToString()); File.AppendAllText("player.csv", csv.ToString()); csv.Clear(); if (!File.Exists("match.csv")) { csv.AppendLine(MatchStat.GetFieldNames()); } foreach (MatchStat m in friendlyList) { httpPostMatchMetricTest(m); csv.AppendLine(m.ToString()); } foreach (MatchStat m in enemyList) { httpPostMatchMetricTest(m); csv.AppendLine(m.ToString()); } File.AppendAllText("match.csv", csv.ToString()); }
static void LogCSV() { string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string playerCsvPath = Path.Combine(exePath, "player.csv"); string matchCsvPath = Path.Combine(exePath, "match.csv"); apiUrl = (System.Configuration.ConfigurationManager.AppSettings["ApiUrl"] == "" || System.Configuration.ConfigurationManager.AppSettings["ApiUrl"] == null) ? "http://mwarena.azurewebsites.net/api/" : System.Configuration.ConfigurationManager.AppSettings["ApiUrl"]; associationName = (System.Configuration.ConfigurationManager.AppSettings["AssociationName"] == "" || System.Configuration.ConfigurationManager.AppSettings["AssociationName"] == null) ? "PUG" : System.Configuration.ConfigurationManager.AppSettings["AssociationName"]; StringBuilder csv = new StringBuilder(); if (!File.Exists(playerCsvPath)) { csv.AppendLine(PlayerStat.GetFieldNames()); } csv.AppendLine(playerStat.ToString()); File.AppendAllText(playerCsvPath, csv.ToString()); csv.Clear(); if (!File.Exists(matchCsvPath)) { csv.AppendLine(MatchStat.GetFieldNames()); } foreach (MatchStat m in friendlyList) { // httpPostMatchMetric(m); csv.AppendLine(m.ToString()); } foreach (MatchStat m in enemyList) { // httpPostMatchMetric(m); csv.AppendLine(m.ToString()); } File.AppendAllText(matchCsvPath, csv.ToString()); LoggedMatch lm = new LoggedMatch(); lm.MatchHash = "";//GetMatchHash(); lm.FriendlyMatchStats = friendlyList; lm.EnemyMatchStats = enemyList; lm.AssociationName = associationName; lm.PublishingUserName = (playerNameSet) ? ((playerName == null | playerName == "") ? "UNKNOWN" : playerName) : "UNKNOWN"; //MatchCompletedPublisher.Publish(lm); httpPostLoggedMatch(lm); }
static void LogCSV() { string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string playerCsvPath = Path.Combine(exePath, "player.csv"); string matchCsvPath = Path.Combine(exePath, "match.csv"); StringBuilder csv = new StringBuilder(); if (!File.Exists(playerCsvPath)) { csv.AppendLine(PlayerStat.GetFieldNames()); } csv.AppendLine(playerStat.ToString()); File.AppendAllText(playerCsvPath, csv.ToString()); csv.Clear(); if (!File.Exists(matchCsvPath)) { csv.AppendLine(MatchStat.GetFieldNames()); } foreach (MatchStat m in friendlyList) { csv.AppendLine(m.ToString()); } foreach (MatchStat m in enemyList) { csv.AppendLine(m.ToString()); } File.AppendAllText(matchCsvPath, csv.ToString()); LoggedMatch lm = new LoggedMatch { MatchHash = "", FriendlyMatchStats = friendlyList, EnemyMatchStats = enemyList, AssociationName = "PUG", PublishingUserName = (playerNameSet) ? ((playerName == null | playerName == "") ? "UNKNOWN" : playerName) : "UNKNOWN" }; httpPostLoggedMatch(lm); }