mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
fixed context errors in votingmachine and reordered installation cmds
This commit is contained in:
parent
a334c3201d
commit
e157b2b2ce
2 changed files with 13 additions and 7 deletions
10
README.md
10
README.md
|
|
@ -18,9 +18,9 @@ Migrated from API 7 TO API 8 , this might be unstable and missing some features.
|
|||
## Getting Started
|
||||
This assumes you are on Ubuntu or an Ubuntu based distribution.
|
||||
|
||||
Update and install `software-properties-common`
|
||||
Install `software-properties-common`
|
||||
```
|
||||
sudo apt update; sudo apt install software-properties-common -y
|
||||
sudo apt install software-properties-common -y
|
||||
```
|
||||
Add python Deadsnakes PPA
|
||||
```
|
||||
|
|
@ -30,6 +30,10 @@ Install Python 3.12
|
|||
```
|
||||
sudo apt install python3-pip python3.12-dev python3.12-venv
|
||||
```
|
||||
Update installed and existing packages
|
||||
```
|
||||
sudo apt update && sudo apt upgrade
|
||||
```
|
||||
Create a tmux session.
|
||||
```
|
||||
tmux new -s 43210
|
||||
|
|
@ -116,4 +120,4 @@ Here you can ban players, mute them, or disable their kick votes.
|
|||
- set 2d plane with _ba.set_2d_plane(z) - beta , not works with spaz.fly = true.
|
||||
- New Splitted Team in game score screen.
|
||||
- New final score screen , StumbledScoreScreen.
|
||||
- other small small feature improvement here there find yourself.
|
||||
- other small small feature improvement here there find yourself.
|
||||
10
dist/ba_root/mods/features/votingmachine.py
vendored
10
dist/ba_root/mods/features/votingmachine.py
vendored
|
|
@ -58,7 +58,7 @@ def vote(pb_id, client_id, vote_type):
|
|||
else:
|
||||
activity = bs.get_foreground_host_activity()
|
||||
if activity is not None:
|
||||
with _babase.Context(activity):
|
||||
with activity.context:
|
||||
bs.broadcastmessage(
|
||||
f"{max_votes_required(len(active_players)) - len(voters)} votes required for {vote_type}",
|
||||
image={"texture": bs.gettexture(
|
||||
|
|
@ -75,7 +75,8 @@ def vote(pb_id, client_id, vote_type):
|
|||
vote_machine[vote_type]["voters"] = []
|
||||
if vote_type == "end":
|
||||
try:
|
||||
with _babase.Context(bs.get_foreground_host_activity()):
|
||||
activity = bs.get_foreground_host_activity()
|
||||
with activity.context:
|
||||
bs.get_foreground_host_activity().end_game()
|
||||
except:
|
||||
pass
|
||||
|
|
@ -120,7 +121,8 @@ def update_vote_text(votes_needed):
|
|||
activity.end_vote_text.node.text = "{} more votes to end this map\ntype 'end' to vote".format(
|
||||
votes_needed)
|
||||
except:
|
||||
with _babase.Context(bs.get_foreground_host_activity()):
|
||||
activity = bs.get_foreground_host_activity()
|
||||
with activity.context:
|
||||
node = bs.NodeActor(bs.newnode('text',
|
||||
attrs={
|
||||
'v_attach': 'top',
|
||||
|
|
@ -142,4 +144,4 @@ def remove_vote_text():
|
|||
activity = bs.get_foreground_host_activity()
|
||||
if hasattr(activity,
|
||||
"end_vote_text") and activity.end_vote_text.node.exists():
|
||||
activity.end_vote_text.node.delete()
|
||||
activity.end_vote_text.node.delete()
|
||||
Loading…
Add table
Add a link
Reference in a new issue