Esempio n. 1
0
static GHashTable *
__copy_params(GHashTable *params)
{
	GHashTable *r = _params();
	g_hash_table_foreach(params, __kv_dup, &r);
	return r;
}
Esempio n. 2
0
void FacebookAgent::logEvent(std::string& eventName, float valueToSum, FBInfo& parameters)
{
	PluginParam _eventName(eventName.c_str());
	PluginParam _valueToSum(valueToSum);
	PluginParam _params(parameters);
	agentManager->getUserPlugin()->callFuncWithParam("logEvent", &_eventName, &_valueToSum, &_params, NULL);
}
Esempio n. 3
0
static struct data_security_s *
_dummy_datasec(void)
{
	struct data_security_s *result = g_malloc0(sizeof(struct data_security_s));
	result->name = g_strdup(DATA_SECURITY_NONE);
	result->type = DS_NONE;
	result->params = _params();
	return result;
}
Esempio n. 4
0
static struct data_treatments_s*
_dummy_datatreat(void)
{
	struct data_treatments_s *result = g_malloc0(sizeof(struct data_treatments_s));
	result->name = g_strdup(DATA_TREATMENT_NONE);
	result->type = DT_NONE;
	result->params = _params();
	return result;
}
Esempio n. 5
0
void FacebookAgent::api(std::string &path, int method, FBInfo &params, FBCallback cb)
{
	requestCallbacks.push_back(cb);

	PluginParam _path(path.c_str());
	PluginParam _method(method);
	PluginParam _params(params);
	PluginParam _cbIndex((int)(requestCallbacks.size() - 1));

	agentManager->getUserPlugin()->callFuncWithParam("request", &_path, &_method, &_params, &_cbIndex, NULL);
}
Esempio n. 6
0
static struct data_security_s *
_load_data_security(namespace_info_t *ni, const gchar *key)
{
	if (_is_off(key))
		return _dummy_datasec();
	if (!ni)
		return NULL;

	gchar *config = namespace_info_get_data_security(ni, key);
	if (!config)
		return NULL;

	struct data_security_s *ds = g_malloc0(sizeof(struct data_security_s));
	ds->name = g_strdup(key);
	ds->type = DS_NONE;
	ds->params = _params();

	int rc = _parse_data_security(ds, config);
	g_free(config);
	if (rc)
		return ds;
	_data_security_clean(ds);
	return NULL;
}
Esempio n. 7
0
static struct data_treatments_s *
_load_data_treatments(namespace_info_t *ni, const char *key)
{
	if (_is_off(key))
		return _dummy_datatreat();
	if (!ni)
		return NULL;

	gchar *config = namespace_info_get_data_treatments(ni, key);
	if (!config)
		return NULL;

	struct data_treatments_s *dt = g_malloc0(sizeof(struct data_treatments_s));
	dt->name = g_strdup(key);
	dt->params = _params();
	dt->type = DT_NONE;

	int rc = _parse_data_treatments(dt, config);
	g_free(config);
	if (rc)
		return dt;
	_data_treatments_clean(dt);
	return NULL;
}
Esempio n. 8
0
void SrvCLI::sendRequest (const QString &command, const QString &params)
{
    QString _params (params);
    _params = _params.replace(QLatin1String(";"), QLatin1String("#~#"));
    // Neuen Block zum Senden erstellen
    QByteArray block;
    // Datasteam an den Block binden
    QDataStream out (&block, QIODevice::WriteOnly);
    // DataStream version setzen, hier aktuelle 4.6 = DataStream version 10
    out.setVersion(QDataStream::Qt_4_6);
    // Größe des Blockes erstmal mit 0 initieren und Aktion angeben
    out << quint64(0);
    out << command;
    out << _params;
    // Wieder an die erste Stelle des Blockes springen und die Größe neu setzen
    out.device()->seek(0);
    out << quint64(block.size() - sizeof(quint64));
    Debug::log(QString::number(block.size() - sizeof(quint64)));
    // Block an das Socket schicken und senden
    this->sslSocket.write(block);    
    this->sslSocket.waitForBytesWritten(1500);
    this->sslSocket.flush();
    this->sslSocket.waitForBytesWritten(1500);
}
Esempio n. 9
0
void FacebookAgent::logPurchase(float mount, std::string currency,FBInfo &params){
	PluginParam _mount(mount);
	PluginParam _currency(currency.c_str());
	PluginParam _params(params);
	agentManager->getUserPlugin()->callFuncWithParam("logPurchase", &_mount, &_currency, &_params, NULL);
}