demoinfo icon indicating copy to clipboard operation
demoinfo copied to clipboard

Does not parsing all players properly

Open gdhsnlvr opened this issue 7 years ago • 4 comments

Lib does not parsing some players and event related to this players have null in player field. examples: https://www.hltv.org/matches/2320066/sk-vs-astralis-iem-katowice-2018 map 2 (de_mirage). https://www.hltv.org/matches/2320074/renegades-vs-cloud9-iem-katowice-2018 map 3 (de_train). parser.PlayingParticipants have 9 players, PlayerKilledEventArgs have null in fields Killer/Victim/Assister when event related to missing player. (version is last stable realise 1.2.0)

gdhsnlvr avatar Sep 26 '18 19:09 gdhsnlvr

Hi I found that the library doesnt parse all entries in a Stringtable Packet. Just delete line 83 and 84 in Namespace: DemoInfo.DP.Handler Class: CreateStringTableUserInfoHandler .

if (userdata.Length == 0) break;

That at least solved my issue with players not beeing parsed.

InspektorLulz avatar Dec 03 '18 06:12 InspektorLulz

Deleting that will lead to unwated behavior, change it to:

if (userdata.Length == 0)
  continue;

instead.

Edit:

I just checked, it is already

if (userdata.Length == 0)
  continue;

where did you see:

if (userdata.Length == 0)
  break;

?

master117 avatar Dec 03 '18 12:12 master117

I just removed

if (userdata.Length == 0)
  continue;

as you suggested. This leads to exceptions in Helper.cs:

		public static long ReadInt64SwapEndian(this BinaryReader reader)
		{
			return BitConverter.ToInt64(reader.ReadBytes(8).Reverse().ToArray(), 0);
		}

steaming from:

internal PlayerInfo(BinaryReader reader)

master117 avatar Dec 03 '18 12:12 master117

In the stable release 1.2.0 from November 2015 (you can download the zip) there is a break instead of continue. You are right, it should be continue. I didn't get the exception though.

InspektorLulz avatar Dec 03 '18 12:12 InspektorLulz