It can be spoofed, but with some limits. Newbie attacker won't get more than 50.000 IPs, which gives 500k accounts in database. Without limits, single IP can make billion accounts and make database use all SSD space or at least lock all popular accounts names forcing players to use other account names.IP can be easily spoofed, so no point.
Above:Hello.
Znote have option with check IP?
I need system who check IP and agree create only 5/10 accounts, no more. This is possible?
$createdAccountsData = mysql_select_single("SELECT COUNT(`ip`) AS `value` FROM `znote_accounts` WHERE `created` >= " . (time() - 86400) . " AND `ip` = " . getIPLong());
$createdAccounts = ($createdAccountsData !== false) ? $createdAccountsData['value'] : 0;
if ($createdAccounts >= 10) {
$errors[] = 'You cannot create more than 10 account within 24 hours.';
}
For Gesior 2012 we have something similar?It can be spoofed, but with some limits. Newbie attacker won't get more than 50.000 IPs, which gives 500k accounts in database. Without limits, single IP can make billion accounts and make database use all SSD space or at least lock all popular accounts names forcing players to use other account names.
Above:
Add:![]()
ZnoteAAC/register.php at master · Znote/ZnoteAAC
Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server. - Znote/ZnoteAACgithub.com
PHP:$createdAccountsData = mysql_select_single("SELECT COUNT(`ip`) AS `value` FROM `znote_accounts` WHERE `created` >= " . (time() - 86400) . " AND `ip` = " . getIPLong()); $createdAccounts = ($createdAccountsData !== false) ? $createdAccountsData['value'] : 0; if ($createdAccounts >= 10) { $errors[] = 'You cannot create more than 10 account within 24 hours.'; }
Under:For Gesior 2012 we have something similar?
if (empty($reg_form_errors)) {
$visitorIp = (int)Visitor::getIP();
$createdAccountsData = $SQL->query('SELECT COUNT(1) AS value FROM `accounts` WHERE `creation` >= ' . (time() - 86400) . ' AND `create_ip` = ' . $visitorIp)->fetch();
$createdAccounts = ($createdAccountsData !== false) ? $createdAccountsData['value'] : 0;
if ($createdAccounts >= 10) {
$reg_form_errors[] = 'You cannot create more than 10 accounts within 24 hours.';
}
}
0.0.0.0
), so after 10 accounts created by IPv6 users, it will block all others.Got error when try to create account after this change:Under:
Add:![]()
Gesior2012/pages/createaccount.php at master · gesior/Gesior2012
Gesior 2012 - Account Maker [website] for OTSes, account maker you can find in BRANCHES. Select 'branch'. - gesior/Gesior2012github.com
PHP:if (empty($reg_form_errors)) { $visitorIp = (int)Visitor::getIP(); $createdAccountsData = $SQL->query('SELECT COUNT(1) AS value FROM `accounts` WHERE `creation` >= ' . (time() - 86400) . ' AND `create_ip` = ' . $visitorIp)->fetch(); $createdAccounts = ($createdAccountsData !== false) ? $createdAccountsData['value'] : 0; if ($createdAccounts >= 10) { $reg_form_errors[] = 'You cannot create more than 10 accounts within 24 hours.'; } }
CloudFlare NOTE:
If you are using CloudFlare.com, users may access your site using IPv6, even, if your VPS/dedicated server allows only IPv4 connections.
Gesior2012/Znote does not support IPv6 and all IPv6 users will be counted as single IP (as0.0.0.0
), so after 10 accounts created by IPv6 users, it will block all others.
You cannot switch off 'IPv6 support' in Cloudflare panel on website. Here is instruction how to disable it using CloudFlare API:
![]()
Disabling IPv6 on Cloudflare - Media Realm
Find out how to disable IPv6 access on your Cloudflare website, even if the dashboard won't allow you. Helpful if you have a legacy app without IPv6 supportmediarealm.com.au
Looks like your database is not compatible. Post what columns you have inGot error when try to create account after this change:
[Wed Jun 22 08:14:45.078367 2022] [php7:error] [pid 15584] PHP Fatal error: Uncaught Error: Call to a member function fetch() on boolean in /var/www/html/pages/createaccount.php:276\nStack trace:\n#0 /var/www/html/system/load.page.php(7): include()\n#1 /var/www/html/index.php(42): include_once('/var/www/html/s...')\n#2 {main}\n thrown in /var/www/html/pages/createaccount.php on line 276
accounts
table.creation
with create_date
or created
.Already did, itsIn code from my post above replacecreation
withcreate_date
orcreated
.
I don't know in which column your acc. maker stores date of account creation.
create_date
. Thanks!