Problem Connecting to Vivox Servers

Hi there,

We are having the issue below with Vivox and cannot seem to get to a resolution:


InvalidOperationException: Operation is not valid due to the current state of the object.

VivoxUnity.Client.CheckInitialized () (at C:/UnityProjects/Projectname/Assets/Vivox/Runtime/VivoxUnity/Client.cs:51)

VivoxUnity.Client.GetLoginSession (VivoxUnity.AccountId accountId) (at C:/UnityProjects/Projectname/Assets/Vivox/Runtime/VivoxUnity/Client.cs:168)

VivoxVoiceManager.Login (System.String displayName) (at C:/UnityProjects/Projectname/Assets/Vivox/Samples/TanksUnityGameSample/Scripts/Vivox/VivoxVoiceManager.cs:186)

LoginScreenUI.LoginToVivox () (at C:/UnityProjects/Projectname/Assets/Vivox/Samples/TanksUnityGameSample/Scripts/Vivox/UI/LoginScreenUI.cs:109)

LoginScreenUI.LoginToVivoxService () (at C:/UnityProjects/Projectname/Assets/Vivox/Samples/TanksUnityGameSample/Scripts/Vivox/UI/LoginScreenUI.cs:80)

LoginScreenUI.b__7_1 () (at C:/UnityProjects/Projectname/Assets/Vivox/Samples/TanksUnityGameSample/Scripts/Vivox/UI/LoginScreenUI.cs:33)

UnityEngine.Events.InvokableCall.Invoke () (at <07c89f75206


Any thoughts on how we might be able to solve this? Really appreciate some support!

Best,

Hi Metaverse1234,

The error you’re running into can occur for two reasons:

  • The client has not been initialized
  • The program is running on an unsupported platform

Of the two, the former is the most likely issue that you’re running into. It does appear that you’re attempting to implement TUGS (Tanks Unity Game Sample) which was deprecated in the latest version of Vivox (5.15). Before we go too far into troubleshooting this implementation, I’d recommend that you look into upgrading to Vivox 5.15 and trying out our ChatLobbySample instead. If you’d like to continue troubleshooting the TUGS sample, please let me know the following:

  • What version of Unity you are running
  • What version of the Vivox SDK is enabled
  • What platform you are developing on
  • Have you made any changes to the TUGS project?
  • How did you download the sample?

Without the information above, I can only offer suggestions on where to look, but here is my current hypothesis:

I think that the error you’re receiving is due to the Vivox client being uninitialized. As of Vivox 5.14.2, I see that LoginScreenUI.cs attempts to login to Vivox during an Awake() call in its parent object. However, the client does not call Initialize() until VivoxManager.cs has reached its Start(). As such, it seems quite likely that the Vivox client has not initialized in time.

Possible Workarounds:

  • Add waiting logic to LoginScreenUI.cs to ensure VivoxManager.cs has run its Start() code.

  • Handle the exception then:

  • Sleep and try again or…

  • Create your own call to Initialize()

Again, if possible, I’d highly recommend trying out our new samples and updating to Vivox 5.15. Let me know how you’d like to proceed from here and if you have any follow-up questions.

Regards,
-Kip