- Баллы
- 78
Всем доброго времени суток. Возникла следующая проблема: подключил AuthMe к БД, импортировал из файла auths.db всех игроков в базу данных MySQL с помощью данного php скрипта:
Вроде как всё работает корректно, пользователи перенеслись, инвентарь, регионы и прочее - тоже. Но есть одно но: при вводе неправильного пароля во время авторизации в консоли появляются следующие ошибки:
Хотя при вводе верного пароля - игроки спокойно авторизуются. Помогите разобраться, что это за ошибка и чем она вызвана?
<?
// Notes from BloodyEye
// Before starting convert, you MUST run the AuthMe plugin with database settings in
// config.yml, for creating table authme in database
// When convert from file, don't forget about read rights on Dir and File , they must be
// visible for your user
// Execute command from console: - php ConvertFromFileToMySQL.php
// PHP must be installed
$dbHost = 'localhost'; // localhost - this computer
$dbUserName = 'minecraft'; // user name for connect to mysql
$dbUserPass = 'minecraft'; // user password for connect to mysql
$dbName = 'minecraft'; // name of database
$dbTableName = 'authme'; // name of database table
$fileName = './auths.db'; // file with users data ./ means file is located current Dir
$dbh = @mysql_connect($dbHost, $dbUserName, $dbUserPass) or die("Could not connect: - ".mysql_error()."\r\n");
@mysql_select_db($dbName) or die ("Can't use this database: - " . mysql_error()."\r\n");
if ($dbh)
{
if (file_exists($fileName))
{
$openFile=@fopen($fileName, "r");
if($openFile)
{
while (!feof($openFile))
{
@list($username, $password, $ip) = Explode(":", fgets($openFile));
if (!empty($password))
{
$sqlString = "INSERT INTO ".$dbTableName." (username, password, ip) VALUES ('".$username."', '".$password."', '".$ip."') ";
$sql = @mysql_query ($sqlString, $dbh);
}
}
fclose($openFile);
}
else
{
echo "Can't open file! \r\n";
}
}
else
{
echo "Can't found file! \r\n";
}
}
else
{
echo "Can't connect to mysql! \r\n";
}
?>
// Notes from BloodyEye
// Before starting convert, you MUST run the AuthMe plugin with database settings in
// config.yml, for creating table authme in database
// When convert from file, don't forget about read rights on Dir and File , they must be
// visible for your user
// Execute command from console: - php ConvertFromFileToMySQL.php
// PHP must be installed
$dbHost = 'localhost'; // localhost - this computer
$dbUserName = 'minecraft'; // user name for connect to mysql
$dbUserPass = 'minecraft'; // user password for connect to mysql
$dbName = 'minecraft'; // name of database
$dbTableName = 'authme'; // name of database table
$fileName = './auths.db'; // file with users data ./ means file is located current Dir
$dbh = @mysql_connect($dbHost, $dbUserName, $dbUserPass) or die("Could not connect: - ".mysql_error()."\r\n");
@mysql_select_db($dbName) or die ("Can't use this database: - " . mysql_error()."\r\n");
if ($dbh)
{
if (file_exists($fileName))
{
$openFile=@fopen($fileName, "r");
if($openFile)
{
while (!feof($openFile))
{
@list($username, $password, $ip) = Explode(":", fgets($openFile));
if (!empty($password))
{
$sqlString = "INSERT INTO ".$dbTableName." (username, password, ip) VALUES ('".$username."', '".$password."', '".$ip."') ";
$sql = @mysql_query ($sqlString, $dbh);
}
}
fclose($openFile);
}
else
{
echo "Can't open file! \r\n";
}
}
else
{
echo "Can't found file! \r\n";
}
}
else
{
echo "Can't connect to mysql! \r\n";
}
?>
Вроде как всё работает корректно, пользователи перенеслись, инвентарь, регионы и прочее - тоже. Но есть одно но: при вводе неправильного пароля во время авторизации в консоли появляются следующие ошибки:
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.listener.AuthMePlayerListener.onPlayerLogin(AuthMePlayerListener.java:578)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.CacheDataSource.isAuthAvailable(CacheDataSource.java:34)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MySQLDataSource.isAuthAvailable(MySQLDataSource.java:136)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getValidConnection(MiniConnectionPoolManager.java:185)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getValidConnection2(MiniConnectionPoolManager.java:203)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getConnection2(MiniConnectionPoolManager.java:140)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getConnection3(MiniConnectionPoolManager.java:156)
03.04 18:26:16 [Server] INFO at com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection.getConnection(MysqlPooledConnection.java:158)
03.04 18:26:16 [Server] INFO at com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection.getConnection(MysqlPooledConnection.java:188)
03.04 18:26:16 [Server] INFO at com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection.callConnectionEventListeners(MysqlPooledConnection.java:250)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager$PoolConnectionEventListener.connectionErrorOccurred(MiniConnectionPoolManager.java:286)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.access$1(MiniConnectionPoolManager.java:245)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.disposeConnection(MiniConnectionPoolManager.java:251)
03.04 18:26:16 [Server] INFO Caused by: java.lang.AssertionError
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:409)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:476)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:225)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:580)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:29)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServerConnectionThread.a(DedicatedServerConnectionThread.java:41)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.PendingConnection.c(PendingConnection.java:44)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.PendingConnection.d(PendingConnection.java:120)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.PlayerList.attemptLogin(PlayerList.java:319)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
03.04 18:26:16 [Server] INFO org.bukkit.event.EventException
03.04 18:26:16 [Server] SEVERE Could not pass event PlayerLoginEvent to AuthMe v2.7.0
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.CacheDataSource.isAuthAvailable(CacheDataSource.java:34)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MySQLDataSource.isAuthAvailable(MySQLDataSource.java:136)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getValidConnection(MiniConnectionPoolManager.java:185)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getValidConnection2(MiniConnectionPoolManager.java:203)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getConnection2(MiniConnectionPoolManager.java:140)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.getConnection3(MiniConnectionPoolManager.java:156)
03.04 18:26:16 [Server] INFO at com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection.getConnection(MysqlPooledConnection.java:158)
03.04 18:26:16 [Server] INFO at com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection.getConnection(MysqlPooledConnection.java:188)
03.04 18:26:16 [Server] INFO at com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection.callConnectionEventListeners(MysqlPooledConnection.java:250)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager$PoolConnectionEventListener.connectionErrorOccurred(MiniConnectionPoolManager.java:286)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.access$1(MiniConnectionPoolManager.java:245)
03.04 18:26:16 [Server] INFO at uk.org.whoami.authme.datasource.MiniConnectionPoolManager.disposeConnection(MiniConnectionPoolManager.java:251)
03.04 18:26:16 [Server] INFO Caused by: java.lang.AssertionError
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:409)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:476)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:225)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:580)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:29)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.DedicatedServerConnectionThread.a(DedicatedServerConnectionThread.java:41)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.PendingConnection.c(PendingConnection.java:44)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.PendingConnection.d(PendingConnection.java:120)
03.04 18:26:16 [Server] INFO at net.minecraft.server.v1_5_R2.PlayerList.attemptLogin(PlayerList.java:319)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
03.04 18:26:16 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
03.04 18:26:16 [Server] INFO org.bukkit.event.EventException
03.04 18:26:16 [Server] SEVERE Could not pass event PlayerLoginEvent to AuthMe v2.7.0
Хотя при вводе верного пароля - игроки спокойно авторизуются. Помогите разобраться, что это за ошибка и чем она вызвана?