PhotonNetwork.JoinRoom problem
Options
Hi,
I've got problem with JoinRoom(name) function.
I want to join room by name when someone else created private room and share room name.
It's working fine but I've got weird problem.
When I try to join room by name and this room doesn't exist then I expected I should receive message that room doesn't exist and I cannot join it but instead this room is created. I thought it should work like that in JoinOrCreate rather than in JoinRoom.
Can anyone help me?
I've got problem with JoinRoom(name) function.
I want to join room by name when someone else created private room and share room name.
It's working fine but I've got weird problem.
When I try to join room by name and this room doesn't exist then I expected I should receive message that room doesn't exist and I cannot join it but instead this room is created. I thought it should work like that in JoinOrCreate rather than in JoinRoom.
Can anyone help me?
0
Comments
-
Thanks for contact.
I'm calling JoinRoom with unused name. I don't know why it happens. It's weird.0 -
Do you use webhooks with AsyncJoin?0
-
No. I dont know what is wrong. I will inspect my code then.0
-
Anyways it's working fine when room is not open (room.isOpen = false). Then i receive OnPhotonJoinRoomFailed with message that room is closed but it doesn't when room don't exist0
-
Hi, I've got latest Photon PUN from Asset Store. Today updated (removed old files and imported new) and same problem.
I have added your code in onConnectedToMaster() instantly after connected to master server and it creates room - very weird.
This is my logcat:
It even doesn't call OnPhotonJoinRoomFailed or OnCreatedRoom it just joins room that doesn't exists and is empty (you can see my log that after joined room there is only 1 player (me) and no opponents).
0 -
so you are using PlayFab.
the screenshot shows Unity Editor console logs and not (Android's) logcat.
OK try this code:void OnConnectedToMaster() { string shortGuid = Convert.ToBase64String(Guid.NewGuid().ToByteArray()) .Substring(0, 22) .Replace("/", "_") .Replace("+", "-"); Debug.Log(string.Format("trying to join room \"{0}\"", shortGuid)); if (!PhotonNetwork.JoinRoom(shortGuid)) { Debug.LogError("Failed to send join request"); } } void OnJoinedRoom() { Debug.Log(string.Format("Joined room \"{0}\"", PhotonNetwork.room.Name)); }
is this related to the other discussion here?0 -
Yes, I'm using PlayFab. This is Log:
I think that in second disussion problem is similar but not same. In my case all I need is to just receive error when trying to join room that doesn't exist.
0 -
OK thank you. Is there any estimated time it will be fixed?0
-
We are discussing it now, I can't help you.
We can if you agree update your webhooks config to fix this from config but it's a "workaround".
The idea is to disable Persistence by setting "IsPersistent = false".
If you agree let me know by sending your AppId via private message on the forum.
Do you know when you started to see/have this issue?
When did you first spot it?0 -
I have just started to implement this feature in my game and got that problem. I didn't notice it before because I didn't create private rooms before.0
-
Another fix is to change CloudScript as follows:
handlers.RoomCreated = function (args) { if (args.Type === "Load") { return {ResultCode: 1, Message: "Room does not exist!"}; } }
0 -
Nevermind. I found it on Playfab dashboard. Thank you.0
-
hi @ByQ,
It turns out AsyncJoin is enabled by default (true) when IsPersistent is enabled (true) for any webhooks version.
We can disable it for you by updating the webhooks settings for your app. Just send me your Realtime AppId via message.
I apologize about the inconvenience.0 -
I had the exact same issue several months ago that I was trying to debug with someone who works at Photon via email for weeks, we were never able to find a resolution for the issue. I even created a new simple project to make sure there was not a mistake I was overlooking in my project code. My temporary solution was to write a hack in my client code to get around it but it was not something I felt comfortable with for the long term.
It looks like adding that conditional statement to my CloudScript fixed the problem and that makes me happy. @JohnTube is there a more permanent solution planned for this in the future?0 -
Hi @Guts,
I apologize about the inconvenience!
Please reply to the same email thread with your AppId and reference this forum discussion.
The right thing to do to avoid the AsyncJoin behaviour is that we or PlayFab update the webhooks settings for your app with a new key/value "AsyncJoin" = "false".0 -
-> on call joinRoom got Error Operation failed: OperationResponse 226 before call Photon event OnPhotonJoinRoomFailed(object[] codeAndMsg). i just want to show message if room is not available to join.
if (!PhotonNetwork.JoinRoom("RoomNameTest"))
{
txt_ValidateErrorMsg_Join.text = "Fail to Join Room...!";
}
-------------------
Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists). Parameters: {} Server: MasterServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1621)
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)0 -
Hello
I'm having the same problem in that trying to join a room that doesn't exist creates one.
What is the workaround or the correct way to handle it? Using PUN2 with PlayFab
Thanks
0 -
Hi @matrix211v2,
Set AsyncJoin : false from web hooks settings.
0