How do I use central servers with the Multiplayer Plugin?

0 favourites
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There was a lot of discussion about this some time ago:

    The general consensus was to have a browser or browser emulator on your server that connects first and serves as the more permanent host.

  • 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

  • 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.

  • 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

  • 1. a 000webhost.com server

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

    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

    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 <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    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.

  • I would consider dedicated servers "normal" and peer-to-peer as an oddball.

    And why does C2 use peer-to-peer?

    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.

  • And why does C2 use peer-to-peer? <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing">

    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.

    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. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Look for open source solutions first. Like:

    https://github.com/dhamaniasad/HeadlessBrowsers

    http://stackoverflow.com/questions/8147 ... et-browser

  • 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.

  • 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.

  • Please answer, I am a bit stuck.

  • It depends on your host. You should talk to them about it. If you can remote desktop in to the server, you should just be able to run the EXE like normal.

  • Well, after many days trying to get a free server that runs exe files (it's impossible), I've finally decided to export the chat as a html and run it on the server. But, whenever I log out from the server, the host also logs out. I thought it would keep running as a permanent host

    I don't get it, what's the difference between running the chat on a dedicated server and running it on a browser tab, if I have to keep both the server and the browser tab opened in order to keep the chat running? I thought there was a way to keep a permanent host using dedicated servers...

    PS: Does iOS already support WebRTC, or are iOS devices still unable to run the Multiplayer Plugin?

  • Well, after many days trying to get a free server that runs exe files (it's impossible), I've finally decided to export the chat as a html and run it on the server. But, whenever I log out from the server, the host also logs out. I thought it would keep running as a permanent host

    I don't get it, what's the difference between running the chat on a dedicated server and running it on a browser tab, if I have to keep both the server and the browser tab opened in order to keep the chat running? I thought there was a way to keep a permanent host using dedicated servers...

    You need two server-side programs running. One is the webserver which runs your C2 application and one is the browser on the server which talks to the webserver (over the localhost, presumably) and acts as the 'host' client.

    You are beginning to see why I consider dedicated servers 'normal' though.

  • You are beginning to see why I consider dedicated servers 'normal' though.

    Yes

    You need two server-side programs running. One is the webserver which runs your C2 application and one is the browser on the server which talks to the webserver (over the localhost, presumably) and acts as the 'host' client.

    Ok... So, I have the first one (the server that hosts my C2 application) but I don't have the second one, I guess... And what do I have to do in order to get the second one to work? I have looked up many tutorials but I didn't find nothing interesting.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)