Airconsole controller maker

Post your completed addons to share with the community

Post » Tue Mar 21, 2017 10:10 am

@StillSarah,

Thanks for finding the fix! We are reworking our controller over the next few weeks using the new plugin, so I'll let you know if I see any issues on iOS.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
13
G
20
Posts: 373
Reputation: 14,484

Post » Tue Mar 21, 2017 7:21 pm

StillSarah wrote:@cjbruce
I did find a fix for the iPhone reconnect issue in case anyone else comes across it. Several days ago I tried copying in the handshake code directly into the controller.html hoping that would solve the problem, and it had no effect. However, now it is suddenly working. Just copy:
Code: Select all
<script type="text/javascript">
  var air_console = new AirConsole();

  var sendHandshake = function() {
    air_console.message(AirConsole.SCREEN, {
      handshake: true
    });
  };

  air_console.onReady = function() {
    sendHandshake();
  };

  // Let the screen know we are here
  air_console.onMessage = function(device_id, data) {
    if (data.handshake) {
      sendHandshake();
    }
  };
</script>

into the controller.html file and it fixes this issue now. Hopefully this helps others who run into this.
Thanks,
Happy Game Designing!


I don't understand, this is the default JS code for a standard connection...
B
32
S
11
G
3
Posts: 214
Reputation: 4,267

Post » Wed Mar 22, 2017 9:38 am

Double post because totally different topic.

@X3M The plugin updated to AC API 1.7.0, don't forget to update this one for the controllers to use 1.7.0

@all this is also for all of you, don't forget to update your controller AC API link in the header
B
32
S
11
G
3
Posts: 214
Reputation: 4,267

Post » Wed Mar 22, 2017 10:05 am

Psychokiller1888 wrote:Double post because totally different topic.

@X3M The plugin updated to AC API 1.7.0, don't forget to update this one for the controllers to use 1.7.0

@all this is also for all of you, don't forget to update your controller AC API link in the header


Thanks for the heads up. What happens if you don't update the api? Will it still work?
B
54
S
23
G
12
Posts: 747
Reputation: 11,910

Post » Wed Mar 22, 2017 6:08 pm

Psychokiller1888 wrote:
StillSarah wrote:@cjbruce
I did find a fix for the iPhone reconnect issue in case anyone else comes across it. Several days ago I tried copying in the handshake code directly into the controller.html hoping that would solve the problem, and it had no effect. However, now it is suddenly working. Just copy:
Code: Select all
<script type="text/javascript">
  var air_console = new AirConsole();

  var sendHandshake = function() {
    air_console.message(AirConsole.SCREEN, {
      handshake: true
    });
  };

  air_console.onReady = function() {
    sendHandshake();
  };

  // Let the screen know we are here
  air_console.onMessage = function(device_id, data) {
    if (data.handshake) {
      sendHandshake();
    }
  };
</script>

into the controller.html file and it fixes this issue now. Hopefully this helps others who run into this.
Thanks,
Happy Game Designing!


I don't understand, this is the default JS code for a standard connection...


Yes, it is the default connection code. However, the controller plugin doesn't automatically put this into the controller.html file for you. So anyone using the controller plugin just needs to add it in manually. Android devices were connecting no problem without that code in the html file, but iOS devices seem to need it to be there to reconnect after disconnecting. This is just what I've observed in my own testing. It's possible that this was only an issue with my game and no one else will run into this, but from what I could tell, the on device join event wasn't getting triggered when iOS devices were trying to reconnect in, and copying the connect code right into the controller.html file fixed it for me.
B
9
Posts: 13
Reputation: 847

Post » Wed Mar 22, 2017 6:39 pm

@Psychokiller1888 Will projects that use 1.6 stop working ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Thu Mar 23, 2017 9:43 am

Anonnymitet wrote:
Psychokiller1888 wrote:Double post because totally different topic.

@X3M The plugin updated to AC API 1.7.0, don't forget to update this one for the controllers to use 1.7.0

@all this is also for all of you, don't forget to update your controller AC API link in the header


Thanks for the heads up. What happens if you don't update the api? Will it still work?


Yes it does still work, no problem. But deprecated APIs might get deleted in the future, who knows...


@X3M no, they won't

@StillSarah Hmmm, ok. That code IS needed for any devices to connect, not only IOS. Anyway, the onConnect method of the plugin is bad, I'm working today on finishing the AirConsole plugin version 2. So far, I did not encounter any onConnect / on Disconnect failure, looks promising.

Follow the dev here: https://github.com/Psychokiller1888/c2airconsole but be aware it is not finished / ready for use until I release a version on Github
B
32
S
11
G
3
Posts: 214
Reputation: 4,267

Post » Thu Mar 23, 2017 9:53 am

@Psychokiller1888 Nice to hear that and fantastic work o nthe plugin. Much appreciated :)
B
54
S
23
G
12
Posts: 747
Reputation: 11,910

Post » Thu Mar 23, 2017 9:19 pm

@Psychokiller1888 - yeah, the connect code right now is included somewhere in one of the controller's js files that is exported. I haven't had a chance to dig through and find it, but I'm sure it's there, like I said Android devices were connecting and even the iOS devices were connecting in initially too. Anyway, thanks for your thoughts on this. I don't know why copying the code into the controller.html file worked for me, I just know that it did. I've run several tests and gotten the same results each time. Thanks for all the work you've put into the airconsole plugin. Looking forward to trying out V2!
B
9
Posts: 13
Reputation: 847

Post » Fri Mar 24, 2017 1:21 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.

Appreciating any feedbacks, reports, requests
B
32
S
11
G
3
Posts: 214
Reputation: 4,267

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests