Commit 937e8cbf authored by jan.koester's avatar jan.koester
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
build/*
*.kdev4

CMakeLists.txt

0 → 100644
+19 −0
Original line number Diff line number Diff line
project(gameinfoplus CXX)
cmake_minimum_required(VERSION 3.0)

find_package(libnetplus REQUIRED)

set(LIBV "1")
set(Upstream_VERSION 1.0.0)

if(${DEBUG} MATCHES TRUE)
    add_definitions(-DDEBUG)
endif()

include_directories(
    ${CMAKE_SOURCE_DIR}/src
)

add_subdirectory(src)
add_subdirectory(example)

example/CMakeLists.txt

0 → 100644
+2 −0
Original line number Diff line number Diff line
add_executable(hldshello hldsinfo.cpp)
target_link_libraries(hldshello hldsview)

example/hldsinfo.cpp

0 → 100644
+24 −0
Original line number Diff line number Diff line
#include <iostream>

#include "hldsview.h"

int main(int argc, char *argv[]){
    try{
        HldsView hlds(argv[1], atoi(argv[2]));
        std::cout << "Gamename: " << hlds.getGameName() << std::endl;
        std::cout << "Servername: " << hlds.getServerName() << std::endl;
        std::cout << "Modname: " << hlds.getModName() << std::endl;
        std::cout << "Mapname: " << hlds.getMapName() << std::endl;
        std::cout << "pwprotected: ";
        if(hlds.pwProtected())
            std::cout << "yes";
        else
            std::cout << "no";
        std::cout << std::endl;
        std::cout << "Players: " << hlds.getPlayers()  << "("
                  << hlds.getBotsAmount() << ")" << "/"
                  << hlds.getMaxPlayers() << std::endl;
    }catch(char &e){
        std::cerr << e << std::endl;
    }
}

src/CMakeLists.txt

0 → 100644
+8 −0
Original line number Diff line number Diff line
list(APPEND hldsviewsrc
    hldsview.cpp
)


add_library(hldsview SHARED ${hldsviewsrc})

target_link_libraries(hldsview netplus)
Loading