mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
fixing bcs web plugin
This commit is contained in:
parent
be5a8f6104
commit
28dbe5fcd2
5 changed files with 50 additions and 24 deletions
20
config.toml
20
config.toml
|
|
@ -67,12 +67,11 @@ party_name = "BombSquad Community Server"
|
|||
# (see below).
|
||||
#session_type = "ffa"
|
||||
|
||||
# Playlist-code for teams or free-for-all mode sessions.
|
||||
# To host your own custom playlists, use the 'share' functionality in the
|
||||
# playlist editor in the regular version of the game.
|
||||
# This will give you a numeric code you can enter here to host that
|
||||
# playlist.
|
||||
playlist_code = 12345
|
||||
# Playlist-code for teams or free-for-all mode sessions. To host
|
||||
# your own custom playlists, use the 'share' functionality in the
|
||||
# playlist editor in the regular version of the game. This will give
|
||||
# you a numeric code you can enter here to host that playlist.
|
||||
#playlist_code = 12345
|
||||
|
||||
# Alternately, you can embed playlist data here instead of using
|
||||
# codes. Make sure to set session_type to the correct type for the
|
||||
|
|
@ -107,7 +106,7 @@ playlist_code = 12345
|
|||
|
||||
# Series length in teams mode (7 == 'best-of-7' series; a team must
|
||||
# get 4 wins)
|
||||
teams_series_length = 7
|
||||
#teams_series_length = 7
|
||||
|
||||
# Points to win in free-for-all mode (Points are awarded per game
|
||||
# based on performance)
|
||||
|
|
@ -167,3 +166,10 @@ team_colors = [[0.8, 0.0, 0.6], [0, 1, 0.8]]
|
|||
# before rejoining the game. This can help suppress exploits
|
||||
# involving leaving and rejoining or switching teams rapidly.
|
||||
#player_rejoin_cooldown = 10.0
|
||||
|
||||
# Log levels for particular loggers, overriding the engine's
|
||||
# defaults. Valid values are NOTSET, DEBUG, INFO, WARNING, ERROR, or
|
||||
# CRITICAL.
|
||||
#[log_levels]
|
||||
#"ba.lifecycle" = "INFO"
|
||||
#"ba.assets" = "INFO"
|
||||
29
dist/ba_root/mods/custom_hooks.py
vendored
29
dist/ba_root/mods/custom_hooks.py
vendored
|
|
@ -21,6 +21,8 @@ from typing import TYPE_CHECKING
|
|||
|
||||
import babase
|
||||
import bascenev1 as bs
|
||||
import _bascenev1
|
||||
from baclassic._appmode import ClassicAppMode
|
||||
import bauiv1 as bui
|
||||
import setting
|
||||
from baclassic._servermode import ServerController
|
||||
|
|
@ -130,11 +132,6 @@ def bootstraping():
|
|||
"""Bootstarps the server."""
|
||||
logging.warning("Bootstraping mods...")
|
||||
# server related
|
||||
# _bascenev1.set_server_name(settings["HostName"])
|
||||
# _bascenev1.set_transparent_kickvote(settings["ShowKickVoteStarterName"])
|
||||
# _bascenev1.set_kickvote_msg_type(settings["KickVoteMsgType"])
|
||||
# bs.hide_player_device_id(settings["Anti-IdRevealer"]) TODO add call in
|
||||
# cpp
|
||||
|
||||
# check for auto update stats
|
||||
_thread.start_new_thread(mystats.refreshStats, ())
|
||||
|
|
@ -417,3 +414,25 @@ def wrap_player_spaz_init(original_class):
|
|||
|
||||
|
||||
playerspaz.PlayerSpaz = wrap_player_spaz_init(playerspaz.PlayerSpaz)
|
||||
|
||||
original_classic_app_mode_activate = ClassicAppMode.on_activate
|
||||
|
||||
|
||||
def new_classic_app_mode_activate(*args, **kwargs):
|
||||
# Call the original function
|
||||
result = original_classic_app_mode_activate(*args, **kwargs)
|
||||
|
||||
# Perform additional actions after the original function call
|
||||
on_classic_app_mode_active()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
ClassicAppMode.on_activate = new_classic_app_mode_activate
|
||||
|
||||
|
||||
def on_classic_app_mode_active():
|
||||
_bascenev1.set_server_name(settings["HostName"])
|
||||
_bascenev1.set_transparent_kickvote(settings["ShowKickVoteStarterName"])
|
||||
_bascenev1.set_kickvote_msg_type(settings["KickVoteMsgType"])
|
||||
_bascenev1.hide_player_device_id(settings["Anti-IdRevealer"])
|
||||
|
|
|
|||
3
dist/ba_root/mods/plugins/bcs_plugin.py
vendored
3
dist/ba_root/mods/plugins/bcs_plugin.py
vendored
|
|
@ -11,6 +11,7 @@ from functools import wraps
|
|||
from threading import Thread
|
||||
|
||||
import _babase
|
||||
import _bascenev1
|
||||
from flask import Flask, request, jsonify
|
||||
|
||||
# import uvicorn
|
||||
|
|
@ -277,7 +278,7 @@ def update_server_config():
|
|||
|
||||
def run_server():
|
||||
from waitress import serve
|
||||
serve(app, host="0.0.0.0", port=_babase.get_game_port())
|
||||
serve(app, host="0.0.0.0", port=_bascenev1.get_game_port())
|
||||
|
||||
|
||||
def enable(password):
|
||||
|
|
|
|||
|
|
@ -116,7 +116,8 @@ class BsDataThread(object):
|
|||
return data
|
||||
|
||||
|
||||
BsDataThread()
|
||||
v = bs.AppTimer(5, babase.Call(
|
||||
BsDataThread))
|
||||
|
||||
|
||||
def get_stats():
|
||||
|
|
|
|||
1
dist/ba_root/mods/spazmod/tag.py
vendored
1
dist/ba_root/mods/spazmod/tag.py
vendored
|
|
@ -48,7 +48,6 @@ def addhp(node, spaz):
|
|||
position=(0, 1.75, 0), shad=1.4)
|
||||
else:
|
||||
spaz.hptimer = None
|
||||
|
||||
spaz.hptimer = bs.Timer(2, babase.Call(
|
||||
showHP), repeat=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue