Exemple #1
0
        public static void LogToFile(object message)
        {
            if (!Directory.Exists(Directory.GetCurrentDirectory() + sepChar + "SystemLogs" + sepChar))
            {
                Directory.CreateDirectory(Directory.GetCurrentDirectory() + sepChar + "SystemLogs" + sepChar);
            }

            if (_logFile == string.Empty)
            {
                int fileCount = Directory.GetFiles(Directory.GetCurrentDirectory() + sepChar + "SystemLogs" + sepChar).Length;
                if (GameServer.isMono)
                {
                    _logFile = Directory.GetCurrentDirectory() + sepChar + "SystemLogs" + sepChar + fileCount + "_" + GameTimer.GetDateTime().Replace("/", "-").Replace(" ", "_") + ".txt";
                }
                else
                {
                    _logFile = Directory.GetCurrentDirectory() + sepChar + "SystemLogs" + sepChar + fileCount + ".txt";
                }
            }
            //Logger.Log(_logFile);
            StreamWriter writer = new StreamWriter(_logFile, true);

            writer.WriteLine(message.ToString());
            writer.Close();
        }
Exemple #2
0
 private object Time_CMD(User caller, params string[] args)
 {
     return(GameTimer.GetDateTime());
 }