def configureServer(self, config): cvars = self.getCvars() for cvar, value in cvars.items(): self.set_cvar(cvar, value) for plugin in (self.database.smembers("{}:plugins".format(self.server_key))): minqlx.load_plugin(plugin.decode()) self.set_cvar("sv_master", "1") self.is_ready = True
def cmd_load(self, player, msg, channel): if len(msg) < 2: return minqlx.CMD_USAGE else: try: minqlx.load_plugin(msg[1]) channel.reply("^7Plugin ^6{} ^7has been successfully loaded." .format(msg[1])) except Exception as e: channel.reply("^7Plugin ^6{} ^7has failed to load: {} - {}" .format(msg[1], e.__class__.__name__, e)) minqlx.log_exception(self)
def cmd_load(self, player, msg, channel): if len(msg) < 2: return minqlx.CMD_USAGE else: try: minqlx.load_plugin(msg[1]) channel.reply("Plugin ^6{} ^7has been successfully loaded." .format(msg[1])) except Exception as e: channel.reply("Plugin ^6{} ^7has failed to load: {} - {}" .format(msg[1], e.__class__.__name__, e)) minqlx.log_exception(self)
def configureServer(self, config): cvars = self.getCvars() for cvar, value in cvars.items(): self.set_cvar(cvar, value) for plugin in (self.database.smembers("{}:plugins".format( self.server_key))): minqlx.load_plugin(plugin.decode()) self.set_cvar("sv_master", "1") self.is_ready = True
def shutdown(shutdownMinutes): shutdownSeconds = (shutdownMinutes * 60) mainDelay = (shutdownSeconds - 60) time.sleep(mainDelay) self.msg("The server will be shutting down in ^41 minute^7.") time.sleep(30) self.msg("The server will be shutting down in ^430 seconds^7.") time.sleep(15) self.center_print("This server is shutting down\nin ^115 seconds^7.") self.msg("This server will be shutting down in ^415 seconds^7.") self.play_sound("sound/world/klaxon1") time.sleep(5) self.center_print("This server is shutting down\nin ^110 seconds^7.") time.sleep(1) self.center_print("This server is shutting down\nin ^19 seconds^7.") time.sleep(1) self.center_print("This server is shutting down\nin ^18 seconds^7.") time.sleep(1) self.center_print("This server is shutting down\nin ^17 seconds^7.") time.sleep(1) self.center_print("This server is shutting down\nin ^16 seconds^7.") time.sleep(1) self.center_print("This server is shutting down\nin ^15 seconds^7.") time.sleep(1) self.play_sound("sound/world/klaxon1") self.center_print("This server is shutting down\nin ^14 seconds^7.") time.sleep(1) self.play_sound("sound/world/klaxon1") self.center_print("This server is shutting down\nin ^13 seconds^7.") time.sleep(1) self.play_sound("sound/world/klaxon1") self.center_print("This server is shutting down\nin ^12 seconds^7.") time.sleep(1) self.play_sound("sound/world/klaxon1") self.center_print("This server is shutting down\nin ^11 second^7.") time.sleep(1) self.play_sound("sound/world/buzzer") self.center_print("^1Shutting down.") time.sleep(1) minqlx.load_plugin("maintenance")
def handle_map(self, map_name, factory): """Brands map title and updates list of race maps on map change. Also sets correct starting weapons for the map and clears savepos and move_player dicts. """ map_name = map_name.lower() if self.get_cvar("qlx_raceBrand"): self.brand_map(map_name) self.get_maps() self.savepos = {} self.move_player = {} self.lagged = {} self.current_frame = 0 if self.game.factory not in ("qlrace_classic", "qlrace_turbo"): return self.set_starting_weapons(map_name) self.set_starting_ammo(map_name) if self.get_cvar("qlx_raceMode", int) == 0: gl_v = "700" if map_name in ("k4n", "uprising", "jjm2") else "800" self.set_cvar("g_velocity_gl", gl_v) ramp_jump = "0" if map_name == "10towers" else "1" self.set_cvar("pmove_rampJump", ramp_jump) elif self.get_cvar("qlx_raceMode", int) == 2: ramp_jump = "1" if map_name == "dontlookdown" else "0" self.set_cvar("pmove_RampJump", ramp_jump) if map_name == "puzzlemap": self.set_cvar("g_infiniteAmmo", "1") self.set_cvar("g_startingWeapons", "3") minqlx.load_plugin("puzzlemap") else: if "puzzlemap" in self.plugins: minqlx.unload_plugin("puzzlemap") if map_name == "walkathon": self.set_cvar("g_respawn_delay_min", "1000") self.set_cvar("g_respawn_delay_max", "1000") else: self.set_cvar("g_respawn_delay_min", "10") self.set_cvar("g_respawn_delay_max", "10") if map_name == "pornstarghost3": self.set_cvar("g_maxFlightFuel", "10000") elif map_name == "tomb": self.set_cvar("g_maxFlightFuel", "2500") elif map_name == "tatmt_long": self.set_cvar("g_maxFlightFuel", "500") elif map_name == "bokluk": self.set_cvar("g_maxFlightFuel", "3500") elif map_name == "dkr14": self.set_cvar("g_maxFlightFuel", "3000") else: self.set_cvar("g_maxFlightFuel", "16000") if map_name == "gl": if self.get_cvar("g_startingHealth", int) != 3000: self.map_restart = True self.set_cvar("g_startingHealth", "3000") else: self.set_cvar("g_startingHealth", "100") if map_name in ("track_comp", "track_comp_barriers"): self.set_cvar("pmove_noPlayerClip", "0") self.set_cvar("g_damage_g", "1") self.set_cvar("g_damage_mg", "1") self.set_cvar("g_knockback_g", "0") self.set_cvar("g_knockback_mg", "0") elif map_name == "track_comp_weap": self.set_cvar("pmove_noPlayerClip", "0") self.set_cvar("g_damage_g", "25") self.set_cvar("g_damage_mg", "3") self.set_cvar("g_damage_gl", "20") self.set_cvar("g_damage_rl", "20") self.set_cvar("g_damage_rg", "10") self.set_cvar("g_knockback_g", "1.2") self.set_cvar("g_knockback_mg", "0") self.set_cvar("g_knockback_gl", "1.2") self.set_cvar("g_knockback_gl_self", "0") self.set_cvar("g_knockback_rl", "1") self.set_cvar("g_knockback_rl_self", "0") self.set_cvar("g_knockback_rg", "10") self.set_cvar("g_splashdamage_gl", "20") self.set_cvar("g_splashdamage_rl", "16") else: self.set_cvar("pmove_noPlayerClip", "1") self.set_cvar("g_knockback_gl_self", "1.10") self.set_cvar("g_knockback_rl_self", "1.10")
def initialise(self): minqlx.load_plugin("serverbuilder_helper") self.database.set("{}:receiving".format(self.server_key), "1") self.checkForConfiguration()
def __init__(self): self.add_hook("map", self.map_load) self.add_hook("game_countdown", self.game_countdown) self.add_hook("game_start", self.game_start) self.add_hook("game_end", self.game_end) self.add_hook("player_loaded", self.handle_player_loaded) self.add_hook("player_connect", self.handle_player_connect, priority=minqlx.PRI_HIGHEST) #self.add_hook("player_spawn", self.handle_player_spawn) disable battle-suits per spawn self.add_hook("vote_called", self.handle_vote_called) # to add custom votes self.add_hook("vote_started", self.handle_vote_started) self.add_hook("vote_ended", self.handle_vote_ended) self.add_hook("chat", self.handle_chat) self.add_hook("userinfo", self.handle_userinfo, priority=minqlx.PRI_HIGHEST) # to prevent illegal name changes self.add_hook("client_command", self.handle_client_command) self.add_hook("death", self.handle_death) self.add_hook("team_switch", self.handle_team_switch) self.add_command(("help", "about", "version"), self.cmd_help) self.add_command(("teamsize", "ts"), self.cmd_teamsize, priority=minqlx.PRI_HIGH) self.add_command("rules", self.cmd_showrules) self.add_command(("donation_messages", "donate_messages"), self.cmd_donation_messages) self.add_command("map_restart", self.cmd_maprestart, 1) self.add_command("muteall", self.cmd_muteall, 4) self.add_command("unmuteall", self.cmd_unmuteall, 4) self.add_command(("forum", "forums", "f"), self.cmd_forums) self.add_command(("donate", "donations", "d", "donating"), self.cmd_donate) self.add_command("killall", self.cmd_killall, 4) self.add_command(("respawn", "spawn"), self.cmd_respawn, 5, usage="[id]") self.add_command(("respawn_aircontrol", "spawn_aircontrol"), self.respawn_aircontrol, 5) self.add_command("tomtec_versions", self.cmd_showversion) self.add_command(("wiki", "w"), self.cmd_wiki) self.add_command(("facebook", "fb"), self.cmd_facebook) self.add_command(("acommands", "acmds"), self.cmd_acommands) self.add_command("mapname", self.cmd_mapname) # display current map name self.add_command("server_reconfigure", self.cmd_reconfigure, 5) self.add_command("test", self.cmd_test) self.add_command("crash", self.cmd_crash, 3, usage="<id>") self.add_command(("listcv", "cvlist", "listcvs"), self.cmd_listcv) self.disabled_maps = ["proq3dm6"] self.readyPlayers = [] self.set_cvar_once("qlx_purgeryDonationMessages", "1") self.set_cvar_once("qlx_visitForumMessages", "0") self.set_cvar_once("qlx_specsAliveDuringWarmup", "0") self.set_cvar_once("qlx_strictVql", "0") self.set_cvar_once("qlx_ratingLimiter", "0") self.set_cvar_once("qlx_loadQueue", "0") self.plugin_version = "5.3" self.serverId = int((self.get_cvar("net_port", str))[-1:]) self.serverLocation = self.get_cvar("sv_location") self.protectedPlayers = ["76561198213481765", "76561198061594466"] # purger, mf falling comets self.purgersBirthday = False if self.get_cvar("qlx_visitForumMessages", bool): message = "Visit ^2forum.thepurgery.com^7 to vote for/nominate a moderator." self.set_cvar("qlx_connectMessage", message) self.set_cvar("qlx_endOfGameMessage", message) if (datetime.datetime.now().month == 3) and (datetime.datetime.now().day == 18): # It's Purger's birthday. self.purgersBirthday = True self.set_cvar("purgersBirthday", "1", 68) # put it in the /serverinfo as read-only self.set_cvar("qlx_connectMessage", "^7It's Pur^4g^7er's Birthday!") self.set_cvar("qlx_countdownMessage", "^7It's Pur^4g^7er's Birthday!") else: self.set_cvar("purgersBirthday", "0", 68) # put it in the /serverinfo as read-only if self.get_cvar("qlx_strictVql", bool): minqlx.load_plugin("strictvql") if self.get_cvar("qlx_ratingLimiter", bool): minqlx.load_plugin("ratinglimiter") if self.get_cvar("qlx_loadQueue", bool): minqlx.load_plugin("queue") minqlx.load_plugin("gamemode_secondchance") minqlx.load_plugin("gamemode_singleweapon") minqlx.load_plugin("gamemode_triweapon") if "auckland" in self.serverLocation.lower(): # was put in to reduce lag and server command traffic in the auckland server. @minqlx.delay(20) def f(): try: minqlx.unload_plugin("fun") except: pass f()