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

[V2] CHANGE UNIX_TIMESTAMP(CURDATE()) TO UNIX_TIMESTAMP(NOW()) #512

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

mano368
Copy link

@mano368 mano368 commented Jun 6, 2022

Hello,

When making a test purchase, I verified that when using CURDATE(), only 5 hours of premium was added to the account, instead of 24 hours. Switching to NOW() seems to have fixed the problem by adding 24 hours!

Engine->Function->users.php

// Add additional premium days to account id
function user_account_add_premdays($accid, $days) {
	$accid = (int)$accid;
	$days = (int)$days;
	mysql_update("
		UPDATE `accounts` 
		SET `premium_ends_at` = GREATEST(`premium_ends_at`, UNIX_TIMESTAMP(NOW())) + ({$days} * 86400)
		WHERE `id`='{$accid}';
	");
}

If this error has to do with the webserver, please disregard and I apologize in advance.

Znote and others added 30 commits July 22, 2021 15:30
Vice leaders were able to do a bit more things than they should have
Allow admins to see executed SQL queries overlay
Useful for testing and optimizing query usage on website
exp history should be able to store negative values, yes
online time shouldn't
MEDIUMINT: 97 days
MEDIUMINT UNSIGNED: 194.2 days
INT: 68 years
INT UNSIGNED: 136.1 years

bigint was way too big for these values, thanks to @divinity76
having an account as free, make lots of weirds widgets to appear in game and even some client features unavailable.
This unlocks protocol 12 client features for servers who use freePremium in config.lua
Znote and others added 7 commits December 23, 2021 09: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.

5 participants