How do I use central servers with the Multiplayer Plugin?

Get help using Construct 2

Post » Thu Jan 12, 2017 12:34 pm

Hi,

I want to make a chat where the host is always connected, so that the peers don´t get kicked from the room whenever the host leaves the chat room. I do already have a 000webhost-server which I could use, but I don't know how to make this server my chat room's host.
Do I have to configurate anything in this website? Or can this be done only with events an actions?

Thank you for your help :)
B
21
S
6
Posts: 153
Reputation: 1,713

Post » Thu Jan 12, 2017 5:03 pm

There was a lot of discussion about this some time ago:
viewtopic.php?f=146&t=122599
viewtopic.php?f=146&t=162260

The general consensus was to have a browser or browser emulator on your server that connects first and serves as the more permanent host.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Thu Jan 12, 2017 6:51 pm

@gumshoe2029

Thank you for your answer! :)
After reading these posts I have 2 questions:

1. How can I add a browser or a browser emulator on my server? I am not really an expert in servers. I suppose if I do this once it won't be necessary to mantain the server (excepting there is a bug or the server has any problem), isn't it?

2. I read that the Multiplayer Plugin does not work with iOS, but this post is from 2015. Does it work now on iOS devices?

Tank you once again for your reply :)
B
21
S
6
Posts: 153
Reputation: 1,713

Post » Thu Jan 12, 2017 8:41 pm

ChesVCF wrote:@gumshoe2029

Thank you for your answer! :)
After reading these posts I have 2 questions:

1. How can I add a browser or a browser emulator on my server? I am not really an expert in servers. I suppose if I do this once it won't be necessary to mantain the server (excepting there is a bug or the server has any problem), isn't it?

2. I read that the Multiplayer Plugin does not work with iOS, but this post is from 2015. Does it work now on iOS devices?

Tank you once again for your reply :)


1. What kind of server are you running?

2. I have no idea. I use dedicated servers.

Honestly, it sounds like you need to be using a dedicated server and not the multiplayer plugin. I recommend doing research on how to use the AJAX object.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Fri Jan 13, 2017 2:55 pm

@gumshoe2029

1. a 000webhost.com server

2. which is exactly the difference between normal and dedicated servers?

I tried using the AJAX object to "contact" a database, but my problem is that all the tutorials are written for PHP 5.6 (which uses MySQL) and since the PHP 7 update, it is necessary to write MySQLi (I don't know and I didn't find the adequate code), so I decided trying with the Multiplayer plugin (which would be fine if the room's stability didn't depend on the host being connected). I don't want to give up the Multiplayer plugin yet, I hope to be able to find a solution.

Anyhow, if you could kindly tell me what I exactly need to research on to implement a dedicated server (I do only have basic knowledge), it would be great.

Thank you once again for your help, I really need it :)
B
21
S
6
Posts: 153
Reputation: 1,713

Post » Mon Jan 16, 2017 8:18 pm

ChesVCF wrote:1. a 000webhost.com server

That is a curious new server provider. I might have to recommend this for beginners instead of AWS.

ChesVCF wrote:2. which is exactly the difference between normal and dedicated servers?

I would consider dedicated servers "normal" and peer-to-peer as an oddball. Your 000webhost server is a dedicated server.
See: how-do-i-use-a-lobby-server-for-a-multiplayer-game_p1091393?#p1091393

ChesVCF wrote:I tried using the AJAX object to "contact" a database, but my problem is that all the tutorials are written for PHP 5.6 (which uses MySQL) and since the PHP 7 update, it is necessary to write MySQLi (I don't know and I didn't find the adequate code), so I decided trying with the Multiplayer plugin (which would be fine if the room's stability didn't depend on the host being connected). I don't want to give up the Multiplayer plugin yet, I hope to be able to find a solution.
Anyhow, if you could kindly tell me what I exactly need to research on to implement a dedicated server (I do only have basic knowledge), it would be great.

Thank you once again for your help, I really need it :)

MySQLi for beginners: http://codular.com/php-mysqli

For research to use a dedicated server, you just need to use your 000webhost server and do research on "PHP program application interface tutorial" and "PHP mySQLi" to find out how to take in HTTP parameters and place them into your database. Then you access your API via AJAX and use it to input items into your database.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Mon Jan 16, 2017 8:51 pm

gumshoe2029 wrote:I would consider dedicated servers "normal" and peer-to-peer as an oddball.

And why does C2 use peer-to-peer? :lol:

gumshoe2029 wrote:For research to use a dedicated server, you just need to use your 000webhost server and do research on "PHP program application interface tutorial" and "PHP mySQLi" to find out how to take in HTTP parameters and place them into your database. Then you access your API via AJAX and use it to input items into your database.


Ok, thank you. I am going to do research on these topics and I hope to be able to implement a browser emulator on my web server. Also thank you for all the information and the tutorials, they are very helpful. :)
B
21
S
6
Posts: 153
Reputation: 1,713

Post » Tue Jan 17, 2017 7:48 pm

ChesVCF wrote:And why does C2 use peer-to-peer? :lol:

Because that was the way Scirra designed it. If I were a betting man, I would wager that C3 will offer more dedicated server support.

ChesVCF wrote:Ok, thank you. I am going to do research on these topics and I hope to be able to implement a browser emulator on my web server. Also thank you for all the information and the tutorials, they are very helpful. :)

Look for open source solutions first. Like:
https://github.com/dhamaniasad/HeadlessBrowsers
http://stackoverflow.com/questions/8147 ... et-browser
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Wed Jan 18, 2017 5:31 pm

Multiplayer works in NW.js, so if you want an app that works as a server, export to NW.js, put it on a dedicated server, run it, log in as host, and leave it running. Anyone who joins the same room will now connect to your dedicated server. You can do the same with a browser tab too, but you might have trouble with Chrome suspending the tab if it's not in the foreground.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Wed Jan 18, 2017 6:16 pm

Thank you, @Ashley!

I did already export it to NW.js and I uploaded all the files in the "win64" folder to my dedicated server, but I don't know how to run it.
B
21
S
6
Posts: 153
Reputation: 1,713

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests