mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
Merge pull request #64 from vishal332008/public-server
Updating a few Unfixed Errors
This commit is contained in:
commit
daff57f1e9
5 changed files with 27 additions and 27 deletions
|
|
@ -7,7 +7,7 @@ import ba.internal
|
||||||
def send(msg, clientid):
|
def send(msg, clientid):
|
||||||
"""Shortcut To Send Private Msg To Client"""
|
"""Shortcut To Send Private Msg To Client"""
|
||||||
|
|
||||||
_ba.chatmessage(str(msg), clients=[clientid])
|
ba.internal.chatmessage(str(msg), clients=[clientid])
|
||||||
_ba.screenmessage(str(msg), transient=True, clients=[clientid])
|
_ba.screenmessage(str(msg), transient=True, clients=[clientid])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,13 +111,13 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
||||||
|
|
||||||
def changepartysize(arguments):
|
def changepartysize(arguments):
|
||||||
if len(arguments)==0:
|
if len(arguments)==0:
|
||||||
_ba.chatmessage("enter number")
|
ba.internal.chatmessage("enter number")
|
||||||
else:
|
else:
|
||||||
ba.internal.set_public_party_max_size(int(arguments[0]))
|
ba.internal.set_public_party_max_size(int(arguments[0]))
|
||||||
|
|
||||||
def changeplaylist(arguments):
|
def changeplaylist(arguments):
|
||||||
if len(arguments)==0:
|
if len(arguments)==0:
|
||||||
_ba.chatmessage("enter list code or name")
|
ba.internal.chatmessage("enter list code or name")
|
||||||
else:
|
else:
|
||||||
if arguments[0]=='coop':
|
if arguments[0]=='coop':
|
||||||
serverdata.coopmode=True
|
serverdata.coopmode=True
|
||||||
|
|
@ -187,10 +187,10 @@ def get_profiles(arguments,clientid):
|
||||||
def party_toggle(arguments):
|
def party_toggle(arguments):
|
||||||
if arguments == ['public']:
|
if arguments == ['public']:
|
||||||
ba.internal.set_public_party_enabled(True)
|
ba.internal.set_public_party_enabled(True)
|
||||||
_ba.chatmessage("party is public now")
|
ba.internal.chatmessage("party is public now")
|
||||||
elif arguments == ['private']:
|
elif arguments == ['private']:
|
||||||
ba.internal.set_public_party_enabled(False)
|
ba.internal.set_public_party_enabled(False)
|
||||||
_ba.chatmessage("party is private now")
|
ba.internal.chatmessage("party is private now")
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -454,11 +454,11 @@ def remove_command_to_role(arguments):
|
||||||
|
|
||||||
# if arguments[0] == 'on':
|
# if arguments[0] == 'on':
|
||||||
# if settings["white_list"]["whitelist_on"]:
|
# if settings["white_list"]["whitelist_on"]:
|
||||||
# _ba.chatmessage("Already on")
|
# ba.internal.chatmessage("Already on")
|
||||||
# else:
|
# else:
|
||||||
# settings["white_list"]["whitelist_on"] = True
|
# settings["white_list"]["whitelist_on"] = True
|
||||||
# setting.commit(settings)
|
# setting.commit(settings)
|
||||||
# _ba.chatmessage("whitelist on")
|
# ba.internal.chatmessage("whitelist on")
|
||||||
# from tools import whitelist
|
# from tools import whitelist
|
||||||
# whitelist.Whitelist()
|
# whitelist.Whitelist()
|
||||||
# return
|
# return
|
||||||
|
|
@ -466,7 +466,7 @@ def remove_command_to_role(arguments):
|
||||||
# elif arguments[0] == 'off':
|
# elif arguments[0] == 'off':
|
||||||
# settings["white_list"]["whitelist_on"] = False
|
# settings["white_list"]["whitelist_on"] = False
|
||||||
# setting.commit(settings)
|
# setting.commit(settings)
|
||||||
# _ba.chatmessage("whitelist off")
|
# ba.internal.chatmessage("whitelist off")
|
||||||
# return
|
# return
|
||||||
|
|
||||||
# else:
|
# else:
|
||||||
|
|
@ -475,7 +475,7 @@ def remove_command_to_role(arguments):
|
||||||
# for i in rost:
|
# for i in rost:
|
||||||
# if i['client_id'] == int(arguments[0]):
|
# if i['client_id'] == int(arguments[0]):
|
||||||
# add_to_white_list(i['account_id'], i['display_string'])
|
# add_to_white_list(i['account_id'], i['display_string'])
|
||||||
# _ba.chatmessage(str(i['display_string'])+" whitelisted")
|
# ba.internal.chatmessage(str(i['display_string'])+" whitelisted")
|
||||||
# add_commit_to_logs(accountid+" added "+i['account_id'])
|
# add_commit_to_logs(accountid+" added "+i['account_id'])
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -489,12 +489,12 @@ def spectators(arguments):
|
||||||
if arguments[0] == 'on':
|
if arguments[0] == 'on':
|
||||||
settings["white_list"]["spectators"] = True
|
settings["white_list"]["spectators"] = True
|
||||||
setting.commit(settings)
|
setting.commit(settings)
|
||||||
_ba.chatmessage("spectators on")
|
ba.internal.chatmessage("spectators on")
|
||||||
|
|
||||||
elif arguments[0] == 'off':
|
elif arguments[0] == 'off':
|
||||||
settings["white_list"]["spectators"] = False
|
settings["white_list"]["spectators"] = False
|
||||||
setting.commit(settings)
|
setting.commit(settings)
|
||||||
_ba.chatmessage("spectators off")
|
ba.internal.chatmessage("spectators off")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -503,9 +503,9 @@ def change_lobby_check_time(arguments):
|
||||||
try:
|
try:
|
||||||
argument = int(arguments[0])
|
argument = int(arguments[0])
|
||||||
except:
|
except:
|
||||||
_ba.chatmessage("must type number to change lobby check time")
|
ba.internal.chatmessage("must type number to change lobby check time")
|
||||||
return
|
return
|
||||||
settings = setting.get_settings_data()
|
settings = setting.get_settings_data()
|
||||||
settings["white_list"]["lobbychecktime"] = argument
|
settings["white_list"]["lobbychecktime"] = argument
|
||||||
setting.commit(settings)
|
setting.commit(settings)
|
||||||
_ba.chatmessage(f"lobby check time is {argument} now")
|
ba.internal.chatmessage(f"lobby check time is {argument} now")
|
||||||
|
|
|
||||||
6
dist/ba_root/mods/features/EndVote.py
vendored
6
dist/ba_root/mods/features/EndVote.py
vendored
|
|
@ -24,7 +24,7 @@ def vote_end(pb_id, client_id):
|
||||||
clients=[client_id])
|
clients=[client_id])
|
||||||
return
|
return
|
||||||
if len(voters) == 0:
|
if len(voters) == 0:
|
||||||
_ba.chatmessage("end vote started")
|
ba.internal.chatmessage("end vote started")
|
||||||
|
|
||||||
# clean up voters list
|
# clean up voters list
|
||||||
active_players = []
|
active_players = []
|
||||||
|
|
@ -40,10 +40,10 @@ def vote_end(pb_id, client_id):
|
||||||
update_vote_text(required_votes(len(active_players)) - len(voters))
|
update_vote_text(required_votes(len(active_players)) - len(voters))
|
||||||
if required_votes(len(active_players)) - len(
|
if required_votes(len(active_players)) - len(
|
||||||
voters) == 3: # lets dont spam chat/screen message with votes required , only give message when only 3 votes left
|
voters) == 3: # lets dont spam chat/screen message with votes required , only give message when only 3 votes left
|
||||||
_ba.chatmessage("3 more end votes required")
|
ba.internal.chatmessage("3 more end votes required")
|
||||||
|
|
||||||
if len(voters) >= required_votes(len(active_players)):
|
if len(voters) >= required_votes(len(active_players)):
|
||||||
_ba.chatmessage("end vote succeed")
|
ba.internal.chatmessage("end vote succeed")
|
||||||
try:
|
try:
|
||||||
with _ba.Context(_ba.get_foreground_host_activity()):
|
with _ba.Context(_ba.get_foreground_host_activity()):
|
||||||
_ba.get_foreground_host_activity().end_game()
|
_ba.get_foreground_host_activity().end_game()
|
||||||
|
|
|
||||||
4
dist/ba_root/mods/features/discord_bot.py
vendored
4
dist/ba_root/mods/features/discord_bot.py
vendored
|
|
@ -48,7 +48,7 @@ async def on_message(message):
|
||||||
channel=message.channel
|
channel=message.channel
|
||||||
|
|
||||||
if message.channel.id==logsChannelID:
|
if message.channel.id==logsChannelID:
|
||||||
_ba.pushcall(Call(_ba.chatmessage,message.content),from_other_thread=True)
|
_ba.pushcall(Call(ba.internal.chatmessage,message.content),from_other_thread=True)
|
||||||
|
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
|
|
@ -188,7 +188,7 @@ class BsDataThread(object):
|
||||||
#system={'cpu':80,'ram':34}
|
#system={'cpu':80,'ram':34}
|
||||||
# stats['system']=system
|
# stats['system']=system
|
||||||
stats['roster']=liveplayers
|
stats['roster']=liveplayers
|
||||||
stats['chats']=_ba.get_chat_messages()
|
stats['chats']=ba.internal.get_chat_messages()
|
||||||
stats['playlist']=minigame
|
stats['playlist']=minigame
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
18
dist/ba_root/mods/tools/playlist.py
vendored
18
dist/ba_root/mods/tools/playlist.py
vendored
|
|
@ -25,7 +25,7 @@ def set_playlist(content):
|
||||||
_playlists_var = "{} Playlists".format(content["playlistType"])
|
_playlists_var = "{} Playlists".format(content["playlistType"])
|
||||||
playlists = _ba.app.config[_playlists_var]
|
playlists = _ba.app.config[_playlists_var]
|
||||||
playlist = playlists[content["playlistName"]]
|
playlist = playlists[content["playlistName"]]
|
||||||
_ba.chatmessage("Fetched playlist:"+content["playlistName"])
|
ba.internal.chatmessage("Fetched playlist:"+content["playlistName"])
|
||||||
typename = (
|
typename = (
|
||||||
'teams' if content['playlistType'] == 'Team Tournament' else
|
'teams' if content['playlistType'] == 'Team Tournament' else
|
||||||
'ffa' if content['playlistType'] == 'Free-for-All' else '??')
|
'ffa' if content['playlistType'] == 'Free-for-All' else '??')
|
||||||
|
|
@ -75,14 +75,14 @@ def set_next_map(session, game_map):
|
||||||
|
|
||||||
|
|
||||||
def playlist(code):
|
def playlist(code):
|
||||||
_ba.add_transaction(
|
ba.internal.add_transaction(
|
||||||
{
|
{
|
||||||
'type': 'IMPORT_PLAYLIST',
|
'type': 'IMPORT_PLAYLIST',
|
||||||
'code': str(code),
|
'code': str(code),
|
||||||
'overwrite': True
|
'overwrite': True
|
||||||
},
|
},
|
||||||
callback=set_playlist)
|
callback=set_playlist)
|
||||||
_ba.run_transactions()
|
ba.internal.run_transactions()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -96,26 +96,26 @@ def setPlaylist(para):
|
||||||
elif para in settings["playlists"]:
|
elif para in settings["playlists"]:
|
||||||
playlist(settings["playlists"][para])
|
playlist(settings["playlists"][para])
|
||||||
else:
|
else:
|
||||||
_ba.chatmessage("Available Playlist")
|
ba.internal.chatmessage("Available Playlist")
|
||||||
for play in settings["playlists"]:
|
for play in settings["playlists"]:
|
||||||
_ba.chatmessage(play)
|
ba.internal.chatmessage(play)
|
||||||
|
|
||||||
|
|
||||||
def flush_playlists():
|
def flush_playlists():
|
||||||
print("Clearing old playlists..")
|
print("Clearing old playlists..")
|
||||||
for playlist in _ba.app.config["Team Tournament Playlists"]:
|
for playlist in _ba.app.config["Team Tournament Playlists"]:
|
||||||
_ba.add_transaction(
|
ba.internal.add_transaction(
|
||||||
{
|
{
|
||||||
"type":"REMOVE_PLAYLIST",
|
"type":"REMOVE_PLAYLIST",
|
||||||
"playlistType":"Team Tournament",
|
"playlistType":"Team Tournament",
|
||||||
"playlistName":playlist
|
"playlistName":playlist
|
||||||
})
|
})
|
||||||
_ba.run_transactions()
|
ba.internal.run_transactions()
|
||||||
for playlist in _ba.app.config["Free-for-All Playlists"]:
|
for playlist in _ba.app.config["Free-for-All Playlists"]:
|
||||||
_ba.add_transaction(
|
ba.internal.add_transaction(
|
||||||
{
|
{
|
||||||
"type":"REMOVE_PLAYLIST",
|
"type":"REMOVE_PLAYLIST",
|
||||||
"playlistType":"Free-for-All",
|
"playlistType":"Free-for-All",
|
||||||
"playlistName":playlist
|
"playlistName":playlist
|
||||||
})
|
})
|
||||||
_ba.run_transactions()
|
ba.internal.run_transactions()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue