Beispiel #1
0
        public static void WriteMsgTypeError(this DefaultMessageIDTypes defaultMessageIDType, string errorMsg)
        {
            if (!canOutput)
            {
                return;
            }
            Console.ForegroundColor = ConsoleColor.Yellow;
            string msgStr = string.Format(@"{0} - {1}  {2}", defaultMessageIDType.GetMessageIDTypeStr(), errorMsg, DateTime.Now.GetDefaultFormat());

            Console.WriteLine(msgStr);
            Console.ResetColor();
            Debug.WriteLine(msgStr);
        }
Beispiel #2
0
        public static void WriteMsgTypeInfo(this DefaultMessageIDTypes defaultMessageIDType, RakPeerInterface rakPeer, string address, ushort port, string msg)
        {
            if (!canOutput)
            {
                return;
            }
            Console.ForegroundColor = ConsoleColor.Green;
            string msgStr = string.Format(@"[{0}:{1}]-[{2}]-[{3}:{4}]-{5}:{6}",
                                          rakPeer.GetMyBoundAddress().ToString(false),
                                          rakPeer.GetMyBoundAddress().GetPort(),
                                          DateTime.Now.GetDefaultFormat(),
                                          address,
                                          port,
                                          defaultMessageIDType.GetMessageIDTypeStr(),
                                          msg);

            Console.WriteLine(msgStr);
            Console.ResetColor();
            Debug.WriteLine(msgStr);
        }