This commit is contained in:
parent
ae743cde15
commit
a14e0414b6
@ -50,8 +50,8 @@ class Server:
|
|||||||
return self.execute(parsedCommand[0], parsedCommand[1], parsedCommand[2])
|
return self.execute(parsedCommand[0], parsedCommand[1], parsedCommand[2])
|
||||||
|
|
||||||
def execute(self, command: str, firstParam: str = "", secondParam: str = "") -> None:
|
def execute(self, command: str, firstParam: str = "", secondParam: str = "") -> None:
|
||||||
if self.executor.currentDirectory == "" or self.executor.baseDir == "":
|
if self.executor.baseDir == "":
|
||||||
raise Exception("Directories must not be empty string. Did the user log in?")
|
raise Exception("Home directory must not be empty string. Did the user log in?")
|
||||||
if command == "LOUT":
|
if command == "LOUT":
|
||||||
if secondParam != "" or firstParam != "":
|
if secondParam != "" or firstParam != "":
|
||||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||||
@ -121,5 +121,8 @@ class Server:
|
|||||||
|
|
||||||
def startServer(self):
|
def startServer(self):
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
message = self.networkInstance.recieveMessage().decode('UTF-8')
|
message = self.networkInstance.recieveMessage().decode('UTF-8')
|
||||||
self.parseCommand(message)
|
self.parseCommand(message)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user