The type or namespace name 'RoomInfo' could not be found
Options
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,
Is there a using somethingorother that I've missed specifically for rooms now?
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?
0
Comments
-
Hi @Lethn,
Thank you for choosing Photon!RoomInfo
is now part ofPhoton.Realtime
namespace, you either addusing Photon.Realtime;
on top
or
usePhoton.Realtime.RoomInfo
.
We will add this to the "Migration Notes".1 -
Thank you! Now I'll get to experiment more with network smoothing and see if PUN 2 makes any difference to the movement etc.0
-
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?)0
-
There shouldn't be any trace of PUN classic as I deleted the Photon folder before importing.0
-
Then follow "Migration Notes".
- AutoJoinLobby is removed
-ServerSettings.EnableLobbyStatistics
is moved toServerSettings.AppSettings.EnableLobbyStatistics
-isWriting
is renamed toIsWriting
0 -
Oh bloody hell, right, thanks, I'll check these out and report back if it's all working.0
-
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.0
-
Okay, I've managed to whittle down my errors to about 5 now, one thing that's causing me a huge number of problems isILobbyCallbacks.OnRoomListUpdate(List < RoomInfo > roomList);
I get the following errors:error CS0305: Using the generic type 'List' requires 1 type argumentserror 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 );
0 -
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 extendMonoBehaviourPunCallbacks
instead ofMonoBehaviour
(or old PUN1Photon.PunBehaviour
orPhoton.MonoBehaviour.
) then override the callbacks you need.1 -
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.0 -
@JohnTube Thank you I was having the same problem!0