mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
kick annoying kids, ping all command
This commit is contained in:
parent
7897eebd19
commit
7f95481c26
5 changed files with 29 additions and 2 deletions
|
|
@ -39,7 +39,8 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
|||
def get_ping(arguments, clientid):
|
||||
if arguments == [] or arguments == ['']:
|
||||
send(f"Your ping {_ba.get_client_ping(clientid)}ms ", clientid)
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
pingall(clientid)
|
||||
else:
|
||||
try:
|
||||
session = ba.internal.get_foreground_host_session()
|
||||
|
|
@ -67,6 +68,20 @@ def stats(ac_id, clientid):
|
|||
def fetch_send_stats(ac_id, clientid):
|
||||
_thread.start_new_thread(stats, (ac_id, clientid,))
|
||||
|
||||
def pingall(clientid):
|
||||
"""Returns The List Of Players Clientid and index"""
|
||||
|
||||
p = u'{0:^16}{1:^34}ms'
|
||||
seprator = '\n______________________________\n'
|
||||
|
||||
list = p.format('Name', 'Ping (ms)')+seprator
|
||||
session = ba.internal.get_foreground_host_session()
|
||||
|
||||
for index, player in enumerate(session.sessionplayers):
|
||||
list += p.format(player.getname(icon=True),
|
||||
_ba.get_client_ping(int(player.inputdevice.client_id)))+"\n"
|
||||
|
||||
send(list, clientid)
|
||||
|
||||
def list(clientid):
|
||||
"""Returns The List Of Players Clientid and index"""
|
||||
|
|
|
|||
3
dist/ba_root/mods/playersData/pdata.py
vendored
3
dist/ba_root/mods/playersData/pdata.py
vendored
|
|
@ -190,7 +190,8 @@ def add_profile(
|
|||
cid = ros['client_id']
|
||||
ip = _ba.get_client_ip(cid)
|
||||
serverdata.clients[account_id]["lastIP"] = ip
|
||||
|
||||
serverdata.recents.append({"client_id":cid,"deviceId":display_string,"pbid": account_id})
|
||||
serverdata.recents = serverdata.recents[-20:]
|
||||
device_id = _ba.get_client_public_device_uuid(cid)
|
||||
if(device_id==None):
|
||||
device_id = _ba.get_client_device_uuid(cid)
|
||||
|
|
|
|||
11
dist/ba_root/mods/tools/servercheck.py
vendored
11
dist/ba_root/mods/tools/servercheck.py
vendored
|
|
@ -35,6 +35,17 @@ class checkserver(object):
|
|||
deviceClientMap = {}
|
||||
for ros in ba.internal.get_game_roster():
|
||||
ip = _ba.get_client_ip(ros["client_id"])
|
||||
device_id = _ba.get_client_public_device_uuid(ros["client_id"])
|
||||
if device_id not in deviceClientMap:
|
||||
deviceClientMap[device_id] = [ros["client_id"]]
|
||||
else:
|
||||
deviceClientMap[device_id].append(ros["client_id"])
|
||||
if len(deviceClientMap[device_id]) >= settings['maxAccountPerIP']:
|
||||
_ba.chatmessage(f"Only {settings['maxAccountPerIP']} player per IP allowed, disconnecting this device.", clients=[ros["client_id"]])
|
||||
ba.internal.disconnect_client(ros["client_id"])
|
||||
logger.log(" Player disconnected, reached max players per device ||"+ ros["account_id"] ,
|
||||
"playerjoin")
|
||||
continue
|
||||
if ip not in ipClientMap:
|
||||
ipClientMap[ip] = [ros["client_id"]]
|
||||
else:
|
||||
|
|
|
|||
BIN
dist/bombsquad_headless
vendored
BIN
dist/bombsquad_headless
vendored
Binary file not shown.
BIN
dist/bombsquad_headless_aarch64
vendored
BIN
dist/bombsquad_headless_aarch64
vendored
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue