|
@ -357,8 +357,8 @@ class MTChunks: |
|
|
self.website_root="/var/www/html/minetest" |
|
|
self.website_root="/var/www/html/minetest" |
|
|
self.world_name = "FCAGameAWorld" |
|
|
self.world_name = "FCAGameAWorld" |
|
|
self.os_name="linux" |
|
|
self.os_name="linux" |
|
|
self.refresh_map_seconds = 1 #does one chunk at a time so as not to interrupt player updates too often |
|
|
self.refresh_map_seconds = 30 #does one chunk at a time so as not to interrupt player updates too often |
|
|
self.refresh_players_seconds = 1 |
|
|
self.refresh_players_seconds = 5 |
|
|
self.chunk_yaml_name_opener_string = "chunk_" |
|
|
self.chunk_yaml_name_opener_string = "chunk_" |
|
|
self.chunk_yaml_name_dotext_string = ".yml" |
|
|
self.chunk_yaml_name_dotext_string = ".yml" |
|
|
|
|
|
|
|
@ -1257,6 +1257,7 @@ class MTChunks: |
|
|
#self.last_run_second = best_timer() |
|
|
#self.last_run_second = best_timer() |
|
|
self.loop_enable = True |
|
|
self.loop_enable = True |
|
|
self.verbose_enable = False |
|
|
self.verbose_enable = False |
|
|
|
|
|
is_first_iteration = True |
|
|
while self.loop_enable: |
|
|
while self.loop_enable: |
|
|
before_second = best_timer() |
|
|
before_second = best_timer() |
|
|
run_wait_seconds = self.refresh_map_seconds |
|
|
run_wait_seconds = self.refresh_map_seconds |
|
@ -1277,23 +1278,30 @@ class MTChunks: |
|
|
else: |
|
|
else: |
|
|
print("player update is not enabled") |
|
|
print("player update is not enabled") |
|
|
if self.refresh_map_enable: |
|
|
if self.refresh_map_enable: |
|
|
if (self.last_map_refresh_second is None) or (best_timer()-self.last_map_refresh_second > self.refresh_map_seconds): |
|
|
is_first_run = True |
|
|
|
|
|
map_render_latency = 0.3 |
|
|
|
|
|
if (not is_first_iteration) or (self.last_map_refresh_second is None) or (best_timer()-self.last_map_refresh_second > self.refresh_map_seconds): |
|
|
|
|
|
while is_first_run or ( ((best_timer()+map_render_latency)-self.last_players_refresh_second) < self.refresh_players_seconds ): |
|
|
|
|
|
is_first_run = False |
|
|
|
|
|
is_first_iteration = self.todo_index<0 |
|
|
|
|
|
#if (self.last_map_refresh_second is None) or (best_timer()-self.last_map_refresh_second > self.refresh_map_seconds): |
|
|
#if self.last_map_refresh_second is not None: |
|
|
#if self.last_map_refresh_second is not None: |
|
|
#print ("waited "+str(best_timer()-self.last_map_refresh_second)+"s for map update") |
|
|
#print ("waited "+str(best_timer()-self.last_map_refresh_second)+"s for map update") |
|
|
self.last_map_refresh_second = best_timer() |
|
|
self.last_map_refresh_second = best_timer() |
|
|
self.check_map_pseudorecursion_iterate() |
|
|
self.check_map_pseudorecursion_iterate() |
|
|
|
|
|
map_render_latency = best_timer() - self.last_map_refresh_second |
|
|
#self.check_map_inefficient_squarepattern() |
|
|
#self.check_map_inefficient_squarepattern() |
|
|
else: |
|
|
else: |
|
|
print("waiting before doing map update") |
|
|
print("waiting before doing map update") |
|
|
else: |
|
|
else: |
|
|
print("map update is not enabled") |
|
|
print("map update is not enabled") |
|
|
else: |
|
|
|
|
|
self.verbose_enable = True |
|
|
|
|
|
run_wait_seconds -= (best_timer()-before_second) |
|
|
run_wait_seconds -= (best_timer()-before_second) |
|
|
if (int(float(run_wait_seconds)+.5)>0.0): |
|
|
if (float(run_wait_seconds)>0.0): |
|
|
print ("sleeping for "+str(run_wait_seconds)+"s") |
|
|
print ("sleeping for "+str(run_wait_seconds)+"s") |
|
|
time.sleep(run_wait_seconds) |
|
|
time.sleep(run_wait_seconds) |
|
|
self.run_count += 1 |
|
|
self.run_count += 1 |
|
|
|
|
|
else: |
|
|
|
|
|
self.verbose_enable = True |
|
|
|
|
|
|
|
|
def run(self): |
|
|
def run(self): |
|
|
if self.refresh_players_enable: |
|
|
if self.refresh_players_enable: |
|
|