Пример #1
0
def start_match(match):
    serverid = servers.find_open_server()
    if serverid == None:
        return None
    #move the server and start it
    scode = servers.edit_server(serverid, {'location':match.location})
    if scode != 200:
        return None
    scode = servers.start_server(serverid)
    if scode != 200:
        return None
    #tell the server to request the match config from CGL
    scode = servers.put_console(serverid, "get5_loadmatch_url \"https://cgl-discord-bot.herokuapp.com/config/%s\"" % match.id)
    if scode != 200:
        return None
    return servers.server_info(serverid)[0]
Пример #2
0
 async def slots(self, ctx, servername, slots: int):
     scode = servers.edit_server(servers.server_id(servername), {'csgo_settings.slots':slots})
     if scode == 200:
         await ctx.send("Server size has been changed.")
     else:
         await ctx.send("There was an error editing the server settings.")
Пример #3
0
 async def location(self, ctx, servername, location):
     scode = servers.edit_server(servers.server_id(servername), {'location':location})
     if scode == 200:
         await ctx.send("Server location has been changed.")
     else:
         await ctx.send("There was an error editing the server settings.")
Пример #4
0
 async def name(self, ctx, servername, newname):
     scode = servers.edit_server(servers.server_id(servername), {'name':newname})
     if scode == 200:
         await ctx.send("Server name has been changed.")
     else:
         await ctx.send("There was an error editing the server settings.")
Пример #5
0
 async def map(self, ctx, servername, map):
     scode = servers.edit_server(servers.server_id(servername), {'csgo_settings.mapgroup_start_map':map})
     if scode == 200:
         await ctx.send("Server start map has been changed.")
     else:
         await ctx.send("There was an error editing the server settings.")