Hashtable Ambiguity Fix Unity 2018

I have Unity 2018 and downloaded the Viking Demo to familiarize myself with Photon again, and this time for an actual job not just hobby shit which I'm super proud of, but ran into the: `Hashtable' is an ambiguous reference between `System.Collections.Hashtable' and `ExitGames.Client.Photon.Hashtable' error

It was a super easy. Currently on line 17 in LoadbalancingPeer.cs there is a bunch of unity versions like:
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 etc...

All you need to do is add UNITY_2018 to the end and you'll be good. There is still a KeyDown function I haven't checked out yet but that is the only other error that exists which will probably be just as easy. All of the other errors are the Hashtable errors and the one boolean addition fixes it all.

Just thought I would give a heads up.

Comments

  • Never mind that is not the only one. There is also some `UnityEditor.SceneManagement.EditorSceneManager' is defined multiple times error. Going to figure that one out. Checking around online to see if anyone has ran into similar problems with it in different versions. I see there is a special unity 5 and 4 case inside the photon scripts so it might be a similar thing for 2018 that is needed.
  • Ok that is super weird. The part that is causing the problem is inside a #if !UNITY_MIN_5_3 section on line 1247 in PhotonClasses.cs. The section right below it on line 1250 is the part throwing the error. I have no clue why. But adding the unity 2018 condition so that 1250 looks like this: #if UNITY_EDITOR && !UNITY_2018 fixes the problem.

    All that is left now it seems is a 'PhotonAnimatorViewEditor' could be found. Are you missing an assembly reference? error. But I don't think that is anything I have done. Going to check it real quick and will post here.
  • CairoCairo
    edited June 9
    :/ Looks like it is something Photon is going to have to correct with the Viking package. Something similar happened with UFPS back in 2015 during version 5.something and the fix was to just import the raw pun stuff separately and replace. There seems to be a few things conflicting between photon and 2018 which are super similar between version 5. Which makes sense considering both were pretty weird overhauls.

    So Photon might want to take a look at that real quick and see if they can be easy fixes they have already done for version 5. For now just going to get the normal sdk from the website or assetstore and see if it works then make something from the ground up rather than spending time trying to get Vikings package to work.
  • Hi @Cairo,

    sorry for the inconvenience. This demo hasn't been updated for a long time (last update is from November 2016) and I'm not sure if we are going to update it again. So it is definitely not working with Unity 2018 by default. If you still want to work this demo, you can try to replace the PUN scripts with the scripts from a newer PUN version from the Asset Store and see if this already fixes the issues. The latest PUN version is definitely compatible with Unity 2018. This one also includes some demos providing different examples for certain topics.

    So all in all I would recommend you taking a look at the demos from the PUN package instead of the Vikings demo with the reason mentioned above. If you have further questions, please feel free to ask.
Sign In or Register to comment.