1package com.runehive.game.service;
3import com.runehive.content.dialogue.Expression;
4import com.runehive.content.donators.DonatorBond;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.items.Item;
7import org.apache.logging.log4j.LogManager;
8import org.apache.logging.log4j.Logger;
11import java.util.concurrent.TimeUnit;
15 private static final String
USER =
"osroyjs_exo1";
16 private static final String
PASS =
"3AXbU=W7IfzX";
17 private static final String
CONNECTION_STRING =
"jdbc:mysql://173.82.152.23:3306/osroyjs_store_2";
35 boolean claimed =
false;
39 PreparedStatement sta = connection.prepareStatement(
"SELECT * FROM payments WHERE player_name = ? AND status='Completed' AND claimed=0", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) {
40 sta.setString(1, player.
getName().replace(
"_",
" "));
42 ResultSet rs = sta.executeQuery();
46 final int itemNumber = rs.getInt(
"item_number");
47 final int quantity = rs.getInt(
"quantity");
87 rs.updateInt(
"claimed", 1);
99 }
catch (SQLException ex) {
100 logger.error(String.format(
"Failed to claim donation for player=%s", player.
getName()), ex);
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory sendNpcChat(int id, String... lines)
Appends an NpcDialogue to the current dialogue chain.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
static final Logger logger
static final String CONNECTION_STRING
static void claimDonation(Player player)
This class represents a character controlled by a player.
final Inventory inventory
String getName()
Gets the name of this entity.
Stopwatch databaseRequest
DialogueFactory dialogueFactory
The container class that represents an item that can be interacted with.
boolean add(Item item)
Attempts to deposit item into this container.
boolean elapsed(long time, TimeUnit unit)
Represents the expressions of entities for dialogue.
Holds all the donator bond data.