lennaert's Forum Posts

  • That looks fantastic.

    I glanced at the video from oktober too, but this is way way better already.

    Nice work so far

    And keep on biting I guess, you seem to be able to chew it ;P

  • Not really, I have not been using ftp options in cs2.

    Doesnt Rex have anything ?

    Perhaps the option to get project files ?, and externally placing a file in the app folder ?

  • 1. Even if you refer to files relatively, the call is still being made over a http connection.

    Just use the whole address, adding the https int he ajax call.

    The ajax calls will be made by the client, and its info will be sent in the headers as if browsing.

    2. As soon as you have an application running in a browser, and you perform ajax calls (to your php files for example), your making calls over the internet, https adds extra security.

    3. 'HTTP_USER_AGENT'

    PHP can get all the info, php.net server calls

  • some thoughts:

    Store the IP of the user, you can directly compare that.

    You could use the IP in the token generation.

    If you take that one step further, you can include the user browser agent ID in the token generation too.

    You can use an auto timeout on the server.

    Each time you request the user data and successfully authenticates, update a time stamp int he user table.

    If you use tasks or cron jobs, you can have a script run at an interval to check timeouts in the user table based on the time stamp.

    Use https connections for the ajax.

    You could have a new token generated every request, or every X request, and have the client update theirs after having authenticated and a new one is generated.

    Have the server generate the token each request instead of storing it in the db.

    I found that using MD5()'ed (php) strings really usefull.

    Just make a list of strings including all required information, then MD5 the whole string into an unique value/token.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nice game, I like tank games hehe

    Had fun playing with someone

    I entered an alias for login, but did not see it get used though.

    After a couple levels hit enter to start again did no longer work after death.

    Also, when a peer joined, the game I was playing restarted, I had near all tanks killed xD

  • I would like a feature where the host is able to set a "room state".

    Such as: open, closed. (custom ones would be even better)

    This will aid in making larger multiplayer rooms layout system.

    Right now when I request a list of rooms, its either those locked, or not, or both.

    But when a game has already started, and not locked (due to not having the max amount of players in the room) it also shows up as available game.

    I would like to be able to filter the available rooms on their state.

    ie

    room.state = open >>>> show link to join game

    room.state = closed >>>>> ignore

    If there is already such a mechanic in the multiplayer object, then I am unaware how to set the room to "unavailable" witout the max amount of players.

    Perhaps an easy solution would be the ability to manipulate the room's locking state while in room with peers joined.

    ie Locked, not locked.

    Host starts game, and regardless of the amount of players, lock the room.

    Though, I would prefer the first suggestion, the room state, leaves room for a lot of manipulation while everything runs.

  • yeah sorry I use SF+ by default.

    Yes it's an Ajax request and Ajax.lastData comes up empty. You're right, I checked the Chrome console and it says "No 'Access-Control-Allow-Origin' header is present on the requested resource."

    Sorry to be clueless but could you give a bit more info on how I would go about the iFrame technique?

    Sorry to say, I just did some research on the cross site policies, and the methods used a couple years ago now also no longer seem to work.

    Well, some still work, in very old browsers :

    The current support for the adding of manual scripting in cs2 is rather limited.

    I added podes iframe plugin and did some tests, but did not succeed.

    There are some other approaches, such as using a webserver with php and having that request a webpage, which relays the results back to you. But its a messy solution.

    Outside of construct 2 its already a lot easier as you could add javascript to the iframe, and have the iframe send the innerHTML to the parent object (parent window). But in cs2 I can not add javascript or jquery to podes iframe. Perhaps you can ask Pode if it is possible to have it add it to the plugin so the iframe source is available in the iframes propperties in cs2.

    For various approaches you can google around for : javascript get iframe html

    I applied several of the suggestions by adding the browser object and podes iframe object.

    The iframe loaded a url, and with the browser object I executed various bits of javascript to get the innerHTML from the iframe to anything in cs2, and all that worked gives me the cross domain notifcation.

    document.getElementById('my_iframe').contentWindow.document.body.innerHTML;
    [/code:fpenqg7y]
  • Very nice graphics and tunes.

    Really looks like a fine piece of work.

    pointers:

    first story block was huge piece of text, perhaps show in chunks or as the levels progress?

    There were a LOT of meteors everywhere, making it feel and fly rather clumsy 90% of the time. (some meteors looked weird bumping as there were so many)

    The bumping of firing looked somewhat odd at first, but I was finally using it to shoot around the meteors to hit the turrets.

    imo the game would benefit from a little less meteors and and less fire ricocheting

  • Cant open the capx, I do not have the spritefont+ installed.

    But I imagine you have the ajax plugin doing a request or post and its not working.

    Hitting Ctrl shift J gives you the error console in chrome and FF.

    I forgot about the cross domain policies.

    Sites generally have cross domain security enabled. (origin access)

    So the ajax is not the best solution unless your trying to fetch info from one of your own sites on the same domain or sites having all origin access set to *

    You could use a hidden Iframe, load the page, and fetch the html from the frame with a bit of javascript.

  • Even if we supported it, without a full DOM, Web Audio API, WebRTC etc. etc. it will be an ongoing compatibility nightmare. A big factor in dropping CocoonJS support was the perpetual support headache of users running in to those same missing features again and again. So no, if it is missing such major features, I don't want to support it.

    With a quick glance in the wiki, I see it supports web audio when on web.

    Does not look like it supports webrtc.

    cocos2d wiki

    Also, looking at the tool, ... perhaps the Cocos2d users can request Cocos2d for a decent importer of an exported html5 web app/game.

    Sounds far more plausible then asking for a 3rd party to make their exports compatible with cocos2ds features/changes.

    They support HTML5, I would have thought they would be able to import some.

  • Use ajax to request the page, then you will have it in Ajax.LastData.

  • Perhaps actually follow the tutorial

    You can use bound to layout.

    Or add a border (sprites) with solid behavior and make the ghosts bullet behavior bounce of solid

  • If you have a user login status with PHP or something, manually add the checks to the exported index.html document and change the extension to .php.

    You could add the check at the top of the file, something like

    ie

    if($userloggedin = 1){

    //rest of the original html file content

    } else {

    header(location: http://someURL);

    }

  • you position the background on 0,0

    Most likely, the origin point of your image is in the center.

    Double click your sprite, and change the origin point 0 to 0,0, or change the positioning to 480,480

  • Ah, okay! So could I do it like this?

    No super hosts; whenever a player moves into a layout, that player becomes the 'peer host' of that layout, and anyone else who enters the layout will enter the peer host's version.

    So when a player enters the "Dangerous Cave" layout, the game pings the signaling server to see if anyone else is currently hosting the 'dangerous cave' layout, and if so it connects them, and if not that player becomes the first 'peer host' of the 'dangerous cave' layout. That will work?

    And then for syncing global variables, I could use WebKit or something like that for syncing the global variables from a simple data file I host on a server somewhere? So, for example, if the world has a day/night cycle, that will sync up across all players playing the game through a separate mechanism than the multiplayer object?

    Exactly !!

    And for the mmorpg part of things ...

    Use PHP /mysql back end with ajax.

    I used it for my first version of tankwars (even the movement) and with a good approach in php you can make certain transaction safe enough, the vast majority of mmorpgs run on php/mysql

    For the game side of things, it really livens things up ...

    ie

    mysql database having a table wit player info, and rooms/wordparts.

    The player table should contain a reference to in which layout it resides atm. (current location)

    Player starts app and ajax request ID info, if ID exists, send info from player etc.

    If does not exist, create ID etc.

    Now, if you move to another layout piece, simple ajax your way to the db and update player current location.

    This will make you peers optionally available if they are offline too

    Or, imagine sending someone a message ... store in DB, and when they come online, they check the db through ajax for messages.