The type or namespace name 'RoomInfo' could not be found

Since I had bought PUN beforehand I decided to go ahead and upgrade to PUN 2 to see if that would help with network smoothing and so on at all. I got a bunch of assembly reference errors that I managed to fix myself but for some reason a RoomInfo one still stays,

error CS0246: The type or namespace name 'RoomInfo' could not be found (are you missing a using directive or an assembly reference?)


Is there a using somethingorother that I've missed specifically for rooms now?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited January 2019
    Hi @Lethn,

    Thank you for choosing Photon!

    RoomInfo is now part of Photon.Realtime namespace, you either add
    using Photon.Realtime; on top
    or
    use Photon.Realtime.RoomInfo.

    We will add this to the "Migration Notes".
  • Thank you! Now I'll get to experiment more with network smoothing and see if PUN 2 makes any difference to the movement etc.
  • Scratch that, I spoke to soon, I've got three new assembly reference errors.

    error CS1061: 'ServerSettings' does not contain a definition for 'JoinLobby' and no accessible extension method 'JoinLobby' accepting a first argument of type 'ServerSettings' could be found (are you missing a using directive or an assembly reference?)


    error CS1061: 'ServerSettings' does not contain a definition for 'EnableLobbyStatistics' and no accessible extension method 'EnableLobbyStatistics' accepting a first argument of type 'ServerSettings' could be found (are you missing a using directive or an assembly reference?)


    error CS1061: 'PhotonStream' does not contain a definition for 'isWriting' and no accessible extension method 'isWriting' accepting a first argument of type 'PhotonStream' could be found (are you missing a using directive or an assembly reference?)
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Lethn,

    Remove PUN Classic first then import PUN2.
  • Lethn
    Lethn
    edited January 2019
    There shouldn't be any trace of PUN classic as I deleted the Photon folder before importing.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited January 2019
    Then follow "Migration Notes".

    - AutoJoinLobby is removed
    - ServerSettings.EnableLobbyStatistics is moved to ServerSettings.AppSettings.EnableLobbyStatistics
    - isWriting is renamed to IsWriting
  • Oh bloody hell, right, thanks, I'll check these out and report back if it's all working.
  • Okay, I'm working through the errors now, it just looks like I need to change the code to match the changes in the migration notes like you say, thanks for the help.
  • Okay, I've managed to whittle down my errors to about 5 now, one thing that's causing me a huge number of problems is
    ILobbyCallbacks.OnRoomListUpdate(List < RoomInfo > roomList);


    I get the following errors:

    error CS0305: Using the generic type 'List' requires 1 type arguments


    error CS0119: 'RoomInfo' is a type, which is not valid in the given context


    Here's a code snippet of what I'm trying to do.

    createdRooms = ILobbyCallbacks.OnRoomListUpdate( List<RoomInfo> roomList );
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited January 2019
    Hi @Lethn,

    I think you misunderstood how you should use interfaces and callbacks.
    OnRoomListUpdate does not return anything, it will be called when the server sends the client lobby rooms list updates. Take a look at examples in PUN2 demos to see how it works. Also, you may want to learn more about C# interfaces and how to implement them, also how to extend classes and override methods, etc.

    As a start, I suggest that your classes extend MonoBehaviourPunCallbacks instead of MonoBehaviour (or old PUN1 Photon.PunBehaviour or Photon.MonoBehaviour.) then override the callbacks you need.
  • Lethn
    Lethn
    edited February 2019
    Hi, sorry, major necro/bump I know I should have absolutely written up a response earlier, in regards to interfaces I was doing research a lot on how to make a decent room browser and it was awhile back that I came across this write up which was working absolutely fine in PUN 1 and I was just following along with the migration notes to try and fix things.

    https://sharpcoderr.com/blog/photon-network-beginners-guide

    Oh and lol this is so typical, I just found the demo example you were talking about PUN Cockpit, I'll check this out and see if I can't use that demo to fix things, it should all work as it all seems to be up to date so that's nice. I had the flu most of January so I wasn't doing very well keeping on top of things.

    public void OnRoomListUpdate(List<RoomInfo> roomList) { }

    That's why it wouldn't work -_- looks like I'm going to have to work using the demo as my resource rather than the PUN 1 tutorial which explains a lot.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited February 2019
    Hi @Lethn,

    You can find a good snippet of how to implement OnRoomListUpdate here, read my last comment after that also.
  • Thanks @JohnTube! I'll check it out.
  • @JohnTube Thank you I was having the same problem!