Search Unity

Can a non-Unity app "listen" to a Unty network?

Discussion in 'Multiplayer' started by bigkahuna, Jan 16, 2009.

  1. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I have a Unity app that has a moving object, and attached to that object is a Network View that observes the object's transform. This Unity app is also set up to be the server.

    I'm able to set up other Unity apps that connect to the network and can receive the server's object transform info, no problem. But is it possible to create a different application, say with Visual Basic, that can watch read that transform data from the server? If so, how is this accomplished?
     
  2. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Yes, but you'll have to rebuild/reconstruct the raknet implementation of unity and this'll be a bit nasty. It has been done/attempted by others on the forum though (zumwalt?)
     
  3. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    So there isn't any way of doing this without modifying Unity or our Unity application?
     
  4. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Get ahold of either the masterserver code or Raknet 3.001 from Jenkins Archives, there is no wrapper for Raknet for any other language at the moment (like old vb), but there is a wrapper written and hiding around for .Net against the 3.001 base, it is incomplete but enough to work in .Net to get the basic information from the RPC call. "listening" would better be done as "forwarding", you send your information to a master server that then forwards it on to another server. Unity internally only allows for 1 server connection, you can do packet interception and cloning if you like via a linux box with packet sniffers, but thats rather useless and overblown, would take months to properly configure.

    I am not sure what you are trying to actually accomplish, but what you can do is this:

    Unity -> Raknet -> Raknet -> Clients

    To achieve this, you have Server 1 listen for connections, server 1 connects to server 2 much like a client connects to the server, all packets coming in from the client are then broadcast to server 2, server 2 then does with them what you want and sends them to the clients.

    Much like the example I posted which is around the forums about multi server configuration for clustering example that uses pure RakNet. This is much easier to draw on paper or in Visio to explain than it is in pure text. Can easily do a mock up to show this in action. (just not until later tonight, very busy at the moment)
     
  5. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Thanks Zumwalt. I'm still an absolute noob when it comes to networking. The fact that I've been able to create a Unity application that can network with other Unity applications is more a testament to Unity's simplicity than to any skills I may have. I'm still in the early investigative stage of this potential project so all I need to know at this point is that it is possible. Thanks!