izestyler / gwlp-revived-open-source

Automatically exported from code.google.com/p/gwlp-revived-open-source
0 stars 0 forks source link

Unclear logs #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the emulator

What is the expected output? What do you see instead?
Names of packets, unmarshalled values and original bytes.
Instead only the incoming and outgoing (original) bytes are printed.

What version of the product are you using? On what operating system?
Head revision

Please provide any additional information below.
N/A

Original issue reported on code.google.com by idemmelg...@gmail.com on 15 Sep 2011 at 5:25

GoogleCodeExporter commented 9 years ago
Good point, though its a bit complicated to display all the info in the console 
or logfiles... any ideas?

Original comment by apple9...@googlemail.com on 16 Sep 2011 at 3:17

GoogleCodeExporter commented 9 years ago
I didn't find how to call the ToString method of a template (that you could 
manually write), but for the printing of the packet name I just do:

Debug.Write("#Bytes OUT: " + tmpMessage.PacketData.ToArray().Length + " ");
                                Debug.WriteLine("-OUT->" + BitConverter.ToString(tmpMessage.PacketData.ToArray()).Replace("-", " "));
                                Debug.WriteLine("Class: " + pck.GetType());

...in PacketManager.

Original comment by idemmelg...@gmail.com on 16 Sep 2011 at 6:31

GoogleCodeExporter commented 9 years ago
ToString would require a base class for the templates,
and the following will only work, if GetType() and GetField() support late 
binding

<code language="cs">

// ToString within the base class...

foreach (var fld in GetType().GetFields())
{
        Debug.WriteLine(fld.Name + ": " + fld.GetValue(this).ToString());
}

</code>

Original comment by apple9...@googlemail.com on 17 Sep 2011 at 5:23

GoogleCodeExporter commented 9 years ago
Partly implemented (i did the same as you, just displayed the packet names)

Original comment by apple9...@googlemail.com on 19 Oct 2011 at 9:01