From: havoc Date: Tue, 29 Aug 2006 04:50:40 +0000 (+0000) Subject: another patch from div0 to fix ping report parsing X-Git-Tag: xonotic-v0.1.0preview~3811 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=273addafcba70cca1f0eaf3465c8f397a3107e30;p=xonotic%2Fdarkplaces.git another patch from div0 to fix ping report parsing git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6575 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 68734df6..7eaaaaef 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -2087,22 +2087,25 @@ qboolean CL_ExaminePrintString(const char *text) { int charindex = 0; t++; - for (charindex = 0;cl.scores[cl.parsingtextplayerindex].name[charindex] == t[charindex];charindex++) - ; - if (cl.scores[cl.parsingtextplayerindex].name[charindex] == 0 && t[charindex] == '\n') + if(cl.parsingtextplayerindex < cl.maxclients) { - cl.scores[cl.parsingtextplayerindex].qw_ping = bound(0, ping, 9999); - for (cl.parsingtextplayerindex++;cl.parsingtextplayerindex < cl.maxclients && !cl.scores[cl.parsingtextplayerindex].name[0];cl.parsingtextplayerindex++) + for (charindex = 0;cl.scores[cl.parsingtextplayerindex].name[charindex] == t[charindex];charindex++) ; - if (cl.parsingtextplayerindex < cl.maxclients) + if (cl.scores[cl.parsingtextplayerindex].name[charindex] == 0 && t[charindex] == '\n') { - // we parsed a valid ping entry, so expect another to follow - cl.parsingtextmode = CL_PARSETEXTMODE_PING; - cl.parsingtextexpectingpingforscores = expected; + cl.scores[cl.parsingtextplayerindex].qw_ping = bound(0, ping, 9999); + for (cl.parsingtextplayerindex++;cl.parsingtextplayerindex < cl.maxclients && !cl.scores[cl.parsingtextplayerindex].name[0];cl.parsingtextplayerindex++) + ; + //if (cl.parsingtextplayerindex < cl.maxclients) // we could still get unconnecteds! + { + // we parsed a valid ping entry, so expect another to follow + cl.parsingtextmode = CL_PARSETEXTMODE_PING; + cl.parsingtextexpectingpingforscores = expected; + } + return !expected; } - return !expected; } - else if (!strncmp(t, "unconnected\n", 12)) + if (!strncmp(t, "unconnected\n", 12)) { // just ignore cl.parsingtextmode = CL_PARSETEXTMODE_PING; @@ -2110,7 +2113,7 @@ qboolean CL_ExaminePrintString(const char *text) return !expected; } else - Con_Printf("player names '%s' and '%s' didn't match\n", cl.scores[cl.parsingtextplayerindex].name, t); + Con_DPrintf("player names '%s' and '%s' didn't match\n", cl.scores[cl.parsingtextplayerindex].name, t); } } }