[Plugin] AirConsole - local multiplayer for your game

Post your completed addons to share with the community

Post » Fri Feb 24, 2017 4:57 pm

Will do - thanks again ;)
Image
B
27
S
14
G
54
Posts: 853
Reputation: 31,110

Post » Fri Feb 24, 2017 6:01 pm

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:

Code: Select all
    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);
        }
    };


Now when you finally receive confirmation from the Screen:
Code: Select all
                    if( ! isWelcomedByTheScreen)
                    {
                        console.log('welcome received');
                        clearTimeout(handShakeReattempt);
                        isWelcomedByTheScreen = true;
                    }


I presume this issue affects all C2 AC apps, so here's the easy workaround for now.
Image
B
27
S
14
G
54
Posts: 853
Reputation: 31,110

Post » Fri Feb 24, 2017 6:25 pm

Good job! I did something similar too but did not continue as I changed the way it works in my plugin. Will redirect people to your post if someone asks about the same issue!
B
24
S
8
G
3
Posts: 156
Reputation: 3,624

Post » Sun Feb 26, 2017 11:48 pm

lol i had the same problem and tryed something similar but simpler, i just keep sending messages and handling the "login" when receiving messages (because the problem is that the "ondevicejoin" is not triggered, but the device actually can send messages)
B
17
S
3
Posts: 91
Reputation: 955

Post » Mon Feb 27, 2017 3:09 am

Hmmm. I couldn't get ondevicejoin working for awhile, but realized I hadn't set maxplayers correctly. Now I am getting duplicates of ondevicejoin approximately 1 time out of 6. In C2, I just kept track of all joined deviceids, and ignored the duplicate calls.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
37
S
8
G
8
Posts: 211
Reputation: 7,398

Post » Wed Mar 22, 2017 9:36 am

Plugin updated to API 1.7.0!

Don't forget to update your controllers to make them use the 1.7.0 API too

https://github.com/AirConsole/airconsole-construct2
B
24
S
8
G
3
Posts: 156
Reputation: 3,624

Post » Fri Mar 24, 2017 1:24 pm

The new plugin is ready for an early release: https://github.com/Psychokiller1888/c2airconsole

Documentation should follow shortly, but technically the big changes are:
- Better connection support
- Better/easier message Controller <-> Screen support
- Dropped deprecated conditions/actions/expressions

This is a 95% done job, but bugs are to be expected (unless I'm very very good at it, which I doubt)

The plugin will be the official new AC plugin sometimes in the next two weeks. Support and documentation directly on Github. Scirra forum topic will be created once we have decided with AC how/where/who to host the new plugin

The Pong exemple on that repository has been updated to fit the new plugin. Don't forget to use GameReady when the loader has finished loading. Along with the pong exemple comes the basic controller structure

Appreciating any feedbacks, reports, requests. Use the Github issue tab for that
B
24
S
8
G
3
Posts: 156
Reputation: 3,624

Post » Tue Mar 28, 2017 10:07 am

The plugin version 2 was merged into AirConsole main git repository and I was granted access to push for it

The new plugin is to be found on https://github.com/AirConsole/airconsole-construct2 as before.

The old plugin can still be found on the branch: https://github.com/AirConsole/airconsol ... -version-1

Issues will be adressed on the Git repo itself: https://github.com/AirConsole/airconsol ... ct2/issues

A new forum topic will be made on this forum

Documentation on airconsole.com will be updated, and a wiki will be populated on https://github.com/AirConsole/airconsol ... ruct2/wiki

Hope you enjoy the new plugin!
B
24
S
8
G
3
Posts: 156
Reputation: 3,624

Post » Thu Mar 30, 2017 1:56 pm

@Psychokiller1888 thank you very much !
Image
B
40
S
19
G
4
Posts: 85
Reputation: 5,877

Previous

Return to Completed Addons

Who is online

Users browsing this forum: Anonnymitet, undeadbobop and 4 guests