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

feat(engine): last logged in ip address & number of days #1040

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ultraviolet-jordan
Copy link
Collaborator

@ultraviolet-jordan ultraviolet-jordan commented Jan 3, 2025

Current State

The welcome screen interface displays some details about your account when you login. Currently, this always shows that you "last logged in today" and your "current" ip address that is connected through the client. It never actually counts the number of days you actually last logged in. As well as never showing the actual last ip address that was used.
image

The problem

Adding this feature technically requires 2004scape to collect ip addresses of players and save them into their saves. The reason they have to be saved is because 2004scape would have to provide to the player what the last ip address was, which means saving that state for a future purpose. I personally don't care, but it is PII and I'm sure others would care.

This solution

The best solution I could think of was to use the players own password as the key for encrypting and decrypting their own ip address. The only drawback is storing the password in memory for it to be used by the ciphering functions. So the password exists in memory of the server until the player is no longer online in the world.

If a players password was changed, it would fail the decryption one time for the next login only, resulting in the welcome screen not showing for that login. This is actually because it gets defaulted to 0 when sent to the client, and the client checks if it's not 0 to open the interface.

Examples

image

image

image

@ultraviolet-jordan ultraviolet-jordan marked this pull request as draft January 3, 2025 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant