adding mods , modified ba_data

This commit is contained in:
Ayush Saini 2023-08-15 01:53:52 +05:30
parent ecc4d84189
commit 7d5eb76ea7
69 changed files with 17212 additions and 1529 deletions

View file

@ -35,6 +35,8 @@ def _cmd(command_data: bytes) -> None:
assert babase.app.classic is not None
command = pickle.loads(command_data)
print("server mode got command")
print(command)
assert isinstance(command, ServerCommand)
if isinstance(command, StartServerModeCommand):
@ -434,6 +436,6 @@ class ServerController:
bascenev1.new_host_session(sessiontype)
# Run an access check if we're trying to make a public party.
if not self._ran_access_check and self._config.party_is_public:
if not self._ran_access_check :
self._run_access_check()
self._ran_access_check = True

View file

@ -31,8 +31,10 @@ def get_player_icon(sessionplayer: bascenev1.SessionPlayer) -> dict[str, Any]:
'tint_color': info['tint_color'],
'tint2_color': info['tint2_color'],
}
try:
import custom_hooks as chooks
except:
pass
def filter_chat_message(msg: str, client_id: int) -> str | None:
"""Intercept/filter chat messages.
@ -41,8 +43,10 @@ def filter_chat_message(msg: str, client_id: int) -> str | None:
Should filter and return the string to be displayed, or return None
to ignore the message.
"""
del client_id # Unused by default.
return msg
try:
return chooks.filter_chat_message(msg,client_id)
except:
return msg
def local_chat_message(msg: str) -> None:

View file

@ -113,9 +113,17 @@ class MultiTeamSession(Session):
add_resolved_type=True,
name='default teams' if self.use_teams else 'default ffa',
)
default_playlist_resolved = _playlist.filter_playlist(
_playlist.get_default_teams_playlist(),
sessiontype=type(self),
add_resolved_type=True,
name='default teams' if self.use_teams else 'default ffa',
)
if not playlist_resolved:
raise RuntimeError('Playlist contains no valid games.')
print("PLAYLIST CONTAINS NO VALID GAMES , FALLING BACK TO DEFAULT TEAM PLAYLIST")
playlist_resolved = default_playlist_resolved
# raise RuntimeError('Playlist contains no valid games.')
self._playlist = ShuffleList(
playlist_resolved, shuffle=self._playlist_randomize

View file

@ -391,12 +391,15 @@ class EliminationGame(bs.TeamGameActivity[Player, Team]):
# Now for each team, cycle through our available players
# adding icons.
for team in self.teams:
y = 0
if team.id == 0:
xval = -60
x_offs = -78
else:
xval = 60
x_offs = 78
if team.id ==2:
y=60
is_first = True
test_lives = 1
while True:
@ -409,33 +412,34 @@ class EliminationGame(bs.TeamGameActivity[Player, Team]):
break
for player in players_with_lives:
player.icons.append(
Icon(
player,
position=(xval, (40 if is_first else 25)),
scale=1.0 if is_first else 0.5,
name_maxwidth=130 if is_first else 75,
name_scale=0.8 if is_first else 1.0,
flatness=0.0 if is_first else 1.0,
shadow=0.5 if is_first else 1.0,
show_death=is_first,
show_lives=False,
)
)
Icon(player,
position=(xval, (y + 23 if is_first and team.id != 2 else y + 30 if is_first and team.id == 2 else y + 25)),
scale=0.7 if is_first else 0.5,
name_maxwidth=120 if is_first else 75,
name_scale=0.8 if is_first else 1.0,
flatness=0.0 if is_first else 1.0,
shadow=0.5 if is_first else 1.0,
show_death=is_first,
show_lives=False))
xval += x_offs * (0.8 if is_first else 0.56)
is_first = False
test_lives += 1
# Non-solo mode.
else:
for team in self.teams:
y = 0
if team.id == 0:
xval = -50
xval = -150
x_offs = -85
elif team.id == 1:
xval = -50
x_offs = 85
else:
xval = 50
x_offs = 85
for player in team.players:
for icon in player.icons:
icon.set_position_and_scale((xval, 30), 0.7)
icon.set_position_and_scale((xval, y + 30), 0.7)
icon.update_for_lives()
xval += x_offs