Friends help with photon login error

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Friends. I have an extended chat on Photon. You can say almost like a social network.

    I made a registration room. After registration, the player can enter the "Login to your account" room. There he enters his data.

    He enters a username and password. And after clicking "Login to your account" these two values ​​​​are sent to the server for verification, that is, the username and password are separated by the "_" character

    When the server receives the code, it checks if this username exists. If not, it sends the text "Username not found". And if found, it looks at the password of this username.

    I did this using a "For" loop.

    But the thing is that if there are more than 2 or 3 registered users.

    Then I can’t log into my account. Sometimes I can and sometimes I can’t.

    I enter my data and the server says that the user is not in the list of registered users, although he is. I can’t understand the reason for 2 days, help someone who can. I’ll throw off the project itself if necessary.

    Here's what it looks like

  • It could be that it continous checking and fails.

    Perhaps you could try and break the loop checking for matches after it found a match and checked the password.

  • How can I break the cycle? and why does he fail, if his name is on the list, he must find it. and for some reason it finds and everything works well when there are less than 3 registered users

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • System event, action: stop loop.

    Place it after the password checks.

    It likely fails if your name and pass checked out, and call the function, but before the function finishes, the loop perhaps checked the user in the array AFTER yours, and fires the failed function before the previous one was done.

  • Thank you. I will definitely try and write to you. All I will do is stop the loop after checking the password

  • System event, action: stop loop.

    Place it after the password checks.

    It likely fails if your name and pass checked out, and call the function, but before the function finishes, the loop perhaps checked the user in the array AFTER yours, and fires the failed function before the previous one was done.

    I interrupted the cycle and it helped. But it is necessary to break the cycle in 2 cases.

    When the user and password are found and when the user is found but the password is not found. and then everything worked great.

    And if you put it only after the password is found, then the server gave an error "user found but password is not correct".

    I advise everyone to break the cycles after their success and failure.

  • Good to hear! and great you solved it.

    Those loops, with checks, when not propperly executed can cause varying results, which makes finding the cause or problem difficult. I recognized it as I had something similair some time ago.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)