diff --git a/dist/ba_root/mods/chathandle/chatcommands/commands/cheats.py b/dist/ba_root/mods/chathandle/chatcommands/commands/cheats.py index 21c1267..de754d0 100644 --- a/dist/ba_root/mods/chathandle/chatcommands/commands/cheats.py +++ b/dist/ba_root/mods/chathandle/chatcommands/commands/cheats.py @@ -72,15 +72,15 @@ def kill(arguments, clientid): def heal(arguments, clientid): if arguments == [] or arguments == ['']: myself = clientid_to_myself(clientid) - handlemsg(myself, babase.PowerupMessage(poweruptype='health')) + handlemsg(myself, bs.PowerupMessage(poweruptype='health')) elif arguments[0] == 'all': - handlemsg_all(babase.PowerupMessage(poweruptype='health')) + handlemsg_all(bs.PowerupMessage(poweruptype='health')) else: try: req_player = int(arguments[0]) - handlemsg(req_player, babase.PowerupMessage(poweruptype='health')) + handlemsg(req_player, bs.PowerupMessage(poweruptype='health')) except: return @@ -88,15 +88,15 @@ def heal(arguments, clientid): def curse(arguments, clientid): if arguments == [] or arguments == ['']: myself = clientid_to_myself(clientid) - handlemsg(myself, babase.PowerupMessage(poweruptype='curse')) + handlemsg(myself, bs.PowerupMessage(poweruptype='curse')) elif arguments[0] == 'all': - handlemsg_all(babase.PowerupMessage(poweruptype='curse')) + handlemsg_all(bs.PowerupMessage(poweruptype='curse')) else: try: req_player = int(arguments[0]) - handlemsg(req_player, babase.PowerupMessage(poweruptype='curse')) + handlemsg(req_player, bs.PowerupMessage(poweruptype='curse')) except: return @@ -164,15 +164,15 @@ def super_punch(arguments, clientid): def gloves(arguments, clientid): if arguments == [] or arguments == ['']: myself = clientid_to_myself(clientid) - handlemsg(myself, babase.PowerupMessage(poweruptype='punch')) + handlemsg(myself, bs.PowerupMessage(poweruptype='punch')) elif arguments[0] == 'all': - handlemsg_all(babase.PowerupMessage(poweruptype='punch')) + handlemsg_all(bs.PowerupMessage(poweruptype='punch')) else: try: req_player = int(arguments[0]) - handlemsg(req_player, babase.PowerupMessage(poweruptype='punch')) + handlemsg(req_player, bs.PowerupMessage(poweruptype='punch')) except: return @@ -180,15 +180,15 @@ def gloves(arguments, clientid): def shield(arguments, clientid): if arguments == [] or arguments == ['']: myself = clientid_to_myself(clientid) - handlemsg(myself, babase.PowerupMessage(poweruptype='shield')) + handlemsg(myself, bs.PowerupMessage(poweruptype='shield')) elif arguments[0] == 'all': - handlemsg_all(babase.PowerupMessage(poweruptype='shield')) + handlemsg_all(bs.PowerupMessage(poweruptype='shield')) else: try: req_player = int(arguments[0]) - handlemsg(req_player, babase.PowerupMessage(poweruptype='shield')) + handlemsg(req_player, bs.PowerupMessage(poweruptype='shield')) except: return @@ -196,15 +196,15 @@ def shield(arguments, clientid): def freeze(arguments, clientid): if arguments == [] or arguments == ['']: myself = clientid_to_myself(clientid) - handlemsg(myself, babase.FreezeMessage()) + handlemsg(myself, bs.FreezeMessage()) elif arguments[0] == 'all': - handlemsg_all(babase.FreezeMessage()) + handlemsg_all(bs.FreezeMessage()) else: try: req_player = int(arguments[0]) - handlemsg(req_player, babase.FreezeMessage()) + handlemsg(req_player, bs.FreezeMessage()) except: return @@ -212,15 +212,15 @@ def freeze(arguments, clientid): def un_freeze(arguments, clientid): if arguments == [] or arguments == ['']: myself = clientid_to_myself(clientid) - handlemsg(myself, babase.ThawMessage()) + handlemsg(myself, bs.ThawMessage()) elif arguments[0] == 'all': - handlemsg_all(babase.ThawMessage()) + handlemsg_all(bs.ThawMessage()) else: try: req_player = int(arguments[0]) - handlemsg(req_player, babase.ThawMessage()) + handlemsg(req_player, bs.ThawMessage()) except: return diff --git a/dist/ba_root/mods/chathandle/chatcommands/commands/fun.py b/dist/ba_root/mods/chathandle/chatcommands/commands/fun.py index b16d8e5..9af5529 100644 --- a/dist/ba_root/mods/chathandle/chatcommands/commands/fun.py +++ b/dist/ba_root/mods/chathandle/chatcommands/commands/fun.py @@ -178,8 +178,8 @@ def creep(arguments): if node.head_mesh != None: node.head_mesh = None - node.handlemessage(babase.PowerupMessage(poweruptype='punch')) - node.handlemessage(babase.PowerupMessage(poweruptype='shield')) + node.handlemessage(bs.PowerupMessage(poweruptype='punch')) + node.handlemessage(bs.PowerupMessage(poweruptype='shield')) else: try: @@ -190,8 +190,8 @@ def creep(arguments): if node.head_mesh != None: node.head_mesh = None - node.handlemessage(babase.PowerupMessage(poweruptype='punch')) - node.handlemessage(babase.PowerupMessage(poweruptype='shield')) + node.handlemessage(bs.PowerupMessage(poweruptype='punch')) + node.handlemessage(bs.PowerupMessage(poweruptype='shield')) except: return diff --git a/dist/ba_root/mods/chathandle/chatcommands/commands/management.py b/dist/ba_root/mods/chathandle/chatcommands/commands/management.py index d73b1dd..0b5985e 100644 --- a/dist/ba_root/mods/chathandle/chatcommands/commands/management.py +++ b/dist/ba_root/mods/chathandle/chatcommands/commands/management.py @@ -304,7 +304,7 @@ def ban(arguments): pdata.ban_player( account["pbid"], duration, "by chat command") logger.log( - f'banned {ros["display_string"]} by chat command, recents') + f'banned {account["pbid"]} by chat command, recents') kick(arguments) except: pass @@ -350,7 +350,7 @@ def un_mute(arguments): if account['client_id'] == int(arguments[0]): pdata.unmute(account["pbid"]) logger.log( - f'unmuted {ros["display_string"]} by chat command, recents') + f'unmuted {account["pbid"]} by chat command, recents') except: pass @@ -377,7 +377,7 @@ def remove(arguments): def slow_motion(): activity = _babase.get_foreground_host_activity() - if activity.globalsnode.slow_motion != True: + if not activity.globalsnode.slow_motion: activity.globalsnode.slow_motion = True else: @@ -423,7 +423,7 @@ def dv(arguments): def pause(): activity = _babase.get_foreground_host_activity() - if activity.globalsnode.paused != True: + if not activity.globalsnode.paused: activity.globalsnode.paused = True else: @@ -437,7 +437,7 @@ def rotate_camera(): activity.globalsnode.camera_mode = 'rotate' else: - activity.globalsnode.camera_mode == 'normal' + activity.globalsnode.camera_mode = 'normal' def create_role(arguments): diff --git a/dist/ba_root/mods/chathandle/chatcommands/floater.py b/dist/ba_root/mods/chathandle/chatcommands/floater.py index 9464da9..3720085 100644 --- a/dist/ba_root/mods/chathandle/chatcommands/floater.py +++ b/dist/ba_root/mods/chathandle/chatcommands/floater.py @@ -4,10 +4,11 @@ from __future__ import annotations import _babase import math import random -from babase._generated.enums import InputType -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING +from babase import InputType import bascenev1 as bs +import babase from bascenev1lib.actor.bomb import Bomb from bascenev1lib.gameutils import SharedObjects @@ -209,7 +210,7 @@ class Floater(bs.Actor): def assignFloInputs(clientID: int): - with babase.Context(_babase.get_foreground_host_activity()): + with bs.get_foreground_host_activity().context(): activity = bs.getactivity() if not hasattr(activity, 'flo') or not activity.flo.node.exists(): try: diff --git a/dist/ba_root/mods/custom_hooks.py b/dist/ba_root/mods/custom_hooks.py index b6b41fe..9356967 100644 --- a/dist/ba_root/mods/custom_hooks.py +++ b/dist/ba_root/mods/custom_hooks.py @@ -17,7 +17,6 @@ import time from datetime import datetime import _babase -import _bascenev1 from typing import TYPE_CHECKING import babase @@ -65,13 +64,13 @@ class modSetup(babase.Plugin): bootstraping() servercheck.checkserver().start() ServerUpdate.check() - bs.AppTimer(5, account.updateOwnerIps) + bs.apptimer(5, account.updateOwnerIps) if settings["afk_remover"]['enable']: afk_check.checkIdle().start() if (settings["useV2Account"]): - if (babase.internal.get_v1_account_state() == - 'signed_in' and babase.internal.get_v1_account_type() == 'V2'): + if (plus.get_v1_account_state() == + 'signed_in' and plus.get_v1_account_type() == 'V2'): logging.debug("Account V2 is active") else: logging.warning("Account V2 login require ....stay tuned.") diff --git a/dist/ba_root/mods/features/afk_check.py b/dist/ba_root/mods/features/afk_check.py index 5347a19..9a556f8 100644 --- a/dist/ba_root/mods/features/afk_check.py +++ b/dist/ba_root/mods/features/afk_check.py @@ -21,8 +21,7 @@ class checkIdle(object): def check(self): global cLastIdle global cIdle - current = bs.time(babase.TimeType.REAL, - timeformat=babase.TimeFormat.MILLISECONDS) + current = bs.apptime() * 1000 if not bs.get_foreground_host_session(): return for player in bs.get_foreground_host_session().sessionplayers: @@ -54,7 +53,7 @@ class checkIdle(object): lobby_afk = int( (current - self.lobbies[player['client_id']]) / 1000) if lobby_afk in range(INLOBBY_TIME, INLOBBY_TIME + 10): - _bs.broadcastmessage("Join game within " + str( + bs.broadcastmessage("Join game within " + str( INLOBBY_TIME + 10 - lobby_afk) + " secs", color=(1, 0, 0), transient=True, clients=[player['client_id']]) diff --git a/dist/ba_root/mods/features/discord_bot.py b/dist/ba_root/mods/features/discord_bot.py index d7fdfeb..e57d448 100644 --- a/dist/ba_root/mods/features/discord_bot.py +++ b/dist/ba_root/mods/features/discord_bot.py @@ -50,7 +50,7 @@ async def on_message(message): channel = message.channel if message.channel.id == logsChannelID: - _babase.pushcall(Call(babase.internal.chatmessage, + _babase.pushcall(Call(bs.chatmessage, message.content), from_other_thread=True) @@ -147,7 +147,7 @@ def get_chats(): class BsDataThread(object): def __init__(self): self.refreshStats() - self.Timer = bs.Timer(8, babase.Call(self.refreshStats), repeat=True) + self.Timer = bs.AppTimer(8, babase.Call(self.refreshStats), repeat=True) # self.Timerr = bs.Timer( 10,babase.Call(self.refreshLeaderboard),timetype = babase.TimeType.REAL,repeat = True) # def refreshLeaderboard(self): @@ -175,7 +175,7 @@ class BsDataThread(object): currentMap = '' global stats - for i in babase.internal.get_game_roster(): + for i in bs.get_game_roster(): try: liveplayers[i['account_id']] = { 'name': i['players'][0]['name_full'], @@ -186,11 +186,11 @@ class BsDataThread(object): 'name': "", 'clientid': i['client_id'], 'device_id': i['display_string']} try: - nextMap = babase.internal.get_foreground_host_session( + nextMap = bs.get_foreground_host_session( ).get_next_game_description().evaluate() - current_game_spec = babase.internal.get_foreground_host_session()._current_game_spec - gametype: Type[GameActivity] = current_game_spec['resolved_type'] + current_game_spec = bs.get_foreground_host_session()._current_game_spec + gametype = current_game_spec['resolved_type'] currentMap = gametype.get_settings_display_string( current_game_spec).evaluate() @@ -201,7 +201,7 @@ class BsDataThread(object): # system={'cpu':80,'ram':34} # stats['system']=system stats['roster'] = liveplayers - stats['chats'] = babase.internal.get_chat_messages() + stats['chats'] = bs.get_chat_messages() stats['playlist'] = minigame # stats['teamInfo']=self.getTeamInfo() diff --git a/dist/ba_root/mods/features/fire_flies.py b/dist/ba_root/mods/features/fire_flies.py index f1717a1..8c1d108 100644 --- a/dist/ba_root/mods/features/fire_flies.py +++ b/dist/ba_root/mods/features/fire_flies.py @@ -104,7 +104,7 @@ class FireFly(bs.Actor): def off(self): death_secs = random.uniform(0.5, 3) - with babase.Context(self._activity()): + with self._activity().context(): bs.animate( self.node, 'mesh_scale', diff --git a/dist/ba_root/mods/playersdata/roles.json b/dist/ba_root/mods/playersdata/roles.json index 4711894..e3da243 100644 --- a/dist/ba_root/mods/playersdata/roles.json +++ b/dist/ba_root/mods/playersdata/roles.json @@ -70,8 +70,8 @@ ], "commands": [], "ids": [ - "pb-IF5RU3EcAg==", - "pb-IF4VAk4a" + "pb-IF4VAk4a", + "pb-IF5RU3EcAg==" ] }, "bypass-warn": { diff --git a/dist/ba_root/mods/playersdata/roles.json.backup b/dist/ba_root/mods/playersdata/roles.json.backup index 4711894..e3da243 100644 --- a/dist/ba_root/mods/playersdata/roles.json.backup +++ b/dist/ba_root/mods/playersdata/roles.json.backup @@ -70,8 +70,8 @@ ], "commands": [], "ids": [ - "pb-IF5RU3EcAg==", - "pb-IF4VAk4a" + "pb-IF4VAk4a", + "pb-IF5RU3EcAg==" ] }, "bypass-warn": { diff --git a/dist/ba_root/mods/plugins/auto_stunt.py b/dist/ba_root/mods/plugins/auto_stunt.py index 19e42d0..f3a22af 100644 --- a/dist/ba_root/mods/plugins/auto_stunt.py +++ b/dist/ba_root/mods/plugins/auto_stunt.py @@ -17,11 +17,10 @@ import babase import bascenev1 as bs import bascenev1lib import bauiv1 as bui -from bascenev1lib.actor import spaz +from bascenev1lib.actor import spaz, playerspaz from bascenev1lib.actor.image import Image from bascenev1lib.actor.powerupbox import PowerupBoxFactory from bascenev1lib.actor.spazfactory import SpazFactory -from bascenev1lib.actor.text import Text from bascenev1lib.game.elimination import EliminationGame from bascenev1lib.gameutils import SharedObjects diff --git a/dist/ba_root/mods/plugins/bombsquad_service.py b/dist/ba_root/mods/plugins/bombsquad_service.py index 78e5974..c254b4f 100644 --- a/dist/ba_root/mods/plugins/bombsquad_service.py +++ b/dist/ba_root/mods/plugins/bombsquad_service.py @@ -1,4 +1,4 @@ -import babase + import _thread import os from datetime import datetime @@ -30,12 +30,10 @@ class BsDataThread(object): stats["discord"] = "https://discord.gg/ucyaesh" stats["vapidKey"] = notification_manager.get_vapid_keys()["public_key"] - self.refresh_stats_cache_timer = bs.Timer(8, babase.Call( - self.refreshStats), - babase.TimeType.REAL, - repeat=True) - self.refresh_leaderboard_cache_timer = bs.Timer(10, babase.Call( - self.refreshLeaderboard), babase.TimeType.REAL, repeat=True) + self.refresh_stats_cache_timer = bs.AppTimer(8, babase.Call( + self.refreshStats) , repeat=True) + self.refresh_leaderboard_cache_timer = bs.AppTimer(10, babase.Call( + self.refreshLeaderboard), repeat=True) def startThread(self): _thread.start_new_thread(self.refreshLeaderboard, ()) @@ -58,7 +56,7 @@ class BsDataThread(object): nextMap = '' currentMap = '' - for i in babase.internal.get_game_roster(): + for i in bs.get_game_roster(): try: liveplayers[i['account_id']] = { 'name': i['players'][0]['name_full'], @@ -84,11 +82,11 @@ class BsDataThread(object): system = {'cpu': "null", 'ram': 'null'} stats['system'] = system stats['roster'] = liveplayers - stats['chats'] = babase.internal.get_chat_messages() + stats['chats'] = bs.get_chat_messages() stats['playlist'] = current_games stats['teamInfo'] = self.getTeamInfo() stats["sessionType"] = type( - babase.internal.get_foreground_host_session()).__name__ + bs.get_foreground_host_session()).__name__ # print(self.getTeamInfo()); diff --git a/dist/ba_root/mods/plugins/elPatronPowerups.py b/dist/ba_root/mods/plugins/elPatronPowerups.py index 07c3d48..ce38aa7 100644 --- a/dist/ba_root/mods/plugins/elPatronPowerups.py +++ b/dist/ba_root/mods/plugins/elPatronPowerups.py @@ -504,7 +504,7 @@ class NewProfileBrowserWindow(browser.ProfileBrowserWindow): super().__init__(transition, in_main_menu, selected_profile, origin_widget) - self.session = babase.internal.get_foreground_host_session() + self.session = bs.get_foreground_host_session() uiscale = bui.app.ui_v1.uiscale width = (100 if uiscale is babase.UIScale.SMALL else -14) @@ -688,7 +688,7 @@ def bomb_handlemessage(self, msg: Any) -> Any: source_player=babase.existing(self._source_player))) if self.blast_type in ('ice', 'ice_bubble'): bomb.BombFactory.get().freeze_sound.play(10, position=nodepos) - node.handlemessage(babase.FreezeMessage()) + node.handlemessage(bs.FreezeMessage()) return None @@ -949,7 +949,7 @@ def spaz_on_punch_release(self) -> None: pass -def new_get_bomb_type_tex(self) -> babase.Texture: +def new_get_bomb_type_tex(self): factory = NewPowerupBoxFactory.get() if self.bomb_type == 'sticky': return factory.tex_sticky_bombs @@ -1002,12 +1002,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._multi_bomb_wear_off_timer = (bs.Timer( (POWERUP_WEAR_OFF_TIME - 2000), - babase.Call(self._multi_bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(self._multi_bomb_wear_off_flash))) self._multi_bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - babase.Call(self._multi_bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(self._multi_bomb_wear_off))) elif msg.poweruptype == 'land_mines': self.set_land_mine_count(min(self.land_mine_count + 3, 3)) elif msg.poweruptype == 'impact_bombs': @@ -1023,12 +1021,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._bomb_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - babase.Call(self._bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(self._bomb_wear_off_flash))) self._bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - babase.Call(self._bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(self._bomb_wear_off))) elif msg.poweruptype == 'sticky_bombs': self.bomb_type = 'sticky' tex = self._get_bomb_type_tex() @@ -1042,12 +1038,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._bomb_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - babase.Call(self._bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(self._bomb_wear_off_flash))) self._bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - babase.Call(self._bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(self._bomb_wear_off))) elif msg.poweruptype == 'punch': self._has_boxing_gloves = True tex = PowerupBoxFactory.get().tex_punch @@ -1063,12 +1057,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._boxing_gloves_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - bs.WeakCall(self._gloves_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._gloves_wear_off_flash))) self._boxing_gloves_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - bs.WeakCall(self._gloves_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._gloves_wear_off),)) elif msg.poweruptype == 'shield': factory = SpazFactory.get() self.equip_shields(decay=factory.shield_decay_rate > 0) @@ -1087,12 +1079,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._bomb_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - bs.WeakCall(self._bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off_flash))) self._bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - bs.WeakCall(self._bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off))) elif msg.poweruptype == 'health': if self.edg_eff: f = self.color[0] @@ -1151,12 +1141,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._bomb_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - bs.WeakCall(self._bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off_flash))) self._bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - bs.WeakCall(self._bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off))) elif msg.poweruptype == 'fire_bombs': self.bomb_type = 'fire' @@ -1171,12 +1159,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._bomb_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - bs.WeakCall(self._bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off_flash))) self._bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - bs.WeakCall(self._bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off))) elif msg.poweruptype == 'impairment_bombs': self.bomb_type = 'impairment' @@ -1191,12 +1177,10 @@ def new_handlemessage(self, msg: Any) -> Any: t_ms + POWERUP_WEAR_OFF_TIME) self._bomb_wear_off_flash_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME - 2000, - bs.WeakCall(self._bomb_wear_off_flash), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off_flash))) self._bomb_wear_off_timer = (bs.Timer( POWERUP_WEAR_OFF_TIME, - bs.WeakCall(self._bomb_wear_off), - timeformat=babase.TimeFormat.MILLISECONDS)) + bs.WeakCall(self._bomb_wear_off))) elif msg.poweruptype == 'ice_man': tex = factory.tex_ice_man @@ -1216,13 +1200,11 @@ def new_handlemessage(self, msg: Any) -> Any: self.ice_man_flash_timer = (bs.Timer( ice_man_time - 2000, - babase.Call(_ice_man_off_flash, self), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(_ice_man_off_flash, self))) self.ice_man_timer = (bs.Timer(ice_man_time, babase.Call(_ice_man_wear_off, - self), - timeformat=babase.TimeFormat.MILLISECONDS)) + self))) elif msg.poweruptype == 'speed': self.node.hockey = True @@ -1238,8 +1220,7 @@ def new_handlemessage(self, msg: Any) -> Any: self.speed_flash_timer = (bs.Timer( speed_time - 2000, - babase.Call(_speed_off_flash, self), - timeformat=babase.TimeFormat.MILLISECONDS)) + babase.Call(_speed_off_flash, self))) self.speed_timer = (bs.apptimer(speed_time, babase.Call(_speed_wear_off, @@ -1265,11 +1246,11 @@ def new_handlemessage(self, msg: Any) -> Any: self.frozen = True self.node.frozen = True bs.timer(5.0, babase.Call(self.handlemessage, - babase.ThawMessage())) + bs.ThawMessage())) if self.hitpoints <= 0: self.shatter() if self.freeze_punch: - self.handlemessage(babase.ThawMessage()) + self.handlemessage(bs.ThawMessage()) elif isinstance(msg, bs.ThawMessage): if self.frozen and not self.shattered and self.node: @@ -1309,7 +1290,7 @@ def new_handlemessage(self, msg: Any) -> Any: def fire(time, damage): if not self.shield and not self._dead: self.hitpoints -= damage - babase.show_damage_count(f'-{damage}HP', + bs.show_damage_count(f'-{damage}HP', self.node.position, msg.force_direction) bs.getsound('fuse01').play() @@ -1362,7 +1343,7 @@ def new_handlemessage(self, msg: Any) -> Any: else: hitpoints = int(self.hitpoints * 0.80) self.hitpoints -= int(hitpoints) - babase.show_damage_count((f'-{int(hitpoints / 10)}%'), + bs.show_damage_count((f'-{int(hitpoints / 10)}%'), self.node.position, msg.force_direction) @@ -1446,7 +1427,7 @@ def new_handlemessage(self, msg: Any) -> Any: dism = int(damage * porcentaje) damage = int(damage - dism) - babase.show_damage_count('-' + str(int(damage / 10)) + '%', + bs.show_damage_count('-' + str(int(damage / 10)) + '%', msg.pos, msg.force_direction) self.node.handlemessage('hurt_sound') @@ -1470,13 +1451,13 @@ def new_handlemessage(self, msg: Any) -> Any: if msg.get_source_player(bs.Player).actor.freeze_punch: self.node.color = (0, 1, 4) bs.getsound('freeze').play() - self.node.handlemessage(babase.FreezeMessage()) + self.node.handlemessage(bs.FreezeMessage()) except: pass if damage > 350: assert msg.force_direction is not None - babase.show_damage_count('-' + str(int(damage / 10)) + '%', + bs.show_damage_count('-' + str(int(damage / 10)) + '%', msg.pos, msg.force_direction) if msg.hit_subtype == 'super_punch': @@ -1562,7 +1543,7 @@ def new_handlemessage(self, msg: Any) -> Any: self.shatter() elif self.hitpoints <= 0: self.node.handlemessage( - bs.DieMessage(how=babase.DeathType.IMPACT)) + bs.DieMessage(how=bs.DeathType.IMPACT)) if self.hitpoints <= 0: damage_avg = self.node.damage_smoothed * damage_scale @@ -1703,7 +1684,7 @@ class PowerupManagerWindow(PopupWindow): self._sub_height = 200 self._scroll_width = self._width * 0.90 self._scroll_height = self._height - 180 - self._sub_width = self._scroll_width * 0.95; + self._sub_width = self._scroll_width * 0.95 self.tab_buttons: set = {} self.list_cls_power: list = [] self.default_powerups = default_powerups() @@ -1856,7 +1837,7 @@ class PowerupManagerWindow(PopupWindow): if tab == 'Action 4': if self._scrollwidget: self._scrollwidget.delete() - self._scrollwidget = babase.hscrollwidget(parent=self._root_widget, + self._scrollwidget = bui.hscrollwidget(parent=self._root_widget, position=( self._width * 0.08, 51 * 1.8), size=( diff --git a/dist/ba_root/mods/plugins/wavedash.py b/dist/ba_root/mods/plugins/wavedash.py index ef2271a..9df5f8b 100644 --- a/dist/ba_root/mods/plugins/wavedash.py +++ b/dist/ba_root/mods/plugins/wavedash.py @@ -41,7 +41,7 @@ class MikiWavedashTest: if self.node.knockout > 0.0 or self.frozen or self.node.hold_node: return - t_ms = bs.time(timeformat=babase.TimeFormat.MILLISECONDS) + t_ms = bs.time() * 1000 assert isinstance(t_ms, int) if t_ms - self.last_wavedash_time_ms >= self._wavedash_cooldown: diff --git a/dist/ba_root/mods/spazmod/hitmessage.py b/dist/ba_root/mods/spazmod/hitmessage.py index a96e4b4..8db7227 100644 --- a/dist/ba_root/mods/spazmod/hitmessage.py +++ b/dist/ba_root/mods/spazmod/hitmessage.py @@ -16,16 +16,16 @@ def handle_hit(mag, pos): if mag >= 110: PopupText("#PRO !", color=(1, 0.2, 0.2), scale=1.6, position=pos).autoretain() - elif mag >= 93 and mag < 110: + elif 93 <= mag < 110: PopupText("GOOD ONE!", color=(1, 0.3, 0.1), scale=1.6, position=pos).autoretain() - elif mag >= 63 and mag < 93: + elif 63 <= mag < 93: PopupText("OH! YEAH", color=(1, 0.5, 0.2), scale=1.6, position=pos).autoretain() - elif mag >= 45 and mag < 63: + elif 45 <= mag < 63: PopupText("WTF!", color=(0.7, 0.4, 0.2), scale=1.6, position=pos).autoretain() - elif mag > 30 and mag < 45: + elif 30 < mag < 45: PopupText("!!!", color=(1, 1, 1), scale=1.6, position=pos).autoretain() except: diff --git a/dist/ba_root/mods/spazmod/modifyspaz.py b/dist/ba_root/mods/spazmod/modifyspaz.py index 5e7368f..2190a66 100644 --- a/dist/ba_root/mods/spazmod/modifyspaz.py +++ b/dist/ba_root/mods/spazmod/modifyspaz.py @@ -2,7 +2,7 @@ from random import randint import setting from spazmod import tag - +import babase import bascenev1 as bs _setting = setting.get_settings_data() @@ -55,7 +55,7 @@ def getCharacter(player, character): def getRandomCharacter(otherthen): - characters = list(babase.app.spaz_appearances.keys()) + characters = list(babase.app.classic.spaz_appearances.keys()) invalid_characters = ["Snake Shadow", "Lee", "Zola", "Butch", "Witch", "Middle-Man", "Alien", "OldLady", "Wrestler", "Gretel", "Robot"] @@ -71,7 +71,7 @@ def setTeamCharacter(): if not _setting["sameCharacterForTeam"]: return used = [] - teams = babase.internal.get_foreground_host_session().sessionteams + teams = bs.get_foreground_host_session().sessionteams if len(teams) < 10: for team in teams: character = getRandomCharacter(used) diff --git a/dist/ba_root/mods/tools/ServerUpdate.py b/dist/ba_root/mods/tools/ServerUpdate.py index ca99be5..1065384 100644 --- a/dist/ba_root/mods/tools/ServerUpdate.py +++ b/dist/ba_root/mods/tools/ServerUpdate.py @@ -80,7 +80,7 @@ def fetchChangelogs(): def checkChangelog(): changelog = fetchChangelogs() - if changelog == None: + if changelog is None: print( f'{Clr.BRED} UNABLE TO CHECK UPDATES , CHECK MANUALLY FROM URL {Clr.RST}', flush=True) diff --git a/dist/ba_root/mods/tools/file_handle.py b/dist/ba_root/mods/tools/file_handle.py index f0a49c7..d780bd2 100644 --- a/dist/ba_root/mods/tools/file_handle.py +++ b/dist/ba_root/mods/tools/file_handle.py @@ -64,7 +64,7 @@ class JsonFile: output = json.dumps(data, indent=4) output2 = re.sub(r'": \[\s+', '": [', output) output3 = re.sub(r'",\s+', '", ', output2) - output4 = re.sub(r'"\s+\]', '"]', output3) + output4 = re.sub(r'"\s+]', '"]', output3) with open(self.path, mode="w", encoding="utf-8") as json_file: json_file.write(output4) diff --git a/dist/ba_root/mods/tools/playlist.py b/dist/ba_root/mods/tools/playlist.py index d8f1506..4da1fd9 100644 --- a/dist/ba_root/mods/tools/playlist.py +++ b/dist/ba_root/mods/tools/playlist.py @@ -7,7 +7,7 @@ import time import _babase import setting - +from bascenev1 import filter_playlist import babase import bascenev1 as bs import bauiv1 as bui @@ -67,19 +67,19 @@ def updateSession(session, playlist): def updatePlaylist(playlist): session = bs.get_foreground_host_session() - content = babase._playlist.filter_playlist( + content = filter_playlist( playlist, sessiontype=type(session), add_resolved_type=True, ) - playlist = babase._multiteamsession.ShuffleList(content, shuffle=False) + playlist = bs._multiteamsession.ShuffleList(content, shuffle=False) session._playlist = playlist set_next_map(session, playlist.pull_next()) def set_next_map(session, game_map): session._next_game_spec = game_map - with babase.Context(session): + with session.context(): session._instantiate_next_game() diff --git a/dist/ba_root/mods/tools/servercheck.py b/dist/ba_root/mods/tools/servercheck.py index 251c28b..2796f34 100644 --- a/dist/ba_root/mods/tools/servercheck.py +++ b/dist/ba_root/mods/tools/servercheck.py @@ -41,7 +41,7 @@ class checkserver(object): ip = _bascenev1.get_client_ip(ros["client_id"]) device_id = _bascenev1.get_client_public_device_uuid( ros["client_id"]) - if (device_id == None): + if device_id is None: device_id = _bascenev1.get_client_device_uuid(ros["client_id"]) if device_id not in deviceClientMap: deviceClientMap[device_id] = [ros["client_id"]] @@ -87,7 +87,7 @@ class checkserver(object): except: pass if d_str2 != d_str: - _bs.broadcastmessage( + bs.broadcastmessage( "Profanity in Id , change your ID and join back", color=(1, 0, 0), transient=True, clients=[ros['client_id']]) @@ -100,9 +100,9 @@ class checkserver(object): bs.disconnect_client(ros['client_id'], 1) return - if settings["whitelist"] and ros["account_id"] != None: + if settings["whitelist"] and ros["account_id"] is not None: if ros["account_id"] not in pdata.CacheData.whitelist: - _bs.broadcastmessage("Not in whitelist,contact admin", + bs.broadcastmessage("Not in whitelist,contact admin", color=(1, 0, 0), transient=True, clients=[ros['client_id']]) logger.log( @@ -111,7 +111,7 @@ class checkserver(object): return - if ros['account_id'] != None: + if ros['account_id'] is not None: if ros['account_id'] in serverdata.clients: on_player_join_server(ros['account_id'], serverdata.clients[ @@ -140,7 +140,7 @@ def on_player_join_server(pbid, player_data, ip, device_id): if now - lastjoin < 15: joincount += 1 if joincount > 2: - _bs.broadcastmessage("Joining too fast , slow down dude", + bs.broadcastmessage("Joining too fast , slow down dude", # its not possible now tho, network layer will catch it before reaching here color=(1, 0, 1), transient=True, clients=[clid]) @@ -158,7 +158,7 @@ def on_player_join_server(pbid, player_data, ip, device_id): if pbid in serverdata.clients: serverdata.clients[pbid]["lastJoin"] = now - if player_data != None: # player data is in serevrdata or in local.json cache + if player_data is not None: # player data is in serevrdata or in local.json cache serverdata.recents.append( {"client_id": clid, "deviceId": device_string, "pbid": pbid}) serverdata.recents = serverdata.recents[-20:] @@ -172,7 +172,7 @@ def on_player_join_server(pbid, player_data, ip, device_id): settings["minAgeToJoinInHours"]: for ros in bs.get_game_roster(): if ros['account_id'] == pbid: - _bs.broadcastmessage( + bs.broadcastmessage( "New Accounts not allowed here , come back later", color=(1, 0, 0), transient=True, clients=[ros['client_id']]) @@ -199,7 +199,7 @@ def on_player_join_server(pbid, player_data, ip, device_id): serverdata.clients[pbid]["lastIP"] = ip device_id = _bascenev1.get_client_public_device_uuid(clid) - if (device_id == None): + if device_id is None: device_id = _bascenev1.get_client_device_uuid(clid) serverdata.clients[pbid]["deviceUUID"] = device_id verify_account(pbid, player_data) # checked for spoofed ids @@ -209,7 +209,7 @@ def on_player_join_server(pbid, player_data, ip, device_id): settings["regularWelcomeMsg"] + " " + device_string, color=(0.60, 0.8, 0.6), transient=True, clients=[clid]) - if (settings["ballistica_web"]["enable"]): + if settings["ballistica_web"]["enable"]: from . import notification_manager notification_manager.player_joined(pbid) else: @@ -224,7 +224,7 @@ def on_player_join_server(pbid, player_data, ip, device_id): thread.start() bs.broadcastmessage(settings["firstTimeJoinMsg"], color=(0.6, 0.8, 0.6), transient=True, clients=[clid]) - if (settings["ballistica_web"]["enable"]): + if settings["ballistica_web"]["enable"]: from . import notification_manager notification_manager.player_joined(pbid) @@ -400,7 +400,7 @@ def save_ids(ids, pb_id, display_string): def kick_by_pb_id(pb_id, msg): for ros in bs.get_game_roster(): if ros['account_id'] == pb_id: - _bs.broadcastmessage(msg, transient=True, + bs.broadcastmessage(msg, transient=True, clients=[ros['client_id']]) bs.disconnect_client(ros['client_id']) diff --git a/dist/ba_root/mods/tools/servercontroller.py b/dist/ba_root/mods/tools/servercontroller.py index 1545d1a..2e9619c 100644 --- a/dist/ba_root/mods/tools/servercontroller.py +++ b/dist/ba_root/mods/tools/servercontroller.py @@ -98,24 +98,24 @@ def check_queue(): def on_update_response(response): allowed_to_join = response["c"] players_in_queue = response["e"] - max_allowed_in_server = _babase.app.server._config.max_party_size - current_players = len(_babase.get_game_roster()) + max_allowed_in_server = babase.app.classic.server._config.max_party_size + current_players = len(bs.get_game_roster()) # print(allowed_to_join) if allowed_to_join: # looks good , yipee - _babase.set_public_party_queue_enabled(True) + bs.set_public_party_queue_enabled(True) return if not allowed_to_join and len( players_in_queue) > 1 and current_players < max_allowed_in_server: # something is wrong , lets disable queue for some time - _babase.set_public_party_queue_enabled(False) + bs.set_public_party_queue_enabled(False) def simple_queue_checker(): - max_allowed_in_server = _babase.app.server._config.max_party_size - current_players = len(_babase.get_game_roster()) + max_allowed_in_server = babase.app.classic.server._config.max_party_size + current_players = len(bs.get_game_roster()) if current_players < max_allowed_in_server: - _babase.set_public_party_queue_enabled(False) + bs.set_public_party_queue_enabled(False) else: - _babase.set_public_party_queue_enabled(True) + bs.set_public_party_queue_enabled(True) diff --git a/dist/bombsquad_headless b/dist/bombsquad_headless index 8d00f20..c8f3d55 100644 Binary files a/dist/bombsquad_headless and b/dist/bombsquad_headless differ diff --git a/dist/bombsquad_headless_aarch64 b/dist/bombsquad_headless_aarch64 index b840e94..0a51f3a 100644 Binary files a/dist/bombsquad_headless_aarch64 and b/dist/bombsquad_headless_aarch64 differ