Commit 2022e100 authored by jan.koester's avatar jan.koester
Browse files

added port to game data

parent 8034eab6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

class GameInfoData{
public:
    int         Port;
    std::string GameName;
    std::string ServerName;
    std::string MapName;
+4 −2
Original line number Diff line number Diff line
@@ -38,7 +38,8 @@ const uint8_t payload_template[A2S_INFO_PAYLOAD_LEN_WITH_CHALLENGE] = {

HldsView::HldsView(const char *addr,int port){
    try{
        serverSocket = new netplus::udp(addr,port,1,0);
        sport = port;
        serverSocket = new netplus::udp(addr,sport,1,0);
        clientSocket=serverSocket->connect();
        memset(challange,0,sizeof(challange));
    }catch(netplus::NetException &exp){
@@ -98,8 +99,9 @@ void HldsView::refresh(HldsData &info){
}

void HldsView::_parse(HldsData &info,const char* data, size_t len){

    info.Port=sport;
    info.header=0x00;

    for(int i=0; i<len; ++i){
        if(data[i]==0x49){
            info.header=0x49;
+2 −0
Original line number Diff line number Diff line
@@ -55,4 +55,6 @@ private:
    netplus::udp *serverSocket;

    std::mutex rlock;

    int sport;
};