Skip to content

Commit

Permalink
Update Client/profile_save.py
Browse files Browse the repository at this point in the history
Co-authored-by: Hauke Platte <[email protected]>
  • Loading branch information
bananabr3d and HOOK-Hawkins authored Mar 14, 2024
1 parent 56d71e6 commit ed3b241
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions Client/profile_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,6 @@ def get_profiles(self):
else:
return None

def get_profile(self, player : Player):
"""
This method returns a profile by its uuid
:param profile_uuid:
:return: profile matching given uuid
"""
player_dict = player.as_dict()
if self.check_file():
try:
with open(self.path, 'r') as file:
data = json.load(file)
for profile in data:
if profile["uuid"] == player_dict["uuid"]:
return Player.from_dict(profile)
except:
raise RuntimeError("json error: Make sure profiles.json is formatted correctly")
return None

def set_profile(self, player : Player):
"""
This method sets the profile name and/or color by the uuid
Expand Down

0 comments on commit ed3b241

Please sign in to comment.