Exemplo n.º 1
0
//
//
//
//	AdFonic specific implementation
//
//
//
bool CIwGameAds::RequestAdAdFonic()
{
	// Get device surface dimensions
	Width = IwGxGetScreenWidth();
	Height = IwGxGetScreenHeight();

	CIwGameString urlencoded;

	RequestURI = "http://adfonic.net/ad/";
	RequestURI += ApplicationID;
	RequestURI += "?";
	RequestURI += "r.id=";
	urlencoded.URLEncode(CIwGameString(UDID).c_str());
	RequestURI += urlencoded;
	RequestURI += "&s.test=0";
	RequestURI += "&t.format=xml";
	if (!ExtraInfo.IsEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.setBody("");
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 2
0
//
//
//
//	VServ specific implementation
//
//
//
bool CIwGameAds::RequestAdVServ()
{
	// Get device surface dimensions
	Width = IwGxGetScreenWidth();
	Height = IwGxGetScreenHeight();

	// Build M2M request URI string
	RequestURI = "http://a.vserv.mobi/delivery/adapi.php?";
	CIwGameString urlencoded;

	RequestURI += "zoneid=";
	RequestURI += ApplicationID;
	RequestURI += "&im=";
	RequestURI += CIwGameString(UDID);
	RequestURI += "&ic=";
	RequestURI += s3eDeviceGetString(S3E_DEVICE_LOCALE);
	RequestURI += "&app=1";
	RequestURI += "&ts=1";
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	if (Width != 0)
	{
		RequestURI += "&sw=";
		RequestURI += CIwGameString(Width);
	}
	if (Height != 0)
	{
		RequestURI += "&sh=";
		RequestURI += CIwGameString(Height);
	}
	if (!ExtraInfo.IsEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 3
0
//
//
//
//	MillennialMedia specific implementation
//
//
//
bool CIwGameAds::RequestAdMillennialMedia()
{
	// Build M2M request URI string
	//RequestURI = "http://ads.mp.mydas.mobi/getAd.php5?";
    RequestURI = "http://ads.mydas.mobi/getAd?";
	CIwGameString urlencoded;

	RequestURI += "apid=";
	RequestURI += ApplicationID;
	RequestURI += "&auid=";
	RequestURI += CIwGameString(UDID);
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
//	RequestURI += "&mode=test";
//	RequestURI += "&uip=";
//	RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();

	if (UserAge != 0)
	{
		RequestURI += "&age=";
		RequestURI += CIwGameString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			RequestURI += "&gender=female";
		else
			RequestURI += "&gender=male";
	}
	if (!ExtraInfo.IsEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 4
0
//
//
//
//	KomliMobile specific implementation
//
//
//
bool CIwGameAds::RequestAdKomliMobile()
{
	// Get device surface dimensions
	Width = IwGxGetScreenWidth();
	Height = IwGxGetScreenHeight();

	// Build M2M request URI string
	RequestURI = "http://a.zestadz.com/waphandler/deliverad?";
	CIwGameString urlencoded;

	RequestURI += "ip=";
	RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
	RequestURI += "&cid=";
	RequestURI += ApplicationID;
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	RequestURI += "&response_type=xml";
//	RequestURI += CIwGameString(UDID);
	if (!ExtraInfo.IsEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 5
0
//
//
//
//	AdModa specific implementation
//
//
//
bool CIwGameAds::RequestAdAdModa()
{
	// Get device surface dimensions
	Width = IwGxGetScreenWidth();
	Height = IwGxGetScreenHeight();

	// Build M2M request URI string
	RequestURI = "http://www.admoda.com/ads/fetch.php?";
	CIwGameString urlencoded;

	RequestURI += "v=4";
	RequestURI += "&l=php";
	RequestURI += "&z=";
	RequestURI += ApplicationID;
//	RequestURI += "&a=";
//	RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	if (!ExtraInfo.IsEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 6
0
//
//
//
//	MobFox specific implementation
//
//
//
bool CIwGameAds::RequestAdMobFox()
{
	// Build request URI string
	RequestURI = "http://my.mobfox.com/request.php";

	CIwGameString body;
	CIwGameString urlencoded;

	body = "rt=api";
	body += "&u=";
	urlencoded.URLEncode(UserAgent.c_str());
	body += urlencoded;
	body += "&i=";
	body += IW_GAME_HTTP_MANAGER->getIPAddress();
	body += "&o=";
	body += CIwGameString(UDID);
	body += "&m=live";
	body += "&s=";
	body += ApplicationID;
	if (!ExtraInfo.IsEmpty())
	{
		body += ExtraInfo;
	}

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CIwGameString(body.GetLength()).c_str());
	AdRequest.setBody(body.c_str());
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 7
0
//
//
//
//	ImMobi specific implementation
//
//
//
bool CIwGameAds::RequestAdInMobi()
{
	// Build M2M request URI string
	RequestURI = "http://w.inmobi.com/showad.asm";				// Live
//	RequestURI = "http://i.w.sandbox.inmobi.com/showad.asm";	// Test
    
    int slotSize = (int)SlotSize;

	CIwGameString body;
	CIwGameString urlencoded;

	body = "mk-siteid=";
	body += ApplicationID;
	body += "&mk-carrier=";
	body += IW_GAME_HTTP_MANAGER->getIPAddress();
	body += "&h-user-agent=";
	urlencoded.URLEncode(UserAgent.c_str());
	urlencoded.ToLower();
	body += urlencoded;
	body += "&u-id=";
	body += CIwGameString(UDID);
	body += "&d-localization=";
	urlencoded.URLEncode(s3eDeviceGetString(S3E_DEVICE_LOCALE));
	urlencoded.ToLower();
	body += urlencoded;
//	body += "&d-netType=wifi";
	body += "&d-netType=carrier";
    body += "&mk-ad-slot=";
    body += CIwGameString(slotSize);
	body += "&mk-version=pr-SPEC-CTATA-20130111";
	if (UserAge != 0)
	{
		body += "&u-age=";
		body += CIwGameString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&u-gender=f";
		else
			body += "&u-gender=m";
	}
	if (!UserGPSLocation.IsEmpty())
	{
		body += "&u-latlong=";
		body += UserGPSLocation;
	}
	if (!UserKeywords.IsEmpty())
	{
		body += "&u-interests=";
		body += UserKeywords;
	}
	if (!ExtraInfo.IsEmpty())
	{
		body += ExtraInfo;
	}
//	body.ToLower();

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("X-Mkhoj-SiteID", ApplicationID.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CIwGameString(body.GetLength()).c_str());
	AdRequest.setBody(body.c_str());
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 8
0
//
//
//
//	Mojiva specific implementation
//
//
//
bool CIwGameAds::RequestAdMojiva()
{
	// Build M2M request URI string
	RequestURI = "http://ads.mojiva.com/ad?";

	CIwGameString urlencoded;

	RequestURI += "zone=";
	RequestURI += ApplicationID;
	RequestURI += "&ip=";
	RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	RequestURI += "&udid=";
	RequestURI += CIwGameString(UDID);

	if (!ExtraInfo.IsEmpty())
	{
		RequestURI += ExtraInfo;
	}

/*	CIwGameString local = s3eDeviceGetString(S3E_DEVICE_LOCALE);
	int pos = local.Contains('_');
	if (pos >= 0)
	{
		// Strip language and underscore
		local.setString(local.c_str() + pos + 1, 2);
		local.ToUpper();
		body += "&country=";
		body += local;
	}*/

/*	if (UserAge != 0)
	{
		body += "&age=";
		body += CIwGameString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&gender=F";
		else
			body += "&gender=M";
	}
	if (!UserKeywords.IsEmpty())
	{
		body += "&keywords=";
		body += UserKeywords;
	}*/

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
Exemplo n.º 9
0
bool CIwGameAds::RequestAdMadvertise()
{
	// Build M2M request URI string
	RequestURI = "http://ad.madvertise.de/site/";
	RequestURI += ApplicationID;

	CIwGameString body;
	CIwGameString urlencoded;

	body += "ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	body += urlencoded;
//	body += "&ip=";
//	body += IW_GAME_HTTP_MANAGER->getIPAddress();
	body += "&requester=madvertise_api";
	body += "&version=api_2.1";
	body += "&unique_device_id=";
	body += CIwGameString(UDID);
	if (!ExtraInfo.IsEmpty())
	{
		body += ExtraInfo;
	}

/*	CIwGameString local = s3eDeviceGetString(S3E_DEVICE_LOCALE);
	int pos = local.Contains('_');
	if (pos >= 0)
	{
		// Strip language and underscore
		local.setString(local.c_str() + pos + 1, 2);
		local.ToUpper();
		body += "&country=";
		body += local;
	}*/

	if (UserAge != 0)
	{
		body += "&age=";
		body += CIwGameString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&gender=F";
		else
			body += "&gender=M";
	}
	if (!UserKeywords.IsEmpty())
	{
		body += "&keywords=";
		body += UserKeywords;
	}

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CIwGameString(body.GetLength()).c_str());
	AdRequest.setBody(body.c_str());
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}