forked from rDrama/rDrama
sneed (rename procoins to marseybux) (#472)
* sneed (rename procoins to marseybux) * literally unusable Co-authored-by: TLSM <duolsm@outlook.com>master
parent
9e4c89ad1b
commit
272e2ee936
|
@ -113,7 +113,7 @@ class User(Base):
|
|||
login_nonce = Column(Integer, default=0)
|
||||
coins = Column(Integer, default=0)
|
||||
truescore = Column(Integer, default=0)
|
||||
procoins = Column(Integer, default=0)
|
||||
marseybux = Column(Integer, default=0)
|
||||
mfa_secret = deferred(Column(String))
|
||||
is_private = Column(Boolean, default=False)
|
||||
stored_subscriber_count = Column(Integer, default=0)
|
||||
|
@ -175,7 +175,7 @@ class User(Base):
|
|||
if currency == 'coins':
|
||||
g.db.query(User).filter(User.id == self.id).update({ User.coins: User.coins + amount })
|
||||
else:
|
||||
g.db.query(User).filter(User.id == self.id).update({ User.procoins: User.procoins + amount })
|
||||
g.db.query(User).filter(User.id == self.id).update({ User.marseybux: User.marseybux + amount })
|
||||
|
||||
g.db.flush()
|
||||
|
||||
|
@ -192,11 +192,11 @@ class User(Base):
|
|||
if not should_check_balance or account_balance >= amount:
|
||||
g.db.query(User).filter(User.id == self.id).update({ User.coins: User.coins - amount })
|
||||
succeeded = True
|
||||
elif currency == 'procoins':
|
||||
account_balance = in_db.procoins
|
||||
elif currency == 'marseybux':
|
||||
account_balance = in_db.marseybux
|
||||
|
||||
if not should_check_balance or account_balance >= amount:
|
||||
g.db.query(User).filter(User.id == self.id).update({ User.procoins: User.procoins - amount })
|
||||
g.db.query(User).filter(User.id == self.id).update({ User.marseybux: User.marseybux - amount })
|
||||
succeeded = True
|
||||
|
||||
if succeeded: g.db.flush()
|
||||
|
|
|
@ -283,7 +283,7 @@ PERMS = { # Minimum admin_level to perform action.
|
|||
}
|
||||
|
||||
FEATURES = {
|
||||
'PROCOINS': True,
|
||||
'MARSEYBUX': True,
|
||||
'AWARDS': True,
|
||||
'CHAT': True,
|
||||
'PINS': True,
|
||||
|
@ -1368,7 +1368,7 @@ if SITE_NAME == 'PCM':
|
|||
AWARDS_DISABLED.remove('ghost')
|
||||
elif SITE_NAME == 'WPD':
|
||||
AWARDS_DISABLED.remove('lootbox')
|
||||
if not FEATURES['PROCOINS']:
|
||||
if not FEATURES['MARSEYBUX']:
|
||||
AWARDS_DISABLED.append('benefactor')
|
||||
|
||||
AWARDS2 = {x: AWARDS[x] for x in AWARDS if x not in AWARDS_DISABLED}
|
||||
|
|
|
@ -119,10 +119,10 @@ def _give_monthly_marseybux_task():
|
|||
|
||||
emails = [x['email'] for x in requests.get(f'https://api.gumroad.com/v2/products/{GUMROAD_ID}/subscribers', data=data, timeout=5).json()["subscribers"]]
|
||||
|
||||
def give_procoins(u):
|
||||
procoins_reward = procoins_li[u.patron]
|
||||
u.pay_account('procoins', procoins_reward)
|
||||
send_repeatable_notification(u.id, f"@AutoJanny has given you {procoins_reward} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
def give_marseybux(u):
|
||||
marseybux_reward = marseybux_li[u.patron]
|
||||
u.pay_account('marseybux', marseybux_reward)
|
||||
send_repeatable_notification(u.id, f"@AutoJanny has given you {marseybux_reward} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
|
||||
for badge in g.db.query(Badge).filter(Badge.badge_id > 20, Badge.badge_id < 28).all():
|
||||
g.db.delete(badge)
|
||||
|
@ -130,7 +130,7 @@ def _give_monthly_marseybux_task():
|
|||
for u in g.db.query(User).filter(User.patron > 0, User.patron_utc == 0).all():
|
||||
g.db.add(u)
|
||||
if u.admin_level or u.id in GUMROAD_MESSY:
|
||||
give_procoins(u)
|
||||
give_marseybux(u)
|
||||
elif u.email and u.is_activated and u.email.lower() in emails:
|
||||
data = {'access_token': GUMROAD_TOKEN, 'email': u.email}
|
||||
try:
|
||||
|
@ -147,7 +147,7 @@ def _give_monthly_marseybux_task():
|
|||
tier = tiers[response["variants_and_quantity"]]
|
||||
u.patron = tier
|
||||
badge_grant(badge_id=20+tier, user=u, notify=False)
|
||||
give_procoins(u)
|
||||
give_marseybux(u)
|
||||
else:
|
||||
u.patron = 0
|
||||
|
||||
|
@ -173,9 +173,9 @@ def _give_monthly_marseybux_task_kofi():
|
|||
u.patron = 0
|
||||
continue
|
||||
|
||||
procoins_reward = procoins_li[u.patron]
|
||||
u.pay_account('procoins', procoins_reward)
|
||||
send_repeatable_notification(u.id, f"@AutoJanny has given you {procoins_reward} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
marseybux_reward = marseybux_li[u.patron]
|
||||
u.pay_account('marseybux', marseybux_reward)
|
||||
send_repeatable_notification(u.id, f"@AutoJanny has given you {marseybux_reward} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||
|
||||
ma = ModAction(
|
||||
kind="monthly",
|
||||
|
|
|
@ -92,7 +92,7 @@ link_fix_regex = re.compile("(\[.*?\]\()(?!http|/)(.*?\))", flags=re.A)
|
|||
|
||||
css_url_regex = re.compile('url\(\s*[\'"]?(.*?)[\'"]?\s*\)', flags=re.I|re.A)
|
||||
|
||||
procoins_li = (0,2500,5000,10000,25000,50000,100000,250000)
|
||||
marseybux_li = (0,2500,5000,10000,25000,50000,100000,250000)
|
||||
|
||||
linefeeds_regex = re.compile("([^\n])\n([^\n])", flags=re.A)
|
||||
|
||||
|
|
|
@ -176,10 +176,10 @@ def spin_roulette_wheel():
|
|||
gambler = get_account(user_id)
|
||||
gambler_payout = payouts[user_id]
|
||||
coin_winnings = gambler_payout['coins']
|
||||
procoin_winnings = gambler_payout['procoins']
|
||||
procoin_winnings = gambler_payout['marseybux']
|
||||
|
||||
gambler.pay_account('coins', coin_winnings)
|
||||
gambler.pay_account('procoins', procoin_winnings)
|
||||
gambler.pay_account('marseybux', procoin_winnings)
|
||||
|
||||
# Notify the winners.
|
||||
notification_text = f"Winning number: {number}\nCongratulations! One or more of your roulette bets paid off!\n"
|
||||
|
@ -236,7 +236,7 @@ def determine_roulette_winners(number, bets):
|
|||
if not payouts.get(gambler_id):
|
||||
payouts[gambler_id] = {
|
||||
'coins': 0,
|
||||
'procoins': 0
|
||||
'marseybux': 0
|
||||
}
|
||||
|
||||
if not rewards_by_game_id.get(game_id):
|
||||
|
|
|
@ -126,7 +126,7 @@ def check_slots_command(v:User, u:User, c:Comment):
|
|||
|
||||
if '!slotsmb' in body:
|
||||
command_word = '!slotsmb'
|
||||
currency = 'procoins'
|
||||
currency = 'marseybux'
|
||||
elif '!slots' in body:
|
||||
command_word = '!slots'
|
||||
currency = 'coins'
|
||||
|
@ -151,7 +151,7 @@ def check_slots_command(v:User, u:User, c:Comment):
|
|||
abort(400, f"Wager must be 100 {currency} or more")
|
||||
return
|
||||
|
||||
if (currency == "coins" and wager > u.coins) or (currency == "procoins" and wager > u.procoins):
|
||||
if (currency == "coins" and wager > u.coins) or (currency == "marseybux" and wager > u.marseybux):
|
||||
if v.id == u.id:
|
||||
abort(400, f"Not enough {currency} to make that bet")
|
||||
return
|
||||
|
|
|
@ -24,7 +24,7 @@ from .front import frontlist
|
|||
def kippy(v):
|
||||
if SITE != 'pcmemes.net': abort(404)
|
||||
kippy = get_account(KIPPY_ID)
|
||||
kippy.pay_account('procoins', 10000)
|
||||
kippy.pay_account('marseybux', 10000)
|
||||
g.db.add(kippy)
|
||||
return '10k marseybux printed!'
|
||||
|
||||
|
@ -88,7 +88,7 @@ def merge(v, id1, id2):
|
|||
g.db.add(exile)
|
||||
g.db.flush()
|
||||
|
||||
for kind in ('comment_count', 'post_count', 'winnings', 'received_award_count', 'coins_spent', 'lootboxes_bought', 'coins', 'truescore', 'procoins'):
|
||||
for kind in ('comment_count', 'post_count', 'winnings', 'received_award_count', 'coins_spent', 'lootboxes_bought', 'coins', 'truescore', 'marseybux'):
|
||||
amount = getattr(user1, kind) + getattr(user2, kind)
|
||||
setattr(user1, kind, amount)
|
||||
setattr(user2, kind, 0)
|
||||
|
@ -138,7 +138,7 @@ def merge_all(v, id):
|
|||
g.db.flush()
|
||||
|
||||
for alt in user.alts_unique:
|
||||
for kind in ('comment_count', 'post_count', 'winnings', 'received_award_count', 'coins_spent', 'lootboxes_bought', 'coins', 'truescore', 'procoins'):
|
||||
for kind in ('comment_count', 'post_count', 'winnings', 'received_award_count', 'coins_spent', 'lootboxes_bought', 'coins', 'truescore', 'marseybux'):
|
||||
amount = getattr(user, kind) + getattr(alt, kind)
|
||||
setattr(user, kind, amount)
|
||||
setattr(alt, kind, 0)
|
||||
|
|
|
@ -68,7 +68,7 @@ def buy(v, award):
|
|||
if award == "grass":
|
||||
abort(403, "You can't buy the grass award with marseybux.")
|
||||
|
||||
charged = v.charge_account('procoins', price)
|
||||
charged = v.charge_account('marseybux', price)
|
||||
if not charged:
|
||||
abort(400, "Not enough marseybux.")
|
||||
else:
|
||||
|
@ -331,7 +331,7 @@ def award_thing(v, thing_type, id):
|
|||
author.patron = 1
|
||||
if author.patron_utc: author.patron_utc += 2629746
|
||||
else: author.patron_utc = int(time.time()) + 2629746
|
||||
author.pay_account('procoins', 2500)
|
||||
author.pay_account('marseybux', 2500)
|
||||
badge_grant(user=v, badge_id=103)
|
||||
elif kind == "rehab":
|
||||
if author.rehab: author.rehab += 86400
|
||||
|
|
|
@ -87,22 +87,20 @@ def pull_slots(v):
|
|||
|
||||
try:
|
||||
currency = request.values.get("currency", "").lower()
|
||||
if currency not in ('coins', 'procoins'): raise ValueError()
|
||||
if currency not in ('coins', 'marseybux'): raise ValueError()
|
||||
except:
|
||||
abort(400, "Invalid currency (expected 'coins' or 'procoins').")
|
||||
abort(400, "Invalid currency (expected 'coins' or 'marseybux').")
|
||||
|
||||
friendly_currency_name = "coins" if currency == "coins" else "marseybux"
|
||||
|
||||
if (currency == "coins" and wager > v.coins) or (currency == "procoins" and wager > v.procoins):
|
||||
abort(400, f"Not enough {friendly_currency_name} to make that bet")
|
||||
if (currency == "coins" and wager > v.coins) or (currency == "marseybux" and wager > v.marseybux):
|
||||
abort(400, f"Not enough {currency} to make that bet")
|
||||
|
||||
game_id, game_state = casino_slot_pull(v, wager, currency)
|
||||
success = bool(game_id)
|
||||
|
||||
if success:
|
||||
return {"game_state": game_state, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"game_state": game_state, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
else:
|
||||
abort(400, f"Wager must be 5 {friendly_currency_name} or more")
|
||||
abort(400, f"Wager must be 5 {currency} or more")
|
||||
|
||||
|
||||
# 21
|
||||
|
@ -120,7 +118,7 @@ def blackjack_deal_to_player(v):
|
|||
state = dispatch_action(v, BlackjackAction.DEAL)
|
||||
feed = get_game_feed('blackjack', g.db)
|
||||
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
except Exception as e:
|
||||
abort(400, str(e))
|
||||
|
||||
|
@ -135,7 +133,7 @@ def blackjack_player_hit(v):
|
|||
try:
|
||||
state = dispatch_action(v, BlackjackAction.HIT)
|
||||
feed = get_game_feed('blackjack', g.db)
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
except:
|
||||
abort(400, "Unable to hit.")
|
||||
|
||||
|
@ -150,7 +148,7 @@ def blackjack_player_stay(v):
|
|||
try:
|
||||
state = dispatch_action(v, BlackjackAction.STAY)
|
||||
feed = get_game_feed('blackjack', g.db)
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
except:
|
||||
abort(400, "Unable to stay.")
|
||||
|
||||
|
@ -165,7 +163,7 @@ def blackjack_player_doubled_down(v):
|
|||
try:
|
||||
state = dispatch_action(v, BlackjackAction.DOUBLE_DOWN)
|
||||
feed = get_game_feed('blackjack', g.db)
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
except:
|
||||
abort(400, "Unable to double down.")
|
||||
|
||||
|
@ -180,7 +178,7 @@ def blackjack_player_bought_insurance(v):
|
|||
try:
|
||||
state = dispatch_action(v, BlackjackAction.BUY_INSURANCE)
|
||||
feed = get_game_feed('blackjack', g.db)
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
except:
|
||||
abort(403, "Unable to buy insurance.")
|
||||
|
||||
|
@ -194,7 +192,7 @@ def roulette_get_bets(v):
|
|||
|
||||
bets = get_roulette_bets()
|
||||
|
||||
return {"success": True, "bets": bets, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "bets": bets, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
|
||||
|
||||
@app.post("/casino/roulette/place-bet")
|
||||
|
@ -224,6 +222,6 @@ def roulette_player_placed_bet(v):
|
|||
try:
|
||||
gambler_placed_roulette_bet(v, bet, which, amount, currency)
|
||||
bets = get_roulette_bets()
|
||||
return {"success": True, "bets": bets, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||
return {"success": True, "bets": bets, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||
except:
|
||||
abort(400, "Unable to place a bet.")
|
||||
|
|
|
@ -48,10 +48,10 @@ def buy_hat(v, hat_id):
|
|||
abort(403, "This hat is not for sale.")
|
||||
|
||||
if request.values.get("mb"):
|
||||
charged = v.charge_account('procoins', hat.price)
|
||||
charged = v.charge_account('marseybux', hat.price)
|
||||
if not charged: abort(400, "Not enough marseybux.")
|
||||
|
||||
hat.author.pay_account('procoins', hat.price * 0.1)
|
||||
hat.author.pay_account('marseybux', hat.price * 0.1)
|
||||
currency = "marseybux"
|
||||
else:
|
||||
charged = v.charge_account('coins', hat.price)
|
||||
|
|
|
@ -281,7 +281,7 @@ def settings_personal_post(v):
|
|||
|
||||
success = v.charge_account('coins', cost)
|
||||
if not success:
|
||||
success = v.charge_account('procoins', cost)
|
||||
success = v.charge_account('marseybux', cost)
|
||||
if not success: abort(403)
|
||||
|
||||
if house == "None": house = ''
|
||||
|
@ -358,16 +358,16 @@ def gumroad(v):
|
|||
tier = tiers[response["variants_and_quantity"]]
|
||||
if v.patron == tier: abort(400, f"{patron} rewards already claimed")
|
||||
|
||||
procoins = procoins_li[tier] - procoins_li[v.patron]
|
||||
if procoins < 0: abort(400, f"{patron} rewards already claimed")
|
||||
marseybux = marseybux_li[tier] - marseybux_li[v.patron]
|
||||
if marseybux < 0: abort(400, f"{patron} rewards already claimed")
|
||||
|
||||
existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).first()
|
||||
if existing: abort(400, f"{patron} rewards already claimed on another account")
|
||||
|
||||
v.patron = tier
|
||||
|
||||
v.pay_account('procoins', procoins)
|
||||
send_repeatable_notification(v.id, f"You have received {procoins} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
||||
v.pay_account('marseybux', marseybux)
|
||||
send_repeatable_notification(v.id, f"You have received {marseybux} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
||||
|
||||
g.db.add(v)
|
||||
|
||||
|
|
|
@ -273,24 +273,23 @@ def get_coins(v, username):
|
|||
user = get_user(username, v=v, include_shadowbanned=False)
|
||||
return {"coins": user.coins}
|
||||
|
||||
def transfer_currency(v:User, username:str, currency_name:Literal['coins', 'procoins'], apply_tax:bool):
|
||||
def transfer_currency(v:User, username:str, currency_name:Literal['coins', 'marseybux'], apply_tax:bool):
|
||||
MIN_CURRENCY_TRANSFER = 100
|
||||
TAX_PCT = 0.03
|
||||
friendly_currency_name = 'marseybux' if currency_name == 'procoins' else 'coins'
|
||||
receiver = get_user(username, v=v, include_shadowbanned=False)
|
||||
if receiver.id == v.id: abort(400, f"You can't transfer {friendly_currency_name} to yourself!")
|
||||
if receiver.id == v.id: abort(400, f"You can't transfer {currency_name} to yourself!")
|
||||
amount = request.values.get("amount", "").strip()
|
||||
amount = int(amount) if amount.isdigit() else None
|
||||
|
||||
if amount is None or amount <= 0: abort(400, f"Invalid number of {friendly_currency_name}")
|
||||
if amount < MIN_CURRENCY_TRANSFER: abort(400, f"You have to gift at least {MIN_CURRENCY_TRANSFER} {friendly_currency_name}")
|
||||
if amount is None or amount <= 0: abort(400, f"Invalid number of {currency_name}")
|
||||
if amount < MIN_CURRENCY_TRANSFER: abort(400, f"You have to gift at least {MIN_CURRENCY_TRANSFER} {currency_name}")
|
||||
tax = 0
|
||||
if apply_tax and not v.patron and not receiver.patron and not v.alts_patron and not receiver.alts_patron:
|
||||
tax = math.ceil(amount*TAX_PCT)
|
||||
|
||||
reason = request.values.get("reason", "").strip()
|
||||
log_message = f"@{v.username} has transferred {amount} {friendly_currency_name} to @{receiver.username}"
|
||||
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} {friendly_currency_name}!"
|
||||
log_message = f"@{v.username} has transferred {amount} {currency_name} to @{receiver.username}"
|
||||
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} {currency_name}!"
|
||||
|
||||
if reason:
|
||||
if len(reason) > TRANSFER_MESSAGE_LENGTH_LIMIT: abort(400, f"Reason is too long, max {TRANSFER_MESSAGE_LENGTH_LIMIT} characters")
|
||||
|
@ -298,11 +297,11 @@ def transfer_currency(v:User, username:str, currency_name:Literal['coins', 'proc
|
|||
log_message += f"\n\n> {reason}"
|
||||
|
||||
if not v.charge_account(currency_name, amount):
|
||||
abort(400, f"You don't have enough {friendly_currency_name}")
|
||||
abort(400, f"You don't have enough {currency_name}")
|
||||
|
||||
if not v.shadowbanned:
|
||||
if currency_name == 'procoins':
|
||||
receiver.pay_account('procoins', amount - tax)
|
||||
if currency_name == 'marseybux':
|
||||
receiver.pay_account('marseybux', amount - tax)
|
||||
elif currency_name == 'coins':
|
||||
receiver.pay_account('coins', amount - tax)
|
||||
else:
|
||||
|
@ -311,7 +310,7 @@ def transfer_currency(v:User, username:str, currency_name:Literal['coins', 'proc
|
|||
if GIFT_NOTIF_ID: send_repeatable_notification(GIFT_NOTIF_ID, log_message)
|
||||
send_repeatable_notification(receiver.id, notif_text)
|
||||
g.db.add(v)
|
||||
return {"message": f"{amount - tax} {friendly_currency_name} have been transferred to @{receiver.username}"}
|
||||
return {"message": f"{amount - tax} {currency_name} have been transferred to @{receiver.username}"}
|
||||
|
||||
@app.post("/@<username>/transfer_coins")
|
||||
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
||||
|
@ -321,12 +320,12 @@ def transfer_coins(v, username):
|
|||
return transfer_currency(v, username, 'coins', True)
|
||||
|
||||
@app.post("/@<username>/transfer_bux")
|
||||
@feature_required('PROCOINS')
|
||||
@feature_required('MARSEYBUX')
|
||||
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
||||
@is_not_permabanned
|
||||
@ratelimit_user()
|
||||
def transfer_bux(v, username):
|
||||
return transfer_currency(v, username, 'procoins', False)
|
||||
return transfer_currency(v, username, 'marseybux', False)
|
||||
|
||||
@app.get("/leaderboard")
|
||||
@auth_required
|
||||
|
@ -1108,9 +1107,9 @@ def settings_kofi(v):
|
|||
|
||||
tier = kofi_tiers[transaction.amount]
|
||||
|
||||
procoins = procoins_li[tier]
|
||||
v.pay_account('procoins', procoins)
|
||||
send_repeatable_notification(v.id, f"You have received {procoins} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
||||
marseybux = marseybux_li[tier]
|
||||
v.pay_account('marseybux', marseybux)
|
||||
send_repeatable_notification(v.id, f"You have received {marseybux} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
||||
g.db.add(v)
|
||||
|
||||
if tier > v.patron:
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<li><a href="/chuds">Permachudded Users</a></li>
|
||||
<li><a href="/grassed">Currently Grassed Users</a></li>
|
||||
{%- endif %}
|
||||
{% if FEATURES['PROCOINS'] and (not AEVANN_ID or v.id in (AEVANN_ID, CARP_ID, SNAKES_ID)) -%}
|
||||
{% if FEATURES['MARSEYBUX'] and (not AEVANN_ID or v.id in (AEVANN_ID, CARP_ID, SNAKES_ID)) -%}
|
||||
<li><a href="/patrons">Patrons</a></li>
|
||||
{%- endif %}
|
||||
{% if v.admin_level >= PERMS['VIEW_ACTIVE_USERS'] %}
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
document.getElementById("user-coins-amount").innerText = updated.coins;
|
||||
}
|
||||
|
||||
if (updated.procoins) {
|
||||
document.getElementById("user-bux-amount").innerText = updated.procoins;
|
||||
if (updated.marseybux) {
|
||||
document.getElementById("user-bux-amount").innerText = updated.marseybux;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@
|
|||
const currency = document.querySelector(
|
||||
'input[name="wagerCurrency"]:checked'
|
||||
).value;
|
||||
const genericCurrency = currency == 'marseybux' ? 'procoins' : 'coins';
|
||||
const genericCurrency = currency == 'marseybux' ? 'marseybux' : 'coins';
|
||||
|
||||
return { amount, currency: genericCurrency, localCurrency: currency };
|
||||
}
|
||||
|
@ -72,13 +72,13 @@
|
|||
function disableWager() {
|
||||
document.getElementById("wagerAmount").disabled = true;
|
||||
document.getElementById("wagerCoins").disabled = true;
|
||||
document.getElementById("wagerProcoins").disabled = true;
|
||||
document.getElementById("wagerMarseybux").disabled = true;
|
||||
}
|
||||
|
||||
function enableWager() {
|
||||
document.getElementById("wagerAmount").disabled = false;
|
||||
document.getElementById("wagerCoins").disabled = false;
|
||||
document.getElementById("wagerProcoins").disabled = false;
|
||||
document.getElementById("wagerMarseybux").disabled = false;
|
||||
}
|
||||
|
||||
function updateResult(text, className) {
|
||||
|
@ -162,7 +162,7 @@
|
|||
const [biggestWinnerAllTime, biggestWinner24h, biggestLoser24h, biggestLoserAllTime] = [
|
||||
'biggestWinnerAllTime', 'biggestWinner24h', 'biggestLoser24h', 'biggestLoserAllTime'
|
||||
].map(id => document.getElementById(id));
|
||||
const formatLocalCurrencyName = currency => ({ coins: 'coins', procoins: 'marseybux' })[currency];
|
||||
const formatLocalCurrencyName = currency => ({ coins: 'coins', marseybux: 'marseybux' })[currency];
|
||||
|
||||
biggestWinnerAllTime.innerHTML = `
|
||||
<a href="/@${leaderboardData.all_time.biggest_win.user}">${leaderboardData.all_time.biggest_win.user}</a> <br><small>${leaderboardData.all_time.biggest_win.amount} ${formatLocalCurrencyName(leaderboardData.all_time.biggest_win.currency)}</small>
|
||||
|
@ -386,9 +386,9 @@
|
|||
<img src="/i/rDrama/coins.webp?v=3009" alt="coin" width="32" data-bs-toggle="tooltip"
|
||||
data-bs-placement="bottom" title="Coin" aria-label="Coin">
|
||||
</label>
|
||||
<input type="radio" class="btn-check ml-2" name="wagerCurrency" autocomplete="off" id="wagerProcoins"
|
||||
<input type="radio" class="btn-check ml-2" name="wagerCurrency" autocomplete="off" id="wagerMarseybux"
|
||||
value="marseybux">
|
||||
<label for="wagerProcoins" class="btn btn-primary">
|
||||
<label for="wagerMarseybux" class="btn btn-primary">
|
||||
<img src="/i/marseybux.webp?v=2000" alt="marseybux" width="32" data-bs-toggle="tooltip"
|
||||
data-bs-placement="bottom" title="Marseybux" aria-label="Marseybux">
|
||||
</label>
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
profile: `/@${bet.gambler_username}`,
|
||||
wagerTotal: {
|
||||
coins: 0,
|
||||
procoins: 0
|
||||
marseybux: 0
|
||||
},
|
||||
wagers: []
|
||||
}
|
||||
|
@ -204,7 +204,7 @@
|
|||
which: bet.which,
|
||||
amounts: {
|
||||
coins: 0,
|
||||
procoins: 0
|
||||
marseybux: 0
|
||||
},
|
||||
};
|
||||
newEntry.amounts[bet.wager.currency] += bet.wager.amount;
|
||||
|
@ -283,7 +283,7 @@
|
|||
betHtml += ` <div class="roulette-bet-summary--heading">`;
|
||||
betHtml += buildPokerChip(avatar);
|
||||
const coinText = wagerTotal.coins > 0 ? `${wagerTotal.coins} ${coinImgHtml}` : "";
|
||||
const procoinText = wagerTotal.procoins > 0 ? `${wagerTotal.procoins} ${marseybuxImgHtml}` : "";
|
||||
const procoinText = wagerTotal.marseybux > 0 ? `${wagerTotal.marseybux} ${marseybuxImgHtml}` : "";
|
||||
const bettingText = coinText && procoinText ? `${coinText} and ${procoinText}` : coinText || procoinText;
|
||||
betHtml += `<p>${name} is betting ${bettingText}:</p>`;
|
||||
betHtml += ` </div>`;
|
||||
|
@ -292,7 +292,7 @@
|
|||
betHtml += `<ul class="roulette-bet-summary--list">`;
|
||||
for (const individualBet of wagers) {
|
||||
const coinText = individualBet.amounts.coins > 0 ? `${individualBet.amounts.coins} ${coinImgHtml}` : "";
|
||||
const procoinText = individualBet.amounts.procoins > 0 ? `${individualBet.amounts.procoins} ${marseybuxImgHtml}` : "";
|
||||
const procoinText = individualBet.amounts.marseybux > 0 ? `${individualBet.amounts.marseybux} ${marseybuxImgHtml}` : "";
|
||||
const details = {
|
||||
STRAIGHT_UP_BET: `that the number will be ${individualBet.which}`,
|
||||
LINE_BET: `that the number will be within line ${individualBet.which}`,
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
<em style="position: relative; top: 2px; margin-left: 0.5rem">{{c.slots_result}}</em>
|
||||
{% elif c.casino_game_id %}
|
||||
{% set game_state = c.casino_game.game_state_json %}
|
||||
<em style="position: relative; top: 2px; margin-left: 0.5rem">{{game_state['symbols'].replace(',','')}} {{game_state['text'].replace('procoins', 'marseybux')}}</em>
|
||||
<em style="position: relative; top: 2px; margin-left: 0.5rem">{{game_state['symbols'].replace(',','')}} {{game_state['text']}}</em>
|
||||
{% endif %}
|
||||
|
||||
{% if c.blackjack_result %}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<img alt=":#marseymerchant:" loading="lazy" class="mb-2" src="/e/marseymerchant.webp">
|
||||
<h5>401 Not Authorized</h5>
|
||||
<p class="text-muted">This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:</p>
|
||||
{% if FEATURES['PROCOINS'] and v.truescore -%}
|
||||
{% if FEATURES['MARSEYBUX'] and v.truescore -%}
|
||||
{% if KOFI_LINK %}
|
||||
<a rel="nofollow noopener" href="{{KOFI_LINK}}">{{KOFI_LINK}}</a>
|
||||
{% else %}
|
||||
|
|
|
@ -120,8 +120,8 @@
|
|||
<div id="if-not-owned-{{hat.id}}">
|
||||
<button type="button" id="buy1-{{hat.id}}" class="btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" data-click="postToastSwitch(this, '/buy_hat/{{hat.id}}', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-coins-amount').innerHTML-={{hat.price}}})" onclick="areyousure(this)"><span class="m-auto">Buy</span></button>
|
||||
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
<button type="button" id="buy2-{{hat.id}}" class="marseybux btn btn-success {% if v.procoins < hat.price %}disabled{% endif %}" data-click="postToastSwitch(this, '/buy_hat/{{hat.id}}?mb=true', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-bux-amount').innerHTML-={{hat.price}}})" onclick="areyousure(this)"><span class="m-auto">MBux</span></button>
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<button type="button" id="buy2-{{hat.id}}" class="marseybux btn btn-success {% if v.marseybux < hat.price %}disabled{% endif %}" data-click="postToastSwitch(this, '/buy_hat/{{hat.id}}?mb=true', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-bux-amount').innerHTML-={{hat.price}}})" onclick="areyousure(this)"><span class="m-auto">MBux</span></button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -221,9 +221,9 @@
|
|||
</div>
|
||||
<div class="text-left pl-2">
|
||||
<div style="color: #{{v.name_color}}" class="text-small font-weight-bold"><span id="header--username" {% if v.patron %}class="patron" style="background-color:#{{v.name_color}}"{% endif %}>{{v.user_name}}</span></div>
|
||||
<div class="header--currency"><img alt="coins" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="{{'coins.webp' | asset_siteimg}}" title="Coins" aria-label="coins"><span id="user-coins-amount">{{v.coins}}</span>{% if not FEATURES['PROCOINS'] %} Coin{{macros.plural(v.coins)}}{% endif %}</div>
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
<div class="header--currency"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="/i/marseybux.webp?v=2000" title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span></div>
|
||||
<div class="header--currency"><img alt="coins" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="{{'coins.webp' | asset_siteimg}}" title="Coins" aria-label="coins"><span id="user-coins-amount">{{v.coins}}</span>{% if not FEATURES['MARSEYBUX'] %} Coin{{macros.plural(v.coins)}}{% endif %}</div>
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<div class="header--currency"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="/i/marseybux.webp?v=2000" title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.marseybux}}</span></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -235,7 +235,7 @@
|
|||
|
||||
<a class="dropdown-item" href="/app"><i class="fas fa-mobile fa-fw mr-3"></i>App</a>
|
||||
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<a class="dropdown-item" rel="nofollow noopener" href="/donate"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
|
||||
{% endif %}
|
||||
|
||||
|
@ -296,7 +296,7 @@
|
|||
|
||||
<a class="nav-item nav-link" href="/app"><i class="fas fa-mobile fa-fw mr-3"></i>App</a>
|
||||
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<a class="nav-item nav-link" rel="nofollow noopener" href="/donate"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div id="awardModalBody" class="modal-body mb-3">
|
||||
<div class="card-columns award-columns awards-wrapper">
|
||||
{% for award in v.user_awards %}
|
||||
<div data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{award.description}}" id="{{award.kind}}" class="card" onclick="pick('{{award.kind}}', {{award.price}}*{{v.discount}} <= {{v.procoins}}, {{award.price}}*{{v.discount}} <= {{v.coins}})">
|
||||
<div data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{award.description}}" id="{{award.kind}}" class="card" onclick="pick('{{award.kind}}', {{award.price}}*{{v.discount}} <= {{v.marseybux}}, {{award.price}}*{{v.discount}} <= {{v.coins}})">
|
||||
<i class="{{award.icon}} {{award.color}}"></i>
|
||||
<div class="pt-2" style="font-weight: bold; font-size: 14px; color:#E1E1E1">{{award.title}}</div>
|
||||
<div class="text-muted"><span id="{{award.kind}}-owned">{{award.owned}}</span> owned</div>
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
<input autocomplete="off" id="giveaward" class="awardbtn btn btn-primary mt-3" style="float:right" type="submit" onclick="giveaward(this)" value="Give Award" data-bs-dismiss="modal" disabled>
|
||||
|
||||
<button type="button" id="buy1" class="awardbtn btn btn-primary mt-3 mx-3 {% if not FEATURES['PROCOINS'] %}d-none{% endif %}" disabled style="float:right" data-click="buy(true)" onclick="areyousure(this)">Buy with marseybux</button>
|
||||
<button type="button" id="buy1" class="awardbtn btn btn-primary mt-3 mx-3 {% if not FEATURES['MARSEYBUX'] %}d-none{% endif %}" disabled style="float:right" data-click="buy(true)" onclick="areyousure(this)">Buy with marseybux</button>
|
||||
|
||||
<button type="button" id="buy2" class="awardbtn btn btn-primary mt-3" disabled style="float:right" data-click="buy()" onclick="areyousure(this)">Buy</button>
|
||||
</div>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<p>Join a house (cost: {{cost}} coins or marseybux).</p>
|
||||
{% endif %}
|
||||
<div class="input-group mb2">
|
||||
<select {% if v.coins < cost and v.procoins < cost or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control" form="profile-settings" name="house" onchange="postToastReload(this,'/settings/personal?house='+document.getElementById('house').value)">
|
||||
<select {% if v.coins < cost and v.marseybux < cost or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control" form="profile-settings" name="house" onchange="postToastReload(this,'/settings/personal?house='+document.getElementById('house').value)">
|
||||
{% for entry in HOUSES %}
|
||||
<option value="{{entry}}" {% if v.house == entry %} selected {% endif %}>
|
||||
{{entry}}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
<div class="footer">
|
||||
<div class="d-flex">
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
{% if KOFI_TOKEN %}
|
||||
<button type="button" class="btn btn-success" onclick="postToastSwitch(this,'/settings/kofi')">Claim {{patron}} rewards</button>
|
||||
{% else %}
|
||||
|
@ -48,7 +48,7 @@
|
|||
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" onclick="disable(this)" value="Add email">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<span class="text-small text-muted pl-1">Must be same email as the one you used to donate
|
||||
{% if v.truescore >= TRUESCORE_DONATE_LIMIT %}
|
||||
on
|
||||
|
|
|
@ -60,8 +60,8 @@
|
|||
<h5 class="mt-4">Coins spent by you: {{"{:,}".format(v.coins_spent)}} coins</h5>
|
||||
<h5 class="mt-4">Lootboxes bought by you: {{v.lootboxes_bought}} lootbox{{'es' if v.lootboxes_bought != 1}}</h5>
|
||||
<h5 class="mt-4">Your current coins: {{"{:,}".format(v.coins)}}</h5>
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
<h5 class="mt-4">Your current marseybux: {{"{:,}".format(v.procoins)}}</h3>
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<h5 class="mt-4">Your current marseybux: {{"{:,}".format(v.marseybux)}}</h3>
|
||||
{% endif %}
|
||||
</header>
|
||||
{% endblock %}
|
||||
|
@ -96,9 +96,9 @@
|
|||
{% if kind != "benefactor" %}
|
||||
<button type="button" id="buy1-{{loop.index}}" class="btn btn-success {% if v.coins < a['price'] %}disabled{% endif %}" data-click="postToastSwitch(this,'/buy/{{kind}}')" onclick="areyousure(this)"><span class="m-auto">Buy</span></button>
|
||||
{% endif %}
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
{% if kind != "grass" %}
|
||||
<button type="button" id="buy2-{{loop.index}}" class="marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" data-click="postToastSwitch(this,'/buy/{{kind}}?mb=true')" onclick="areyousure(this)"><span class="m-auto">Buy with MBux</span></button>
|
||||
<button type="button" id="buy2-{{loop.index}}" class="marseybux btn btn-success {% if v.marseybux < a['price'] %}disabled{% endif %}" data-click="postToastSwitch(this,'/buy/{{kind}}?mb=true')" onclick="areyousure(this)"><span class="m-auto">Buy with MBux</span></button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
<span id="profile-coins-amount">{{u.coins}}</span>
|
||||
<img alt="coins" class="ml-1 mb-1 mr-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Coins" height="20" src="{{'coins.webp' | asset_siteimg}}">
|
||||
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
<span id="profile-bux-amount">{{u.procoins}}</span>
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<span id="profile-bux-amount">{{u.marseybux}}</span>
|
||||
<img alt="marseybux" class="ml-1 mb-1 mr-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Marseybux" height="20" width="46" src="/i/marseybux.webp?v=2000">
|
||||
{% endif %}
|
||||
|
||||
|
@ -151,7 +151,7 @@
|
|||
<button type="button" class="btn btn-primary" onclick="postToastSwitch(this,'/@{{u.username}}/suicide')">Get Them Help</button>
|
||||
{%- endif %}
|
||||
<button type="button" class="btn btn-primary" onclick="toggleElement('coin-transfer', 'coin-transfer-amount')">Gift Coins</button>
|
||||
{% if FEATURES['PROCOINS'] -%}
|
||||
{% if FEATURES['MARSEYBUX'] -%}
|
||||
<button type="button" class="btn btn-primary" onclick="toggleElement('bux-transfer', 'bux-transfer-amount')">Gift Marseybux</button>
|
||||
{%- endif %}
|
||||
|
||||
|
@ -309,8 +309,8 @@
|
|||
<span id="profile-coins-amount-mobile" class="font-weight-bold">{{u.coins}}</span>
|
||||
<img alt="coins" class="ml-1 mb-1 mr-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Coins" height="15" src="{{'coins.webp' | asset_siteimg}}">
|
||||
|
||||
{% if FEATURES['PROCOINS'] %}
|
||||
<span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.procoins}}</span>
|
||||
{% if FEATURES['MARSEYBUX'] %}
|
||||
<span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.marseybux}}</span>
|
||||
<img alt="marseybux" class="ml-1 mb-1 mr-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Marseybux" height="15" width="35" src="/i/marseybux.webp?v=2000">
|
||||
{% endif %}
|
||||
|
||||
|
@ -402,7 +402,7 @@
|
|||
<button type="button" class="btn btn-primary" onclick="postToastSwitch(this,'/@{{u.username}}/suicide')">Get Them Help</button>
|
||||
{%- endif %}
|
||||
<button type="button" class="btn btn-primary" onclick="toggleElement('coin-transfer-mobile', 'coin-transfer-amount-mobile')">Gift Coins</button>
|
||||
{% if FEATURES['PROCOINS'] -%}
|
||||
{% if FEATURES['MARSEYBUX'] -%}
|
||||
<button type="button" class="btn btn-primary" onclick="toggleElement('bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</button>
|
||||
{%- endif %}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching
|
|||
|
||||
CREATE TYPE public.casino_game_currency AS ENUM (
|
||||
'coins',
|
||||
'procoins'
|
||||
'marseybux'
|
||||
);
|
||||
|
||||
|
||||
|
@ -980,7 +980,7 @@ CREATE TABLE public.users (
|
|||
club_allowed boolean,
|
||||
frontsize integer DEFAULT 25 NOT NULL,
|
||||
coins_spent integer DEFAULT 0 NOT NULL,
|
||||
procoins integer DEFAULT 0 NOT NULL,
|
||||
marseybux integer DEFAULT 0 NOT NULL,
|
||||
verifiedcolor character varying(6),
|
||||
marseyawarded integer,
|
||||
sig character varying(200),
|
||||
|
|
Loading…
Reference in New Issue