Does FindFriends only work when not in a room?
Options
I have FindFriends working when I am not in a room, and I call it periodically to get the online status of friends. Works fine before I join a room.
However when I create/join a private (IsVisible = false) room, it doesn't work anymore. I would like to invite friends to the private room once I'm already in it. I get these two errors instead:
Operation failed: OperationResponse 222: ReturnCode: -2 (Unknown operation code). Parameters: {} Server: GameServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1544)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)
FindFriends failed to apply the result, as a required value wasn't provided or the friend list length differed from result.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1922)
In NetworkingPeer line 1906, both lists are empty:
i.e. onlineList and roomList are both null.
However when I create/join a private (IsVisible = false) room, it doesn't work anymore. I would like to invite friends to the private room once I'm already in it. I get these two errors instead:
Operation failed: OperationResponse 222: ReturnCode: -2 (Unknown operation code). Parameters: {} Server: GameServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1544)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)
FindFriends failed to apply the result, as a required value wasn't provided or the friend list length differed from result.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1922)
In NetworkingPeer line 1906, both lists are empty:
i.e. onlineList and roomList are both null.
0
Comments
-
Hi @aravikumar,
Thank you for choosing Photon!
Yes FindFriends should work on Master Server only (when not joined to a room).0 -
It's good to know the reason it was failing, thanks!
Is there a way around this, or other suggestions you might have to know which friends are online once I'm in a room?0 -
Is there a way around this, or other suggestions you might have to know which friends are online once I'm in a room?
- You need to have a separate client to do this or
- use an external service (HTTP/web based maybe combined with WebRPC) to track friends availability or
- use Photon chat.0 -
I switched my friend management to PhotonChat and it works much better. Thanks!0
-
Sorry to bump, but totally relevant -- why is it again that we can't update friends while in a room? A once/min refresh doesn't sound too burdening compared to other Photon funcs.
It's bizarre that a friend gets into a queue of the game, tell his buddy to get on, and never see him get on because of this ~
Logically, it makes no sense to me, so it must be a functionality problem?2 -
Hi @Guy,
Thank you for choosing Photon!I am not sure why I can't find friends when I am in a room.
That is by design.Does it mean that every time I want to add a friend I need to exit from the room?
You could also use an external service for friends management like PlayFab or facebook after all Photon does not persist friends lists or pending requests.0