further adjustsments
This commit is contained in:
parent
aa9785da5a
commit
5e587b1536
@ -187,18 +187,18 @@ def my_file_created_function(event_path):
|
|||||||
|
|
||||||
file_size = None
|
file_size = None
|
||||||
while True:
|
while True:
|
||||||
time.sleep(10)
|
|
||||||
stdout, stderr = subprocess.Popen(["ls", "-l", event_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
stdout, stderr = subprocess.Popen(["ls", "-l", event_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||||
#print('stdout: ', stdout)
|
#print('stdout: ', stdout)
|
||||||
#print('stderr: ', stderr)
|
#print('stderr: ', stderr)
|
||||||
if stderr:
|
if stderr:
|
||||||
print('finished downloading the bz2 file.')
|
print('finished downloading the bz2 file. Reconnecting client again.')
|
||||||
|
writeCfgInput("retry;")
|
||||||
break
|
break
|
||||||
|
|
||||||
user = stdout.decode().split("autismbots")[0]
|
user = stdout.decode().split("autismbots")[0]
|
||||||
if whoami not in user:
|
if whoami not in user:
|
||||||
writeCfgInput("disconnect;")
|
|
||||||
print("disconnected from server until other user finished downloading bz2 file")
|
print("disconnected from server until other user finished downloading bz2 file")
|
||||||
continue
|
writeCfgInput("disconnect;")
|
||||||
|
|
||||||
#in case the bz2 download is not progressing just delete the file and disconnect.
|
#in case the bz2 download is not progressing just delete the file and disconnect.
|
||||||
cur_file_size = stdout.decode().split("autismbots")[1].strip().split(" ")[0]
|
cur_file_size = stdout.decode().split("autismbots")[1].strip().split(" ")[0]
|
||||||
@ -209,6 +209,7 @@ def my_file_created_function(event_path):
|
|||||||
subprocess.Popen(["rm", event_path], stdout=subprocess.DEVNULL).communicate()[0]
|
subprocess.Popen(["rm", event_path], stdout=subprocess.DEVNULL).communicate()[0]
|
||||||
break
|
break
|
||||||
file_size = cur_file_size
|
file_size = cur_file_size
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
class NewFileHandler(FileSystemEventHandler):
|
class NewFileHandler(FileSystemEventHandler):
|
||||||
def on_created(self, event):
|
def on_created(self, event):
|
||||||
@ -295,14 +296,12 @@ if __name__ == '__main__':
|
|||||||
print('bot kicked server full: ', datetime.datetime.now().time())
|
print('bot kicked server full: ', datetime.datetime.now().time())
|
||||||
elif "autismo connected to ze" == data:
|
elif "autismo connected to ze" == data:
|
||||||
print('Bot connected to ze!')
|
print('Bot connected to ze!')
|
||||||
#cpulimit_pid_of_game()
|
|
||||||
is_bot_connected_to_ze2 = False
|
is_bot_connected_to_ze2 = False
|
||||||
overwrite_file_access()
|
overwrite_file_access()
|
||||||
elif "not connected to ze2" == data:
|
elif "not connected to ze2" == data:
|
||||||
is_bot_connected_to_ze2 = False
|
is_bot_connected_to_ze2 = False
|
||||||
elif "autismo connected to ze2" == data:
|
elif "autismo connected to ze2" == data:
|
||||||
print('Bot connected to ze2!')
|
print('Bot connected to ze2!')
|
||||||
#cpulimit_pid_of_game()
|
|
||||||
is_bot_connected_to_ze2 = True
|
is_bot_connected_to_ze2 = True
|
||||||
overwrite_file_access()
|
overwrite_file_access()
|
||||||
elif "connect to ze" == data or ("connect to ze2" == data and not is_bot_connected_to_ze2):
|
elif "connect to ze" == data or ("connect to ze2" == data and not is_bot_connected_to_ze2):
|
||||||
|
Loading…
Reference in New Issue
Block a user