-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Exception in OnStartClient : An element with the same key already exists in the dictionary. #48
Comments
Hi Gabe, Do you get this same error when running the HLAPI demo scene? That also uses triggers on the player prefab, so it sounds like it ought to suffer from the same problem. The first error is coming from inside this
Would you mind drilling into this and finding what the null reference is? If you're not sure how to do that just comment out the following lines and it'll give me a good hint:
Make sure to add the lines back in afterwards! The second error looks like something that has already been fixed in the dev branch. Once we've tracked down the first error I can send you a new package with that fix included :) |
I'm not at the office yet, but I'll check the demo scene to see if it repro's in there. I tracked down the null reference last night and it's coming from the HLAPIClient in ReadMessages(). In the first frame of a newly loaded scene, the connection property on NetworkHost.singleton.client.connection is null. (or something like that, I'm recalling from memory until I get into the office) After the the first frame, the property has a value. |
HlapiClient.cs line 95. Connection is null for the first frame only.
|
We also just tested the HLAPI demo scene and it does work. I suspect there's something going on with our setup. |
That's odd - that code doesn't run until
You could add another check in there to ensure that the connection is not null:
This will delay Dissonance startup until the connection is not null (but only if the client is active). If that works for you I'll include it in the next Dissonance version.
It's intended to be very forgiving of slightly wrong setups - for example the check I referenced above means it doesn't care if it's active before a network session even exists - it just waits until HLAPI is ready. Even if you have set up something very wrong I'd still like for Dissonance to detect that and print a more useful message than a null reference exception! |
Hey Martin, I sorted it out, it looks like my setup had multiple room triggers in the scene. After removing those it appears to be working properly, but we still get those exceptions but at least audio is now playing. |
I'm going to add a null check on the connection and to have it return true if the connection is null as per a setup. Then after that it should be good. |
Multiple room triggers is totally fine! You can have as many room triggers as you like - that's totally expected (e.g. one global, one per team, one proximity per player).
Do you mean the |
I didn't try the networkActive check since we got it working shortly after
we got it setup.
Once you have a dev build, let me know as I'd love to try it.
…On Wed, Aug 30, 2017 at 12:51 PM, Martin Evans ***@***.***> wrote:
it looks like my setup had multiple room triggers in the scene
Multiple room triggers is totally fine! You can have as many room triggers
as you like - that's totally expected (e.g. one global, one per team, one
proximity per player).
I'm going to add a null check on the connection
Do you mean the var networkActive = ... check I suggested above? If not,
did you try that and did it work?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVWK_n-M9wNYMXhzlm7Z8abDbq_IP4Cdks5sdb1CgaJpZM4PFR1V>
.
|
I've already got a change merged into the dev branch so I can send you a build right now if you'd like - just send me your order number. Out of interest what change did you make to fix this yourself? |
Just did a null check and returned true until it was non-null.
…On Tue, Sep 5, 2017 at 4:19 PM, Martin Evans ***@***.***> wrote:
I've already got a change merged into the dev branch so I can send you a
build right now if you'd like - just send me
***@***.***> your order number.
Out of interest what change did you make to fix this yourself?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVWK_q7sK14u6J870rrRGaqDbxg8dPIOks5sfdcCgaJpZM4PFR1V>
.
|
Dissonance 3.0.1 has just released on the Unity asset store, this includes the changes made to resolve this issue so I'll close it now. If the problem persists please feel free to continue posting in this thread. If you're happy with how this issue was handled please consider rating and reviewing us on the asset store! |
Context
I'm using the HLAPI setup in Unity 2017.1.0p4 and i'm getting exceptions when a client tries to join the game that is being self-hosted on another computer.
Screenshot of Log: http://imgur.com/a/MSoYU
[Dissonance:Network] HlapiClient: Object reference not set to an instance of an object
Exception in OnStartClient:An element with the same key already exists in the dictionary.
Expected Behavior
Shouldn't see an exception when connecting
Actual Behavior
Exception
Steps to Reproduce
We're using the stock settings that were in the tutorial, channels 0 and 1 for comms.
Verify: Error occurs
Your Environment
Dissonance version used: v3.0.0
Unity version: Unity 2017.1.0p4
Editor Operating System and version: Microsoft Windows 10
Build Settings: Windows, x86_64, In Editor
The text was updated successfully, but these errors were encountered: