Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

LLapi problems on Android

Discussion in 'Multiplayer' started by cjf93, Sep 13, 2016.

  1. cjf93

    cjf93

    Joined:
    Apr 28, 2014
    Posts:
    14
    Hi i'm new here, so i'll try my best to post this properly.

    I have a working demo of a Server side broadcasting and Client reciving the message parsing and using the info to connect to the server.
    (NetworkTransport.Init(), NetworkTransport.StartBroadcastDiscovery(id, .., ..) ,i can go on detail on this if you need it)

    When I try the same with PC as server, Android as Client, if the Android device act as a client, he don't recieve the broadcast from the server but i can connect manually(i know the IP of my local machine) and i can send and recieve messages.(This is okay except for the broadcast problem)

    If the Android act as Server and PC client, the PC recieves the broadcast but can't connect to the Android neither automatically nor manually.

    I searched for problems with the Network and Unity but i only found some people talking about the Android Manifest but not saying exactly what to do about. If you can point me to the correct direction with this i would apreciate.

    I can't test with 2 androids at the same time for now but it's the main goal of the project.

    Edit: I tested with 2 Androids an the results are bad too.
    The client didn't recieve the broadcast and if I try the mnual connection the server didn't recieve the connect event.

    Help please!

    Using Unity 5.3.5f1

    Thanks and sorry for my poor english.

    EDIT I switched to unity 5.4 to test about Android 6 permisions and isn't working too. I posted the same question on stackoverflow and someone tested too and seems to be a bug. I will report this bug ASAP
     
    Last edited: Sep 29, 2016
  2. cjf93

    cjf93

    Joined:
    Apr 28, 2014
    Posts:
    14
    I edited the post with more info.
     
  3. Optimus_Prime

    Optimus_Prime

    Joined:
    Apr 15, 2015
    Posts:
    34
    I followed this link line by line, built 1 for windows, 1 for android, installed it on my android phone and clicked the Send Message button and I saw the message come through to the windows machine debug console,

    robotmonkeybrain.com/good-enough-guide-to-unitys-unet-transport-layer-llapi/

    I copied every line from that article and it worked 1st time. I am struggling now with custom events and creating and joining rooms.
     
  4. cjf93

    cjf93

    Joined:
    Apr 28, 2014
    Posts:
    14
    I did a proyect few time ago and i used that guide and other guides to create the network and it worked fine on Android PC and IOs aswell, but in this proyect i literally copy-pasted the code of my other project and didnt work on Android, the error its mine but i dont know where to look exactly :(
     
  5. cjf93

    cjf93

    Joined:
    Apr 28, 2014
    Posts:
    14
    What are you testing, PC as Server , and Android as Client?
     
  6. Optimus_Prime

    Optimus_Prime

    Joined:
    Apr 15, 2015
    Posts:
    34
    Yep PC as Server and Android As Client.
    I am trying to make an authoritative server, the server (unity exe) will be hosted in the cloud somewhere, All my clients will have that IP address and attempt to login, check the leaderboard, start a game etc etc.

    The clients will be "dumb" meaning no hectic logic will be on them, they will send info to the server and the server will reply. no transform or location needed. I Just need to send ints to the server and get ints back.

    I am assuming the LLAPI is the correct way to do this....Im not sure...