LLAPI problems when using two editor projects with same code

Would someone be able to confirm a bug(s) with LLAPI and two separate projects for me?

I’m not sure, but it appears that I hit a bug when using client and server split across two scenes and editor instances.

I get errors on NetworkTransport.Send() ONLY when trying to make a dedicated server. Connect, config, init, etc. all return successful and I have no other errors. But when I try to use NetworkTransport.Send() I see this on the client:

Attempt to send to not connected connection {1}
UnityEngine.Networking.NetworkTransport:Send(Int32, Int32, Int32, Byte[ ], Int32, Byte&)

And error gets set to: Error: WrongConnection

_connectionID = NetworkTransport.Connect(_hostID, serverHostname, port, 0, out error);
(snip)
NetworkTransport.Send(_hostID,  _connectionID,  channelID,  writer.AsArray(), (int)writer.Position,  out error);

However, connection, channel and host ID all appear valid. If I put both server and client scripts in the same scene and editor instance, it works. Yet once moved to a different editor process (client / server), it gives me errors. The Assets folder is symlink between the both projects so all the code is the same data.

1 Like

Is anyone able to test and confirm this? As I said it works in the same scene, but when I use two different projects then it fails. This is a bug and not by design right? :slight_smile:

I am not sure about this, but every project seems to generate its own kind of project key which must match in order to connect properly. Thus you can only connect to clients that originate from the same build/project

Note that this is just what I have understood, I may be completely wrong here so please correct me if thats the case.

I knew that they do a CRC check on scripts for HLAPI stuff, but the LLAPI shouldn’t be effected by it… at least I think. :slight_smile: Using HLAPI you get CRC mismatch if scripts are out of sync when you connect. But that’s not the problem here since I can connect in both cases. It just appears the NetworkTransport.Send() is the problem.

same problem

I’m assuming this is not a 5.2 specific problem as UNet was not modified for 5.2. Removing version from title (unless you can show regression) and shifting to network forum.

Edit: Wrong statement, UNet had no real additions for 5.2 just bug fixes.

Have you received connect event before sending?

1 Like

You’re right! Forgot to add receive…
Now if I could only get the the webgl client to talk to the editor server.
Has that been tested and known to work?

I did get it working in 5.1 so this was a 5.2 issue.

Yes I did, please read the first post.

“Connect, config, init, etc. all return successful and I have no other errors.”

@terravires can you attach you project here? I will take a look. or report bug please (with reproduction steps) and send here bug number

@mike950 you can take a look on llapi project from UNet Sample Projects - Unity Engine - Unity Discussions it works for webgl client and pc-server

Thank you for identifying a bug “terravires”. same problem. +++++++++
LLAPI problems when using two editor projects with same code

Did you manage to get this to work across multiple editors? I’m struggling with the same scenario now.

Yeah I did, I quit using UNET and made my own with raw .Net sockets. :smile:

1 Like

I quit using NetworkTransport.Send and used the NetworkClient & NetworkServer instead. I only needed to send simple messages across the network to capture user details in a seperate iPad app before playing a VR game on a machine during exhibitions.

I’ve a strong feeling it’s a security feature hidden away in the LLAPI somewher that’s stopping it across different builds.

Guys we are not wizards, without project or bugs opened (with repro steps) we cannot identify your problems… :frowning:

Sorry about this :frowning:
Alex

I appear to be having the same problem. The client says it’s connected, but ‘connected’ debug message is never logged on the server. Furthermore, when I send a message I get ‘attempt to send to not connected connection’. I’ve made two small projects showing the problem, since they’re too large to attach to this post please find them at this link (click the download button at the top right): https://drive.google.com/file/d/0B7MVH02QgFwda0RJTlV6WHp1UXc/view?usp=sharing

Repro steps:

  1. Start the ‘server sandbox’ project on the single scene that’s in there. Observe that a ‘listening’ message is logged to the console
  2. In a separate editor, start the ‘Unity sandbox’ project on the single scene that’s in there. Observe that a ‘connected’ message is logged to the console, BUT no corresponding ‘client connected’ message is logged on the server
  3. Click the ‘send message to server’ button and observe that a warning ‘Attempt to send to not connected connection’ is sent to the console

@jamy015 I have same issue as you. Have you found solution, please help me.

@Tkaewkunha I haven’t found a solution, sadly. Hopefully, someone from Unity can look at the projects I posted and weigh in on the issue.

@aabramychev

Bump. Anyone still got the same problem or is this resolved?