Placeholder-Software / Dissonance

Unity Voice Chat Asset
71 stars 5 forks source link

[bug] Error(s) occur when using the HLAPI in Server Only mode. #21

Closed timforever closed 7 years ago

timforever commented 7 years ago

Context

Error(s) occur when using the HLAPI in Server Only mode.

Expected Behavior

A user should be able to start Dissonance using HLAPI in Server Only mode without seeing error in the Unity Console, and then be able to use voice chat in connecting clients as would be normally expected.

Actual Behavior

Prior to a client connecting to the server, the following error message is repeatedly produced:
NullReferenceException: Object reference not set to an instance of an object
Dissonance.Integrations.UNet_HLAPI.HlapiCommsNetwork.PreprocessPacketToServer (ArraySegment`1 packet) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiCommsNetwork.cs:140)
Dissonance.Integrations.UNet_HLAPI.HlapiClient.Send (ArraySegment`1 packet, Byte channel) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiClient.cs:60)
Dissonance.Integrations.UNet_HLAPI.HlapiClient.SendReliable (ArraySegment`1 packet) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiClient.cs:50)
Dissonance.Networking.BaseClient`3[Dissonance.Integrations.UNet_HLAPI.HlapiServer,Dissonance.Integrations.UNet_HLAPI.HlapiClient,Dissonance.Integrations.UNet_HLAPI.HlapiConn].SendReliableDataPackets () (at Assets/Plugins/Dissonance/Core/Networking/BaseClient.cs:179)
Dissonance.Networking.BaseClient`3[Dissonance.Integrations.UNet_HLAPI.HlapiServer,Dissonance.Integrations.UNet_HLAPI.HlapiClient,Dissonance.Integrations.UNet_HLAPI.HlapiConn].Update () (at Assets/Plugins/Dissonance/Core/Networking/BaseClient.cs:153)
Dissonance.Networking.BaseCommsNetwork`3[Dissonance.Integrations.UNet_HLAPI.HlapiServer,Dissonance.Integrations.UNet_HLAPI.HlapiClient,Dissonance.Integrations.UNet_HLAPI.HlapiConn].Update () (at Assets/Plugins/Dissonance/Core/Networking/BaseCommsNetwork.cs:143)
Dissonance.Integrations.UNet_HLAPI.HlapiCommsNetwork.Update () (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiCommsNetwork.cs:32)

After a client connects, a new but similar error appears:

NullReferenceException: Object reference not set to an instance of an object
Dissonance.Integrations.UNet_HLAPI.HlapiCommsNetwork.PreprocessPacketToClient (ArraySegment`1 packet, HlapiConn destination) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiCommsNetwork.cs:109)
Dissonance.Integrations.UNet_HLAPI.HlapiServer.Send (ArraySegment`1 packet, HlapiConn connection, Byte channel) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiServer.cs:87)
Dissonance.Integrations.UNet_HLAPI.HlapiServer.SendReliable (HlapiConn connection, ArraySegment`1 packet) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiServer.cs:77)
Dissonance.Networking.BaseServer`3[Dissonance.Integrations.UNet_HLAPI.HlapiServer,Dissonance.Integrations.UNet_HLAPI.HlapiClient,Dissonance.Integrations.UNet_HLAPI.HlapiConn].NetworkReceivedPacket (HlapiConn source, ArraySegment`1 data) (at Assets/Plugins/Dissonance/Core/Networking/BaseServer.cs:130)
Dissonance.Integrations.UNet_HLAPI.HlapiServer.OnMessageReceivedHandler (UnityEngine.Networking.NetworkMessage netmsg) (at Assets/Dissonance/Integrations/UNet_HLAPI/HlapiServer.cs:40)
UnityEngine.Networking.NetworkConnection.HandleReader (UnityEngine.Networking.NetworkReader reader, Int32 receivedSize, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs:468)
UnityEngine.Networking.NetworkConnection.HandleBytes (System.Byte[] buffer, Int32 receivedSize, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs:424)
UnityEngine.Networking.NetworkConnection.TransportRecieve (System.Byte[] bytes, Int32 numBytes, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs:576)
UnityEngine.Networking.NetworkServer.OnData (UnityEngine.Networking.NetworkConnection conn, Int32 receivedSize, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServer.cs:753)
UnityEngine.Networking.NetworkServer+ServerSimpleWrapper.OnData (UnityEngine.Networking.NetworkConnection conn, Int32 receivedSize, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServer.cs:1851)
UnityEngine.Networking.NetworkServerSimple.HandleData (Int32 connectionId, Int32 channelId, Int32 receivedSize, Byte error) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServerSimple.cs:384)
UnityEngine.Networking.NetworkServerSimple.Update () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServerSimple.cs:248)
UnityEngine.Networking.NetworkServer.InternalUpdate () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServer.cs:705)
UnityEngine.Networking.NetworkServer.Update () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServer.cs:655)
UnityEngine.Networking.NetworkIdentity.UNetStaticUpdate () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkIdentity.cs:1088)

Steps to Reproduce

This can be reproduced by running the DissonanceHlapiDemo scene from the Dissonance package from the Unity store, and using the Server Only mode.

Your Environment

martindevans commented 7 years ago

Hi Tim,

Dissonance doesn't currently support dedicated server mode - the server must also be a client. The null reference here is the server system looking for the local client and failing to find it.

Someone else actually requested this feature just a couple of days ago and we have it implemented (it won't be in the next release, but it should be in the one after that). If you send me your invoice number (martin@placeholder-software.co.uk) I can send you a patched version of Dissonance including the dedicated server support.

martindevans commented 7 years ago

Hi Tim. I've just sent out the version which includes dedicated server support to the testing group (which I believe you're included in).

For anyone else coming across this issue feel free to contact me with your invoice number to get that version, or just wait for the release on the Unity store (planned for 1 week from now).

martindevans commented 7 years ago

Dissonance 1.0.6 just went live on the asset store. That includes the dedicated server support requested (currently HLAPI/LLAPI only) so I'll close this issue - of course feel free to re-open it if things aren't satisfactory.