編譯... 的src \服務器\型號\播放器\ \包Commands.java:1389:文件的最終達成在分析 }→ ^ 1錯誤 按任意關鍵是要繼續。 。 。到達文件末尾,而解析什麼IMISS
我錯過了什麼?
if (playerCommand.startsWith("auth") && playerCommand.length() > 5) {
if (!Config.MYSQL_ACTIVE) {
c.sendMessage("Sorry this is currently disabled.");
return;
} else {
try {
PreparedStatement ps = Database.getConnection().prepareStatement("SELECT * FROM votes WHERE username = ? AND used = '1' LIMIT 1");
ps.setString(1, c.playerName);
ResultSet results = ps.executeQuery();
if (results.next()) {
c.sendMessage("You have already voted once today.");
} else {
ps.close();
ps = Database.getConnection().prepareStatement("SELECT * FROM votes WHERE authcode = ? AND used = '0' LIMIT 1");
ps.setString(1, playerCommand.substring(5));
results = ps.executeQuery();
if (results.next()) {
ps.close();
ps = Database.getConnection().prepareStatement("UPDATE votes SET used = '1' WHERE authcode = ?");
ps.setString(1, playerCommand.substring(5));
ps.executeUpdate();
c.getItems().addItem(995, 10000000);
c.sendMessage("Thank you for voting.");
} else {
c.sendMessage("The auth code is not valid!");
}
}
ps.close();
} catch (Exception e) {
e.printStackTrace();
}
}
return;
第一個錯誤可能是具有單個源文件1400行......我的意思是 - 如果你能找到一種方法將它分解成幾個模塊化部分,它可能會使你的代碼更易於管理。 – mfrankli
對不起,但它不是我的代碼即時嘗試添加此代碼是tuturial到我自己的服務器任何幫助將被apricated對不起,我的英語不好 –