Commit 4a40c66f authored by jan.koester's avatar jan.koester
Browse files

some fixes

parent e04f47dd
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include <vector>

#include <gameinfoplus/hldsview.h>
#include <gameinfoplus/exception.h>

#include <plugin.h>
#include <database.h>
@@ -86,7 +87,7 @@ namespace blogi {
            for (int i = 0; i < count; i++) {
                if(atoi(res[i][0])!=0)
                    continue;
                HldsView view(res[i][1],atoi(res[i][2]));
                gameinfo::HldsView view(res[i][1],atoi(res[i][2]));
                HLDS.push_back(view);
            }
        }
@@ -103,7 +104,7 @@ namespace blogi {

            for (auto i = HLDS.begin(); i!=HLDS.end(); ++i) {
                try{
                    HldsView::HldsData hldsdata;
                    gameinfo::HldsView::HldsData hldsdata;
                    rlock.lock();
                    i->refresh(hldsdata);
                    rlock.unlock();
@@ -123,9 +124,10 @@ namespace blogi {
                    << hldsdata.BotsAmount << ")" << "/"
                    << hldsdata.MaxPlayers
                    << "</td></tr></table></div>";
                }catch(const char *e){
                    std::cerr << e <<std::endl;
                }catch(gameinfo::GameInfoException &e){
                    std::cerr << e.what();
                    rlock.unlock();
                    continue;
                }
            }

@@ -147,7 +149,7 @@ namespace blogi {

        }
    private:
        std::vector<HldsView> HLDS;
        std::vector<gameinfo::HldsView> HLDS;
    };
};

+2 −6
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ namespace blogi {
                *nreq.setData("user-agent") = "blogi/1.0 (Alpha Version 0.1)";
                nreq.send(cltsock.get(),srvsock.get());

                std::shared_ptr<char> data(new char[16384]);
                std::shared_ptr<char[16384]> data(new char[16384]);

                int recv,tries=0,chunklen=0;

@@ -260,8 +260,7 @@ namespace blogi {
                    size_t readed=0;

                    for(;;){
                        std::cout << "test" << std::endl;
                        if(recv - cpos <= 0){
                        if(recv - cpos < 0){

                            if(readed==chunklen){
                                if( (chunklen=readchunk(data.get(),recv,cpos)) == 0 ){
@@ -300,9 +299,6 @@ namespace blogi {
                    throw ej;
                }

                std::cout << "hello" << std::endl;


                libhtmlpp::HtmlString fileHtml,out;
                std::string sid;