Skip to content

Commit

Permalink
disable osu for now
Browse files Browse the repository at this point in the history
  • Loading branch information
GDcheeriosYT committed Jul 21, 2024
1 parent b70469e commit 2d7ef10
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 37 deletions.
26 changes: 12 additions & 14 deletions crap/osu_crap/Player.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# packages
from crap.ServerData import ServerData

from .authentication_crap import *


Expand All @@ -10,18 +8,18 @@ class Player:
def __init__(self, id):
self.id = id

if str(id) in ServerData.osu_player_json.keys():
player_data = ServerData.osu_player_json[str(id)]
self.name = player_data["user data"]["name"]
self.rank = player_data["user data"]["rank"]
self.play_count = player_data["user data"]["playcount"]
self.score = player_data["user data"]["score"]
self.avatar = player_data["user data"]["avatar url"]
self.background = player_data["user data"]["background url"]
self.link = player_data["user data"]["profile url"]
self.accuracy = player_data["user data"]["accuracy"]
else:
self.update_data()
# if str(id) in ServerData.osu_player_json.keys():
# player_data = ServerData.osu_player_json[str(id)]
# self.name = player_data["user data"]["name"]
# self.rank = player_data["user data"]["rank"]
# self.play_count = player_data["user data"]["playcount"]
# self.score = player_data["user data"]["score"]
# self.avatar = player_data["user data"]["avatar url"]
# self.background = player_data["user data"]["background url"]
# self.link = player_data["user data"]["profile url"]
# self.accuracy = player_data["user data"]["accuracy"]
# else:
# self.update_data()

def update_data(self):
try:
Expand Down
17 changes: 0 additions & 17 deletions crap/osu_crap/PlayerList.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import json
import time

import Client_Credentials
from crap.ServerData import ServerData

from .Player import Player

Expand All @@ -11,20 +8,6 @@
class PlayerList:
Players = []

@staticmethod
def load() -> None:
for id in ServerData.osu_player_json.keys():
print(f"loading osu player {id}")
PlayerList.create_player(id)

@staticmethod
def unload() -> None:
for player in PlayerList.Players:
print(player.id, player.name)
ServerData.osu_player_json[player.id] = player.jsonify()[player.id]

json.dump(ServerData.osu_player_json, open("player_data.json", "w"), indent=4)

@staticmethod
def get_users(user_list) -> list:
new_list = []
Expand Down
12 changes: 6 additions & 6 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
<!-- <li><a href="/minecraft/stats">Player Stats</a></li>-->
<!-- </ul>-->
<!-- </li>-->
<li class="dropdown"><a href="/osu">osu</a>
<ul class="dropdown-content">
<li><a href="/osu">Home</a></li>
<li><a href="/osu/matches">Matches</a></li>
</ul>
</li>
<!-- <li class="dropdown"><a href="/osu">osu</a>-->
<!-- <ul class="dropdown-content">-->
<!-- <li><a href="/osu">Home</a></li>-->
<!-- <li><a href="/osu/matches">Matches</a></li>-->
<!-- </ul>-->
<!-- </li>-->
<li class="dropdown"><a href="/account">Account</a>
<ul class="dropdown-content">
{% if request.cookies.get('userID') != None %}
Expand Down

0 comments on commit 2d7ef10

Please sign in to comment.