Why sometimes a room name I create turns into complex code?

Options

Hi,

Sometimes a room name I created turns into numbers like: 373b41a1-0cc9-481c-9038-f2a50be74274

In such a situation, it becomes impossible for another player to join the room without knowing this long code. For example I named the room "t" but this turned into something complicated. Why does this happen and what is the solution? Can you help me please?

Answers

  • Tobias
    Options

    A room name has to be unique (in the app, region and appversion). If you create rooms that are not unique, the server makes up a GUID as name.

    Or you got a client bug and some CreateRoom calls don't have a name.

  • Kaiserludi
    Options

    Hi @aysegullarpacii.


    @Tobias:

    If you create rooms that are not unique, the server makes up a GUID as name.

    No, it doesn't do that. It returns an error response "A game with the specified id already exist."

    So my guess is that @aysegullarpacii has a bug in his code that causes it to sometimes create rooms without specifying a room name (or passing an empty string for the room name). In that scenario the server indeed generates a random GUID as the name for the room.

  • Hi @Kaiserludi,

    Yes, I think that's exactly my problem. How can I solve this? When the same room name is entered, it already says "There is such a room", I provided this control. I wonder if having a letter count in the room name solve my problem? For example, if it is obligatory to use a room name with at least 4 letters.

  • Hi @Tobias,

    Not when I type the same room name, here is another problem.

  • Kaiserludi
    Options

    Hi @aysegullarpacii.


    In general I recommend to treat the room name as a unique ID and not as a name that is displayed to the user.

    Instead, use a separate string as the display name of the room that is shown to the user. This way you avoid the whole "There is such a room" issue in the first place because then it is no problem for multiple rooms to have the same display name shown to the user.

    So if the user inputs myRoomX as a room name, you could actually name the room myRoomX_someUniqueIDLikeAGUIDorUUID and just hide everything after the character before the last occurrence of '_' in the room name, when displaying the name to users.


    Regarding the issue with Photon just generating a room name because you did not provide one:

    When the same room name is entered, it already says "There is such a room", I provided this control. I wonder if having a letter count in the room name solve my problem?

    Well, what are you doing when you tell the user that "There is such a room"? I suppose you don't create a room at all in that case. Is that correct? Then I don't see how this would be related to the issue of your code sometimes creating a room without a name.

  • Hi @Kaiserludi,

    I still think you do not understand my problem. Anyway, if the same error persists, I will create the room with a randomly generated code. Thank you.