Este plugin hace cachè de todas las actualizaciones del juego online Lineaje II
l2cr.com/Actualizaciones 135 15.15 MiB 0 bytes 0 0,00 %
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "../utils.cpp"
using namespace std;
// use this line to compile
// g++ -I. -fPIC -shared -g -o fastlayer-idc.com.so fastlayer-idc.com.cpp
// Regex
// http.*\.fastlayer-idc\.com.*(\.gtx|\.dat)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-4) + "_" + resultado.at(resultado.size()-3) + "_" + resultado.at(resultado.size()-2) + "_" +resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-4) + "_" + resultado.at(resultado.size()-3) + "_" + resultado.at(resultado.size()-2) + "_" +resultado.at(resultado.size()-1); ;
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find("launchercr.fastlayer-idc.com/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "l2cr.com/Actualizaciones";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
Adjunto el .cpp
buenas gracias david_domh, lo estaré probando y les comento... saludos..
:) feliz :)