mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-10-16 12:02:51 +00:00
Add files via upload
This commit is contained in:
parent
ee4146f848
commit
44e14d92e1
1 changed files with 173 additions and 8 deletions
|
|
@ -1,40 +1,64 @@
|
|||
from .Handlers import send, sendall, sendchat
|
||||
import ba,os
|
||||
import _ba,json
|
||||
from features import discord_bot as dc
|
||||
from datetime import datetime, timedelta
|
||||
import discord, requests, asyncio
|
||||
from playersData import pdata
|
||||
import ba.internal
|
||||
from stats import mystats
|
||||
from ba._general import Call
|
||||
import _thread
|
||||
Commands = ['me', 'list', 'uniqeid', 'ping']
|
||||
Commands = ['me', 'list', 'uniqeid', 'ping', 'vp', 'uid', 'pbid', 'comp', 'complaintstep']
|
||||
CommandAliases = ['stats', 'score', 'rank',
|
||||
'myself', 'l', 'id', 'pb-id', 'pb', 'accountid']
|
||||
'myself', 'l', 'id', 'pb-id', 'pme', 'pb', 'accountid', 'coinhelp', 'voting-playlist', 'complaint', 'cs']
|
||||
|
||||
|
||||
def ExcelCommand(command, arguments, clientid, accountid):
|
||||
def ExcelCommand(command, arguments, clientid, accountid, ARGUMENTS):
|
||||
"""
|
||||
Checks The Command And Run Function
|
||||
|
||||
Parameters:
|
||||
command : str
|
||||
arguments : str
|
||||
ARGUMENTS : str
|
||||
clientid : int
|
||||
accountid : int
|
||||
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
if command in ['me', 'stats', 'score', 'rank', 'myself']:
|
||||
if command in ['me', 'rank', 'stats', 'score', 'myself']:
|
||||
fetch_send_stats(accountid, clientid)
|
||||
|
||||
elif command in ['list', 'l']:
|
||||
list(clientid)
|
||||
|
||||
elif command in ['uniqeid', 'id', 'pb-id', 'pb', 'accountid']:
|
||||
elif command in ['uniqeid', 'uid', 'pb-id', 'pbid', 'accountid']:
|
||||
accountid_request(arguments, clientid, accountid)
|
||||
|
||||
elif command in ['id', 'pb']:
|
||||
accountid_clientid(arguments, clientid, accountid)
|
||||
|
||||
elif command in ['ping']:
|
||||
get_ping(arguments, clientid)
|
||||
|
||||
elif command in ['voting-playlist', 'vp']:
|
||||
voting_playlist(arguments, clientid)
|
||||
|
||||
elif command in ['cs', 'complaintstep']:
|
||||
complaint_step(arguments, clientid)
|
||||
|
||||
elif command == 'pme':
|
||||
stats_to_clientid(arguments, clientid, accountid)
|
||||
|
||||
elif command == 'coinhelp':
|
||||
coinhelp(arguments, clientid)
|
||||
|
||||
elif command in ['comp', 'complaint']:
|
||||
get_complaint(arguments, clientid, accountid, ARGUMENTS)
|
||||
|
||||
|
||||
|
||||
def get_ping(arguments, clientid):
|
||||
if arguments == [] or arguments == ['']:
|
||||
|
|
@ -68,7 +92,7 @@ def stats(ac_id, clientid):
|
|||
reply = (
|
||||
f"\ue048| Name: {stats['name']}\n"
|
||||
f"\ue048| PB-ID: {stats['aid']}\n"
|
||||
f"\ue048| Tickets: {tickets}\ue01f\n"
|
||||
f"\ue048| Coins: {tickets}\U0001FA99\n"
|
||||
f"\ue048| Rank: {stats['rank']}\n"
|
||||
f"\ue048| Score: {stats['scores']}\n"
|
||||
f"\ue048| Games: {stats['games']}\n"
|
||||
|
|
@ -79,13 +103,47 @@ def stats(ac_id, clientid):
|
|||
else:
|
||||
reply = "Not played any match yet."
|
||||
|
||||
_ba.pushcall(Call(sendchat, reply), from_other_thread=True)
|
||||
|
||||
_ba.pushcall(Call(send, reply, clientid), from_other_thread=True)
|
||||
|
||||
|
||||
def fetch_send_stats(ac_id, clientid):
|
||||
_thread.start_new_thread(stats, (ac_id, clientid,))
|
||||
|
||||
|
||||
def stats_to_clientid(arguments, clid, acid):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
if arguments == [] or arguments == ['']:
|
||||
with ba.Context(player):
|
||||
send(f"Using: /pme [Clientid of player]", clid)
|
||||
else:
|
||||
cl_id = int(arguments[0])
|
||||
for pla in ba.internal.get_foreground_host_session().sessionplayers:
|
||||
if pla.inputdevice.client_id == cl_id:
|
||||
fname = pla.getname(full=True, icon=True)
|
||||
for roe in ba.internal.get_game_roster():
|
||||
if roe["client_id"] == cl_id:
|
||||
pbid = roe["account_id"]
|
||||
stats = mystats.get_stats_by_id(pbid)
|
||||
if stats:
|
||||
tickets = nc.getcoins(pbid)
|
||||
reply = (
|
||||
f"\ue048| Name: {fname}\n"
|
||||
f"\ue048| PB-ID: {stats['aid']}\n"
|
||||
f"\ue048| Coins: {tickets}\U0001FA99\n"
|
||||
f"\ue048| Rank: {stats['rank']}\n"
|
||||
f"\ue048| Score: {stats['scores']}\n"
|
||||
f"\ue048| Games: {stats['games']}\n"
|
||||
f"\ue048| Kills: {stats['kills']}\n"
|
||||
f"\ue048| Deaths: {stats['deaths']}\n"
|
||||
f"\ue048| Avg.: {stats['avg_score']}\n"
|
||||
)
|
||||
send(reply, clid)
|
||||
else:
|
||||
areply = "Not played any match yet."
|
||||
send(areply, clid)
|
||||
|
||||
|
||||
def pingall(clientid):
|
||||
"""Returns The List Of Players Clientid and index"""
|
||||
|
||||
|
|
@ -117,6 +175,41 @@ def list(clientid):
|
|||
send(list, clientid)
|
||||
|
||||
|
||||
def voting_playlist(arguments, clientid):
|
||||
"""Voting playlist list"""
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
send(f"\ue048| VOTING GAMES LISTS ", clientid)
|
||||
send(f"\ue048| PLAYLIST EPIC SMASH TYPE PES ", clientid)
|
||||
send(f"\ue048| PLAYLIST EPIC TEAMS TYPE PET ", clientid)
|
||||
send(f"\ue048| PLAYLIST DEFAULTS GAMES TYPE PDG ", clientid)
|
||||
send(f"\ue048| PLAYLIST DEATHMATCH AND ELIMINATION ONLY TYPE PDEG ", clientid)
|
||||
|
||||
|
||||
def complaint_step(arguments, clientid):
|
||||
"""Voting playlist list"""
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
send(f"\ue048| COMPLAINTS STEPS: ", clientid)
|
||||
send(f"\ue048| Type /complaint (clientid of offender) (complaint) or", clientid)
|
||||
send(f"\ue048| /comp (clientid of offender) (complaint)", clientid)
|
||||
send(f"\ue048| For Example: /comp 113 betraying etc!!. ", clientid)
|
||||
send(f"\ue048| Your Complaint will get sent to discord server immediately!!", clientid)
|
||||
send(f"Note - Don't spam with this command or u will get a ban permanently..!!!!!", clientid)
|
||||
|
||||
|
||||
def coinhelp(arguments, clientid):
|
||||
send(f"\ue048| COINSYSTEM CMDz", clientid)
|
||||
send(f"\ue048| Type /shop effects to know which effects are available to buy", clientid)
|
||||
send(f"\ue048| Type /jct to check next join claim time", clientid)
|
||||
send(f"\ue048| Type /rpe to remove paid effect..", clientid)
|
||||
send(f"\ue048| Type /buy (effect) to buy effects ", clientid)
|
||||
send(f"\ue048| Type /donate (amount of coins) (clientid of player) to donate your coins to a player", clientid)
|
||||
#send(f"\ue048| Type /stc (amount) to convert score to cash (not available)", clientid)
|
||||
#send(f"ue048| Type /cts (amount) to convert cash to score (not available)", clientid)
|
||||
|
||||
|
||||
|
||||
def accountid_request(arguments, clientid, accountid):
|
||||
"""Returns The Account Id Of Players"""
|
||||
|
||||
|
|
@ -134,3 +227,75 @@ def accountid_request(arguments, clientid, accountid):
|
|||
send(f" {name}'s account id is '{accountid}' ", clientid)
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def accountid_clientid(arguments, clientid, accountid):
|
||||
"""accountid request by clientid """
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
session = ba.internal.get_foreground_host_session()
|
||||
player = _ba.get_foreground_host_activity()
|
||||
a = arguments
|
||||
with ba.Context(player):
|
||||
if True:
|
||||
clld = int(a[0])
|
||||
for i in session.sessionplayers:
|
||||
if i.inputdevice.client_id == clld:
|
||||
names = i.getname(full=True, icon=True)
|
||||
accountid = i.get_v1_account_id()
|
||||
send(f" {names}'s account id is '{accountid}' ", clientid)
|
||||
|
||||
|
||||
def get_complaint(arguments, clientid, acid, ARGUMENTS):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
server = _ba.app.server._config.party_name
|
||||
customers = pdata.get_custom()['complainter']
|
||||
a = arguments
|
||||
b = ARGUMENTS
|
||||
|
||||
if not arguments or arguments == ['']:
|
||||
with ba.Context(player):
|
||||
send(f"Using: /comp [Clientid of offender] [complaint reason]", clientid)
|
||||
else:
|
||||
cl_id = int(arguments[0])
|
||||
complaint = " ".join(b[1:])
|
||||
|
||||
# Check if the user is trying to complain against themselves
|
||||
if cl_id == clientid:
|
||||
send("You can't file a complaint against yourself.", clientid)
|
||||
return
|
||||
|
||||
for pla in ba.internal.get_foreground_host_session().sessionplayers:
|
||||
if pla.inputdevice.client_id == clientid:
|
||||
name = pla.getname(full=True, icon=True)
|
||||
if pla.inputdevice.client_id == cl_id:
|
||||
fname = pla.getname(full=True, icon=True)
|
||||
|
||||
for ros in ba.internal.get_game_roster():
|
||||
if ros['account_id'] == acid:
|
||||
myself = ros["display_string"]
|
||||
|
||||
for roe in ba.internal.get_game_roster():
|
||||
if roe["client_id"] == cl_id:
|
||||
offendr = roe["display_string"]
|
||||
pbid = roe["account_id"]
|
||||
otheraccounts = pdata.get_detailed_pinfo(pbid)
|
||||
|
||||
now = datetime.now().strftime('%d-%m-%Y %I:%M:%S %p')
|
||||
|
||||
if acid not in customers:
|
||||
if not complaint:
|
||||
send("Please provide a complaint reason.", clientid)
|
||||
return
|
||||
|
||||
expiry = datetime.now() + timedelta(hours=3)
|
||||
customers[acid] = {'expiry': expiry.strftime('%d-%m-%Y %I:%M:%S %p')}
|
||||
|
||||
# Call the send_complaint_to_channel function
|
||||
asyncio.ensure_future(dc.send_complaint_to_channel(server_name=server, time=now, myself=myself, ign=name, useracid=acid, fign=fname, acid=pbid, linkedaccount=otheraccounts, offender=offendr, complaint=complaint))
|
||||
|
||||
send("A complaint has been sent on the Discord server. Please wait for Staff to take action...!!", clientid)
|
||||
else:
|
||||
till = customers[acid]['expiry']
|
||||
send(f"You can use the complaint command again at {till}", clientid)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue