Toby R's Recent Forum Activity

  • Very nice plugin, im currently using every feature of it ... but i have a problem! GetTimestamp gives me an error, while GetFullTimestamp is working just fine. Can you look into this?

    EDIT: SHA256 gives also an error on use, while the other both work.

    Thanks for letting me know! I was refactoring the plugin earlier and made some silly mistakes. Please download the latest version. The bugs are now fixed.

  • For example you could use 10 static locals inside a group, when only just that group uses them, and they never appear anywhere else in the event system, and the variables themselves are close to where they are used. I think this is an under-used feature and would do a lot to solve the "global overload" problem..

    That's exactly the point and I have mentioned that in my article as well. Whenever it is possible you should encapsulate your project as much as you can. The code architecture is crucial in development, especially for big projects.

    Then if you still need some variables with global reach the Globals plugin comes handy.

    you are free to use any of my free plugins in your commercial and non-commercial projects without any restrictions. You are also not obligated to credit me or something - it's fully free.

  • Okay, so I managed to make a quick&dirty "hotfix" for this issue. The point is that the handshake message is sometimes not fetch by C2 code for some reason. So I tried to reattempt the handshaking and it works with every second handshake attempt on my end.

    So basically something like that:

        var isWelcomedByTheScreen = false;
        var handShakeReattempt;
    
        var sendHandshake = function () {
            if( ! isWelcomedByTheScreen)
            {
                console.log('sending handshake');
                airConsole.message(AirConsole.SCREEN, {
                    handshake: true
                });
    
                handShakeReattempt = setTimeout(function(){ sendHandshake() }, 700);
            }
        };[/code:1o2tg1ho]
    
    Now when you finally receive confirmation from the Screen:
    [code:1o2tg1ho]
                        if( ! isWelcomedByTheScreen)
                        {
                            console.log('welcome received');
                            clearTimeout(handShakeReattempt);
                            isWelcomedByTheScreen = true;
                        }[/code:1o2tg1ho]
    
    I presume this issue affects all C2 AC apps, so here's the easy workaround for now.
  • Will do - thanks again

  • Well, I cannot say much because I also do have these issues sometimes. What I can say for sure is that I never had them using an android device, but one of my team mate has an older iphone and an ipad that does that like.... all the time.... I don't know how you handle the JS on your controller, but seeing the identation it looks like that part of the code you shared is under something, I think you instanciate AirConsole under $(document).ready() ? I increased the perfs a lot doing it that way. Something you should try, to see if any difference is actually upload your game without putting it in review, so you can preview it. Usually a lot of things gets fixed doing so

    Ah, then it might be something in the AC API actually. I was suspecting that as well. My controller is quite big so I spread the code across several classes that's why the indentation.

    Alright. Thanks for getting back!

  • Are you having these issues while using the simulator or in production?

    Using a link via their site: http://www.airconsole.com/?http=1#http://my.server.com/

    EDIT: Just checked simulator and all works perfect there. That's interesting.

    EDIT2: Ah no it's not... after more tests it start to have the same issue in simulator.

  • Before I go further with debugging I thought it might be some known issue so I'll ask.

    When I test my game with two controllers, the first one always connects properly as it receives the handshake trigger from the screen. Second controller however has like 50/50 chances to connect or not. It is connected to the airconsole (icon visible in top right corner) but "On device join" condition is not being triggered and so the controller is not connected to the game.

    I've debugged the controller and it is sending the handshake to device 0. I use the standard part in my controler for that as below:

    var airConsole = new AirConsole({orientation: AirConsole.ORIENTATION_LANDSCAPE});
        // var rateLimiter = new RateLimiter(airConsole);
    
        var sendHandshake = function () {
            airConsole.message(AirConsole.SCREEN, {
                handshake: true
            });
        };
    
        airConsole.onReady = function () {
            sendHandshake();
        };
    
        /** -------- AIR CONSOLE MESSAGES --------- **/
        airConsole.onMessage = function (device_id, data)
        {
            if (data.handshake) {
                sendHandshake();
            }[/code:22c9mr75]
    
    I also put just few quick logs to the runtime.js of the plugin and "[i][u]this.air_console.onMessage = function(device_id, data)[/u][/i]" is not even triggered, therefore it can't process the handshake.
    
    So simply saying, if the screen broadcasts  "Game is ready" then controllers connect, but when the screen is already loaded and it's the controller who sends the handshake, then it's like 50/50 that the Plugin will catch it.
    
    I'm using AirConsole plugin v1.4.8.1
    
    Are you maybe familiar with this issue  @Psychokiller1888?
    
    Thanks
    
    ==EDIT==
    Updated to newest plugin version. Still same problem. Screen just logs in console that "WebRTC active for device_id 2", but the plugin is not triggering anything.
  • By consuming a purchased product you basically allow user to purchase it second time (like extra coins which they can buy how many they want for instance). So in your case you don't want to consume the product. Once it is purchased it should not be possible to buy it second time as user already owns it and it has its "has" state set to "true".

  • As you already digged up this topic, I'd like to mention that there's a new TR_System condition Is value in set which makes such things even easier.

  • I assume you use Cranberry's plugin as Scirra's IAP plugin doesn't even have this feature. Or you use Cocoon plugins?

    Either way consuming should work when you just run "consume" action after purchasing the product so if it doesn't then I suggest to contact plugin's author as this technology changes frequently and plugins require constant updates.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't remember I ever said that C2 global variables are dangerous in any way.

    Well, if one has a global var which value change can unintentionally make a mess on the runtime then it means his code architecture is crying a river.

    Please read my article linked in the first post here. I think it will clear things out for you.

  • I understand why having a Global Variable the user can't change freely during game play is considered a problem.

    I have global variables that the user can freely change in game settings or game play, are these considered unsafe Global Variables? They are limited by conditions and only effect the player changing them.

    I'm sorry but I don't understand what you mean exactly. You can change global variables during gameplay and they are safe to use from security perspective... and I think you know that... could you please rephrase your question?

Toby R's avatar

Toby R

Member since 23 Mar, 2015

Twitter
Toby R has 18 followers

Connect with Toby R

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies