+ Reply to Thread
Results 1 to 5 of 5

Thread: ES5 won't connect when Unity3 program runs in MonoDevelop

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ES5 won't connect when Unity3 program runs in MonoDevelop

    I have a working Unity 3 project (all code in C#, running on Windows 7) which connects to a ES5 lobby, accesses Room Variables, and passes EsObjects successfully.

    However, when I attempt to debug the project, by starting MonoDevelop then hitting F5 (to launch and connect to a Unity Editor), my call to ElectroServer.Engine.Connect does not call back the delegate I've associated with ElectroServer.Engine.ConnectionResponse

    It doesn't hang -- it just doesn't connect. But if I run the exact same project from inside Unity, it works consistently.

    Has anyone else reported or encountered this problem? Or better yet, has anyone figured out how to make it work?

    I like having a debugger... but I can't use it and connect to ElectroServer!

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    I haven't tried debugging. I did run into some trouble connecting from inside the Unity editor when I had the build configured for web player, until I got exactly the right IF statement around the prefetch line. What build are you targeting when you debug?
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Electrotank jobem's Avatar
    Join Date
    Apr 2004
    Posts
    996
    Thanks
    0
    Thanked 24 Times in 17 Posts
    evilregis,

    We haven't heard of any issues with this yet. But then again not everyone uses the same IDE. Is it possible that the debug socket is conflicting with the ES socket? It is a shot in the dark, but changing the port you are using may have an effect.
    ------
    Jobe Makar
    @jobemakar
    http://www.electrotank.com

    YouTube ElectroServer video tutorials
    http://www.youtube.com/user/ElectrotankInc

  4. #4
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey Teresa and Jobe,

    I tried switching ElectroServer's BinaryTCP port from 9899 (the default I was using) to 2020, and changing the port in Unity's Security.PrefetchSocketPolicy call and ElectroServer's AvailableConnection constructor. It didn't make a difference.

    I'm using MonoDevelop the way the Unity guys say to set it up... basically I run MonoDevelop (special Unity version), do whatever to my source files, then I hit debug. This launches a new copy of the Unity Editor, which I can then run. So I'm not targetting any particular version, web or standalone -- I'm just targetting the Editor Build. I don't think MonoDevelop lets you do anything else.

    Please note that I've been able (when not running through MonoDevelop) to connect with my current project in the editor, in a web client, and in standalone Windows .EXE builds. So it shouldn't have anything to do with my project settings.

    I'm also able to debug the rest of this project using MonoDevelop just fine. I can set breakpoints, watches and step through the code correctly. Everything functions like it does when I don't use the debugger. The only difference is that when I do use the debugger I don't get my ConnectionResponse callback after calling ElectroServer.Engine.Connect. I also don't get a GenericErrorResponse.

    Have you guys tried running any of your working Unity test projects through the Unity debugger?

  5. #5
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    I run my Unity projects from inside the Unity editor with no problem. I haven't tried using the debugger (haven't had time to do anything with Unity in almost a week). Have you tried commenting out the prefetch line to see if that helps you? Also, I know that some IDEs need to have a security setting toggled to allow sockets to be used at all. I have no experience with one of these myself, but one of our forum threads was about IntelliJ not connecting and that turned out to be the reason.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts