java.lang.NullPointerException at server.util.MysqlManager.checkVote(MysqlManager.java:43) at server.model.players.Client.initialize(Client.java:81) at server.model.players.PlayerHandler.process(PlayerHandler.java:186) at server.Server.main(Server.java:176)
And below is section of code that it states.
Size 5 font = LINE 43
public static void checkVote(Client c) { try { [SIZE=5]Statement stmt = conn.createStatement();[/SIZE] ResultSet rs = stmt .executeQuery("SELECT COUNT(playerName) AS total FROM `votes` WHERE `playerName`= \"" + c.playerName + "\" AND `recieved`= 0"); rs.first(); int total = rs.getInt("total"); if (total == 1) { stmt.execute("UPDATE `votes` SET `recieved` = 1 WHERE `playerName` = '" + c.playerName + "'"); c.getItems().addItem(995, 10000000); c.sendMessage("Thanks for voting! Please do so again in 24 hours!"); } } catch (SQLException ex) { System.out.println(ex); } }
Client.java - Line 81
private CombatAssistant combatAssistant = new CombatAssistant(this);
Size 5 Font = LINE 186
Client o1 = (Client) Server.playerHandler.players[i]; if(PlayerSave.saveGame(o1)){ System.out.println("Game saved for player "+players[i].playerName); } else { System.out.println("Could not save for "+players[i].playerName); } removePlayer(players[i]); players[i] = null; } else { Client o = (Client) Server.playerHandler.players[i]; //if(o.g) { if(!players[i].initialized) { [B]players[i].initialize();[/B] players[i].initialized = true; } else { players[i].update(); }
Server.java - Line 176
playerHandler.process();
It's on a Windows 64-bit VPS, so it's not like on Linux for capitalisation etc.
Any help?
Thanks.