Remove "reward points" feature
This commit is contained in:
@@ -10926,33 +10926,6 @@ public class Character extends AbstractCharacterObject {
|
|||||||
this.commandtext = text;
|
this.commandtext = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRewardPoints() {
|
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
|
||||||
PreparedStatement ps = con.prepareStatement("SELECT rewardpoints FROM accounts WHERE id=?;")) {
|
|
||||||
ps.setInt(1, accountid);
|
|
||||||
ResultSet resultSet = ps.executeQuery();
|
|
||||||
int point = -1;
|
|
||||||
if (resultSet.next()) {
|
|
||||||
point = resultSet.getInt(1);
|
|
||||||
}
|
|
||||||
return point;
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRewardPoints(int value) {
|
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
|
||||||
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET rewardpoints=? WHERE id=?;")) {
|
|
||||||
ps.setInt(1, value);
|
|
||||||
ps.setInt(2, accountid);
|
|
||||||
ps.executeUpdate();
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReborns(int value) {
|
public void setReborns(int value) {
|
||||||
if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
||||||
yellowMessage("Rebirth system is not enabled!");
|
yellowMessage("Rebirth system is not enabled!");
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ public class CommandsExecutor {
|
|||||||
addCommand("online", OnlineCommand.class);
|
addCommand("online", OnlineCommand.class);
|
||||||
addCommand("gm", GmCommand.class);
|
addCommand("gm", GmCommand.class);
|
||||||
addCommand("reportbug", ReportBugCommand.class);
|
addCommand("reportbug", ReportBugCommand.class);
|
||||||
addCommand("points", ReadPointsCommand.class);
|
|
||||||
addCommand("joinevent", JoinEventCommand.class);
|
addCommand("joinevent", JoinEventCommand.class);
|
||||||
addCommand("leaveevent", LeaveEventCommand.class);
|
addCommand("leaveevent", LeaveEventCommand.class);
|
||||||
addCommand("ranks", RanksCommand.class);
|
addCommand("ranks", RanksCommand.class);
|
||||||
@@ -290,7 +289,6 @@ public class CommandsExecutor {
|
|||||||
addCommand("fame", 3, FameCommand.class);
|
addCommand("fame", 3, FameCommand.class);
|
||||||
addCommand("givenx", 3, GiveNxCommand.class);
|
addCommand("givenx", 3, GiveNxCommand.class);
|
||||||
addCommand("givems", 3, GiveMesosCommand.class);
|
addCommand("givems", 3, GiveMesosCommand.class);
|
||||||
addCommand("giverp", 3, GiveRpCommand.class);
|
|
||||||
addCommand("expeds", 3, ExpedsCommand.class);
|
addCommand("expeds", 3, ExpedsCommand.class);
|
||||||
addCommand("kill", 3, KillCommand.class);
|
addCommand("kill", 3, KillCommand.class);
|
||||||
addCommand("seed", 3, SeedCommand.class);
|
addCommand("seed", 3, SeedCommand.class);
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
package client.command.commands.gm0;
|
|
||||||
|
|
||||||
import client.Character;
|
|
||||||
import client.Client;
|
|
||||||
import client.command.Command;
|
|
||||||
import client.command.CommandContext;
|
|
||||||
|
|
||||||
public class ReadPointsCommand extends Command {
|
|
||||||
{
|
|
||||||
setDescription("Show point total.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(Client client, String[] params, CommandContext ctx) {
|
|
||||||
|
|
||||||
Character player = client.getPlayer();
|
|
||||||
if (params.length > 2) {
|
|
||||||
player.yellowMessage("Syntax: @points (rp|all)");
|
|
||||||
return;
|
|
||||||
} else if (params.length == 0) {
|
|
||||||
player.yellowMessage("RewardPoints: " + player.getRewardPoints());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (params[0]) {
|
|
||||||
case "rp":
|
|
||||||
player.yellowMessage("RewardPoints: " + player.getRewardPoints());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
player.yellowMessage("RewardPoints: " + player.getRewardPoints());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package client.command.commands.gm3;
|
|
||||||
|
|
||||||
import client.Character;
|
|
||||||
import client.Client;
|
|
||||||
import client.command.Command;
|
|
||||||
import client.command.CommandContext;
|
|
||||||
|
|
||||||
public class GiveRpCommand extends Command {
|
|
||||||
{
|
|
||||||
setDescription("Give reward points to a player.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(Client client, String[] params, CommandContext ctx) {
|
|
||||||
Character player = client.getPlayer();
|
|
||||||
if (params.length < 2) {
|
|
||||||
player.yellowMessage("Syntax: !giverp <playername> <gainrewardpoint>");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Character victim = client.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
|
||||||
if (victim != null) {
|
|
||||||
victim.setRewardPoints(victim.getRewardPoints() + Integer.parseInt(params[1]));
|
|
||||||
player.message("RP given. Player " + params[0] + " now has " + victim.getRewardPoints()
|
|
||||||
+ " reward points.");
|
|
||||||
} else {
|
|
||||||
player.message("Player '" + params[0] + "' could not be found.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user