Added H. easter egg, temp
This commit is contained in:
@@ -11,7 +11,7 @@ script_dir = Path(__file__).parent
|
|||||||
def login_logic():
|
def login_logic():
|
||||||
while True:
|
while True:
|
||||||
print("LOGIN CLIENT")
|
print("LOGIN CLIENT")
|
||||||
print("[1] Login [2] Sign in")
|
print("[1] Login [2] Sign up")
|
||||||
login_choice = input(" > ")
|
login_choice = input(" > ")
|
||||||
|
|
||||||
if login_choice == "1":
|
if login_choice == "1":
|
||||||
@@ -31,11 +31,27 @@ def login_logic():
|
|||||||
# Get current time (request identifier)
|
# Get current time (request identifier)
|
||||||
timestamp_ms = int(time.time() * 1000)
|
timestamp_ms = int(time.time() * 1000)
|
||||||
|
|
||||||
# Create a request
|
# 1. Define your paths clearly
|
||||||
with open(script_dir / "requests" / f"{timestamp_ms}.txt", "w") as request:
|
req_folder = script_dir / "requests"
|
||||||
request.write(f"LOGIN:{login_username}:{login_password}")
|
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}")
|
||||||
|
|
||||||
# TODO WAIT FOR SUCCESS/UNSUCCESS MESSAGE
|
|
||||||
|
|
||||||
if login_choice == "2":
|
if login_choice == "2":
|
||||||
while True:
|
while True:
|
||||||
@@ -66,8 +82,21 @@ def login_logic():
|
|||||||
# Get current time (request identifier)
|
# Get current time (request identifier)
|
||||||
timestamp_ms = int(time.time() * 1000)
|
timestamp_ms = int(time.time() * 1000)
|
||||||
|
|
||||||
with open(script_dir / "requests" / f"{timestamp_ms}.txt", "w") as request:
|
req_folder = script_dir / "requests"
|
||||||
request.write(f"CREATEUSER:{signup_username}:{signup_password}")
|
tmp_path = req_folder / f"{timestamp_ms}.tmp"
|
||||||
|
final_path = req_folder / f"{timestamp_ms}.txt"
|
||||||
|
|
||||||
|
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
|
# TODO WAIT FOR SUCCESS/UNSUCCESS MESSAGE
|
||||||
|
|
||||||
|
|||||||
1
CHATTER/requests/1775660763462.txt
Normal file
1
CHATTER/requests/1775660763462.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
CREATEUSER:JeffreyEpstein:TheIslandIsMine
|
||||||
@@ -4,6 +4,10 @@ from pathlib import Path
|
|||||||
# Setup paths
|
# Setup paths
|
||||||
base_path = Path(__file__).parent
|
base_path = Path(__file__).parent
|
||||||
req_path = base_path / "requests"
|
req_path = base_path / "requests"
|
||||||
|
user_path = base_path / "users"
|
||||||
|
chat_path = base_path / "single_chats"
|
||||||
|
|
||||||
|
|
||||||
req_path.mkdir(exist_ok=True)
|
req_path.mkdir(exist_ok=True)
|
||||||
|
|
||||||
print("Server online. Monitoring requests...")
|
print("Server online. Monitoring requests...")
|
||||||
@@ -25,7 +29,8 @@ while True:
|
|||||||
|
|
||||||
# FAILSAFE 2: Check if the file is empty or missing colons
|
# FAILSAFE 2: Check if the file is empty or missing colons
|
||||||
if not content or ":" not in content:
|
if not content or ":" not in content:
|
||||||
print(f"Malformed request in {file_path.name}. Deleting.")
|
print(f"Invalid or empty data in {file_path.name}, Deleting.")
|
||||||
|
# make failed request file
|
||||||
file_path.unlink()
|
file_path.unlink()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -35,16 +40,33 @@ while True:
|
|||||||
|
|
||||||
# FAILSAFE 3: Check if we have enough parts (Command:User:Pass)
|
# FAILSAFE 3: Check if we have enough parts (Command:User:Pass)
|
||||||
if len(parts) < 3:
|
if len(parts) < 3:
|
||||||
print(f"Incomplete data in {file_path.name}. Deleting.")
|
print(f"Incomplete data in {file_path.name}, Deleting.")
|
||||||
|
# TODO Make failed request file
|
||||||
file_path.unlink()
|
file_path.unlink()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
command, user, data = parts
|
command, user, data = parts
|
||||||
|
if not command.isalnum() or not user.isalnum() or not data.isalnum():
|
||||||
|
print(f"Invalid parameters in {file_path.name}, Deleting.")
|
||||||
|
# TODO Make failed request file
|
||||||
|
continue
|
||||||
print(f"Processing {command} for {user}...")
|
print(f"Processing {command} for {user}...")
|
||||||
|
|
||||||
# --- YOUR LOGIC GOES HERE ---
|
if command == "LOGIN":
|
||||||
# if command == "LOGIN": ...
|
# TODO
|
||||||
# if command == "CREATEUSER": ...
|
#1. check if user exists as a folder
|
||||||
|
#2. hash password and check against user hash.txt if exist
|
||||||
|
#3. Make success request file
|
||||||
|
#4. Fail file as try/except
|
||||||
|
pass
|
||||||
|
if command == "CREATEUSER":
|
||||||
|
# TODO
|
||||||
|
#1. Make a new folder with the name
|
||||||
|
#2. Hash password and store in hash.txt
|
||||||
|
#3. Init basic files
|
||||||
|
#4. Make success request file
|
||||||
|
#5. Fail file as try/except
|
||||||
|
pass
|
||||||
|
|
||||||
# 4. Clean up: Delete the request after successful processing
|
# 4. Clean up: Delete the request after successful processing
|
||||||
file_path.unlink()
|
file_path.unlink()
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
My love don't leave me... but you did.
|
||||||
Reference in New Issue
Block a user