Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin Code not working Packetver: 20130618 #448

Open
AtomixRO opened this issue Aug 6, 2024 · 20 comments
Open

Pin Code not working Packetver: 20130618 #448

AtomixRO opened this issue Aug 6, 2024 · 20 comments
Labels
Bug Something that is already regarded as completed not working how it should be.

Comments

@AtomixRO
Copy link

AtomixRO commented Aug 6, 2024

Describe the bug

  • Feature gets you straight to Verify Pin instead of Password for old accounts that works.

  • Also Pin code in console is wrong compared to the pin code which has been typed but doesn't mention it's a wrong pincode.

  • Change password gets stuck on Password & Confirm Password, can't get to "New Password" field.

  • Korean button shouldn't be displayed on this packet version.

Screenshots (if applicable)
Typing pincode after login:
image

Change Password:
image

Incorrect pincode pinted and I get an error for wrong pincode if I type the wrong one.
image

Packet/Client version
20130618

Browser/device info

  • Any
@AtomixRO AtomixRO added the Bug Something that is already regarded as completed not working how it should be. label Aug 6, 2024
@MrAntares
Copy link
Owner

@redpolline Do you also have the same issues on your packetver? I can't test it on my server since it is too old.

@redpolline
Copy link
Contributor

Sorry for not getting to this until now. I've been away all week.

  • Feature gets you straight to Verify Pin instead of Password for old accounts that works.

Packet/Client version 20130618
Your PACKETVER is old enough to be affected by a TODO.

Basically, I didn't know what one of the packets for pincodes did as it was deprecated before my PACKETVER. (rAthena won't send it in my case.)

Can you send the full log? What we really need is the received packets from the server and the order they were sent in.

  • Also Pin code in console is wrong compared to the pin code which has been typed but doesn't mention it's a wrong pincode.

The pincode it prints in the console is the encrypted pin code.

If you know the userSeed that was sent, (check the logs), you can decrypt it back into the user's original pincode. (Although, you should be able to tell that it's your pin code. Especially if you have two digits in your pin that are the same. As they'll be the same digits in the encrypted version.)

  • Change password gets stuck on Password & Confirm Password, can't get to "New Password" field.

I may have screwed up the order for what password box is supposed to be used.... That should just be cosmetic though. It should still work if you type in the expected code.

  • Korean button shouldn't be displayed on this packet version.

I'm not sure what that button is supposed to be. Maybe it's the unused Exit button? (That should be hidden automatically though....) Can anyone translate it?

@redpolline
Copy link
Contributor

@redpolline Do you also have the same issues on your packetver? I can't test it on my server since it is too old.

Unfortunately, my server is too new.

The screenshots indicate that login packet state 7 was sent by the server. Which according to rAthena was removed in PACKETVER >= 20180124.

@redpolline
Copy link
Contributor

  • Korean button shouldn't be displayed on this packet version.
    I'm not sure what that button is supposed to be. Maybe it's the unused Exit button? (That should be hidden automatically though....) Can anyone translate it?

OK, that's the unused exit button. Your client files just don't have that button translated for some reason. (Out of date?)

I'll send a patch to disable it on all packetvers, as it's not wired up to anything to begin with.

redpolline added a commit to redpolline/roBrowserLegacy that referenced this issue Aug 15, 2024
Handle pincode state 7 from the server.
Automatically send packet 0x8c5 upon initial entry to char server, if PACKETVER is within the correct range.
@redpolline
Copy link
Contributor

@AtomixRO Did the recent commit fix your issue?

@AtomixRO
Copy link
Author

AtomixRO commented Sep 5, 2024

@redpolline Sorry for the long wait, been too busy.

  • Login works but on client the you should type your pin code in Password box
    image
    Not in Confirm Password on browser:
    image

  • Change doesn't work:
    When you click on Change, the box remains on Confirm Password:
    image
    You click on Verify, it then goes to Password.
    The Change Password procedure on client is:
    After click on Change, you have to type your current PIN
    image
    And then you click on Verify, New Password is now accessible:
    image
    Click on Verify again and then Confirm Password is accessible and Confirm button appears:
    image
    When all information are filled in, if you click on Reset, The procedure will revert back to Password:
    image

  • NEW PIN Code:
    It's buggy but works for new accounts.
    On client it's just like change minus to enter the current PIN code yet the box is white, not blue:
    Enter New Password and then click on Verify.
    image
    Enter Confirm Password and then click on Confirm.
    image

Browser also get 3 notifications box overlapped:
image

@MrAntares
Copy link
Owner

Same issue here. Can't make new pincode and can't login either. This original ui is pretty unintuitive with the lower case "change" to begin with, but the random fileds activating and the 3 popups make it a real a chaos :D I don't even know what I am supposed to do :D

@AtomixRO
Copy link
Author

AtomixRO commented Sep 5, 2024

Same issue here. Can't make new pincode and can't login either. This original ui is pretty unintuitive with the lower case "change" to begin with, but the random fileds activating and the 3 popups make it a real a chaos :D I don't even know what I am supposed to do :D

Click on OK 3 times in a row, type your new pin code and then click on Confirm, done. :D
That was my experience twice on browser.

@issid
Copy link
Contributor

issid commented Sep 8, 2024

the problem is if you use the first digit 0 . it is removed in the code here intCode = Number.parseInt(pincode); that's why we need to add a check

                if (strCode.length < pincode.length) {
                    var zeros = pincode.length - strCode.length;
                    for (var j = 0; j < zeros; j++) {
                        strCode = '0' + strCode;
                    }
                }

before the encryption code

                // Encrypt raw digits with pad.
                for (i = 0; i < strCode.length; i++) {
                    x = Number(strCode[i]);
                    out += (PincodeWindow._keypad[x]).toString();
                }

in the file PincodeWindow.js

image

@redpolline
Copy link
Contributor

@redpolline Sorry for the long wait, been too busy.

  • Login works but on client the you should type your pin code in Password box
    image
    Not in Confirm Password on browser:
    image

Yeah, that's just a cosmetic bug.... I didn't realize it when I wrote the code for setting the values from the buttons.

Basically, "Confirm Password" and "Password" are switched in the code. The data put into them (incorrectly) still gets used properly, but it does look wrong from the user's perspective.

  • Change doesn't work:
    When you click on Change, the box remains on Confirm Password:
    image

That's due to the cosmetic bug above. (It should be on password.)

You click on Verify, it then goes to Password.
The Change Password procedure on client is:
After click on Change, you have to type your current PIN
image
And then you click on Verify, New Password is now accessible:
image
Click on Verify again and then Confirm Password is accessible and Confirm button appears:
image
When all information are filled in, if you click on Reset, The procedure will revert back to Password:
image

That's due to there being no field selection code in the JS handler. I.e. If you click on the password box it doesn't do anything.

That's because I didn't write any code to handle changing the current input field from the GUI. It's done programmatically based on which buttons the user clicks on and which response packets are sent from the login server.

Reasons being:

  1. The responses from the server can reset the window.
  2. Filtering non-numeric input is a pain. (And subject to a permanent ban on official servers. It will even crash some clients, and persist between runs....)
  3. I wanted to get the login itself working before focusing too much on cosmetics.
  • NEW PIN Code:
    It's buggy but works for new accounts.
    On client it's just like change minus to enter the current PIN code yet the box is white, not blue:

Cosmetic bug strikes again. That's the field select changing what input field is active. (It doesn't have any code to handle the input field that isn't used for a the new password flow.)

Enter New Password and then click on Verify.
image
Enter Confirm Password and then click on Confirm.
image

Browser also get 3 notifications box overlapped: image

Those message windows should be "modal" windows. I.e. (You shouldn't be able to do anything but click on their OK button when they are on the screen.) The PincodeWindow doesn't have a disable flag to block input when a message is displayed. So you can get multiple message windows if you don't close them. (Something else that needs to be fixed.)

All that being said, the original issue of "not working Packetver: 20130618" is fixed. Maybe we should close this bug and open new ones for the other stuff.

@redpolline
Copy link
Contributor

Same issue here. Can't make new pincode and can't login either. This original ui is pretty unintuitive with the lower case "change" to begin with,

Hey, that's graphics pulled from the grf. I didn't translate them. 😜

Fun fact if you highlight the change button without clicking on it, it becomes a "charge" button instead. 😄

but the random fileds activating and the 3 popups make it a real a chaos :D I don't even know what I am supposed to do :D

Yeah, I need to clean it up. Although to be fair, the official client doesn't tell you much either, and I got lost the first time I used it.

The normal input flow is still there however. So if your used to inputting a Pincode in the official client, and able to ignore the graphical glitches in the current UI, you'll still complete the process successfully. Even if that process doesn't look right. But some people can't handle the graphics being wrong. (I would know, it's the reason why I set confirm password as the default field to begin with. Having the top field being the input field for the default login process didn't look right to me. Of course, that was before I knew the correct process from the official client.... 😊)

@MrAntares
Copy link
Owner

I know the UI looking stupid is not your fault. The translation project needs some hardcore supervision because the translations are sometimes really bad and there are alot of typos and wrong letter casing. But the original UIs are bad as well. Non-responsive 90's tech. They just look bad and feel bad and not intuitive. It's a shame we have to mimic them. At least we can have plugins that improve on these. Thx for the fix anyways!

@AtomixRO Can you test the fix sometime?

@MrAntares
Copy link
Owner

There is still an error. in HC.SECOND_PASSWD_LOGIN When status is 0, it either means the pincode is correct OR the feature is disables and you must proceed with the login. When this happens and there is no other pincode packet received before this, then the pincode window is not even loaded and it starts referencing unloaded objects resulting in loads of errors.

@MrAntares
Copy link
Owner

I corrected this part in e44555f but the new pin creation is still not working correctly

@MrAntares
Copy link
Owner

I don't really get why PincodeWindow.selectInput is always called with 0 in the CharEngine.js and why the values are manupilated later in the UI itself, but I guess the issue is somewhere in this logic. It enables/disables the wrong fields

@MrAntares
Copy link
Owner

MrAntares commented Sep 13, 2024

There is another issue. in CharEngine.js the onConnectionAccepted is used for:

  • ACCEPT_ENTER_NEO_UNION_HEADER
  • ACCEPT_ENTER_NEO_UNION
  • ACCEPT_ENTER_NEO_UNION_LIST

Packet ACCEPT_ENTER_NEO_UNION is automatically followed by SECOND_PASSWD_LOGIN if the feature is enabled. This is count number 1 for the packet. But since there is a direct request for pincode in the onConnectionAccepted function using the sendPincodeRequest function it also requests for an additional pincode for both the ACCEPT_ENTER_NEO_UNION_HEADER and the ACCEPT_ENTER_NEO_UNION packets and possibly the ACCEPT_ENTER_NEO_UNION_LIST wherever it is used. This results in receiving the SECOND_PASSWD_LOGIN packet 3 or 4 times back to back and this is what creates the triplicated message popups. I will remove this call for additional pincodes, but please revise how this should work, because there is some misunderstanding here or the logic is not the same for every packet version.

@redpolline
Copy link
Contributor

I don't really get why PincodeWindow.selectInput is always called with 0 in the CharEngine.js and why the values are manupilated later in the UI itself, but I guess the issue is somewhere in this logic. It enables/disables the wrong fields

It shouldn't be called externally. If it is that's a bug. (It would be a leftover from an earlier revision of the code. In reality, selectInput() shouldn't even be exported from PincodeWindow at all, and nothing external should be calling it.)

As for the zero arg bit, that was just my way of saying "reset to initial input field." (Which helps given I need to change the field order. I'll send a commit later for that.)

there is some misunderstanding here or the logic is not the same for every packet version.

Yes, based on the tests I made, the older packetver expects the client to request the SECOND_PASSWD_LOGIN packet from the server. In those packetvers if we don't send that request to the server, then the pincode window doesn't get initialized properly.

That functionality should be gated by a packetver check however. So, I'm not sure why it would be triggering on packetvers that don't need it. It doesn't on my end with the tests I've made, but then again I don't have proper full clients to test those packetvers on my end. (The patch I sent was based on a frankinclient made with a 2021 grf against an rAthena built with the older packetver. I can't test with an original client.)

@MrAntares
Copy link
Owner

Thx! Gonna test tmr

@AtomixRO
Copy link
Author

I tested the update. @redpolline

  • Login: Works as intended.

  • New Pin Code: Works more easily but isn't like on client as you go straight to Password field and type the password once instead as mentioned before.

  • Change password doesn't work, same issue as before.

@AtomixRO
Copy link
Author

AtomixRO commented Sep 19, 2024

Another issue which is an important cosmetic matter is that whenever players create a new pin code that is banned from the server because it's too easy such as same number like 1111 0000 or even 1234 (maybe some others which are stored server side)

You then get the following error message (which is confusing)
image

instead of the following on client:
image

Also I'm unsure if I've mentioned this but numbers don't get scrambled after you click on one. (It's ok for now but the behavior on client is different)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something that is already regarded as completed not working how it should be.
Projects
None yet
Development

No branches or pull requests

4 participants