mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
Added more useful commands
Commands added: Kickvote disable all or for specific player lm = shows last 100 messages gp = shows player profiles party private or public command
This commit is contained in:
parent
3e2b1a2e84
commit
38fd457084
1 changed files with 79 additions and 2 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
from .Handlers import handlemsg, handlemsg_all,send
|
from .Handlers import handlemsg, handlemsg_all,send,chattmsg
|
||||||
from playersData import pdata
|
from playersData import pdata
|
||||||
# from tools.whitelist import add_to_white_list, add_commit_to_logs
|
# from tools.whitelist import add_to_white_list, add_commit_to_logs
|
||||||
from serverData import serverdata
|
from serverData import serverdata
|
||||||
import ba, _ba, time, setting
|
import ba, _ba, time, setting
|
||||||
import _thread
|
import _thread
|
||||||
from tools import playlist
|
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']
|
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)
|
ban(arguments)
|
||||||
elif command in ['end', 'next']:
|
elif command in ['end', 'next']:
|
||||||
end(arguments)
|
end(arguments)
|
||||||
|
elif command == 'kickvote':
|
||||||
|
kikvote(arguments, clientid)
|
||||||
|
|
||||||
|
elif command == 'lm':
|
||||||
|
last_msgs(arguments)
|
||||||
|
|
||||||
|
elif command == 'gp':
|
||||||
|
get_profiles(arguments)
|
||||||
|
|
||||||
|
elif command == 'party':
|
||||||
|
party_toggle(arguments)
|
||||||
|
|
||||||
elif command in ['quit', 'restart']:
|
elif command in ['quit', 'restart']:
|
||||||
quit(arguments)
|
quit(arguments)
|
||||||
|
|
@ -118,7 +129,73 @@ def changeplaylist(arguments):
|
||||||
def kick(arguments):
|
def kick(arguments):
|
||||||
_ba.disconnect_client(int(arguments[0]))
|
_ba.disconnect_client(int(arguments[0]))
|
||||||
return
|
return
|
||||||
|
def kikvote(arguments, clientid):
|
||||||
|
if arguments == [] or arguments == ['']:
|
||||||
|
return
|
||||||
|
|
||||||
|
elif arguments[0] == 'enable':
|
||||||
|
if arguments[1] == 'all':
|
||||||
|
_ba.set_enable_default_kick_voting(True)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
cl_id=int(arguments[1])
|
||||||
|
ac_id=""
|
||||||
|
for ros in _ba.get_game_roster():
|
||||||
|
if ros["client_id"]==cl_id:
|
||||||
|
_thread.start_new_thread(pdata.kikvot,(ros['account_id'],))
|
||||||
|
send("Upon server restart, Kick-vote will be enabled for this person", clientid)
|
||||||
|
if ac_id in serverdata.clients:
|
||||||
|
serverdata.clients[ac_id]["canStartKickVote"]=True
|
||||||
|
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])
|
||||||
|
ac_id=""
|
||||||
|
for ros in _ba.get_game_roster():
|
||||||
|
if ros["client_id"]==cl_id:
|
||||||
|
_thread.start_new_thread(pdata.kikvott,(ros['account_id'],))
|
||||||
|
send("Upon server restart, Kick-vote will be disabled for this person", clientid)
|
||||||
|
if ac_id in serverdata.clients:
|
||||||
|
serverdata.clients[ac_id]["canStartKickVote"]=False
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
|
def last_msgs(arguments):
|
||||||
|
if arguments == [] or arguments == ['']:
|
||||||
|
for i in _ba.get_chat_messages():
|
||||||
|
chattmsg(i)
|
||||||
|
|
||||||
|
def get_profiles(arguments):
|
||||||
|
try:
|
||||||
|
playerID = int(arguments[0])
|
||||||
|
num = 1
|
||||||
|
for i in _ba.get_foreground_host_session().sessionplayers[playerID].inputdevice.get_player_profiles():
|
||||||
|
try:
|
||||||
|
chattmsg(f"{num})- {i}")
|
||||||
|
num += 1
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def party_toggle(arguments):
|
||||||
|
|
||||||
|
if arguments == ['public']:
|
||||||
|
_ba.set_public_party_enabled(True)
|
||||||
|
elif arguments == ['private']:
|
||||||
|
_ba.set_public_party_enabled(False)
|
||||||
|
chattmsg("Remember, party will be Public upon restart")
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def end(arguments):
|
def end(arguments):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue