mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	moved stray console.writeline to use main logger
This commit is contained in:
		| @@ -19,13 +19,11 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         public static bool Load() | ||||
|         { | ||||
|             Console.Write("Loading map_config.ini file... "); | ||||
|             Program.Log.Info("Loading map_config.ini file... "); | ||||
|  | ||||
|             if (!File.Exists("./map_config.ini")) | ||||
|             { | ||||
|                 Console.ForegroundColor = ConsoleColor.Red; | ||||
|                 Console.WriteLine(String.Format("[FILE NOT FOUND]")); | ||||
|                 Console.ForegroundColor = ConsoleColor.Gray; | ||||
|                 Program.Log.Error("[FILE NOT FOUND]"); | ||||
|                 return false; | ||||
|             } | ||||
|  | ||||
| @@ -42,9 +40,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             ConfigConstants.DATABASE_USERNAME =     configIni.GetValue("Database", "username", ""); | ||||
|             ConfigConstants.DATABASE_PASSWORD =     configIni.GetValue("Database", "password", ""); | ||||
|  | ||||
|             Console.ForegroundColor = ConsoleColor.Green; | ||||
|             Console.WriteLine("[OK]"); | ||||
|             Console.ForegroundColor = ConsoleColor.Gray; | ||||
|             Program.Log.Info("[OK]"); | ||||
|  | ||||
|             return true; | ||||
|         } | ||||
|   | ||||
| @@ -18,25 +18,22 @@ namespace FFXIVClassic_Map_Server | ||||
|         public static Logger Log; | ||||
|  | ||||
|         static void Main(string[] args) | ||||
|         {             | ||||
|         { | ||||
|  | ||||
|             // set up logging | ||||
|             Log = LogManager.GetCurrentClassLogger(); | ||||
| #if DEBUG | ||||
|             TextWriterTraceListener myWriter = new TextWriterTraceListener(System.Console.Out); | ||||
|             Debug.Listeners.Add(myWriter); | ||||
| #endif | ||||
|             bool startServer = true; | ||||
|  | ||||
|             Console.ForegroundColor = ConsoleColor.Cyan; | ||||
|             Console.WriteLine("---------FFXIV 1.0 Map Server---------"); | ||||
|             Console.ForegroundColor = ConsoleColor.Gray; | ||||
|             Program.Log.Info("---------FFXIV 1.0 Map Server---------"); | ||||
|  | ||||
|             //Load Config | ||||
|             if (!ConfigConstants.Load()) | ||||
|                 startServer = false; | ||||
|  | ||||
|             // set up logging | ||||
|  | ||||
|             Log = LogManager.GetCurrentClassLogger(); | ||||
|  | ||||
|             Assembly assem = Assembly.GetExecutingAssembly(); | ||||
|             Version vers = assem.GetName().Version; | ||||
|             Program.Log.Info("Version: " + vers.ToString()); | ||||
|   | ||||
| @@ -332,7 +332,8 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|         public void DebugPrintPacket() | ||||
|         { | ||||
| #if DEBUG | ||||
|             Console.BackgroundColor = ConsoleColor.DarkYellow; | ||||
|             // todo: create new target for colourful packet logging | ||||
|             //Console.BackgroundColor = ConsoleColor.DarkYellow; | ||||
|  | ||||
|             Program.Log.Debug("IsAuth: {0} IsEncrypted: {1}, Size: 0x{2:X}, NumSubpackets: {3}{4}{5}", header.isAuthenticated, header.isCompressed, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes())); | ||||
|  | ||||
| @@ -341,7 +342,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|                 sub.DebugPrintSubPacket(); | ||||
|             } | ||||
|  | ||||
|             Console.BackgroundColor = ConsoleColor.Black; | ||||
|             //Console.BackgroundColor = ConsoleColor.Black; | ||||
| #endif | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -140,7 +140,8 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|         public void DebugPrintSubPacket() | ||||
|         { | ||||
| #if DEBUG | ||||
|             Console.BackgroundColor = ConsoleColor.DarkRed; | ||||
|             // todo: create new target for colourful packet logging | ||||
|             //Console.BackgroundColor = ConsoleColor.DarkRed; | ||||
|  | ||||
|             Program.Log.Debug("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes())); | ||||
|              | ||||
| @@ -148,12 +149,12 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             { | ||||
|                 Program.Log.Debug("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(GetGameMessageBytes(), SUBPACKET_SIZE)); | ||||
|  | ||||
|                 Console.BackgroundColor = ConsoleColor.DarkMagenta; | ||||
|                 //Console.BackgroundColor = ConsoleColor.DarkMagenta; | ||||
|  | ||||
|                 Program.Log.Debug("Data: {0}{1}", Environment.NewLine, Utils.ByteArrayToHex(data, SUBPACKET_SIZE + GAMEMESSAGE_SIZE)); | ||||
|             } | ||||
|  | ||||
|             Console.BackgroundColor = ConsoleColor.Black; | ||||
|             //Console.BackgroundColor = ConsoleColor.Black; | ||||
| #endif | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user