[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
30
S
16
G
54
Posts: 857
Reputation: 31,393

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
30
S
16
G
54
Posts: 857
Reputation: 31,393

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
26
S
10
G
3
Posts: 181
Reputation: 3,931

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
40
S
9
G
12
Posts: 247
Reputation: 9,652

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
26
S
10
G
3
Posts: 181
Reputation: 3,931

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
26
S
10
G
3
Posts: 181
Reputation: 3,931

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
26
S
10
G
3
Posts: 181
Reputation: 3,931

Post » Thu Mar 30, 2017 1:56 pm

@Psychokiller1888 thank you very much !
Image
B
42
S
21
G
5
Posts: 88
Reputation: 6,633

Post » Sun Apr 30, 2017 8:59 pm

Psychokiller1888 wrote:Hope you enjoy the new plugin!


@Psychokiller1888,

I'm using the new plugin now, and it is working great! Thank you for your hard work on this!

Also,

For anyone who is looking to make both the AirConsole screen and controller in Construct 2, I have just posted this guide in the AirConsole Controller thread:

https://www.scirra.com/forum/viewtopic.php?f=153&t=186227&p=1119512#p1119512
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
40
S
9
G
12
Posts: 247
Reputation: 9,652

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests