added sleep between modinfo downloading, slowed down a bit but not DoS-ing rubenwardy' s hosting now
This commit is contained in:
parent
a312f72eab
commit
930c0bca21
@ -135,6 +135,7 @@ for(unsigned int i = 0; i < _modinfos.size(); i++) {
|
|||||||
ModInfo mi(_modinfos[i].getModInfoDescription());
|
ModInfo mi(_modinfos[i].getModInfoDescription());
|
||||||
std::cout << "Successfully downloaded and parsed: " << mi.getName() << std::endl;
|
std::cout << "Successfully downloaded and parsed: " << mi.getName() << std::endl;
|
||||||
_modinfos[i] = mi;
|
_modinfos[i] = mi;
|
||||||
|
sleep(2); // This is to prevent DoS-ing rubenwardy' s hosting...
|
||||||
} catch(NetSocketPP::NetworkException &exc) {
|
} catch(NetSocketPP::NetworkException &exc) {
|
||||||
std::cerr << "NetworkException occured in NetSocket++: " << exc.what() << std::endl;
|
std::cerr << "NetworkException occured in NetSocket++: " << exc.what() << std::endl;
|
||||||
} catch(NetSocketPP::SocketException &exc) {
|
} catch(NetSocketPP::SocketException &exc) {
|
||||||
|
3
OBJECTS
3
OBJECTS
@ -10,7 +10,8 @@ ModInfoDescription: name, server, modinfoPath x
|
|||||||
ModInfo: ModInfoDescription, vector<ModDescription> x
|
ModInfo: ModInfoDescription, vector<ModDescription> x
|
||||||
ParameterParser: actionList, argc, argv
|
ParameterParser: actionList, argc, argv
|
||||||
Action: x
|
Action: x
|
||||||
SyncAction
|
SyncAction x
|
||||||
|
QueryAction
|
||||||
InstallAction
|
InstallAction
|
||||||
UpdateAction
|
UpdateAction
|
||||||
RemoveAction
|
RemoveAction
|
||||||
|
23
QueryAction.cpp
Normal file
23
QueryAction.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include "QueryAction.h"
|
||||||
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
using namespace mmm;
|
||||||
|
|
||||||
|
QueryAction::QueryAction(): Action() {
|
||||||
|
_local = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryAction::QueryAction(bool local): Action() {
|
||||||
|
_local = local;
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryAction::~QueryAction() {}
|
||||||
|
|
||||||
|
void QueryAction::run() {
|
||||||
|
std::cout << "Starting Query" << std::endl;
|
||||||
|
if(_local) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
32
QueryAction.h
Normal file
32
QueryAction.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#ifndef _QUERYACTION_H
|
||||||
|
#define _QUERYACTION_H
|
||||||
|
#include "ConfigFile.h"
|
||||||
|
#include "3mExceptions.h"
|
||||||
|
#include "ModDescription.h"
|
||||||
|
#include "LocalModDescription.h"
|
||||||
|
#include "LocalModList.h"
|
||||||
|
#include "Action.h"
|
||||||
|
#include <string>
|
||||||
|
/// \file QueryAction.h
|
||||||
|
/// \brief A Query 3m action class.
|
||||||
|
/// \author Phitherek_
|
||||||
|
/// \date 2013
|
||||||
|
/// \version 0.1-pre
|
||||||
|
|
||||||
|
/// \namespace mmm
|
||||||
|
/// \brief A global namespace for 3m.
|
||||||
|
namespace mmm {
|
||||||
|
/// \class QueryAction
|
||||||
|
/// \brief A Query 3m action class.
|
||||||
|
class QueryAction: public Action {
|
||||||
|
private:
|
||||||
|
bool _local;
|
||||||
|
public:
|
||||||
|
QueryAction(); ///< A constructor.
|
||||||
|
QueryAction(bool local); ///< \brief A constructor with parameter.
|
||||||
|
///< \param local Indicated if to search in local repository or remote repositories.
|
||||||
|
~QueryAction(); ///< A destructor.
|
||||||
|
void run(); ///< A virtual function that executes the action.
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user