mirror of
https://github.com/Zrips/Jobs.git
synced 2025-04-06 20:26:05 +02:00
Fix SQLException error when saving points
This commit is contained in:
parent
fbbfe46a66
commit
ebe81b6216
src/main/java/com/gamingmesh/jobs
@ -628,7 +628,7 @@ public class JobsPlayer {
|
|||||||
|
|
||||||
public int getMaxJobLevelAllowed(Job job) {
|
public int getMaxJobLevelAllowed(Job job) {
|
||||||
int maxLevel = 0;
|
int maxLevel = 0;
|
||||||
if (getPlayer().hasPermission("jobs." + job.getName() + ".vipmaxlevel"))
|
if (getPlayer() != null && getPlayer().hasPermission("jobs." + job.getName() + ".vipmaxlevel"))
|
||||||
maxLevel = job.getVipMaxLevel() > job.getMaxLevel() ? job.getVipMaxLevel() : job.getMaxLevel();
|
maxLevel = job.getVipMaxLevel() > job.getMaxLevel() ? job.getVipMaxLevel() : job.getMaxLevel();
|
||||||
else
|
else
|
||||||
maxLevel = job.getMaxLevel();
|
maxLevel = job.getMaxLevel();
|
||||||
@ -795,9 +795,7 @@ public class JobsPlayer {
|
|||||||
* @return true if online, otherwise false
|
* @return true if online, otherwise false
|
||||||
*/
|
*/
|
||||||
public boolean isOnline() {
|
public boolean isOnline() {
|
||||||
if (getPlayer() != null)
|
return getPlayer() != null ? getPlayer().isOnline() : isOnline;
|
||||||
return getPlayer().isOnline();
|
|
||||||
return isOnline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSaved() {
|
public boolean isSaved() {
|
||||||
|
@ -1990,13 +1990,6 @@ public abstract class JobsDAO {
|
|||||||
return;
|
return;
|
||||||
PreparedStatement prest = null;
|
PreparedStatement prest = null;
|
||||||
try {
|
try {
|
||||||
prest = conn.prepareStatement("DELETE FROM `" + DBTables.PointsTable.getTableName() + "` WHERE `" + PointsTableFields.userid.getCollumn() + "` = ?;");
|
|
||||||
prest.setInt(1, jPlayer.getUserId());
|
|
||||||
prest.execute();
|
|
||||||
|
|
||||||
close(prest);
|
|
||||||
prest = null;
|
|
||||||
|
|
||||||
PlayerPoints pointInfo = jPlayer.getPointsData();
|
PlayerPoints pointInfo = jPlayer.getPointsData();
|
||||||
prest = conn.prepareStatement("INSERT INTO `" + DBTables.PointsTable.getTableName() + "` (`" + PointsTableFields.totalpoints.getCollumn() + "`, `" + PointsTableFields.currentpoints.getCollumn()
|
prest = conn.prepareStatement("INSERT INTO `" + DBTables.PointsTable.getTableName() + "` (`" + PointsTableFields.totalpoints.getCollumn() + "`, `" + PointsTableFields.currentpoints.getCollumn()
|
||||||
+ "`, `" + PointsTableFields.userid.getCollumn() + "`) VALUES (?, ?, ?);");
|
+ "`, `" + PointsTableFields.userid.getCollumn() + "`) VALUES (?, ?, ?);");
|
||||||
|
Loading…
Reference in New Issue
Block a user