From ab2c75888d63977e2a24793ce96c6adcd0eb7e0e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 Oct 2013 12:43:53 +0300 Subject: Add support for gm detection in online list on "new" tmw server. --- src/gui/windows/whoisonline.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gui/windows') diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index dafbb0419..40d85f387 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -343,6 +343,7 @@ void WhoIsOnline::loadWebList() // Tokenize and add each line separately char *line = strtok(mMemoryBuffer, "\n"); const std::string gmText("(GM)"); + const std::string gmText2("(gm)"); FOR_EACH (std::set::iterator, itd, mOnlinePlayers) delete *itd; @@ -380,6 +381,15 @@ void WhoIsOnline::loadWebList() lineStr = lineStr.substr(pos + gmText.length()); isGM = true; } + else + { + pos = lineStr.find(gmText2, 0); + if (pos != std::string::npos) + { + lineStr = lineStr.substr(pos + gmText.length()); + isGM = true; + } + } trim(lineStr); pos = lineStr.find("/", 0); -- cgit v1.2.3-70-g09d2