Added H. easter egg, temp
This commit is contained in:
@@ -11,7 +11,7 @@ script_dir = Path(__file__).parent
|
||||
def login_logic():
|
||||
while True:
|
||||
print("LOGIN CLIENT")
|
||||
print("[1] Login [2] Sign in")
|
||||
print("[1] Login [2] Sign up")
|
||||
login_choice = input(" > ")
|
||||
|
||||
if login_choice == "1":
|
||||
@@ -30,12 +30,28 @@ def login_logic():
|
||||
|
||||
# Get current time (request identifier)
|
||||
timestamp_ms = int(time.time() * 1000)
|
||||
|
||||
# Create a request
|
||||
with open(script_dir / "requests" / f"{timestamp_ms}.txt", "w") as request:
|
||||
request.write(f"LOGIN:{login_username}:{login_password}")
|
||||
|
||||
# TODO WAIT FOR SUCCESS/UNSUCCESS MESSAGE
|
||||
# 1. Define your paths clearly
|
||||
req_folder = script_dir / "requests"
|
||||
tmp_path = req_folder / f"{timestamp_ms}.tmp"
|
||||
final_path = req_folder / f"{timestamp_ms}.txt"
|
||||
|
||||
for i in range(3):
|
||||
try:
|
||||
# 2. Write to the temporary file
|
||||
with open(tmp_path, "w") as request:
|
||||
request.write(f"LOGIN:{login_username}:{login_password}")
|
||||
|
||||
# 3. Rename it to .txt (After the 'with' block finishes)
|
||||
tmp_path.rename(final_path)
|
||||
print("Request sent! Please wait...")
|
||||
while True:
|
||||
# Waiting logic
|
||||
break
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"Error in attempt {i+1}: {e}")
|
||||
|
||||
|
||||
if login_choice == "2":
|
||||
while True:
|
||||
@@ -65,9 +81,22 @@ def login_logic():
|
||||
|
||||
# Get current time (request identifier)
|
||||
timestamp_ms = int(time.time() * 1000)
|
||||
|
||||
req_folder = script_dir / "requests"
|
||||
tmp_path = req_folder / f"{timestamp_ms}.tmp"
|
||||
final_path = req_folder / f"{timestamp_ms}.txt"
|
||||
|
||||
with open(script_dir / "requests" / f"{timestamp_ms}.txt", "w") as request:
|
||||
request.write(f"CREATEUSER:{signup_username}:{signup_password}")
|
||||
for i in range(3):
|
||||
try:
|
||||
with open(tmp_path, "w") as request:
|
||||
request.write(f"CREATEUSER:{signup_username}:{signup_password}")
|
||||
|
||||
# RENAME FILE!!!
|
||||
tmp_path.rename(final_path)
|
||||
print("Account creation request sent!")
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"Error in attempt {i+1}: {e}")
|
||||
|
||||
# TODO WAIT FOR SUCCESS/UNSUCCESS MESSAGE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user