From 28ba7d8b4de8cf4f60e061c4e0139849bdec73c7 Mon Sep 17 00:00:00 2001 From: snowman1711 Date: Sat, 10 Apr 2021 16:33:19 +0530 Subject: [PATCH 1/2] added chat commands --- .../mods/chatHandle/chatCMDS/chatcmd.py | 80 ++++-- dist/ba_root/mods/chatHandle/chatCMDS/fun.py | 176 +++++++++++- .../mods/chatHandle/chatCMDS/management.py | 254 +++++++++++++++++- dist/ba_root/mods/chatHandle/handlechat.py | 6 +- dist/ba_root/mods/custom_hooks.py | 6 +- dist/ba_root/mods/playersData/pdata.py | 185 +++++++------ dist/ba_root/mods/playersData/roles.json | 144 ++++++++-- 7 files changed, 690 insertions(+), 161 deletions(-) diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/chatcmd.py b/dist/ba_root/mods/chatHandle/chatCMDS/chatcmd.py index 0be0f4c..b7cfd50 100644 --- a/dist/ba_root/mods/chatHandle/chatCMDS/chatcmd.py +++ b/dist/ba_root/mods/chatHandle/chatCMDS/chatcmd.py @@ -1,41 +1,67 @@ # Released under the MIT License. See LICENSE for details. -import ba -import _ba -from playersData import pdata -import fun,management +import ba, _ba import setting -def public_id(client_id): - rost=_ba.get_game_roster() - for client in rost: - if client['client_id']==client_id: - return client['account_id'] +from playersData import pdata +from . import fun +from . import management, cheats, normal_commands as normal_cmds + + +def client_to_account(client_id): + rost = _ba.get_game_roster() + for i in rost: + if i['client_id'] == client_id: + return i['account_id'] return None -def check_permission(pbid,cmnd): - roles=pdata.roles() + +def check_permission(account_id, command): + roles = pdata.get_roles() for role in roles: - if pbid in role.ids and cmnd in role.commands: + if account_id in roles[role]["ids"] and command in roles[role]["commands"]: return True return False -def cmd_type(cmnd): - if cmnd in fun.cmnds: - return "fun" - if cmnd in management.cmnds: - return "management" -def cmd(msg,client_id): - cmnd=msg.split(" ")[0].lower() - arg=msg.split(" ")[1:] - pbid=public_id(client_id) - if check_permission(pbid,cmnd): - if cmd_type(cmnd)=="fun": - fun.exec_cmd(cmnd,arg,client_id,pbid) - elif cmd_type(cmnd)=="management": - management.exec_cmd(cmnd,arg,client_id,pbid) +def cmd_type(cmnd): + + if cmnd in normal_cmds.cmnds or cmnd in normal_cmds.cmnd_aliases: + return "normal_cmd" + + if cmnd in management.cmnds or cmnd in management.cmnd_aliases: + return "management" + + if cmnd in fun.cmnds or cmnd in fun.cmnd_aliases: + return "fun" + + if cmnd in cheats.cmnds or cmnd in cheats.cmnd_aliases: + return "cheats" + + +def cmd(msg, client_id): + cmnd = msg.split(" ")[0].lower().split("/")[1] + arg = msg.split(" ")[1:] + acid = "pb-IF48VgWkBFQ" +#client_to_account(client_id) + + if cmd_type(cmnd) == "fun": + if check_permission(acid, cmnd): + fun.exec_cmd(cmnd, arg, client_id, acid) + + elif cmd_type(cmnd) == "management": + if check_permission(acid, cmnd): + management.exec_cmd(cmnd, arg, client_id, acid) + + elif cmd_type(cmnd) == "cheats": + if check_permission(acid, cmnd): + cheats.exec_cmd(cmnd, arg, client_id, acid) + + elif cmd_type(cmnd) == "normal_cmd": + normal_cmds.exec_cmd(cmnd, arg, client_id, acid) + else: - _ba.chatmessage("no access",clients=client_id) + _ba.chatmessage("no access") + if setting.brdcast_chatcmd: return msg diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/fun.py b/dist/ba_root/mods/chatHandle/chatCMDS/fun.py index 6c79754..ff1612f 100644 --- a/dist/ba_root/mods/chatHandle/chatCMDS/fun.py +++ b/dist/ba_root/mods/chatHandle/chatCMDS/fun.py @@ -1,23 +1,177 @@ # Released under the MIT License. See LICENSE for details. -cmnds=["/fly","/freeze"] +from _ba import chatmessage as cmsg, screenmessage as smsg +from .handlers import activity_players, on_command_error, handlemsg, handlemsg_all +import ba, _ba -def exec_cmd(cmnd,arg,client_id,pbid): - if cmnd =="/fly": - fly() +cmnds = ['fly', 'invisible', 'headless', 'creepy', 'celebrate', 'spaz'] + +cmnd_aliases = ['inv', 'hl', 'creep', 'celeb'] + + +def exec_cmd(cmnd, arg, clid, pbid): + + if cmnd in ['fly']: + fly_call(arg) + + elif cmnd in ['inv', 'invisible']: + invi_call(arg) + + elif cmnd in ['hl', 'headless']: + headless_call(arg) + + elif cmnd in ['creepy', 'creep']: + creep_call(arg) + + elif cmnd in ['celebrate', 'celeb']: + celeb_call(arg) + + elif cmnd in ['spaz']: + spaz_call(arg) + + + +def fly_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + + for players in activity_players(): + if players.actor.node.fly != True: + players.actor.node.fly = True + else: + players.actor.node.fly = False + + else: + try: + player = int(arg[0]) + + if activity_players()[player].actor.node.fly != True: + activity_players()[player].actor.node.fly = True + else: + activity_players()[player].actor.node.fly = False + + except: + return -# ============== -def fly(): - # do something +def invi_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + for i in activity_players(): + body = i.actor.node + if body.torso_model != None: + body.head_model = None + body.torso_model = None + body.upper_arm_model = None + body.forearm_model = None + body.pelvis_model = None + body.hand_model = None + body.toes_model = None + body.upper_leg_model = None + body.lower_leg_model = None + body.style = 'cyborg' + else: + + player = int(arg[0]) + body = activity_players()[player].actor.node + + if body.torso_model != None: + body.head_model = None + body.torso_model = None + body.upper_arm_model = None + body.forearm_model = None + body.pelvis_model = None + body.hand_model = None + body.toes_model = None + body.upper_leg_model = None + body.lower_leg_model = None + body.style = 'cyborg' -def freeze(): - # do something -def spaz(): - #do something + +def headless_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + + for players in activity_players(): + node = players.actor.node + + if node.head_model != None: + node.head_model = None + node.style='cyborg' + + else: + try: + player = int(arg[0]) + node = activity_players()[player].actor.node + + if node.head_model != None: + node.head_model = None + node.style='cyborg' + except: + return + + + +def creep_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + + for players in activity_players(): + node = players.actor.node + + if node.head_model != None: + node.head_model = None + node.handlemessage(ba.PowerupMessage(poweruptype='punch')) + node.handlemessage(ba.PowerupMessage(poweruptype='shield')) + + else: + try: + player = int(arg[0]) + node = activity_players()[player].actor.node + + if node.head_model != None: + node.head_model = None + node.handlemessage(ba.PowerupMessage(poweruptype='punch')) + node.handlemessage(ba.PowerupMessage(poweruptype='shield')) + except: + return + + + +def celeb_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.CelebrateMessage()) + + else: + try: + player = int(arg[0]) + handlemsg(player, ba.CelebrateMessage()) + except: + return + + + + + +def spaz_call(arg): + if on_command_error(arg): + return + + pass diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/management.py b/dist/ba_root/mods/chatHandle/chatCMDS/management.py index 7d8240c..620ca00 100644 --- a/dist/ba_root/mods/chatHandle/chatCMDS/management.py +++ b/dist/ba_root/mods/chatHandle/chatCMDS/management.py @@ -1,22 +1,260 @@ # Released under the MIT License. See LICENSE for details. -cmnds=["/add","/kick"] +from _ba import chatmessage as cmsg, screenmessage as smsg +from .handlers import activity_players, sess_players, on_command_error, handlemsg, handlemsg_all +from playersData import pdata +import ba, _ba, time -def exec_cmd(cmnd,arg,client_id,pbid): - if cmnd =="/kick": +cmnds = ['kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand', 'removecmd', 'changetag'] + +cmnd_aliases = ['rm', 'next', 'restart', 'mutechat', 'unmutechat', 'sm', 'slow', 'night', 'day', 'pausegame', 'camera_mode', 'rotate_camera'] + +def exec_cmd(cmnd, arg, client_id, pbid): + if cmnd in ['kick']: kick(arg[0]) + + elif cmnd in ['end', 'next']: + end_call(arg) + + elif cmnd in ['quit', 'restart']: + quit_call(arg) + + elif cmnd in ['mute', 'mutechat']: + mute_call() + + elif cmnd in ['unmute', 'unmutechat']: + un_mute_call() + + elif cmnd in ['remove', 'rm']: + remove_call(arg) + + elif cmnd in ['sm', 'slow', 'slowmo']: + slow_mo_call() + + elif cmnd in ['nv', 'night']: + nv_call(arg) + + elif cmnd in ['dv', 'day']: + dv_call(arg) + + elif cmnd in ['pause', 'pausegame']: + pause_call() + + elif cmnd in ['cameraMode', 'camera_mode', 'rotate_camera']: + rotate_camera_call() + + elif cmnd in ['createrole']: + create_role_call(arg) + + elif cmnd in ['addrole']: + add_role_to_player(arg) + + elif cmnd in ['removerole']: + remove_role_from_player(arg) + + elif cmnd in ['addcommand', 'addcmd']: + add_command_to_role(arg) + + elif cmnd in ['removecommand', 'removecmd']: + remove_command_to_role(arg) + + elif cmnd in ['changetag']: + change_role_tag_call(arg) + -# ============== +# ============= + def kick(client_id): _ba.disconnectclient(client_id) - # do something + + +def remove_call(arg): + + if on_command_error(arg): + return + + elif arg[0] == 'all': + for i in sess_players(): + i.remove_from_game() + + else: + try: + req_player = int(arg[0]) + sess_players()[req_player].remove_from_game() + except: + return def add(): - # do something + pass + + +def end_call(arg): + if arg == [] or arg == ['']: + activity = _ba.get_foreground_host_activity() + activity.end_game() +""" + else: + try: + tmr = int(arg[0]) + time.sleep(tmr) + activity = _ba.get_foreground_host_activity() + activity.end_game() + except: + return +""" + + +def quit_call(arg): + + if arg == [] or arg == ['']: + ba.quit() + + """ + else: + try: + tmr = int(arg[0]) + time.sleep(tmr) + ba.quit() + except: + return + """ + + +def mute_call(): + pass + +def un_mute_call(): + pass + + + +def slow_mo_call(): + + activity = _ba.get_foreground_host_activity() + + if activity.globalsnode.slow_motion != True: + activity.globalsnode.slow_motion = True + + else: + activity.globalsnode.slow_motion = False + + + + + +def nv_call(arg): + + activity = _ba.get_foreground_host_activity() + + if arg == [] or arg == ['']: + + if activity.globalsnode.tint != (0.5, 0.7, 1.0): + activity.globalsnode.tint = (0.5, 0.7, 1.0) + else: + #will fix this soon + pass + + elif arg[0] == 'off': + if activity.globalsnode.tint != (0.5, 0.7, 1.0): + return + else: + pass + + + +def dv_call(arg): + + activity = _ba.get_foreground_host_activity() + + if arg == [] or arg == ['']: + + if activity.globalsnode.tint != (1,1,1): + activity.globalsnode.tint = (1,1,1) + else: + #will fix this soon + pass + + elif arg[0] == 'off': + if activity.globalsnode.tint != (1,1,1): + return + else: + pass + + +def pause_call(): + + activity = _ba.get_foreground_host_activity() + + if activity.globalsnode.paused != True: + activity.globalsnode.paused = True + + else: + activity.globalsnode.paused = False + + +def rotate_camera_call(): + + activity = _ba.get_foreground_host_activity() + + if activity.globalsnode.camera_mode != 'rotate': + activity.globalsnode.camera_mode = 'rotate' + + else: + activity.globalsnode.camera_mode == 'normal' + + + + + +def create_role_call(arg): + pdata.create_role(arg[0]) + + +def add_role_to_player(arg): + id = sess_players()[int(arg[1])].get_account_id() + try: + pdata.add_player_role(arg[0], id) + except: + return + +def remove_role_from_player(arg): + id = sess_players()[int(arg[1])].get_account_id() + try: + pdata.remove_player_role(arg[0], id) + except: + return + + +def change_role_tag_call(arg): + pdata.change_role_tag(arg[0], arg[1]) + + + + + +all_commands = ["changetag","createrole", "addrole", "removerole", "addcommand", "addcmd","removecommand","removecmd","kick","remove","rm","end","next","quit","restart","mute","mutechat","unmute","unmutechat","sm","slow","slowmo","nv","night","dv","day","pause","pausegame","cameraMode","camera_mode","rotate_camera","kill","die","heal","heath","curse","cur","sleep","sp","superpunch","gloves","punch","shield","protect","freeze","ice","unfreeze","thaw","gm","godmode","fly","inv","invisible","hl","headless","creepy","creep","celebrate","celeb","spaz"] + + + +def add_command_to_role(arg): + try: + if arg[1] in all_commands: + pdata.add_command_role(arg[0], arg[1]) + except: + return + + + +def remove_command_to_role(arg): + try: + if arg[1] in all_commands: + pdata.remove_command_role(arg[0], arg[1]) + except: + return + + -def end(): - #do something diff --git a/dist/ba_root/mods/chatHandle/handlechat.py b/dist/ba_root/mods/chatHandle/handlechat.py index e15fbe1..2f6fc5a 100644 --- a/dist/ba_root/mods/chatHandle/handlechat.py +++ b/dist/ba_root/mods/chatHandle/handlechat.py @@ -1,7 +1,7 @@ # Released under the MIT License. See LICENSE for details. from playersData import pdata from chatHandle.chatCMDS import chatcmd -from chatFilter import chatfilter +#from chatFilter import chatfilter import ba,_ba def public_id(client_id): @@ -14,11 +14,13 @@ def public_id(client_id): def filter_chat_message(msg,client_id): if msg.startswith("/"): return chatcmd.cmd(msg,client_id) + return msg +""" if chatfilter.isAbuse(msg): pdata.warn(public_id(client_id)) return None return msg - +""" diff --git a/dist/ba_root/mods/custom_hooks.py b/dist/ba_root/mods/custom_hooks.py index 74ce62e..c3621ff 100644 --- a/dist/ba_root/mods/custom_hooks.py +++ b/dist/ba_root/mods/custom_hooks.py @@ -1,8 +1,10 @@ -def filter_chat_message(msg,client_id): - from chatHandle import handlechat + +def filter_chat_message(msg,client_id): + from chatHandle import handlechat return handlechat.filter_chat_message(msg,client_id) + def on_app_launch(): pass #something diff --git a/dist/ba_root/mods/playersData/pdata.py b/dist/ba_root/mods/playersData/pdata.py index 10ed681..51c5594 100644 --- a/dist/ba_root/mods/playersData/pdata.py +++ b/dist/ba_root/mods/playersData/pdata.py @@ -1,151 +1,164 @@ # Released under the MIT License. See LICENSE for details. -import os,_ba,json -roles={} -data={} -custom={} +import _ba, os, json + + + +roles = {} +data = {} +custom = {} data_path = os.path.join(_ba.env()['python_directory_user'],"playersData" + os.sep) + + + +def commit(data): + global roles + if data == {}: + return + with open(data_path+'roles.json','w') as f: + json.dump(data, f, indent=4) + + def get_roles(): global roles - if roles=={}: - f=open(data_path+"roles.json","r") - dat=json.loads(f.read()) - roles=dat - f.close() + if roles == {}: + with open(data_path+'roles.json', 'r') as f: + roles = json.load(f) return roles + def create_role(role): global roles - _roles=get_roles() + _roles = get_roles() if role not in _roles: - _roles[role]={ + _roles[role] = { "tag":role, - "tagcolor":(1,1,1), + "tagcolor":[1,1,1], "commands":[], "ids":[] - } - roles=_roles - comit() - return 'created successfully' - - - return 'already exists' + } + roles = _roles + commit(_roles) + return + return -def add_player_role(role,id): + +def add_player_role(role, id): global roles - _roles=get_roles() + _roles = get_roles() if role in _roles: - _roles[role].ids.append(id) - roles=_roles - commit() - return 'added to '+role + if id not in _roles[role]["ids"]: + _roles[role]["ids"].append(id) + roles =_roles + commit(_roles) + return "added to "+role return "role not exists" -def add_command_role(role,command): - global roles - _roles=get_roles() - if role in _roles: - _roles[role].commands.append(command) - roles=_roles - commit() - return 'added '+command+"to "+role - return role+"not exists" - -def remove_player_role(role,id): +def remove_player_role(role, id): global roles - _roles=get_roles() + _roles = get_roles() if role in _roles: - _roles[role].ids.remove(id) - roles=_roles - commit() - return "removed" + _roles[role]["ids"].remove(id) + roles =_roles + commit(_roles) + return "removed from "+role return "role not exists" -def remove_command_role(): - global roles - _roles=get_roles() - if role in _roles: - _roles[role].commands.remove(command) - roles=_roles - commit() - return 'removed '+command+"from "+role - return role+"not exists" -def change_role_tag(role,tag): + + +def add_command_role(role, command): global roles - _roles=get_roles() + _roles = get_roles() if role in _roles: - _roles[role].tag=tag - roles=_roles - commit() + if command not in _roles[role]["commands"]: + _roles[role]["commands"].append(command) + roles =_roles + commit(_roles) + return "command added to "+role + return "command not exists" + + +def remove_command_role(role, command): + global roles + _roles = get_roles() + if role in _roles: + if command in _roles[role]["commands"]: + _roles[role]["commands"].remove(command) + roles =_roles + commit(_roles) + return "command added to "+role + return "command not exists" + + +def change_role_tag(role, tag): + global roles + _roles = get_roles() + if role in _roles: + _roles[role]['tag'] = tag + roles = _roles + commit(_roles) return "tag changed" return "role not exists" -def commit(_roles): - global roles - if _roles=={}: - return - f=open(data_path+"roles.json",'w') - json.dump(_roles,f,indent=4) - f.close() - roles=_roles - def get_role(acc_id): global roles - _roles =get_roles() + _roles = get_roles() for role in _roles: if acc_id in role["ids"]: return role + +##### those ups done will clean it in future + + + #======================= CUSTOM EFFECTS/TAGS =============== def get_custom(): global custom if custom=={}: - f=open(data_path+"custom.json","r") - dat=json.loads(f.read()) - custom=dat - f.close() - return custom + with open(data_path+"custom.json","r") as f: + custom = json.loads(f.read()) + return custom - -def set_effect(effect,id): +def set_effect(effect, id): global custom - _custom=get_custom() - _custom['customeffects'][id]=effect - custom=_custom + _custom = get_custom() + _custom['customeffects'][id] = effect + custom = _custom commit_c() -def set_tag(tag,id): +def set_tag(tag, id): global custom - _custom=get_custom() - _custom['customtag'][id]=tag - custom=_custom + _custom = get_custom() + _custom['customtag'][id] = tag + custom = _custom commit_c() + def remove_effect(id): global custom - _custom=get_custom() + _custom = get_custom() _custom['customeffects'].pop(id) - custom=_custom + custom = _custom commit_c() def remove_tag(id): global custom - _custom=get_custom() + _custom = get_custom() _custom['customtag'].pop(id) - custom=_custom + custom = _custom commit_c() def commit_c(): global custom - f=open(data_path+"custom.json",'w') - json.dump(custom,f,indent=4) - f.close() + with open(data_path+"custom.json",'w') as f: + json.dump(custom,f,indent=4) diff --git a/dist/ba_root/mods/playersData/roles.json b/dist/ba_root/mods/playersData/roles.json index d524756..d34f3e4 100644 --- a/dist/ba_root/mods/playersData/roles.json +++ b/dist/ba_root/mods/playersData/roles.json @@ -1,27 +1,121 @@ { - "owner":{ - "tag":"OWNER", - "tagcolor":(1,1,1), - "commands":["add","kick","remove"], - "ids":["pb-ihugg7g9==","pb-7gt78"] - - }, - "admin":{ - "tag":"ADMIN", - "tagcolor":(1,1,1), - "commands":["kick","end"], - "ids":["pb-ugg","pb-767fyfd"] - }, - "vip":{ - "tag":"VIP", - "tagcolor":(1,1,1), - "commands":[], - "ids":[] - }, - "toppers":{ - "tag":"DONOR", - "tagcolor":(2,2,2), - "commands":[], - "ids":[] - } + "owner": { + "tag": "pranav", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [ + "createrole", + "addrole", + "removerole", + "addcommand", + "addcmd", + "removecommand", + "removecmd", + "remove", + "kick", + "rm", + "next", + "quit", + "restart", + "mute", + "mutechat", + "unmute", + "unmutechat", + "sm", + "slow", + "slowmo", + "nv", + "night", + "dv", + "day", + "pause", + "pausegame", + "cameraMode", + "camera_mode", + "rotate_camera", + "kill", + "die", + "heal", + "heath", + "curse", + "cur", + "sleep", + "sp", + "superpunch", + "gloves", + "punch", + "shield", + "protect", + "freeze", + "ice", + "unfreeze", + "thaw", + "gm", + "godmode", + "fly", + "inv", + "invisible", + "hl", + "headless", + "creepy", + "creep", + "celebrate", + "celeb", + "spaz", + "me", + "stats", + "score", + "list", + "l", + "uniqeid", + "id", + "pb-id", + "pb", + "accountid", + "end", + "changetag" + ], + "ids": [ + "pb-IF48VgWkBFQ" + ] + }, + "test69": { + "tag": "test69", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [ + "mute" + ], + "ids": [ + "pb-IF4VAk4a" + ] + }, + "test70": { + "tag": "test70", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [ + "pb-IF4VAk4a" + ] + }, + "test71": { + "tag": "test71", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [] + } } \ No newline at end of file From 38cd45f3791c1edf52d9424d1ea03e571c09f4a1 Mon Sep 17 00:00:00 2001 From: snowman1711 Date: Sat, 10 Apr 2021 16:33:52 +0530 Subject: [PATCH 2/2] added chat commands --- .../__pycache__/__init__.cpython-38.opt-1.pyc | Bin 0 -> 362 bytes .../handlechat.cpython-38.opt-1.pyc | Bin 0 -> 647 bytes .../__pycache__/__init__.cpython-38.opt-1.pyc | Bin 0 -> 371 bytes .../__pycache__/chatcmd.cpython-38.opt-1.pyc | Bin 0 -> 1614 bytes .../__pycache__/cheats.cpython-38.opt-1.pyc | Bin 0 -> 3982 bytes .../__pycache__/fun.cpython-38.opt-1.pyc | Bin 0 -> 2899 bytes .../__pycache__/handlers.cpython-38.opt-1.pyc | Bin 0 -> 1005 bytes .../management.cpython-38.opt-1.pyc | Bin 0 -> 5226 bytes .../normal_commands.cpython-38.opt-1.pyc | Bin 0 -> 1660 bytes .../mods/chatHandle/chatCMDS/cheats.py | 236 ++++++++++++++++++ .../mods/chatHandle/chatCMDS/handlers.py | 26 ++ .../chatHandle/chatCMDS/normal_commands.py | 54 ++++ .../__pycache__/__init__.cpython-38.opt-1.pyc | Bin 0 -> 381 bytes .../__pycache__/pdata.cpython-38.opt-1.pyc | Bin 0 -> 3314 bytes 14 files changed, 316 insertions(+) create mode 100644 dist/ba_root/mods/chatHandle/__pycache__/__init__.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/__pycache__/handlechat.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/__init__.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/chatcmd.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/cheats.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/fun.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/handlers.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/management.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/normal_commands.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/cheats.py create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/handlers.py create mode 100644 dist/ba_root/mods/chatHandle/chatCMDS/normal_commands.py create mode 100644 dist/ba_root/mods/playersData/__pycache__/__init__.cpython-38.opt-1.pyc create mode 100644 dist/ba_root/mods/playersData/__pycache__/pdata.cpython-38.opt-1.pyc diff --git a/dist/ba_root/mods/chatHandle/__pycache__/__init__.cpython-38.opt-1.pyc b/dist/ba_root/mods/chatHandle/__pycache__/__init__.cpython-38.opt-1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afc2db22ff97c4fe9912bd8b7ca541e6e9f06c73 GIT binary patch literal 362 zcmYk1zfJ=&493$kP@U9?7w}rC?J+PSgkWJ}DJ(1@m-sG0zU0WCR>za@3Oo&aCnO$$ zjS06CmTbwEf1f`;&gYfjc>kj3vxyMjhvt9qOk8uO85bj-gqdu_V*2)Z8~Q$YXk1PZ zT4;;c*#)o2|2-)HYd>?ksAoC^hBHtmmMbPBX z=c7=<$RePF!F6@NnCwrbG(k)GA>x$3J(k~#I^_^mhc)(vR7O*u*EgYWHm^mQT3eOx c*cM?erDH2nu7`0yyX=E0gjXjl^usCs0D#SL2LJ#7 literal 0 HcmV?d00001 diff --git a/dist/ba_root/mods/chatHandle/__pycache__/handlechat.cpython-38.opt-1.pyc b/dist/ba_root/mods/chatHandle/__pycache__/handlechat.cpython-38.opt-1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1359ebd1f0d55c80ddfc2feafece1299e3f7aec0 GIT binary patch literal 647 zcmYjO!H&}~5FOiTlXkPqN-H52aYwl{oH(rzVte31FAEiz(_1G^!Ayc<>LeWf^!V=&Ff%MZye_Tl4d2L8>OpZQMfs|H z*Xwn4J8)432JiWeP_o>{6bg&oouBQ7wdz`2Aq_mD$RxurCuhW*V66?({;o}R9of?nMslDPR*@iGJ&>|ser_E%&VK9M)&#*kLoEYIZ8wooWN-{&zQ6d= zDdgLP9UCpJMOtTgVW${?%yBn!j;P4$lbzys(%2=wlnKk#7yqd)0=)jPtd3*pnw!ue gvWg8J4GtojI6b@4y%>~y6WT>Va+1??nx)y~4;d4U^#A|> literal 0 HcmV?d00001 diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/__init__.cpython-38.opt-1.pyc b/dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/__init__.cpython-38.opt-1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68ca7f6df718394b58acf3146fe90c00dd0ef585 GIT binary patch literal 371 zcmYk1KTbn2493$kP(7&=7w}rC?c)G|5M^M2rLeH1Y2w!e<;5j`T0Ks}6*vuhCnS!* z#)SJOEZIsd|2}_y8jmZ%@&4skX9FR=kDvd+J#o#MMqG?|7G|&%li}Ovg4&h>tX)n( z4KyX_>?kPjatFz(hz8b}_lNz+aYN0 zFyvk+VPp}|WN=_yTjK(yGEFtlCKgwm`IA zlcXa;(T2GzBGG}lC%U2sb6?Oi68GQ0Y2-Af)}M>aWN#>_pt0wRS*YZ z$j@bFv>nW9Rb^$G*A=V^o#U2GV<2F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0WWNi%LbtbMEOZ#$B-Xqe2;CgFW-0smbQ&;bK3$(ro1A+2(<(2!MXq!Gd=xm=Q^0s zGwkt4294h}PO^ou-wJcl8dzytSO+biv$Vw-{lCDW+hljO^z2)bHUTW-_>=3NBWVlL zCXk%%<$6s4JG%2VX6%#MarC>r`goS`X>LR>&m)MDJ_meDY3yu}+v%QPTY zdB<2a9IksFK$0Sz(9}r&1!W16S&8JG8Iq5TT?1$`pt&x9QDAEc3v@@zik7aHRV{J# zz+2a{0S=6y`CvW0m$l}I7ucEw;tOm1smJ`!HHd?!R)M};$0l((OnW0a@K*LYkgvcY z&ylwdF4QPUKt`O`=**P*%49r_WDv@vG&JvzWVGLGjH4Jg(R?IbVdX5@D4N;JS>k9g zn>HSOjcNA{w#ue)BwxkHcvcYue3)Ckk(kQY=rif;Ed;~5(MJY0z`S94ChE3hT<_eA{0eE_K%UPv8vHQDsdz1B=ug7)gSOK!Kznc zb#*ybyT)TXbG9qO6xL7t2@=lSV$Uo$69e#w7ezm#g`Zy0(w zEbdpoGB~|52oh9!-REu<%E`Z>DC$!zDaq!o=4Q|fCC!dE0iI=&QiyLUdZD?+3r#AW z*@|$W&B=WTYn3BgBSo3Y$tOq_HP$Cy6_@i&Rur@C)o` zmi;AfS@8>q1^2oS%45N;?0Z}}_ndpK-*h@H0`cYE?A;Ga$X7h-nU$ z83=7rbpvu7+8|B2%+qxJ3cOL~x^*Tx=M;YBF7Fk0Z`rvYKCUF6m*Oc7RkvaDX_tlg H3qtl2bK%os literal 0 HcmV?d00001 diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/management.cpython-38.opt-1.pyc b/dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/management.cpython-38.opt-1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae9f7a37e327de01b1f6a915202968425daee634 GIT binary patch literal 5226 zcmc&&&2JmW72gkjEGbf=K5R>}EZg!&LdUTj$4MN=wH(`VoYZDMY&Xd!F}>njQM7iK z^z2fJ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ft{;%6HolUS!gb)-?s}X@{fhox!X%i z8+}rXcd%S$5;(ND0&=U6$ASG8E#~aWLXIghEj&x`Wx@0RKXCaH7W8!UW)^B54+c}lENnFG1R(+oU_D8fqqhj>QOmPJLuZCYr-2wSR zM+?Myl<}&fmAR-bLXRW6x=Fdt|Mu33jEBx zH<8#6GC+|O*UX1d%l1ie14&WY7zfI$%)#M1s>~za-)#0Gj==G|~4-Aa3&P7T#Y3_6^!r z-Wea@owb%lQzpRW@*@+_x@XO+2$mKfO4&VY7}-)(Zfg-QW7qG{dKSTBQN@FAt3lw} z)bicTvhM|M7SCi^W*c1*<9j$Kp_l-N!(I9-o3~4x@qO7And(^+QJh97qYno zgL`u8@>GG0BT;~xhQzP7|oVJkA`Pa=-~BqCzL=B&d&o+-}#qQDD>(l0F+ z@u@`dC29;Kwc=YsmhVCM2*VvdsJOtTyKXIa3Qx2u>ld~ntgYsPX; fI~ivbt%5(>$vVT%gfs38q0cyZ$8qv&8K>|cPTzAK literal 0 HcmV?d00001 diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/normal_commands.cpython-38.opt-1.pyc b/dist/ba_root/mods/chatHandle/chatCMDS/__pycache__/normal_commands.cpython-38.opt-1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5390a8ad533105ae77432a039f8a7d07eeaa1845 GIT binary patch literal 1660 zcmaJ>-ESL35Z{lx^ZERd)Jc=3e3>dDas@a=P^1c>ibjYB$V-Z#7GTad7w3}uaCXmy zIQEnKn!f-=N*?ns?JEzc|3aRaS*KD|Ay(Si`PiM^o!`v-*k}X{$LIG(zrS=D`j+be4#F~vwGM}|Y3NAB zaegDd=Cp;Ix<+$k#ljAr6U2gM)#1gz9?j1y%!7#XS|vMK)384VJ+Vrm23T<>&sSttx| zH_pasSjN!Z?tW8bgT3Q%2wjT*cVP}`Y}sc&?Cf>(LSx7>dk}s$niN(W7rtxX^ftMVcGW^cZnQwcxRoPv@n(=03YK+w zfDG^%2XTQQfCKKO1aHd!V&I+2bv6?vpR*nI>&G($1}Yb9Dh~x^>=`d5^3I_ zU&=4>#PMcX!M&K#Q#RyKKch+@I2*gY_xt}lCU;M_pZxad@$B>wE?>+}Kf`5vW}H04 zbgd#Pab6;1z3L*5ku^M+to`Sy;9JakCy9#uN-B!LKl^q#Pt}JgJ-?F1jf%8TrdndI zYw~R>i#v43H{L$sS1K%fW-7zDw2zRwRHl~Xqj3rG%Or}`duX?rXB?gBVaHMHsOkAS z9;py>#>f<_j3>9?vPiAqt~O3>I}CUDeG%}7T#-JKNZt&309AoS>=iN?S9TYv2;0mVR8Ij(y45 zAE&AM0N*@mZRxi*ZcW5iTeZ=s9w6y>RDycA2)Io0Qf;ByG%@u3n=24-^^o?uYK?48 z7@@|-yQ+@+3-HvtXnH%^tEi)snhJ#R7H|{ zKd{xU^x}D95MuUV!_cNqOFvAL5Id|bVOw+-N9*?1Q>c|FLf`mbWd)4W_-ndCQ@dK` Qb-pYDu_pZ`-}Qrk0j`pQ)&Kwi literal 0 HcmV?d00001 diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/cheats.py b/dist/ba_root/mods/chatHandle/chatCMDS/cheats.py new file mode 100644 index 0000000..5b04256 --- /dev/null +++ b/dist/ba_root/mods/chatHandle/chatCMDS/cheats.py @@ -0,0 +1,236 @@ +# Released under the MIT License. See LICENSE for details. + +from _ba import chatmessage as cmsg, screenmessage as smsg +from .handlers import activity_players, on_command_error, handlemsg, handlemsg_all +import ba, _ba, time + +cmnds = ['kill', 'heal', 'curse', 'sleep', 'superpunch', 'gloves', 'shield', 'freeze', 'unfreeze', 'godmode'] + +cmnd_aliases = ['die', 'heath', 'cur', 'sp', 'punch', 'protect', 'ice', 'thaw', 'gm'] + + + +def exec_cmd(cmnd, arg, client_id, pbid): + + if cmnd in ['kill', 'die']: + kill_call(arg) + + elif cmnd in ['heal', 'heath']: + heal_call(arg) + + elif cmnd in ['curse', 'cur']: + curse_call(arg) + + elif cmnd in ['sleep']: + sleep_call(arg) + + elif cmnd in ['sp', 'superpunch']: + super_punch_call(arg) + + elif cmnd in ['gloves', 'punch']: + gloves_call(arg) + + elif cmnd in ['shield', 'protect']: + shield_call(arg) + + elif cmnd in ['freeze', 'ice']: + freeze_call(arg) + + elif cmnd in ['unfreeze', 'thaw']: + un_freeze_call(arg) + + elif cmnd in ['gm', 'godmode']: + god_mode_call(arg) + + + + +def kill_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.DieMessage()) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.DieMessage()) + except: + return + + + + + +def heal_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.PowerupMessage(poweruptype='health')) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.PowerupMessage(poweruptype='health')) + except: + return + + +def curse_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.PowerupMessage(poweruptype='curse')) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.PowerupMessage(poweruptype='curse')) + except: + return + + + +def sleep_call(arg): + if on_command_error(arg): + return + # ahh ! harsh here maybe fix in future + elif arg[0] == 'all': + for i in activity_players(): + i.actor.node.handlemessage('knockout', 8000) + else: + try: + req_player = int(arg[0]) + activity_players()[req_player].actor.node.handlemessage('knockout', 8000) + except: + return + + + +def super_punch_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + for i in activity_players(): + if i.actor._punch_power_scale != 15: + i.actor._punch_power_scale = 15 + i.actor._punch_cooldown = 0 + else: + i.actor._punch_power_scale = 1.2 + i.actor._punch_cooldown = 400 + + else: + try: + req_player = int(arg[0]) + + if activity_players()[req_player].actor._punch_power_scale != 15: + activity_players()[req_player].actor._punch_power_scale = 15 + activity_players()[req_player].actor._punch_cooldown = 0 + else: + activity_players()[req_player].actor._punch_power_scale = 1.2 + activity_players()[req_player].actor._punch_cooldown = 400 + except: + return + + + +def gloves_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.PowerupMessage(poweruptype='punch')) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.PowerupMessage(poweruptype='punch')) + except: + return + + + +def shield_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.PowerupMessage(poweruptype='shield')) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.PowerupMessage(poweruptype='shield')) + except: + return + + + +def freeze_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.FreezeMessage()) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.FreezeMessage()) + except: + return + + + +def un_freeze_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + handlemsg_all(ba.ThawMessage()) + + else: + try: + req_player = int(arg[0]) + handlemsg(req_player, ba.ThawMessage()) + except: + return + + + +def god_mode_call(arg): + if on_command_error(arg): + return + + elif arg[0] == 'all': + + for i in activity_players(): + if i.actor._punch_power_scale != 7: + i.actor._punch_power_scale = 7 + i.actor.node.hockey = True + i.actor.node.invincible = True + else: + i.actor._punch_power_scale = 1.2 + i.actor.node.hockey = False + i.actor.node.invincible = False + + else: + req_player = int(arg[0]) + player = activity_players()[req_player].actor + + if player._punch_power_scale != 7: + player._punch_power_scale = 7 + player.node.hockey = True + player.node.invincible = True + + else: + player._punch_power_scale = 1.2 + player.node.hockey = False + player.node.invincible = False + + + diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/handlers.py b/dist/ba_root/mods/chatHandle/chatCMDS/handlers.py new file mode 100644 index 0000000..5a414e1 --- /dev/null +++ b/dist/ba_root/mods/chatHandle/chatCMDS/handlers.py @@ -0,0 +1,26 @@ +""" helper functions to reduce lot code """ +import _ba, ba + + +def activity_players(): + return _ba.get_foreground_host_activity().players + +def sess_players(): + return _ba.get_foreground_host_session().sessionplayers + +def on_command_error(arg): + if arg == [] or arg == ['']: + return True + return False + + + +def handlemsg(client, msg): + activity_players()[client].actor.node.handlemessage(msg) + +def handlemsg_all(msg): + for i in activity_players(): + i.actor.node.handlemessage(msg) + + + diff --git a/dist/ba_root/mods/chatHandle/chatCMDS/normal_commands.py b/dist/ba_root/mods/chatHandle/chatCMDS/normal_commands.py new file mode 100644 index 0000000..7319664 --- /dev/null +++ b/dist/ba_root/mods/chatHandle/chatCMDS/normal_commands.py @@ -0,0 +1,54 @@ +# Released under the MIT License. See LICENSE for details. + +from _ba import chatmessage as cmsg, screenmessage as smsg +from .handlers import sess_players +import ba, _ba + +cmnds = ['me', 'list', 'uniqeid'] + +cmnd_aliases = ['stats', 'score', 'rank', 'myself', 'l', 'id', 'pb-id', 'pb', 'accountid'] + + +def exec_cmd(cmnd, arg, clid, pbid): + + if cmnd in ['me', 'stats', 'score', 'rank', 'myself']: + stats_call() + + elif cmnd in ['list', 'l']: + list_call(clid) + + elif cmnd in ['uniqeid', 'id', 'pb-id', 'pb' , 'accountid']: + show_id_call(arg, pbid, clid) + + + + + +def stats_call(): + pass + + + +def list_call(clid): + seprator = '______________________________' + lst = u'{0:^16}{1:^15}{2:^10}'.format('name', 'client_id' , 'player_id') + f'\n{seprator}\n' + + for i in sess_players(): + lst += u'{0:^16}{1:^15}{2:^10}\n'.format(i.getname(icon = False), str(i.inputdevice.client_id), str(i.id)) + smsg(lst, color = (0,2.55,2.55), transient = True , clients = [clid]) + + + +def show_id_call(arg, acid, clid): + if arg == [] or arg == ['']: + cmsg(f'Your account id is {acid} ') + else: + try: + rq_client = sess_players()[int(arg[0])] + name = rq_client.getname(full=True , icon=True) + acid = rq_client.get_account_id() + smsg(f" {name}'s account id is '{acid}' ", color = (0,2.55,2.55), transient = True , clients = [clid]) + except: + return + + \ No newline at end of file diff --git a/dist/ba_root/mods/playersData/__pycache__/__init__.cpython-38.opt-1.pyc b/dist/ba_root/mods/playersData/__pycache__/__init__.cpython-38.opt-1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4dbd2f2a2e62f5c5b0eaa2d4e150604ce4519524 GIT binary patch literal 381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