autoLan - pongDemo3

I have this autoLan Pong3 demo on 3 devices.  Iphone6s plus, ipad2(old thing), SamGal 5. 

Try to have Iphone and ipad play the demo head to head :

  1. iphone  ‘hosts’ , iPad ‘joins’… game plays

  2. iPad ‘hosts’, iPhone ‘joins’ but stays in ‘scanning’ … game does not play.

Ipad and SamGal 5 play the demo head to head:

  1. SamGal ‘hosts’, iPad ‘joins’ … game plays

  2. iPad ‘hosts’ , SamGal ‘joins’ but stays in ‘scanning’ … game does not play.

iPhone and SamGal5 play the demo head to head:

either device ‘hosts’, other ‘joins’, the joining device stays ‘scanning’ … game does not play

I figure this is likely something I should understand, and maybe a setting somewhere needs to be flagged. I just am not sure.  I made no changes to the pong3 demo.

I thought maybe the older iPad (older iOS 9.3.5 (cannot update it any more), was the problem that it could not host either with the iPhone or the SamGal5. And that may still be an issue for that device- or maybe there is a setting I need to flag on the iPad, so it can host.  Does anyone know if that might be the iPad issue?

But, when the iPhone and SamGal (both newer and updated devices) would neither host or join the other, but - they both could host with the iPad joining… I then have no clue as to why these devices fail consistently in the situations mentioned above.

I thank you for any guidance possible.

Bob

Check your build.settings.  If you don’t have modern settings for the networking it may fail.

Also, where did you get the copy of AutoLan and example? i.e. What link

RoamingGamer,

Thanks.

Demo folder was marked created June 26, 2016  … Got it from one of the forum post, I think to your git maybe?

The build settings came with this version of the demo … I am not sure if they are the modern settings. 

Is there a newer pong3 demo with newer build settings?  newer then the June 26, 2016 version?

here is the build settings in the pong3 demo 

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = true, } }, androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_COARSE\_LOCATION", }, }

Thanks

Bob

You’ll have to check this site for the proper build.settings networks setup for iOS:

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html

I’m specifically talking about ATS: https://docs.coronalabs.com/guide/hardware/appleATS/index.html

===> https://docs.coronalabs.com/guide/hardware/appleATS/index.html#bypassing-ats

Note: Autolan is semi-dead, but can in all likelihood be resuscitated with love.  This is my repository link ( viability unknown ):

https://github.com/roaminggamer/AutoLan-IPv6

Can you run the game in this configuration?

  • simulator
  • android device

Ed,

Thanks for your effort.  I tried the iOS plist settings in the link, along with the ‘bypassing ats’ link entry into my build settings.  Still the devices act the same.  

Just since you asked… When using the simulator with the devices, this is what happens, before and after those changes to the build settings; same thing happens - no change.

simulator to android - fails either way, that is wether simulator does host or join, and the android does the opposite; no play occurs.

simulator to iPhone - fails either way, that is wether simulator does host or join and the iPhone does the opposite; no play occurs.

but,

simulator to iPad, if simulator is host, and iPad joins - play happens.

simulator to iPad, if iPad does host, and simulator does join, no play

However, I did not know autoLan was on last leg.  I think I am going to skip the device to device option for this app.  I am successfully using noobhub for internet head to head play, and just am going to table my effort for the local network head to head play. 

Maybe some other day I will add that feature to the app. I just thought I would give it one more try today.

Please do not spend anymore of your time on this.  

And again, thanks for your assistance and kind effort.

Bob

Bob,

I know it is tempting to use AutoLan, but you can likely achieve Local-Network gameplay using some Roll-Your-Own UDP code.

I do wish there were a simple, robust, and reliable solution for local networked gameplay, but I don’t know of one.

Ed,

Thats fine…  you have done plenty to help.   I did play a little with the UDP(roll my own) stuff… and sort-of-understand some of it.  Ran into a few snags doing that, and thought auto lan would be easier and quicker… since it actually worked well in the pong demo and in my app - 'to a point; just can’t have some devices not being able to host and such.  

I am going to table the local network stuff for now. 

Maybe somewhere down the road, there will be a corona plugin to handle local-network play. That might be helpful.

Have a great day!

Bob

Hi again.  I looked into this a bit and it works find for me (as long as I use my code).

  1. Did you read this: https://github.com/roaminggamer/AutoLan-IPv6/blob/master/README.md

  2. If not, in a nutshell there are a couple of variants of the IPV6 soulution.

  • Pong  Demo  3 - This uses Scott’s solution.
  • Pong Demo - This uses my solution mashed together with Scotts.
  • Why is there no 2?  I don’t know.

Pong Demo works fine for me between two simulator instances on the same Windows 10 machine.

You should try this example and if it works in your various cases, you should be good to go.

Be sure to ALSO read the top part of Client.lua and Server.lua as you may need to configure the files for you usage.  i.e. Don’t use these blindly.

Note: I’m also  99.999% sure you don’t need the IPV6 part of this fix for Local networking. 

I believe Pong Demo 3 is IPV6 ONLY which is probably why it isn’t working locally.  

This is stretching my memory a bit, but I believe Pong Demo (using my mashed up code) detects and uses IPV4 if that is all that is available.

My memory is very tenuous on this.

Ed,

Thanks.  I will give it one more try, and look over what you noted in your last 2 posts. I will let you know how it goes.  It may be late tomorrow before I can test it all, but I will do that tomorrow afternoon.

Thanks

Ed, 

Just  an update for you. The pong demo (I guess we can call that version 1), as you thought, works well on the simulator-ipad2-iphone6splus; they each are able to host and join any of the others. That is good.

The Android is able to host with any of the other devices including the simulator, but can not ‘join’ to any of them.  I figure this must be in the build.settings where there is only the permission :

“android.permission.INTERNET”,

Looking around the forum and internet… so far in all the posts I read about auto lan, I have seen nothing specific about the build.settings permissions for android,  so I am going thru the client.lua module of the pongDemo1.

I will let you know if I find anything there that may correct this last hurdle to getting this auto lan working, with host and join,on all the devices.

But, like I said, don’t waste any of your time on it … If I can’t find anything in the client.lua, I will scratch that feature from my app… not a big deal.

Thanks

Bob

Bob - I don’t have anything on that right now, but I should be reviewing Autolan for one of my own projects soon so I’ll post back when I figure out what’s going on with Android.

It could be a few days.

Ed,

Just an update… (I know it may be a few days before you have time to play with that pong demo again).

But, thus far, using some troubleshooting print statements and such, I have narrowed problem down to the call in the  Client.lua … in this function :

local function UDPBroadcastListen() if(broadcastListener) then local broadcastMessage, serverIP, serverPort -- when device is apple or simulator, returns table for broadcastMessage -- and host device ip for serverIP, as it should -- on android (armv7 / arm neon) it returns nil for boradcastMessage and -- 'timeout' as the serverIP ... not sure if the armv7 has anything to do with that broadcastMessage,serverIP,serverPort = broadcastListener:receivefrom()

I am somewhat stuck here as I have no experience with the socket stuff.  I will keep at it, but thought this little bit of info may jog something in your vast experience with this auto lan and socket stuff.  

Since the android can host, (it just fails to join) I would guess the armv7 has little to do with this problem.

Thanks 

Bob

Check your build.settings.  If you don’t have modern settings for the networking it may fail.

Also, where did you get the copy of AutoLan and example? i.e. What link

RoamingGamer,

Thanks.

Demo folder was marked created June 26, 2016  … Got it from one of the forum post, I think to your git maybe?

The build settings came with this version of the demo … I am not sure if they are the modern settings. 

Is there a newer pong3 demo with newer build settings?  newer then the June 26, 2016 version?

here is the build settings in the pong3 demo 

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = true, } }, androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_COARSE\_LOCATION", }, }

Thanks

Bob

You’ll have to check this site for the proper build.settings networks setup for iOS:

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html

I’m specifically talking about ATS: https://docs.coronalabs.com/guide/hardware/appleATS/index.html

===> https://docs.coronalabs.com/guide/hardware/appleATS/index.html#bypassing-ats

Note: Autolan is semi-dead, but can in all likelihood be resuscitated with love.  This is my repository link ( viability unknown ):

https://github.com/roaminggamer/AutoLan-IPv6

Can you run the game in this configuration?

  • simulator
  • android device

Ed,

Thanks for your effort.  I tried the iOS plist settings in the link, along with the ‘bypassing ats’ link entry into my build settings.  Still the devices act the same.  

Just since you asked… When using the simulator with the devices, this is what happens, before and after those changes to the build settings; same thing happens - no change.

simulator to android - fails either way, that is wether simulator does host or join, and the android does the opposite; no play occurs.

simulator to iPhone - fails either way, that is wether simulator does host or join and the iPhone does the opposite; no play occurs.

but,

simulator to iPad, if simulator is host, and iPad joins - play happens.

simulator to iPad, if iPad does host, and simulator does join, no play

However, I did not know autoLan was on last leg.  I think I am going to skip the device to device option for this app.  I am successfully using noobhub for internet head to head play, and just am going to table my effort for the local network head to head play. 

Maybe some other day I will add that feature to the app. I just thought I would give it one more try today.

Please do not spend anymore of your time on this.  

And again, thanks for your assistance and kind effort.

Bob

Bob,

I know it is tempting to use AutoLan, but you can likely achieve Local-Network gameplay using some Roll-Your-Own UDP code.

I do wish there were a simple, robust, and reliable solution for local networked gameplay, but I don’t know of one.