mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge dev to dev-MVC
This commit is contained in:
parent
186dcdc616
commit
5146a490df
@ -118,6 +118,12 @@ class Servers_Controller:
|
||||
def can_stop_no_players(server_id, time_limit):
|
||||
return servers_helper.can_stop_no_players(server_id, time_limit)
|
||||
|
||||
def set_waiting_start(server_id, value):
|
||||
servers_helper.set_waiting_start(server_id, value)
|
||||
|
||||
@staticmethod
|
||||
def get_waiting_start(server_id):
|
||||
return servers_helper.get_waiting_start(server_id)
|
||||
|
||||
#************************************************************************************************
|
||||
# Servers Helpers Methods
|
||||
|
@ -76,6 +76,7 @@ class Server_Stats(Model):
|
||||
desc = CharField(default="Unable to Connect")
|
||||
version = CharField(default="")
|
||||
updating = BooleanField(default=False)
|
||||
waiting_start = BooleanField(default=False)
|
||||
|
||||
|
||||
class Meta:
|
||||
@ -187,5 +188,19 @@ class helper_servers:
|
||||
can = True
|
||||
return can
|
||||
|
||||
@staticmethod
|
||||
def set_waiting_start(server_id, value):
|
||||
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(waiting_start=value).where(Server_Stats.server_id == server_id).execute()
|
||||
|
||||
@staticmethod
|
||||
def get_waiting_start(server_id):
|
||||
waiting_start = Server_Stats.select().where(Server_Stats.server_id == server_id).get()
|
||||
return waiting_start.waiting_start
|
||||
|
||||
|
||||
servers_helper = helper_servers()
|
Loading…
Reference in New Issue
Block a user