mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
bug fixes
This commit is contained in:
parent
1ca553b31a
commit
e100e18886
3 changed files with 18 additions and 7 deletions
13
dist/ba_root/mods/custom_hooks.py
vendored
13
dist/ba_root/mods/custom_hooks.py
vendored
|
|
@ -72,11 +72,13 @@ class modSetup(ba.Plugin):
|
||||||
ba.internal.sign_in_v1('Local')
|
ba.internal.sign_in_v1('Local')
|
||||||
ba.timer(60, playlist.flush_playlists)
|
ba.timer(60, playlist.flush_playlists)
|
||||||
|
|
||||||
def on_app_shutdown(self): # TODO not working, fix this, also dump server logs
|
# it works sometimes , but it blocks shutdown so server raise runtime exception, also dump server logs
|
||||||
|
def on_app_shutdown(self):
|
||||||
print("Server shutting down , lets save cache")
|
print("Server shutting down , lets save cache")
|
||||||
pdata.dump_cache()
|
# lets try threading here
|
||||||
notification_manager.dump_cache()
|
# _thread.start_new_thread(pdata.dump_cache, ())
|
||||||
print("Done dumping memory")
|
# _thread.start_new_thread(notification_manager.dump_cache, ())
|
||||||
|
# print("Done dumping memory")
|
||||||
|
|
||||||
|
|
||||||
def score_screen_on_begin(_stats: ba.Stats) -> None:
|
def score_screen_on_begin(_stats: ba.Stats) -> None:
|
||||||
|
|
@ -118,7 +120,7 @@ def bootstraping():
|
||||||
color_explosion.enable()
|
color_explosion.enable()
|
||||||
if settings["ballistica_web"]["enable"]:
|
if settings["ballistica_web"]["enable"]:
|
||||||
from plugins import bcs_plugin
|
from plugins import bcs_plugin
|
||||||
bcs_plugin.enable()
|
bcs_plugin.enable(settings["ballistica_web"]["server_password"])
|
||||||
if settings["character_chooser"]["enable"]:
|
if settings["character_chooser"]["enable"]:
|
||||||
from plugins import CharacterChooser
|
from plugins import CharacterChooser
|
||||||
CharacterChooser.enable()
|
CharacterChooser.enable()
|
||||||
|
|
@ -132,6 +134,7 @@ def bootstraping():
|
||||||
try:
|
try:
|
||||||
pass
|
pass
|
||||||
# from tools import healthcheck
|
# from tools import healthcheck
|
||||||
|
# healthcheck.main()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,8 @@ def get_roles():
|
||||||
|
|
||||||
def get_perks():
|
def get_perks():
|
||||||
# TODO wire with spaz_effects to fetch list of effects.
|
# TODO wire with spaz_effects to fetch list of effects.
|
||||||
return {"perks": pdata.get_custom_perks(), "availableEffects": ["spark", "glow", "fairydust"]}
|
return {"perks": pdata.get_custom_perks(), "availableEffects": ["spark", "glow", "fairydust", "sparkground", "sweat", "sweatground", "distortion", "shine", "highlightshine", "scorch", "ice", "iceground",
|
||||||
|
"slime", "metal", "splinter", "rainbow"]}
|
||||||
|
|
||||||
|
|
||||||
def update_perks(custom):
|
def update_perks(custom):
|
||||||
|
|
@ -175,11 +176,15 @@ def search_player_profile(search_key: str, db: str):
|
||||||
selectedDB = pdata.get_old_profiles(db)
|
selectedDB = pdata.get_old_profiles(db)
|
||||||
|
|
||||||
matching_objects = {}
|
matching_objects = {}
|
||||||
|
count = 0
|
||||||
for key in selectedDB.keys():
|
for key in selectedDB.keys():
|
||||||
if (search_key == key or
|
if (search_key == key or
|
||||||
any(search_key.lower() in s.lower() for s in selectedDB[key].get("display_string", [])) or
|
any(search_key.lower() in s.lower() for s in selectedDB[key].get("display_string", [])) or
|
||||||
search_key.lower() in selectedDB[key].get("name", "").lower()):
|
search_key.lower() in selectedDB[key].get("name", "").lower()):
|
||||||
matching_objects[key] = selectedDB[key]
|
matching_objects[key] = selectedDB[key]
|
||||||
|
count += 1
|
||||||
|
if count > 50:
|
||||||
|
break
|
||||||
return matching_objects
|
return matching_objects
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
5
dist/ba_root/mods/spazmod/spaz_effects.py
vendored
5
dist/ba_root/mods/spazmod/spaz_effects.py
vendored
|
|
@ -75,7 +75,10 @@ class NewPlayerSpaz(PlayerSpaz):
|
||||||
ba._asyncio._asyncio_event_loop.create_task(self.set_effects())
|
ba._asyncio._asyncio_event_loop.create_task(self.set_effects())
|
||||||
|
|
||||||
async def set_effects(self):
|
async def set_effects(self):
|
||||||
account_id = self._player._sessionplayer.get_v1_account_id()
|
try:
|
||||||
|
account_id = self._player._sessionplayer.get_v1_account_id()
|
||||||
|
except:
|
||||||
|
return
|
||||||
custom_effects = pdata.get_custom()['customeffects']
|
custom_effects = pdata.get_custom()['customeffects']
|
||||||
|
|
||||||
if account_id in custom_effects:
|
if account_id in custom_effects:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue