(self)
| 809 | |
| 810 | |
| 811 | def tick(self): |
| 812 | self.health_record.heartbeat() |
| 813 | self.cell = self.get_meta_cell() |
| 814 | |
| 815 | if self.sleep_schedule: |
| 816 | self.sleep_schedule.work() |
| 817 | |
| 818 | now = time.time() * 1000 |
| 819 | |
| 820 | for fort in self.cell["forts"]: |
| 821 | timeout = fort.get("cooldown_complete_timestamp_ms", 0) |
| 822 | |
| 823 | if timeout >= now: |
| 824 | self.fort_timeouts[fort["id"]] = timeout |
| 825 | |
| 826 | self._refresh_inventory() |
| 827 | |
| 828 | self.tick_count += 1 |
| 829 | |
| 830 | # Check if session token has expired |
| 831 | self.check_session(self.position) |
| 832 | |
| 833 | for worker in self.workers: |
| 834 | if worker.work() == WorkerResult.RUNNING: |
| 835 | return |
| 836 | |
| 837 | def get_meta_cell(self): |
| 838 | location = self.position[0:2] |
no test coverage detected