Skip to content

Commit

Permalink
add stid to all requests
Browse files Browse the repository at this point in the history
  • Loading branch information
smartsir796 committed Mar 22, 2022
1 parent b5d0720 commit c3adc4e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
77 changes: 38 additions & 39 deletions src/game.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
import { Spawner } from "../node_modules/decentraland-builder-scripts/spawner"
//import AdsharesBanner, { Props } from "./item"
//
//
//const banner = new AdsharesBanner()
//const spawner = new Spawner<Props>(banner)
//
//spawner.spawn(
// 'banner',
// new Transform({
// position: new Vector3(4, 0, 8),
// scale: new Vector3(2, 2, 0.1),
// }),
// {
// payout_network: "ads",
// payout_address: "0001-000000F1-6451",
// keywords: "decentraland,metaverse",
// zone_name: "default",
// adserver: "https://adserver.priv",
// exclude: "{\"quality\": [\"low\"], \"category\": [\"adult\"]}"
// }
//);
//
//
//spawner.spawn(
// 'banner',
// new Transform({
// position: new Vector3(6, 0, 6),
// scale: new Vector3(2, 2, 0.1),
// }),
// {
// payout_network: "ads",
// payout_address: "0001-000000F1-6451",
// keywords: "decentraland,metaverse",
// zone_name: "default",
// adserver: "https://adserver.priv",
// exclude: "{\"quality\": [\"low\"], \"category\": [\"adult\"]}"
// }
//);
//
import AdsharesBanner, { Props } from "./item"


const banner = new AdsharesBanner()
const spawner = new Spawner<Props>(banner)

spawner.spawn(
'banner',
new Transform({
position: new Vector3(4, 0, 8),
scale: new Vector3(2, 2, 0.1),
}),
{
payout_network: "ads",
payout_address: "0001-000000F1-6451",
keywords: "decentraland,metaverse",
zone_name: "default",
adserver: "https://adserver.priv",
exclude: "{\"quality\": [\"low\"], \"category\": [\"adult\"]}"
}
);


spawner.spawn(
'banner',
new Transform({
position: new Vector3(6, 0, 6),
scale: new Vector3(2, 2, 0.1),
}),
{
payout_network: "ads",
payout_address: "0001-000000F1-6451",
keywords: "decentraland,metaverse",
zone_name: "default",
adserver: "https://adserver.priv",
exclude: "{\"quality\": [\"low\"], \"category\": [\"adult\"]}"
}
);
8 changes: 5 additions & 3 deletions src/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,17 @@ export default class AdsharesBanner implements IScript<Props> {
{
'cid': banner.cid,
'ctx': UrlSafeBase64Encode(JSON.stringify(viewContext)),
'iid': request.view_id
'iid': request.view_id,
'stid': userAccount
}
);
banner.view_url = addUrlParam(banner.view_url,
{
'cid': banner.cid,
'ctx': UrlSafeBase64Encode(JSON.stringify(viewContext)),
'iid': request.view_id,
'json': 1
'json': 1,
'stid': userAccount
});
await this.renderBanner(host, banner)
this.showWaterMark(host, props, request, banner)
Expand All @@ -188,7 +190,7 @@ export default class AdsharesBanner implements IScript<Props> {
fetch(banner.view_url).then(function (response) {
response.json().then(function (object) {
if (object.aduser_url && !loadedAdusers[object.aduser_url]) {
fetch(object.aduser_url);
fetch(addUrlParam(object.aduser_url, 'stid', userAccount));
loadedAdusers[object.aduser_url] = true
}
});
Expand Down

0 comments on commit c3adc4e

Please sign in to comment.