Commit 436f0091 authored by jan.koester's avatar jan.koester
Browse files

remove debug

parent abb66d39
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <algorithm>
#include <cstring>
#include <thread>
#include <sstream>
#include <iomanip>

#include <netplus/exception.h>

@@ -146,17 +144,6 @@ void gameinfo::HldsView::_parse(HldsData &info,const char* data, size_t len){
    info.Port=sport;
    info.header=0x00;

    // Helper: hex dump for diagnostics
    auto hexdump = [](const char* buf, size_t n) -> std::string {
        std::ostringstream oss;
        size_t limit = std::min(n, (size_t)64);
        for(size_t i = 0; i < limit; ++i)
            oss << std::hex << std::setfill('0') << std::setw(2)
                << ((unsigned int)(uint8_t)buf[i]) << ' ';
        if(n > limit) oss << "...";
        return oss.str();
    };

    // A2S_INFO response format: FF FF FF FF 49 <payload...>
    // Minimum: 5 byte header + 1 byte protocol = 6 bytes
    if(len < 6
@@ -164,14 +151,11 @@ void gameinfo::HldsView::_parse(HldsData &info,const char* data, size_t len){
       || (uint8_t)data[2] != 0xFF || (uint8_t)data[3] != 0xFF
       || (uint8_t)data[4] != 0x49){
         GameInfoException e;
         e[GameInfoException::Error] << "_parse: no hlds server! len="
             << (int)len << " hex: " << hexdump(data, len);
         e[GameInfoException::Error] << "_parse: no hlds server!";
         throw e;
    }

    info.header=0x49;
    const char* origData = data;
    size_t origLen = len;
    data+=5;
    len-=5;

@@ -196,8 +180,7 @@ void gameinfo::HldsView::_parse(HldsData &info,const char* data, size_t len){
    if(!readString(info.ServerName) || !readString(info.MapName)
       || !readString(info.ModName) || !readString(info.GameName)){
        GameInfoException e;
        e[GameInfoException::Error] << "_parse: truncated packet (strings) remaining="
            << (int)len << " hex(full): " << hexdump(origData, origLen);
        e[GameInfoException::Error] << "_parse: truncated packet (strings)";
        throw e;
    }