Corona® AutoLAN- Public Internet Multiplayer Support Beta! Join Now!

Sorry in advance because I am a bit ignorant about networking.

Will AutoLAN make things easier for me? I am looking at making a private application that connects to a local wireless network (no internet), whether that be through the general iphone settings or if the app can pick and choose a network, I am not worried either way.

Anyway once connected, can AutoLAN help me ‘talk’ to a program running on a server on the network? This server is Linux. I am only doing the Iphone side of things and I am wondering what I should be telling the other developer about how to setup his server side scripts. I gather he can use any language he pleases?

btw - this looks like a cool product, and I am sure to purchase for one of my future games anyway. [import]uid: 40116 topic_id: 19917 reply_id: 104071[/import]

do you plan on implementing a matchmaking by email addy or another identifier, so it is no longer random? [import]uid: 90610 topic_id: 19917 reply_id: 108024[/import]

Hi, I’m really interested in join to beta program to test “internet functionality”.

Regards. [import]uid: 151597 topic_id: 19917 reply_id: 108458[/import]

Great work, I’m purchasing my copy now. Any chance for the internet-enabled beta version as well? [import]uid: 6084 topic_id: 19917 reply_id: 109173[/import]

I have been working with AutoLan on and off for some time now. It’s working great for me and I am really impressed.

But now I am stuck switching the client on and off.

I have a function that should handle the closing of a client. When I try to reconnect again, I will have two servers with the same IP, retry that and there will be three and so on…

xnailbender and others have aced this, but I can’t. Reading through the thread there may have been some enhancements to the code. I am working with the 1.20 version.

Any thoughts on what I am doing wrong? Thanks for your replies.

This is my code to connect the client:

function makeClient()  
 if(isServer) then --if we were a server before, we need to unregister all the event listeners  
 Runtime:removeEventListener("autolanPlayerDropped", playerDropped)  
 Runtime:removeEventListener("autolanPlayerJoined", addPlayer)  
 Runtime:removeEventListener("autolanReceived", serverReceived) --all incoming packets sent to serverReceived  
 Runtime:removeEventListener("autolanFileReceived", autolanFileReceived)  
 serverList = {}  
 end  
 print("making client")  
  
 isLocal = false  
 isClient = true  
 isServer = false  
 clientList = {}  
 if client == nil then  
 client = require("Client")  
 end  
 client:start()  
 client:scanServers()  
  
 Runtime:addEventListener("autolanConnected", autolanConnected)  
 Runtime:addEventListener("autolanServerFound", autolanServerFound)  
 Runtime:addEventListener("autolanDisconnected", autolanDisconnected)  
 Runtime:addEventListener("autolanReceived", autolanReceived)  
 Runtime:addEventListener("autolanConnectionFailed", autolanConnectionFailed)  
end  

and this is my server code:

function makeServer()  
 if(isClient) then --if we were a client before, we need to unregister all the event listeners  
 isClient = false  
 Runtime:removeEventListener("autolanConnected", clientReceived) --all incoming packets are sent to clientReceived  
 Runtime:removeEventListener("autolanServerFound", connectionAttemptFailed)  
 Runtime:removeEventListener("autolanDisconnected", connectionAttemptFailed)  
 Runtime:removeEventListener("autolanReceived", connectionAttemptFailed)  
 Runtime:removeEventListener("autolanConnectionFailed", connectionAttemptFailed)  
  
 client:disconnect()  
 client:stop()  
 end  
  
 print("making server")  
 isLocal = false  
 isServer = true  
 isClient = false  
 serverList = {}  
 if server == nil then  
 server = require("Server")  
 end  
 server:setCustomBroadcast({"Players", defMaxNoOfClients})  
 server:startLocal()  
 Runtime:addEventListener("autolanPlayerJoined", autolanPlayerJoined)  
 Runtime:addEventListener("autolanPlayerDropped", autolanPlayerDropped)  
 Runtime:addEventListener("autolanReceived", autolanServerReceived)  
end  

This is the code to cancel the server or client, due to a timeout or request from the user:

function killServerClient()  
 print("killServerClient")  
  
 if isLocal == false then  
 if(isClient) then --if we were a client before, we need to unregister all the event listeners  
 print("Client Off")  
  
 Runtime:removeEventListener("autolanConnected", clientReceived) --all incoming packets are sent to clientReceived  
 Runtime:removeEventListener("autolanServerFound", connectionAttemptFailed)  
 Runtime:removeEventListener("autolanDisconnected", connectionAttemptFailed)  
 Runtime:removeEventListener("autolanReceived", connectionAttemptFailed)  
 Runtime:removeEventListener("autolanConnectionFailed", connectionAttemptFailed)  
  
 client:disconnect()  
 client:stop()  
 end  
  
 if(isServer) then --if we were a server before, we need to unregister all the event listeners  
 print("Server Off")  
  
 Runtime:removeEventListener("autolanPlayerDropped", playerDropped)  
 Runtime:removeEventListener("autolanPlayerJoined", addPlayer)  
 Runtime:removeEventListener("autolanReceived", serverReceived) --all incoming packets sent to serverReceived  
  
 timerActive = false  
 server:disconnect()  
 server:stop()  
 end  
 end  
  
 clientList = {}  
 serverList = {}  
 isLocal = true  
 isServer = false  
 isClient = false  
  
 storyboard.gotoScene( "mainScene", "fromLeft", 100 )  
end  

Thanks
Holger [import]uid: 88712 topic_id: 19917 reply_id: 109275[/import]

Hi holger,

I initially had the same problem, but after looking at my code I realised I wasn’t removing the correct runtime listeners when I was turning the sever on and off.

From the looks of your code above your doing the exact same thing. Your piling up the runtime listeners and not removing them correctly. I’m on my iPad right now but if you don’t get what I’m n about I will elaborate further when I’m on my pc tomorrow. [import]uid: 69826 topic_id: 19917 reply_id: 109284[/import]

So I really want to use AutoLAN for the game my company is developing, but I have a few server questions.

  1. What’s a good amount of bandwidth to start with? I know it will depend on the traffic, but is something like 10 TB complete overkill?

  2. Would a server offered by serversfree.com work or is that only for web hosting?

  3. Is there still going to be a service from M.Y. for hosting?

Thanks! [import]uid: 147314 topic_id: 19917 reply_id: 109331[/import]

@holger,

You are on the right track to remove the client listeners first before calling client:disconnect().

It’s late and been awhile since I worked on my code, but I don’t see a problem with your code.

I’m wondering if you are calling a function to display the buttons you are connecting and disconnecting the client/server with. Is it a possibility that you are creating multiple instances of the connect/disconnect button in you UI? In other words, multiple instances of the same button stacked on each other, never removing them? This would cause multiple eventListeners to be added to the button, resulting in creating multiple instances of the same runtime listeners when initiating a client or server?

I think I did this to myself without realizing it.

GL, Nail [import]uid: 106779 topic_id: 19917 reply_id: 109336[/import]

To elaborate slightly on what i was saying previously Holger, in your code you create these listeners when you create your server…

Runtime:addEventListener("autolanPlayerJoined", autolanPlayerJoined)  
Runtime:addEventListener("autolanPlayerDropped", autolanPlayerDropped)  
Runtime:addEventListener("autolanReceived", autolanServerReceived)  

But then in your “Kill server” code you remove these listeners…

Runtime:removeEventListener("autolanPlayerDropped", playerDropped)  
Runtime:removeEventListener("autolanPlayerJoined", addPlayer)  
Runtime:removeEventListener("autolanReceived", serverReceived)  

As you can see you aren’t removing the same listeners… Therefore if you were to create the server again after calling your kill server code you would have “stacked” runtime listeners for your server, resulting in multiple showing up when scanning for a server.

I had the exact same problem when i was creating a remote for a new app I’m doing, but once i redid all my runtime listeners for both the client and server it all worked perfectly. [import]uid: 69826 topic_id: 19917 reply_id: 109338[/import]

@TandG and @xnailbender

thank you so much for your help! All is working now.

Fact is: I was sloppy copying and pasting the code. I really don’t know how I could have overlooked this … but I did for nearly 2 days now :frowning:
[import]uid: 88712 topic_id: 19917 reply_id: 109340[/import]

Glad you got it working!

Don’t worry, copying and pasting fails happen to the best of us… repeatedly… lol :slight_smile: [import]uid: 69826 topic_id: 19917 reply_id: 109344[/import]

@holger
See my comment here
http://developer.anscamobile.com/forum/2012/05/28/luasocket-issues-servers-0#comment-109109

Maybe that is the issue for you? [import]uid: 64174 topic_id: 19917 reply_id: 110118[/import]

@Satheesh

Thanks for the input, but I do not think that this is it as I am on wifi for both client and server. [import]uid: 88712 topic_id: 19917 reply_id: 110119[/import]

Has anyone had problems to get the client to run on Android?

On my Android device (Samsung Galaxy S) I can only run AutoLan as a server. In client mode it will not find the server.

I also tried the pong example: server works, client does not find server.

I’ve tried with these permissions in config.lua:

 androidPermissions =  
 {  
 "android.permission.ACCESS\_FINE\_LOCATION",  
 "android.permission.INTERNET",  
 "android.permission.CHANGE\_NETWORK\_STATE",  
 "android.permission.CHANGE\_WIFI\_MULTICAST\_STATE",  
 "android.permission.CHANGE\_WIFI\_STATE"  
 }  

I guess it’s the phone, but if anyone has suggestions on how to fix this I would be very happy to hear them :slight_smile:

Thanks Holger

Edit: Forgot to mention. I am using wifi and on iOS (iPhone4, iPad2) this is working. [import]uid: 88712 topic_id: 19917 reply_id: 110117[/import]

OK found it. There was a service running pre installed “SADM Security”. After stopping the service the client can find the server.

Does anyone know, if this is commonly installed on Android, or Samsung phones?

Edit: This software came from my phone company (o2 Germany) and seems to be standard for them. Maybe they do this to stop people from using VOIP.

Does anyone know if this type of software / firewall is widely used around the world? If it is then it would produce a lot of 1 star reviews, even if you write about it in the app description. [import]uid: 88712 topic_id: 19917 reply_id: 110138[/import]

Are there still openings for the internet multiplayer beta? I’d really like to get in. Or at least getting the php script. [import]uid: 147314 topic_id: 19917 reply_id: 112086[/import]

Hi MYDev

I’m interested in your autolan product and I’ve skimmed through the API doc you’ve posted on your site, but was not able to understand if some features I need are available/possible or not. I understand you’ve ran an internet version beta until recently, has it been released or still in beta?
how can I join if still in beta?

I’m looking to have a multiplayer version of Traveler with up to 4 players playing on same map.
Can autoLan support a scenario where players are connected to the web in different geo locations using either wifi or 3g connection?
Where can I find some more info on the server capabilities? for example, can the server code/script support sending files to players?
Can I customize it to allow play by invite as well as open games?

Thanks [import]uid: 118978 topic_id: 19917 reply_id: 113499[/import]

Hello, I also would like to participate in internet multiplayer beta.
Is it possible?
Or, when will it be available for customers? [import]uid: 87869 topic_id: 19917 reply_id: 113755[/import]

The last post here from M.Y. Developers was back at the end of April, and he hasn’t replied back to any of my direct emails. Has this been abandoned or placed in stasis for another project? Has anyone gotten a hold of him/them since that last post?
[import]uid: 6084 topic_id: 19917 reply_id: 113777[/import]

Hello All,

Just an update on the state of our Autolan project. As you know the internet version has been in beta testing for some time now and we have run into a few problems on various internet setups that will probably require some large server network across the globe in order to meet our low latency requirement. This is just not feasible at the moment. At times it just is not possible for some reason or another to do a UDP punchthrough and communication becomes impossible without centralized server(s).

We are now going to give Autolan to the community. At its current state it is a fully functional local networking solution that we feel everyone can use and learn something from. Get it from the code exchange here:
http://developer.coronalabs.com/code/autolan

You will be able to use AutoLan in your commercial as well as free products but you cannot sell just the library itself. We also ask that any updates you make you do as a fork on the main github repository.

We hope you like it and it helps you speed up your development.

Regards,
M.Y. Developers

[import]uid: 55057 topic_id: 19917 reply_id: 115219[/import]