PUN+ and IOS connection ERROR to photoncloud

Hi.

We've just bought the PUN+ plugin in order to use photon cloud with unity free, but things aren't going well... Pearhaps a matter of missunderstanding on my part.

On windows and Mac, everything goes fine. But that was true for the PUNfree plugin too.

After compiling for the IOS simulator, the game is unable to connect to photoncloud. XCODE runtime error (sumarizing):
Coonect() failed: System.EntryPointNotFoundException:egconnect at (wrapper managed-to-native)

ExitGames.Client.Photon.SocketUpdateNativeStatic:egconnect (string) at

ExitGames.Client.Photon.SocketUpdateNativeStatic.DnsAndConnect () [0x00000] in <filename unknown>:0
...
Error status code: ExceptionOnConnect

The game also connects to a web server via WWW class, and it does it fine. So the problem does not look to be in the connection or the DNS.

Any tip? Any known issue connecting to photoncloud from IOS with PUN+? Do you need a piece of code in order to look further on it?

Thanks in advance,

--- David ---

Comments

  • I'm sorry you ran into this issue. I didn't get this one yet but honestly: I am not sure if we really tested this in the simulator.
    Does it work for you on an actual device?

    Maybe the native library is not working in the simulator. It would be a bummer but possible.
    Please let me know which Unity version you use and which Simulator version. I can try to replicate the issue and find out more.
  • Hi Tobias. Thanks for your fast answer.

    I've not tested it on a real device yet.

    The versions I'm working with are:
    - OS X Mavericks (10.9)
    - IOS Simulator 7.0
    - Unity 4.2.2f1 (I didn't upgrade to 4.3 yet since I've seen some issues related to 4.3 and PUN+)

    Anyway, Is there any IOS specific advice I should take into account? Pearhaps a matter importing the plugin correctly? By the way, we are using unityscript (aka "javascript"), not C#

    Thanks again for your support and I'll keep waiting for your answer.
  • It seems the native plugin wasn't found or couldn't be used. We will try to evaluate if this is a simulator issue or something else.
    As we didn't have the issue yet, the simulator might be causing it. Or Mavericks. Or iOS 7. I'm not sure but will check in this order.

    I don't think UnityScript should be a problem in this context but good to know!
    The PUN+ issues with Unity 4.3 should be Android-only. But of course you might be targeting that platform, too.

    Please update us when you found the time to check on device. Just in case.

    Edit:
    About your suggestion it might be the import: Usually all importing is automatic. But to make sure, check if the *.so file is in Assets\Plugins\iOS\.
    And: Which stripping level do you use? I usually use "byte code slow" and DotNet 2.0 subset.
  • Hi again Tobias.

    btw, my name is David, just for you to know.

    I've checked the plugins/IOS directory, and there is only one file: libPhotonSocketPlugin.a (there is libPhotonSocketPlugin.so on android directory).

    Umm.. Scripting level is disbled. Script Call Optimization ys "Slow and Safe". And Api compatibility is DotNET 2.0 subset.

    I hope this help.

    Thanks again mate, for your dedication. Best regards,

    --- David ---
  • By now, I think we got an explanation: The simulator needs a different build of the native library. All ARM builds are in the .a file but not the x86 one. Apple doesn't like you to include that in libraries which get deployed to the devices (maybe for file-size reasons).

    While we can build a special x86 build for the simulator, I don't know if Unity supports this in any way. In worst case, you would have to copy files around and things could become messy when you have 2 .a files and don't know which one is for the device.

    Thinking about this: Are you able to use a device? Usually, the simulation is pretty crappy and you also don't have the same input support (missing touchscreen and gyros, etc). In terms of testing you get the best results on the device.
  • Hi again Tobias.

    Well... Thanks for your answer. Since the simulator is not the best option, it's a comfortable one for testing and development. You can easily test your screens, menus, etc.

    Ok. I'll go with the device option from this point, since we really NEED multiplayer option.

    Thanks again and best regards ;)

    --- David ---
  • David,
    I just can't promise to find a seamless solution for it at the moment (as always: busy) but you have a valid point about testing menus, etc.

    How about this:
    If you are fine to exchange the two different .a files on demand yourself, we could create the library for the simulator and send it to you.
  • Hi again Tobias.

    That would be great!

    I have no problem in changing myself the library while testing process (since it's faster to use the simulator). As long as I could trust (in a reasonable way) that things working fine with one library, will do it with the another one on the device.

    Thanks a lot for your support. I really apreciate it.

    Best regards,

    --- David ---
  • David,
    We didn't forget you. The iOS build is now done and we test it as replacement for the existing .a library now in PUN+ and the simulator. I hope I can send you the link to the lib tomorrow.

    Update: The new build still gives us the same issue. We will work on that today.
    Update: Mailed you the download.
  • Hi again Tobias.

    I received your eMail and downloaded the library for the simulator... But i fail in understand the process to have it working.

    Here is a copy of the eMail I've sent you:
    ===============================================================

    Hi Tobias.

    First of all... Thanks for your support and effort, mate :)

    I've downloaded the library, and tried to follow the instructions on the web page. But, unfortunately, it didin't worked :/

    A problem on my side and lack of understanding touching the PostprocessBuildPlayer.sh file, for sure.

    I've copied the following sh code:
    ==================================

    #!/bin/bash
    cp -fR ./iOS\ Build/Libraries ~/Documents/Xcode/my-project/
    cp -fR ./iOS\ Build/Data ~/Documents/Xcode/my-project/
    rm file.tmp
    awk '
    {
    if ($0 == "#if !(TARGET_IPHONE_SIMULATOR)" && NR == 9) {
    getline var1;
    getline var2;
    printf "%s\n%s\n%s\n", var2, $0, var1 >> "file.tmp"
    } else if (NR == 32) {
    printf "#endif // !(TARGET_IPHONE_SIMULATOR)" >> "file.tmp"
    printf "\n%s\n", $0 >> "file.tmp"
    } else if ($0 == "#endif // !(TARGET_IPHONE_SIMULATOR)" && NR > 32) {
    } else {
    print $0 >> "file.tmp"
    }
    }' ~/Documents/Xcode/my-project/Libraries/RegisterMonoModules.cpp
    mv file.tmp ~/Documents/Xcode/my-project/Libraries/RegisterMonoModules.cpp

    ==============================================

    I've cutted the first 2 lines (cp -fR ...) because i don't see where they fit, and I've replaced ~/Documents/Xcode/... with my project "RegisterMonoModules.cpp" path.

    Then, I've renamed the device library .a, and replaced it with the one you sent me.

    It didn't worked. I know I'm doing something wrong, but I fail in seeing where is the error.

    Could you point e in the right direction, please? Any idea?

    By the way... We've just provisioned the app for one iPhone device (a real one) and the photon library works like a charm :)

    Thanks again and I'll keep waiting for your answer. As soon as we had this working, I could post it on the forums, in order for others to know it.

    Best regards,

    --- David ---
    =============================================================================

    So, I suppose i've failed in understanding what the awk script does.

    Thanks and best regards,

    --- David ---
  • Hi David.

    Have you followed the directions on http://tech.enekochan.com/2012/05/28/us ... s-plug-in/ ?

    They are critical to get PUN+ working on iOS simulator. Otherwise PUN+ will only work on device and in Unity itself, but not on iOS simulator.
  • Hi Kaiserludi.

    As I said on my last post, the error may be on my lack of understandig of such instuctions. Let me go a bit further....

    As I readed them, I supposed that I could use the awk script (on that page) in order to avoid having to modify the lines all the time. I didn't see on the script any reference to the libraries, so I supposed that the "PostprocessBuildPlayer" would work receiving, through standar input, the lines with the external libraries... And unity would send them.

    If that's not the case... What changes should be made on that script in order to get PUN specific library loaded? Could sou enlight me?

    Thanks for your answer and help ;)

    --- David ---
  • Hi David,

    First it can be easier not to use the script for now but do the things manually. Just change the file RegisterMonoModules.cpp in the way described on the webpage. Be aware though, that a code in the file generated by the latest Xcode is a bit different from the code given in the article. Only adjust the script after checking out that manual fix works.