Search Unity

Lidgren.Network

Discussion in 'Multiplayer' started by KeviN8543, Mar 24, 2015.

  1. KeviN8543

    KeviN8543

    Joined:
    Nov 19, 2014
    Posts:
    6
    Hey,
    I'm trying to add a multiplayer feature to my unity3d game using the lidgren networking library.
    When I call client.Start() in my unity3d project I get this runtime error:

    MissingMethodException: Method not found: 'System.Threading.Monitor.Enter'.
    Lidgren.Network.NetPeer.Start () (at /Users/{username}/Projects/{projectname}/Lidgren.Network/NetPeer.cs:149)
    ServerHandler..ctor () (at Assets/Scripts/ServerHandler.cs:23)
    ServerHandler.sharedInstance () (at Assets/Scripts/ServerHandler.cs:33)
    GameManager.Awake () (at Assets/Scripts/GameManager.cs:28)

    I'm working on Mac OS X Yosemite btw.
    Any clue?
     
  2. Mabenan

    Mabenan

    Joined:
    Feb 7, 2014
    Posts:
    132
  3. KeviN8543

    KeviN8543

    Joined:
    Nov 19, 2014
    Posts:
    6
    @Mabenan When I tried to set the Net framework in the Lidgren project to 3.5 It didn't compile.
     
  4. Mabenan

    Mabenan

    Joined:
    Feb 7, 2014
    Posts:
    132
  5. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    456
    That's odd, I don't remember if I encountered that when porting Lidgren to Unity. I put it in a repo when finished but it lacks the encryption classes as, for some reason, when I forked them they were missing.

    Feel free to use this if you still haven't found a solution https://github.com/HelloKitty/Lindgren-Unity-Port
     
  6. KeviN8543

    KeviN8543

    Joined:
    Nov 19, 2014
    Posts:
    6
    @Mabenan version did help! Thanks guys