示例#1
0
        public static string LogTurn(string gameFileName, string email, string outgoingBodyText)
        {
            string theLog = TURN_LOG_DISABLED_MESSAGE;

            try
            {
                string oldLog = DataManagerHelper.LoadTurnLog(gameFileName);

                if (!string.IsNullOrEmpty(oldLog) && oldLog.IndexOf(TURN_LOG_HEADER) >= 0)
                {
                    theLog = UpdateLog(oldLog, email);
                }
                else
                {
                    theLog = CreateLog(email, GetTurnNumber(outgoingBodyText));
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
                Trace.Flush();
            }

            return(theLog);
        }