Fengist's Recent Forum Activity

  • Is your sever Https ? (Secure server)

    It is not. And apparently that's exactly why the 'unsafe scripts' icon on chrome popped up. Well, at least until I get a cert I can at least bypass this blocking.

  • Ok, so I did some digging in the Apache logs and discovered that any time I made an ajax request from the C3 IDE, it wasn't even hitting the server. Run locally on the server, the GET requests were logged with no errors.

    Since you guys say it works, I got to looking at the browser as a problem. Sure enough, one tiny little icon in the top right corner of Chrome notified me that this was an 'unsafe script'

    I clicked on that, and the project did a proper ajax request and I got the proper response back

    Since this script blocking didn't occur when run from html5 uploaded to the server and only occurred when running from the C3 IDE, I'm going to assume that my visitors aren't going to have this same issue with script blocking. Otherwise, them trying to spot that little warning icon is going to cause them to quickly give up.

    Thanks for the suggestion guys, you put me on the right path.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > Is there something about C3 on construct.net that prevents ajax from working?

    Defenitely not, as it works for me. But it´s hard to tell what´s wrong here. The file could be cached for example, try opening it in your regular browser and hit Ctrl+F5 to force it to reload and try again. But it should defenitely work since I don´t have that problem.

    Nope, didn't work. I'll check with the isp tomorrow.

  • Ok, tried the .htaccess and that didn't work. Tried adding both lines to the php, that didn't work either.

    Is there something about C3 on construct.net that prevents ajax from working?

  • I use a .htaccess file for this.

    Header always add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT" Header always add Access-Control-Allow-Origin "*"

    Thanks, I'll give this a try.

  • Ok, a long time ago I had this problem solved with C2. Now, I'm scratching my head again.

    Doing just a simple Ajax request to a php script.

    <?php header("Access-Control-Allow-Origin: *"); $myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); $txt = $_POST; fwrite($myfile, "Post: ".$txt); fclose($myfile); echo "Success"; ?>

    If I export the C3 project to html5 and upload it to the server where this script is, it works as intended. If I try to run it via the C3 preview it gives an Ajax error in C3 with no Ajax.LastData.

    Obviously, this has something to do with cross site but I was under the assumption that the php header would fix that.

    Any ideas? I really don't want to constantly export and upload a project to live test it.

    Tagged:

  • Is there a C3 version of this?

  • I dont know how much I should be saying here, but I did buy the signalling server code.

    The code is minified, so its pretty hard to modify. I have, for my own personal use added in a basic login via sql. It took me less than an hour of formatting and poking around to understand what was going on with the code to be able to start adding my own functionality. (hint: js code formatters are helpfulllll)

    I hope this helps!

    Thank you. That's what I wanted to know.

  • So, I'm guessing this means that nobody knows the answer to this question and therefore I shouldn't waste my money since the dev's apparently have no desire to release any of their MP protocols.

  • Furthermore... and I just noticed this... the Scirra signalling server sends out the IP addresses of everyone connecting. The dev's of RUST learned the hard way that if you have a game and you broadcast the IP address of players, other players will DDOS them with pings just to make them lag out. Don't you just love how desperate some people are to massage their egos with a win?

  • The signalling server offered by Scirra is wholly unusable for my purposes. There's no method of controlling users logging into the game (like an SQL database) and there's no way to start and stop hosts if you don't want the game hosted by a player.

    I've been playing around with a wss client and server in C#, connecting to the public signalling server with no major issues and it appears that writing my own signalling server part wouldn't be that difficult.

    Therefore, my question is this:

    Does anyone know how readable the js code is for the signalling server?

    What I'm hoping to accomplish is to create a signalling server that starts a 'host' client for players to join as peers and then, pass off to the multiplayer control and allow the host to serve the game much the way the current signalling server does.

    In order to do that, it would be real handy to be able to read the signalling server code (since Scirra hasn't released their wss sub protocol standard).

  • Well, this can be done by using built-in multiplayer plugin like in this template.

    The server can be represented as a stand-alone application or even a browser window. Moba games usually have only ten players in each room, so it will not be a problem for C2.

    See my reply above. The question is, can it handle upwards of 150 moving objects and 16 players and all the settings needed for those objects?

Fengist's avatar

Fengist

Member since 6 Nov, 2015

Twitter
Fengist has 5 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies