mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
added unban command
This commit is contained in:
parent
a334c3201d
commit
c0722a6916
6 changed files with 65 additions and 37 deletions
|
|
@ -14,7 +14,7 @@ import bascenev1 as bs
|
||||||
from tools import logger
|
from tools import logger
|
||||||
|
|
||||||
|
|
||||||
Commands = ['recents', 'info', 'createteam', 'showid', 'hideid', 'lm', 'gp',
|
Commands = ['unban', 'recents', 'info', 'createteam', 'showid', 'hideid', 'lm', 'gp',
|
||||||
'party', 'quit', 'kickvote', 'maxplayers', 'playlist', 'ban',
|
'party', 'quit', 'kickvote', 'maxplayers', 'playlist', 'ban',
|
||||||
'kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv',
|
'kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv',
|
||||||
'dv', 'pause', 'tint',
|
'dv', 'pause', 'tint',
|
||||||
|
|
@ -42,6 +42,8 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
||||||
None
|
None
|
||||||
"""
|
"""
|
||||||
match command:
|
match command:
|
||||||
|
case 'unban':
|
||||||
|
unban(arguments)
|
||||||
case 'recents':
|
case 'recents':
|
||||||
get_recents(clientid)
|
get_recents(clientid)
|
||||||
case 'info':
|
case 'info':
|
||||||
|
|
@ -288,6 +290,19 @@ def ban(arguments):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def unban(arguments):
|
||||||
|
try:
|
||||||
|
for account in serverdata.recents:
|
||||||
|
if account['client_id'] == int(arguments[0]):
|
||||||
|
pdata.unban_player(
|
||||||
|
account["pbid"])
|
||||||
|
logger.log(
|
||||||
|
f'unbanned {account["pbid"]} by chat command, recents')
|
||||||
|
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def quit(arguments):
|
def quit(arguments):
|
||||||
if arguments == [] or arguments == ['']:
|
if arguments == [] or arguments == ['']:
|
||||||
babase.quit()
|
babase.quit()
|
||||||
|
|
|
||||||
6
dist/ba_root/mods/chathandle/handlechat.py
vendored
6
dist/ba_root/mods/chathandle/handlechat.py
vendored
|
|
@ -17,6 +17,7 @@ settings = setting.get_settings_data()
|
||||||
|
|
||||||
def filter_chat_message(msg, client_id):
|
def filter_chat_message(msg, client_id):
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
# bypassing chat filter for host
|
||||||
if client_id == -1:
|
if client_id == -1:
|
||||||
if msg.startswith("/"):
|
if msg.startswith("/"):
|
||||||
command_executor.execute(msg, client_id)
|
command_executor.execute(msg, client_id)
|
||||||
|
|
@ -37,6 +38,11 @@ def filter_chat_message(msg, client_id):
|
||||||
displaystring = i['display_string']
|
displaystring = i['display_string']
|
||||||
if acid:
|
if acid:
|
||||||
msg = chatfilter.filter(msg, acid, client_id)
|
msg = chatfilter.filter(msg, acid, client_id)
|
||||||
|
else:
|
||||||
|
bs.broadcastmessage("Fetching your account info , please wait",
|
||||||
|
transient=True, clients=[client_id])
|
||||||
|
return
|
||||||
|
|
||||||
if msg == None:
|
if msg == None:
|
||||||
return
|
return
|
||||||
logger.log(f'{acid} | {displaystring}| {currentname} | {msg}', "chat")
|
logger.log(f'{acid} | {displaystring}| {currentname} | {msg}', "chat")
|
||||||
|
|
|
||||||
5
dist/ba_root/mods/playersdata/pdata.py
vendored
5
dist/ba_root/mods/playersdata/pdata.py
vendored
|
|
@ -314,6 +314,11 @@ def unban_player(account_id):
|
||||||
if account_id in current_profiles:
|
if account_id in current_profiles:
|
||||||
ip = current_profiles[account_id]["lastIP"]
|
ip = current_profiles[account_id]["lastIP"]
|
||||||
device_id = current_profiles[account_id]["deviceUUID"]
|
device_id = current_profiles[account_id]["deviceUUID"]
|
||||||
|
else:
|
||||||
|
for account in serverdata.recents:
|
||||||
|
if account["pbid"] == account_id:
|
||||||
|
ip = account["ip"]
|
||||||
|
device_id = account["device_uuid"]
|
||||||
|
|
||||||
CacheData.blacklist["ban"]["ips"].pop(ip, None)
|
CacheData.blacklist["ban"]["ips"].pop(ip, None)
|
||||||
CacheData.blacklist["ban"]["deviceids"].pop(device_id, None)
|
CacheData.blacklist["ban"]["deviceids"].pop(device_id, None)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ class BsDataThread(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
global stats
|
global stats
|
||||||
stats["name"] = _babase.app.classic.server._config.party_name
|
stats["name"] = _babase.app.classic.server._config.party_name
|
||||||
stats["discord"] = "https://discord.gg/ucyaesh"
|
stats["discord"] = get_server_settings(
|
||||||
|
)["ballistica_web"]["server_password"]
|
||||||
stats["vapidKey"] = notification_manager.get_vapid_keys()["public_key"]
|
stats["vapidKey"] = notification_manager.get_vapid_keys()["public_key"]
|
||||||
|
|
||||||
self.refresh_stats_cache_timer = bs.AppTimer(8, babase.Call(
|
self.refresh_stats_cache_timer = bs.AppTimer(8, babase.Call(
|
||||||
|
|
|
||||||
7
dist/ba_root/mods/setting.json
vendored
7
dist/ba_root/mods/setting.json
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
"BrodcastCommand": true
|
"BrodcastCommand": true
|
||||||
},
|
},
|
||||||
"HostDeviceName": "v1.4",
|
"HostDeviceName": "v1.4",
|
||||||
"HostName": "BCS",
|
"HostName": "BCSv2",
|
||||||
"KickVoteMsgType": "chat",
|
"KickVoteMsgType": "chat",
|
||||||
"ScoreScreenAnnouncement": {
|
"ScoreScreenAnnouncement": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
|
|
@ -36,8 +36,9 @@
|
||||||
},
|
},
|
||||||
"autoTeamBalance": true,
|
"autoTeamBalance": true,
|
||||||
"ballistica_web": {
|
"ballistica_web": {
|
||||||
"enable": false,
|
"enable": true,
|
||||||
"server_password": "my_secerT_password_very_hard"
|
"server_password": "my_secerT_password_very_hard",
|
||||||
|
"discord_link": "https://discord.gg/ucyaesh"
|
||||||
},
|
},
|
||||||
"character_chooser": {
|
"character_chooser": {
|
||||||
"enable": true
|
"enable": true
|
||||||
|
|
|
||||||
2
dist/ba_root/mods/tools/servercheck.py
vendored
2
dist/ba_root/mods/tools/servercheck.py
vendored
|
|
@ -160,7 +160,7 @@ def on_player_join_server(pbid, player_data, ip, device_id):
|
||||||
|
|
||||||
if player_data is not None: # player data is in serevrdata or in local.json cache
|
if player_data is not None: # player data is in serevrdata or in local.json cache
|
||||||
serverdata.recents.append(
|
serverdata.recents.append(
|
||||||
{"client_id": clid, "deviceId": device_string, "pbid": pbid})
|
{"client_id": clid, "deviceId": device_string, "pbid": pbid, "ip": ip, "device_uuid": device_id})
|
||||||
serverdata.recents = serverdata.recents[-20:]
|
serverdata.recents = serverdata.recents[-20:]
|
||||||
if check_ban(ip, device_id, pbid):
|
if check_ban(ip, device_id, pbid):
|
||||||
_babase.chatmessage(
|
_babase.chatmessage(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue