Hi there!
I have been using Photon for quite some time now for "common" stuff, but now things are getting a bit dirtier.
So, forum to the resque :)
I have been trying to connect to two separate rooms on the same server from the same client and I'm receiving the following error when trying to create the second room.
Failed parsing address:
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2081)
ExitGames.Client.Photon.IPhotonSocket:Connect() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/IPhotonSocket.cs:105)
ExitGames.Client.Photon.SocketUdp:Connect() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/SocketUdp.cs:63)
ExitGames.Client.Photon.EnetPeer:Connect(String, String, Object) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:269)
ExitGames.Client.Photon.PhotonPeer:Connect(String, String, Object) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1263)
Photon.Realtime.LoadBalancingClient:ConnectToGameServer() (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:878)
Photon.Realtime.LoadBalancingClient:OnStatusChanged(StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2566)
ExitGames.Client.Photon.<>c__DisplayClass105_0:b__0() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:907)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:431)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1596)
Photon.Voice.Unity.VoiceConnection:Dispatch() (at Assets/Photon/PhotonVoice/Code/VoiceConnection.cs:363)
Photon.Voice.Unity.VoiceConnection:FixedUpdate() (at Assets/Photon/PhotonVoice/Code/VoiceConnection.cs:346)
Backstory:
What I'm trying to do exactly is to have two simultaneous connections from the same client to two different rooms on the same Loadbalancing (self hosted) server instance. One connection would be to allow Unity stuff to work (like RPCs or PhotonView synchronizations) and the other one would be for the Voice Chat.
For the first connection I'm using PUN, since it seems to be a nice wrapper for the LoadBalancingClient which as far as I see, does not leak settings, connections or other stuff to the Voice Clients. Long story short, after customizing the settings, versions and the rest, I connect to the server (not via ConnectUsingSettings), create a room and join it. Everything works fine. I can send RPCs and sync PhotonViews normally.
The problem arises when I try to create a new room for the voice chat.
Upon joining the room, the VoiceConnection class takes charge and tries to connect to the same server using the ConnectUsingSettings method, but I override the settings myself with the following
new AppSettings()
{
Port = 0,
Protocol = ConnectionProtocol.Udp,
Server = PhotonNetwork.ServerAddress,
NetworkLogging = DebugLevel.ALL,
AppVersion = PhotonNetwork.NetworkingClient.AppVersion,
AppIdRealtime = PhotonNetwork.NetworkingClient.AppId,
AppIdVoice = PhotonNetwork.NetworkingClient.AppId,
UseNameServer = false
});
The client tries to connect, connects to the master server and the I try to create the new room and join it.
[Network.VoiceManager] OnVoiceStateChanged from ConnectedToMaster to Joining
Immediately, the state changes to DisconnectingFromMasterServer
[Network.VoiceManager] OnVoiceStateChanged from Joining to DisconnectingFromMasterServer
SocketUdp.Disconnect()
Connect()
SocketUdp: UDP, Unity3d.
And then the error appears:
Failed parsing address:
Along with (yet again)
SocketUdp.Disconnect()
The first connection remains intact, but the Voice Connection did not succeed.
The server is running an unmodified version of the LoadBalancing App.
Any insight on why that might happen would be greatly appreaciated.
If you need any more info, or to provide more code on a specific part of the process, please ask.
Thanks a lot in advance,
John.