How do I restrict the game to run in a domain?

Just started using Construct 2? Post your questions here

Post » Wed Mar 16, 2016 3:05 pm

I want that my game only runs in my domain. How can I do it?
B
4
S
2
Posts: 133
Reputation: 868

Post » Wed Mar 16, 2016 6:44 pm

I'm sorry, would you mind clarifying what you mean by domain?
B
69
S
40
G
24
Posts: 355
Reputation: 18,312

Post » Wed Mar 16, 2016 7:45 pm

ultrafop wrote:I'm sorry, would you mind clarifying what you mean by domain?


DNS (Domain Name System)
B
4
S
2
Posts: 133
Reputation: 868

Post » Wed Mar 16, 2016 8:40 pm

The Browser object has an expression you can use to compare.
Browser.Domain
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Wed Mar 16, 2016 11:08 pm

Browser show same Browser.Domain,on iframe...or am I doing something wrong?

ex1
GameEx1

capx1&SimpleIFRAMEPage1
(just download, extract and open html page in browser)

ex2

GameEx2

capx2&SimpleIFRAMEPage2
(just download, extract and open html page in browser)
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Wed Mar 16, 2016 11:53 pm

Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Thu Mar 17, 2016 12:27 am

If I understand correctly...-

Code: Select all
 var is_at_top = (window.top == window);
       if (this.is_busting_all)
          return is_at_top;
         
        if (is_at_top)
            return true;


this is similar to what I used in second example ...

Code: Select all
Browser.ExecJS("if (top != self)..etc
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Mar 17, 2016 12:54 am

ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Thu Mar 17, 2016 10:33 pm

Thank you guys! but I'm confuse now: what's the best option for my needs? the newt suggestion, the korbaach's examples, the iframe plugin or the tutorial posted by blackhornet?
B
4
S
2
Posts: 133
Reputation: 868

Post » Fri Mar 18, 2016 10:11 am

@korbaach - I didn't understand your examples. Could you explain? is it also prevent loading my game in an iframe?
B
4
S
2
Posts: 133
Reputation: 868


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest