Remove port checker for a port reminder on first run

Add DB column to track a server's first run
Send port reminder for crafty on fresh install.
Remove http server message from startup/logs - don't want to promote that it's running.
This commit is contained in:
Andrew
2022-01-09 13:14:59 -05:00
parent a1c67009c4
commit 3e90210f3b
7 changed files with 51 additions and 49 deletions

View File

@ -77,6 +77,7 @@ class Server_Stats(Model):
version = CharField(default="")
updating = BooleanField(default=False)
waiting_start = BooleanField(default=False)
first_run = BooleanField(default=True)
class Meta:
@ -182,6 +183,16 @@ class helper_servers:
with database.atomic():
Server_Stats.update(updating=value).where(Server_Stats.server_id == server_id).execute()
@staticmethod
def set_first_run(server_id):
#Sets first run to false
try:
row = Server_Stats.select().where(Server_Stats.server_id == server_id)
except Exception as ex:
logger.error("Database entry not found. ".format(ex))
with database.atomic():
Server_Stats.update(first_run=False).where(Server_Stats.server_id == server_id).execute()
@staticmethod
def get_TTL_without_player(server_id):
last_stat = Server_Stats.select().where(Server_Stats.server_id == server_id).order_by(Server_Stats.created.desc()).first()