Closed sixty closed 13 years ago
Do you have an example replay available I can use?
Downloaded a korean replay, and found issues both with the name parsing and the chat parsing. I'm fixing both of those now.
Should be fixed with the latest release. Also, korean chat parses correctly now, and there's a few other additions, such as the BNET ID and gateway being parsed, just as a result of realizing all the things that were incorrectly parsed.
I figured this out when I used your dll on my SC2 ChatCloud project. It seems that most foreign text will cause an exception. The problem seems to be related to the PeekChar of the bytereader. See also here: http://www.johnsoer.com/blog/?p=493
I tried to fix it myself, but failed. Exception attached below.
\ Exception Text ** System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'. Parameter name: chars at System.Text.Encoding.ThrowCharsOverflow() at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded) at System.Text.UTF8Encoding.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, DecoderNLS baseDecoder) at System.Text.DecoderNLS.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, Boolean flush) at System.IO.BinaryReader.InternalReadChars(Char[] buffer, Int32 index, Int32 count) at System.IO.BinaryReader.ReadChars(Int32 count) at Starcraft2.ReplayParser.PlayerDetails.Parse(BinaryReader reader) in C:\Users\2\Desktop\ascendedguard-sc2replay-csharp-d4e9069\Starcraft2.ReplayParser\PlayerDetails.cs:line 44 at Starcraft2.ReplayParser.Replay.ParseReplayDetails(Replay replay, Stream stream) in C:\Users\2\Desktop\ascendedguard-sc2replay-csharp-d4e9069\Starcraft2.ReplayParser\Replay.cs:line 184 at Starcraft2.ReplayParser.Replay.ParseReplayDetails(Replay replay, Byte[] buffer) in C:\Users\2\Desktop\ascendedguard-sc2replay-csharp-d4e9069\Starcraft2.ReplayParser\Replay.cs:line 165 at Starcraft2.ReplayParser.Replay.Parse(String fileName) in C:\Users\2\Desktop\ascendedguard-sc2replay-csharp-d4e9069\Starcraft2.ReplayParser\Replay.cs:line 110 at SC2ChatCloud.Form1.Button3_Click(Object sender, EventArgs e) in C:\code\replay\WhatTheReplay\WhatTheReplay\Form1.vb:line 48 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)