The code will crash on the client when using Voice in game on a server because the Connection->PlayerId is NULL. I looked throughout the engine code and this only gets set on the server and never on the client. My only workaround right now is to set it on the client before the AddVoicePacket call occurs.
Version: 4.6.1 Engine Source (no mods to release branch)
Only specific thing is to log in to a dedicated server, crash occurs on client.
Game is packaged as development and I’ve even tried it with DebugGame. Occurs with one or more clients.
I can’t think of anything else in addition to this. Did you set your breakpoint in this function to ensure that you are actually entering this function? You need to be party to a session through a dedicated server and have VoIP enabled before the client will try to send any voice packets.
You are correct, the UNetConnection::PlayerId isn’t valid on the client. The only reason I think this may not be crashing for us is that we might not run with LogNet set to VeryVerbose very often, so the NULL parameter is getting optimized out. Could you by chance be running at that logging level?
A quick fix is to check for NULL there in the UE_LOG macro. I’ll run this by some folks locally to make sure this checks out, but this is my suspicion at the moment. If this is what is happening, we can fix this locally, thanks for pointing this out
Yes, sorry that I did not explicitly indicate that in this question. My first question clearly indicated that but my question was lost and I had to retype it all. But the ini file above shows the All setting for the UE_LOG for LogNet which is the same as VeryVerbose. It made it hard for me to do my testing with this bug.
Thanks,
Kory
We’ve added a NULL check in the engine to fix this in the short term. The server currently doesn’t communicate his own player id back to the client.
We’re thinking about ways to improve this going forward (maybe have the server send it in the case where it can), but for now, we’re going with the NULL check, which should fix your crash too
OK, great, thanks so much. I’ll continue reporting / fixing bugs as I find them. I’m really hoping someone can address the gameini issue I was having in the other bug report, more than two weeks and still no response.
Thanks!