mirror of
https://github.com/Quackster/Havana.git
synced 2025-07-02 20:57:47 +00:00
Merge pull request #19 from GitHabbo/feature/hc-trasaction
Add user transaction log for buying Habbo Club
This commit is contained in:
commit
7d5fe225e7
2 changed files with 14 additions and 2 deletions
|
@ -80,7 +80,7 @@ public class ClubSubscription {
|
|||
* @param playerDetails the details of the player that subscribed
|
||||
* @param choice the subscription choice
|
||||
*/
|
||||
public static boolean subscribeClub(PlayerDetails playerDetails, int choice) {
|
||||
public static boolean subscribeClub(PlayerDetails playerDetails, int choice) throws SQLException {
|
||||
var choiceData = getChoiceData(choice);
|
||||
|
||||
int credits = choiceData.getKey();
|
||||
|
@ -124,6 +124,17 @@ public class ClubSubscription {
|
|||
PlayerDao.saveSubscription(playerDetails.getId(), playerDetails.getFirstClubSubscription(), playerDetails.getClubExpiration());
|
||||
CurrencyDao.decreaseCredits(playerDetails, credits);
|
||||
|
||||
TransactionDao.createTransaction(
|
||||
playerDetails.getId(),
|
||||
"0",
|
||||
"0",
|
||||
days,
|
||||
"Habbo Club purchase",
|
||||
credits,
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.alexdev.havana.util.DateUtil;
|
|||
import org.alexdev.havana.util.config.GameConfiguration;
|
||||
import org.alexdev.http.util.RconUtil;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -39,7 +40,7 @@ public class HabboClubHabblet {
|
|||
template.render();
|
||||
}
|
||||
|
||||
public static void subscribe(WebConnection webConnection) {
|
||||
public static void subscribe(WebConnection webConnection) throws SQLException {
|
||||
if (!webConnection.session().getBoolean("authenticated")) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue