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.
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?
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. 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.
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.
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 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.
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:
Start the ‘server sandbox’ project on the single scene that’s in there. Observe that a ‘listening’ message is logged to the console
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
Click the ‘send message to server’ button and observe that a warning ‘Attempt to send to not connected connection’ is sent to the console