mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2026-08-15 13:04:30 +00:00
Merge pull request #45 from SenjuZoro/patch-2
Added more useful chat commands
This commit is contained in:
commit
97404c81f2
1 changed files with 74 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ from serverData import serverdata
|
|||
import ba, _ba, time, setting
|
||||
import _thread
|
||||
from tools import playlist
|
||||
Commands = ['maxplayers','playlist','ban','kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand','getroles', 'removecmd', 'changetag','customtag','customeffect','add', 'spectators', 'lobbytime']
|
||||
Commands = ['lm', 'gp', 'party', 'quit', 'kickvote','maxplayers','playlist','ban','kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand','getroles', 'removecmd', 'changetag','customtag','customeffect','add', 'spectators', 'lobbytime']
|
||||
CommandAliases = ['max','rm', 'next', 'restart', 'mutechat', 'unmutechat', 'sm', 'slow', 'night', 'day', 'pausegame', 'camera_mode', 'rotate_camera','effect']
|
||||
|
||||
|
||||
|
|
@ -33,6 +33,17 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
|||
ban(arguments)
|
||||
elif command in ['end', 'next']:
|
||||
end(arguments)
|
||||
elif command == 'kickvote':
|
||||
kikvote(arguments, clientid)
|
||||
|
||||
elif command == 'lm':
|
||||
last_msgs(clientid)
|
||||
|
||||
elif command == 'gp':
|
||||
get_profiles(arguments, clientid)
|
||||
|
||||
elif command == 'party':
|
||||
party_toggle(arguments)
|
||||
|
||||
elif command in ['quit', 'restart']:
|
||||
quit(arguments)
|
||||
|
|
@ -118,13 +129,73 @@ def changeplaylist(arguments):
|
|||
def kick(arguments):
|
||||
_ba.disconnect_client(int(arguments[0]))
|
||||
return
|
||||
def kikvote(arguments, clientid):
|
||||
if arguments == [] or arguments == [''] or len(arguments) < 2:
|
||||
return
|
||||
|
||||
elif arguments[0] == 'enable':
|
||||
if arguments[1] == 'all':
|
||||
_ba.set_enable_default_kick_voting(True)
|
||||
else:
|
||||
try:
|
||||
cl_id=int(arguments[1])
|
||||
for ros in _ba.get_game_roster():
|
||||
if ros["client_id"]==cl_id:
|
||||
if ros["account_id"] in serverdata.clients:
|
||||
serverdata.clients[ros["account_id"]]["canStartKickVote"]=True
|
||||
send("Upon server restart, Kick-vote will be enabled for this person", clientid)
|
||||
return
|
||||
except:
|
||||
return
|
||||
|
||||
elif arguments[0] == 'disable':
|
||||
if arguments[1] == 'all':
|
||||
_ba.set_enable_default_kick_voting(False)
|
||||
else:
|
||||
try:
|
||||
cl_id=int(arguments[1])
|
||||
for ros in _ba.get_game_roster():
|
||||
if ros["client_id"]==cl_id:
|
||||
_ba.disable_kickvote(ros["account_id"])
|
||||
send("Kick-vote disabled for this person", clientid)
|
||||
if ros["account_id"] in serverdata.clients:
|
||||
serverdata.clients[ros["account_id"]]["canStartKickVote"]=False
|
||||
return
|
||||
except:
|
||||
return
|
||||
else:
|
||||
return
|
||||
|
||||
def last_msgs(clientid):
|
||||
for i in _ba.get_chat_messages():
|
||||
send(i,clientid)
|
||||
|
||||
def get_profiles(arguments,clientid):
|
||||
try:
|
||||
playerID = int(arguments[0])
|
||||
num = 1
|
||||
for i in _ba.get_foreground_host_session().sessionplayers[playerID].inputdevice.get_player_profiles():
|
||||
try:
|
||||
send(f"{num})- {i}",clientid)
|
||||
num += 1
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
def party_toggle(arguments):
|
||||
if arguments == ['public']:
|
||||
_ba.set_public_party_enabled(True)
|
||||
_ba.chatmessage("party is public now")
|
||||
elif arguments == ['private']:
|
||||
_ba.set_public_party_enabled(False)
|
||||
_ba.chatmessage("party is private now")
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
def end(arguments):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
|
||||
try:
|
||||
with _ba.Context(_ba.get_foreground_host_activity()):
|
||||
_ba.get_foreground_host_activity().end_game()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue