Skip to content

Add FirstLogin column to database and profile #1234

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

Closed
wants to merge 10 commits into from

Conversation

mourningsickness
Copy link
Contributor

@mourningsickness mourningsickness commented Apr 14, 2025

This PR will add a "First Login" stat, complimenting the "Last Login" stat.

How it is calculated:

New User

New user joins -> Current time (same as how "Last Login" is set on first connect)

Migration for existing user:

Has times on server -> Oldest time's timestamp

Does not have times on server -> Last login

Does not have times on server and last login == 0 -> Current time (time of migration)

In my opinion, this is the best way to handle these cases, but feel free to suggest otherwise. Unfortunately we don't have any other metrics to populate existing users' data, but hopefully these are pretty close :^(

The best time to plant a tree is 10 years ago, the second best time is right now.

Add functionality to turn off noclip on timer restart, disabled by default u.u

I used to use a separate plugin I made for this, but figured it should be in the main plugin itself as a cvar instead. Since adding as a cvar, may as well see if it is wanted upstream.
shavit-misc Add cvar UnNoclipOnRestart (shavitush#1232)
Edge case causing this change, but if style cookies are disabled on a server, no reason to save it.
disable setting style cookie if style cookies are disabled (shavitush#1233)
Startzone speed limit flexibility (shavitush#1219)
@mourningsickness
Copy link
Contributor Author

Would sqlite need a separate query using unixepoch('now')? I've not used sqlite but am looking and it seems it doesn't have UNIX_TIMESTAMP()

@mourningsickness
Copy link
Contributor Author

Added sqlite handling

@mourningsickness
Copy link
Contributor Author

mourningsickness commented Apr 14, 2025

image

Working great!

@mourningsickness
Copy link
Contributor Author

image

New users confirmed working

rtldg pushed a commit that referenced this pull request Apr 19, 2025
fix FirstLogin query for sqlite

fix statsmenu query oopsie teehee :3

sql-create-tables-and-migrations.sp - fix queries for sqlite

Simplify firstlogin column initialization
@rtldg
Copy link
Collaborator

rtldg commented Apr 19, 2025

merged by 3d0cd96

@rtldg rtldg closed this Apr 19, 2025
mourningsickness added a commit to KawaiiClan/bhoptimer that referenced this pull request Apr 19, 2025
Add FirstLogin to database and profile (shavitush#1234)
@mourningsickness mourningsickness deleted the No-Kawaii-Edits branch April 19, 2025 23:56
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.

2 participants