This commit is contained in:
parent
92c0f4a90a
commit
863a42e982
@ -89,6 +89,7 @@ if not os.path.isfile(CONFIG_LOCATION) or os.stat(CONFIG_LOCATION).st_size == 0:
|
|||||||
SERVER_PUBLIC_KEY = loadPublicKey()
|
SERVER_PUBLIC_KEY = loadPublicKey()
|
||||||
CLIENT_PRIVATE_KEY = loadPrivateKey(PASSPHRASE)
|
CLIENT_PRIVATE_KEY = loadPrivateKey(PASSPHRASE)
|
||||||
CLIENT_ADDRESS = loadAddress()
|
CLIENT_ADDRESS = loadAddress()
|
||||||
|
LOGGED_IN = False
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
command = input("Type a command:")
|
command = input("Type a command:")
|
||||||
@ -99,6 +100,7 @@ while True:
|
|||||||
print("Invalid command format!")
|
print("Invalid command format!")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if not LOGGED_IN:
|
||||||
if separatedCommand[0] == 'LIN' and len(separatedCommand) == 3:
|
if separatedCommand[0] == 'LIN' and len(separatedCommand) == 3:
|
||||||
network = NetWrapper(CLIENT_PRIVATE_KEY, CLIENT_ADDRESS, separatedCommand[1], SERVER_PUBLIC_KEY)
|
network = NetWrapper(CLIENT_PRIVATE_KEY, CLIENT_ADDRESS, separatedCommand[1], SERVER_PUBLIC_KEY)
|
||||||
try:
|
try:
|
||||||
@ -114,6 +116,9 @@ while True:
|
|||||||
LOGGED_IN = False
|
LOGGED_IN = False
|
||||||
continue
|
continue
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
print('You are already logged in!')
|
||||||
|
|
||||||
|
|
||||||
if separatedCommand[0] == 'EXIT':
|
if separatedCommand[0] == 'EXIT':
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user