does Unet deprecation affect Photon? NetworkConnection class not found in PunClasses.cs

Options
Hey all,

I'm new to Photon networking, I was formerly using Unet until I just read recently that they were deprecating Unet.

I just installed PUN 2, and I am getting a class not found error for NetworkConnection in PunClasses.cs:
line 423: public void OnClientError(NetworkConnection conn, int errorCode)

Is NetworkConnection a PUN class that I'm missing? I know Unity has a NetworkConnection class in their API, but there is no using import for this in the PunClasses file.

I'm also assuming that PUN is not affected by the Unet deprecation, I didn't read anything anywhere that said it was, and I assume Photon owns the entire library of networking code it uses, with no dependencies to Unet/Unity.

Thanks for the help

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Rumbeard,

    Thank you for choosing Photon!

    PUN does not depend, rely or use UNet.
    I think you had an issue when importing PUN.

    Make sure you import PUN2 only in a fresh clean new empty project.
  • Rumbeard
    Rumbeard
    edited September 2019
    Options
    Ok thanks @JohnTube

    Unfortunately I don't think importing to a new empty project is an option for us as we are far along in development. If it was an import problem I believe we can figure that out.

    Outside of getting potential errors like the one we found, are there other caveats to importing to an existing project as opposed to a new empty one?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Rumbeard,

    Not sure which exact PUN version you have imported and in which Unity version.
    Also, I don't know what other assets you have in your project already.

    What I know is that line 423 in "\Assets\Photon\PhotonUnityNetworking\Code\PunClasses.cs" is different from
    public void OnClientError(NetworkConnection conn, int errorCode)
    Also there is no NetworkConnection class in PUN at all.

    So there is something wrong somewhere.
    It is odd.
  • Rumbeard
    Options
    :# .. yes. this is interesting. Somehow, without opening any files, that bit of code was randomly injected. I compared with a fresh import and that code was not there.
    It just magically appeared in my other project. (I never opened any Photon classes so not sure how this happened!)

    Thanks for the help. Everything working now :)