diff --git a/files/classes/user.py b/files/classes/user.py index b257ced69..98d701da3 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -107,7 +107,7 @@ class User(Base): club_allowed = Column(Boolean) login_nonce = Column(Integer, default=0) coins = Column(Integer, default=0) - truecoins = Column(Integer, default=0) + truescore = Column(Integer, default=0) procoins = Column(Integer, default=0) mfa_secret = deferred(Column(String)) is_private = Column(Boolean, default=False) @@ -424,7 +424,7 @@ class User(Base): if not FEATURES['COUNTRY_CLUB']: return True if self.shadowbanned: return False if self.is_suspended_permanently: return False - return self.admin_level >= PERMS['VIEW_CLUB'] or self.club_allowed or (self.club_allowed != False and self.truecoins >= DUES) + return self.admin_level >= PERMS['VIEW_CLUB'] or self.club_allowed or (self.club_allowed != False and self.truescore >= DUES) @lazy def any_block_exists(self, other): @@ -937,7 +937,7 @@ class User(Base): def can_see_chudrama(self): if self.admin_level >= PERMS['VIEW_CHUDRAMA']: return True if self.client: return True - if self.truecoins >= 5000: return True + if self.truescore >= 5000: return True if self.agendaposter: return True if self.patron: return True return False diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 09d3534c1..94864b4ba 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -450,7 +450,7 @@ def execute_pizza_autovote(v:User, target:Union[Submission, Comment]): autovote.created_utc += 1 g.db.add(autovote) v.coins += votes - v.truecoins += votes + v.truescore += votes g.db.add(v) target.upvotes += votes g.db.add(target) diff --git a/files/helpers/stats.py b/files/helpers/stats.py index b4f1927a5..9edafb85e 100644 --- a/files/helpers/stats.py +++ b/files/helpers/stats.py @@ -136,10 +136,10 @@ def stats(site=None): "House femboy members": "{:,}".format(g.db.query(User).filter(User.house.like('Femboy%')).count()), "House vampire members": "{:,}".format(g.db.query(User).filter(User.house.like('Vampire%')).count()), "House racist members": "{:,}".format(g.db.query(User).filter(User.house.like('Racist%')).count()), - "House furry total truescore": "{:,}".format(g.db.query(func.sum(User.truecoins)).filter(User.house.like('Furry%')).scalar() or 0), - "House femboy total truescore": "{:,}".format(g.db.query(func.sum(User.truecoins)).filter(User.house.like('Femboy%')).scalar() or 0), - "House vampire total truescore": "{:,}".format(g.db.query(func.sum(User.truecoins)).filter(User.house.like('Vampire%')).scalar() or 0), - "House racist total truescore": "{:,}".format(g.db.query(func.sum(User.truecoins)).filter(User.house.like('Racist%')).scalar() or 0), + "House furry total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Furry%')).scalar() or 0), + "House femboy total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Femboy%')).scalar() or 0), + "House vampire total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Vampire%')).scalar() or 0), + "House racist total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Racist%')).scalar() or 0), } stats.update(stats2) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 59691e913..f77172816 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -77,12 +77,12 @@ def get_logged_in_user(): g.db.add(v) if AEVANN_ID and request.headers.get("Cf-Ipcountry") == 'EG': - if v and not v.username.startswith('Aev') and v.truecoins > 0: + if v and not v.username.startswith('Aev') and v.truescore > 0: with open(f"/eg", "r+", encoding="utf-8") as f: ip = request.headers.get('CF-Connecting-IP') if f'@{v.username}, ' not in f.read(): t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time()))) - f.write(f'@{v.username}, {v.truecoins}, {ip}, {t}\n') + f.write(f'@{v.username}, {v.truescore}, {ip}, {t}\n') return v diff --git a/files/routes/admin.py b/files/routes/admin.py index 3f0105549..c8928107a 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -35,7 +35,7 @@ def kippy(v): @admin_level_required(PERMS['VIEW_ACTIVE_USERS']) def loggedin_list(v): ids = [x for x,val in cache.get(f'{SITE}_loggedin').items() if time.time()-val < LOGGEDIN_ACTIVE_TIME] - users = g.db.query(User).filter(User.id.in_(ids)).order_by(User.admin_level.desc(), User.truecoins.desc()).all() + users = g.db.query(User).filter(User.id.in_(ids)).order_by(User.admin_level.desc(), User.truescore.desc()).all() return render_template("loggedin.html", v=v, users=users) @app.get('/admin/loggedout') @@ -91,7 +91,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', 'truecoins', 'procoins'): + for kind in ('comment_count', 'post_count', 'winnings', 'received_award_count', 'coins_spent', 'lootboxes_bought', 'coins', 'truescore', 'procoins'): amount = getattr(user1, kind) + getattr(user2, kind) setattr(user1, kind, amount) setattr(user2, kind, 0) @@ -141,7 +141,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', 'truecoins', 'procoins'): + for kind in ('comment_count', 'post_count', 'winnings', 'received_award_count', 'coins_spent', 'lootboxes_bought', 'coins', 'truescore', 'procoins'): amount = getattr(user, kind) + getattr(alt, kind) setattr(user, kind, amount) setattr(alt, kind, 0) diff --git a/files/routes/static.py b/files/routes/static.py index afa6e5a9b..f01f8e812 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -113,9 +113,9 @@ def patrons(v): @auth_required def admins(v): if v.admin_level >= PERMS['VIEW_SORTED_ADMIN_LIST']: - admins = g.db.query(User).filter(User.admin_level>1).order_by(User.truecoins.desc()).all() - admins += g.db.query(User).filter(User.admin_level==1).order_by(User.truecoins.desc()).all() - else: admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truecoins.desc()).all() + admins = g.db.query(User).filter(User.admin_level>1).order_by(User.truescore.desc()).all() + admins += g.db.query(User).filter(User.admin_level==1).order_by(User.truescore.desc()).all() + else: admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truescore.desc()).all() return render_template("admins.html", v=v, admins=admins) diff --git a/files/routes/users.py b/files/routes/users.py index 869b67495..70b6aa99e 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -336,7 +336,7 @@ def leaderboard(v): comments = Leaderboard("Comments", "comment count", "comments", "Comments", "comments", Leaderboard.get_simple_lb, User.comment_count, v, lambda u:u.comment_count, g.db, users) received_awards = Leaderboard("Awards", "received awards", "awards", "Awards", None, Leaderboard.get_simple_lb, User.received_award_count, v, lambda u:u.received_award_count, g.db, users) coins_spent = Leaderboard("Spent in shop", "coins spent in shop", "spent", "Coins", None, Leaderboard.get_simple_lb, User.coins_spent, v, lambda u:u.coins_spent, g.db, users) - truecoins = Leaderboard("Truescore", "truescore", "truescore", "Truescore", None, Leaderboard.get_simple_lb, User.truecoins, v, lambda u:u.truecoins, g.db, users) + truescore = Leaderboard("Truescore", "truescore", "truescore", "Truescore", None, Leaderboard.get_simple_lb, User.truescore, v, lambda u:u.truescore, g.db, users) badges = Leaderboard("Badges", "badges", "badges", "Badges", None, Leaderboard.get_badge_marsey_lb, Badge.user_id, v, None, g.db, None) marseys = Leaderboard("Marseys", "Marseys made", "marseys", "Marseys", None, Leaderboard.get_badge_marsey_lb, Marsey.author_id, v, None, g.db, None) if SITE_NAME == 'rDrama' else None @@ -346,7 +346,7 @@ def leaderboard(v): owned_hats = Leaderboard("Owned hats", "owned hats", "owned-hats", "Owned Hats", None, Leaderboard.get_hat_lb, User.owned_hats, v, None, g.db, None) designed_hats = Leaderboard("Designed hats", "designed hats", "designed-hats", "Designed Hats", None, Leaderboard.get_hat_lb, User.designed_hats, v, None, g.db, None) - leaderboards = [coins, coins_spent, truecoins, subscribers, posts, comments, received_awards, badges, marseys, blocks, owned_hats, designed_hats] + leaderboards = [coins, coins_spent, truescore, subscribers, posts, comments, received_awards, badges, marseys, blocks, owned_hats, designed_hats] return render_template("leaderboard.html", v=v, leaderboards=leaderboards) diff --git a/files/routes/votes.py b/files/routes/votes.py index 13564373b..f5bb4393e 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -80,14 +80,14 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): if existing: if existing.vote_type == 0 and new != 0: target.author.coins += coin_value - target.author.truecoins += coin_delta + target.author.truescore += coin_delta g.db.add(target.author) existing.vote_type = new existing.coins = coin_value g.db.add(existing) elif existing.vote_type != 0 and new == 0: target.author.charge_account('coins', existing.coins, should_check_balance=False) - target.author.truecoins -= coin_delta + target.author.truescore -= coin_delta g.db.add(target.author) g.db.delete(existing) else: @@ -95,7 +95,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): g.db.add(existing) elif new != 0: target.author.coins += coin_value - target.author.truecoins += coin_delta + target.author.truescore += coin_delta g.db.add(target.author) real = new != 1 or v.is_votes_real diff --git a/files/templates/admins.html b/files/templates/admins.html index fda6fb1b2..012383192 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -21,7 +21,7 @@ {{loop.index}} {% include "user_in_table.html" %} - {{"{:,}".format(user.truecoins)}} + {{"{:,}".format(user.truescore)}} {{"{:,}".format(user.modaction_num)}} {% endfor %} diff --git a/files/templates/donate_WPD.html b/files/templates/donate_WPD.html index 4089f595e..381cf9b4f 100644 --- a/files/templates/donate_WPD.html +++ b/files/templates/donate_WPD.html @@ -9,7 +9,7 @@
- {% if v and v.truecoins >= TRUESCORE_DONATE_LIMIT %} + {% if v and v.truescore >= TRUESCORE_DONATE_LIMIT %} diff --git a/files/templates/donate_rDrama.html b/files/templates/donate_rDrama.html index 059b9214b..d3baf1611 100644 --- a/files/templates/donate_rDrama.html +++ b/files/templates/donate_rDrama.html @@ -9,7 +9,7 @@
Kofi {{KOFI_LINK}}
- {% if v and v.truecoins >= TRUESCORE_DONATE_LIMIT %} + {% if v and v.truescore >= TRUESCORE_DONATE_LIMIT %} diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 091864c7e..e823600ce 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -13,7 +13,7 @@ :#marseymerchant:
401 Not Authorized

This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:

- {% if FEATURES['PROCOINS'] and v.truecoins -%} + {% if FEATURES['PROCOINS'] and v.truescore -%} {% if KOFI_LINK %} {{KOFI_LINK}} {% else %} diff --git a/files/templates/loggedin.html b/files/templates/loggedin.html index f09acc039..f87321c2f 100644 --- a/files/templates/loggedin.html +++ b/files/templates/loggedin.html @@ -13,7 +13,7 @@ - + {% endfor %}
Gumroad {{GUMROAD_LINK}}
{{loop.index}} {% include "user_in_table.html" %}{{"{:,}".format(user.truecoins)}}{{"{:,}".format(user.truescore)}}
diff --git a/files/templates/poll_votes.html b/files/templates/poll_votes.html index cb6705172..834b982d4 100644 --- a/files/templates/poll_votes.html +++ b/files/templates/poll_votes.html @@ -29,7 +29,7 @@ {% include "user_in_table.html" %} {% endwith %} - {{"{:,}".format(vote.user.truecoins)}} + {{"{:,}".format(vote.user.truescore)}} {% endfor %} diff --git a/files/templates/settings_personal.html b/files/templates/settings_personal.html index 30a26800e..285db8abe 100644 --- a/files/templates/settings_personal.html +++ b/files/templates/settings_personal.html @@ -26,7 +26,7 @@

You're a {{TIERS_ID_TO_NAME[v.patron] if v.patron else "freeloader"}}!

{% if v.patron %} Thanks ily! <3{% endif %} - {% if not v.patron and v.truecoins >= TRUESCORE_DONATE_LIMIT %} + {% if not v.patron and v.truescore >= TRUESCORE_DONATE_LIMIT %}

To stop freeloading, first verify your email, support us on {{DONATE_SERVICE}} with the same email, and click "Claim {{patron}} Rewards"

{% elif not v.patron %}

To stop freeloading, you can donate via crypto. Please let us know first beforehand by sending us a modmail. Thanks!

diff --git a/files/templates/settings_security.html b/files/templates/settings_security.html index f3ef5d86a..ba969c1cb 100644 --- a/files/templates/settings_security.html +++ b/files/templates/settings_security.html @@ -50,7 +50,7 @@
{% if FEATURES['PROCOINS'] %} Must be same email as the one you used to donate - {% if v.truecoins >= TRUESCORE_DONATE_LIMIT %} + {% if v.truescore >= TRUESCORE_DONATE_LIMIT %} on {% if KOFI_TOKEN %} Kofi diff --git a/files/templates/userpage.html b/files/templates/userpage.html index fce7fb7e2..230b1a068 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -223,7 +223,7 @@

User ID: {{u.id}}

Coins spent: {{u.coins_spent}}

-

True score: {{u.truecoins}}

+

True score: {{u.truescore}}

Winnings: {{u.winnings}}

= hats_total %}class="profile-owned-all-hats"{% endif %}>{{u.num_of_owned_hats}} / {{hats_total}} hats owned ({{hats_owned_percent}})

{% if u.is_private %} @@ -462,7 +462,7 @@

User ID: {{u.id}}

Coins spent: {{u.coins_spent}}

-

True score: {{u.truecoins}}

+

True score: {{u.truescore}}

Winnings: {{u.winnings}}

= hats_total %}class="profile-owned-all-hats"{% endif %}>{{u.num_of_owned_hats}} / {{hats_total}} hats owned ({{hats_owned_percent}})

{% if u.is_private %} diff --git a/files/templates/votes.html b/files/templates/votes.html index 2507bbf8a..c9d0ed83c 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -13,7 +13,7 @@

{{thing.permalink}}

Author: @{{thing.author.username}}

Author Created At:

-

Author Truescore: {{"{:,}".format(thing.author.truecoins)}}

+

Author Truescore: {{"{:,}".format(thing.author.truescore)}}

Upvotes: {{ups | length}}

Downvotes: {{downs | length}}

@@ -37,7 +37,7 @@ {% include "user_in_table.html" %} {% endwith %} - {{"{:,}".format(vote.user.truecoins)}} + {{"{:,}".format(vote.user.truescore)}} 1599343262 %}data-time="{{vote.created_utc}}"{% endif %}> {% endfor %} @@ -64,7 +64,7 @@ {% include "user_in_table.html" %} {% endwith %} - {{"{:,}".format(vote.user.truecoins)}} + {{"{:,}".format(vote.user.truescore)}} 1599343262 %}data-time="{{vote.created_utc}}"{% endif %}> {% endfor %}