Beispiel #1
0
 public void Write(string text)
 {
     try
     {
         writer.Write(text);
     }
     catch (Exception e)
     {
         OnException(e);
     }
 }
Beispiel #2
0
        public static void DumpPacket(RealmPacketIn packet, PacketSender sender, bool copy, IndentTextWriter writer)
        {
            lock (writer)
            {
                try
                {
                    if (copy)
                    {
                        using (var pkt = packet.Copy())
                        {
                            PacketAnalyzer.Dump(new ParsablePacketInfo(pkt, sender, DateTime.Now), writer);
                        }
                    }
                    else
                    {
                        PacketAnalyzer.Dump(new ParsablePacketInfo(packet, sender, DateTime.Now), writer);
                    }
                }
                catch (Exception e)
                {
                    LogUtil.ErrorException(e, "Unable to parse/render packet " + packet);

                    writer.IndentLevel = 0;
                    writer.Write(packet.ToHexDump());
                }
            }
        }
Beispiel #3
0
        public static void DumpPacket(RealmPacketIn packet, bool copy, IndentTextWriter writer)
        {
            try
            {
                if (copy)
                {
                    using (PinnedRealmPacketIn pkt = packet.Copy())
                    {
                        PacketAnalyzer.Render(pkt, writer);
                    }
                }
                else
                {
                    PacketAnalyzer.Render(packet, writer);
                }
            }
            catch (Exception e)
            {
                log.ErrorException("Unable to parse/render packet " + packet, e);

                writer.IndentLevel = 0;
                writer.Write(packet.ToHexDump());
            }
        }
Beispiel #4
0
		public static void DumpPacket(RealmPacketIn packet, PacketSender sender, bool copy, IndentTextWriter writer)
		{
			lock (writer)
			{
				try
				{
					if (copy)
					{
						using (var pkt = packet.Copy())
						{
							PacketAnalyzer.Dump(new ParsablePacketInfo(pkt, sender, DateTime.Now), writer);
						}
					}
					else
					{
						PacketAnalyzer.Dump(new ParsablePacketInfo(packet, sender, DateTime.Now), writer);
					}
				}
				catch (Exception e)
				{
					LogUtil.ErrorException(e, "Unable to parse/render packet " + packet);

					writer.IndentLevel = 0;
					writer.Write(packet.ToHexDump());
				}
			}
		}
Beispiel #5
0
        public int Visit(FuncDeclaration declaration)
        {
            _writer.Write("func ");
            _writer.Write(declaration.Name.Contents);
            _writer.Write('(');

            var sep = "";

            foreach (var param in declaration.Parameters)
            {
                _writer.Write(sep);
                sep = ", ";

                _writer.Write(param.Name.Contents);
                _writer.Write(": ");
                _writer.Write(param.Type);
            }

            _writer.Write(')');

            if (declaration.ReturnType != null)
            {
                _writer.Write(": ");
                _writer.Write(declaration.ReturnType);
            }

            _writer.WriteLine();

            declaration.Body.Accept(this);

            return(0);
        }
 public int Visit(BreakExpression expression)
 {
     _writer.Write("break");
     return(0);
 }
Beispiel #7
0
		public static void DumpPacket(RealmPacketIn packet, bool copy, IndentTextWriter writer)
		{
			try
			{
				if (copy)
				{
					using (PinnedRealmPacketIn pkt = packet.Copy())
					{
						PacketAnalyzer.Render(pkt, writer);
					}
				}
				else
				{
					PacketAnalyzer.Render(packet, writer);
				}
			}
			catch (Exception e)
			{
				log.ErrorException("Unable to parse/render packet " + packet, e);

				writer.IndentLevel = 0;
				writer.Write(packet.ToHexDump());
			}
		}