From 08b7959775c73a19343449286905977fb33e8585 Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:43:14 +0530 Subject: [PATCH 1/8] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c954cc6..133f8a4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ Modded server scripts to host ballistica (Bombsquad) server. Running on BS1.7.19. +`` +We started working on API 8 , help us to test out and fix bugs +`` +[API8 BRANCH](https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server/tree/api8) + # Prerequisites - Basic knowledge of Linux - A VPS (e.g. [Amazon Web Services](https://aws.amazon.com/), [Microsoft Azure](https://portal.azure.com/)) From bc4849333dee5a98dee180fdcbc4482aa8754d2e Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Sat, 19 Aug 2023 02:18:29 +0530 Subject: [PATCH 2/8] config roll back and PORT by env variable --- .gitignore | 5 +- bombsquad_server | 20 +-- dist/ba_root/mods/defaults/blacklist.json | 34 ++++++ dist/ba_root/mods/defaults/config.yaml | 134 ++++++++++++++++++++ dist/ba_root/mods/defaults/custom.json | 10 ++ dist/ba_root/mods/defaults/profiles.json | 25 ++++ dist/ba_root/mods/defaults/roles.json | 93 ++++++++++++++ dist/ba_root/mods/defaults/settings.json | 141 ++++++++++++++++++++++ 8 files changed, 453 insertions(+), 9 deletions(-) create mode 100644 dist/ba_root/mods/defaults/blacklist.json create mode 100644 dist/ba_root/mods/defaults/config.yaml create mode 100644 dist/ba_root/mods/defaults/custom.json create mode 100644 dist/ba_root/mods/defaults/profiles.json create mode 100644 dist/ba_root/mods/defaults/roles.json create mode 100644 dist/ba_root/mods/defaults/settings.json diff --git a/.gitignore b/.gitignore index 80323aa..7f146b4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ __pycache__/ *.py[cod] *$py.class .mypy_cache/ - +dist/ba_root/mods/playerdata/*.json* +dist/ba_root/mods/serverdata/*.log +dist/ba_root/mods/serverdata/*.log* +dist/ba_root/mods/serverdata/*.json diff --git a/bombsquad_server b/bombsquad_server index db222d7..212812e 100644 --- a/bombsquad_server +++ b/bombsquad_server @@ -40,12 +40,12 @@ def migrate_to_aarch(): pass # by default we have x86_64 setup # if we found aarch64 system copy required files -if platform.processor() == 'aarch64': +if platform.processor() == 'aarch64': print("We are on aarch64 system") if os.path.exists(".we_are_good"): pass else: - migrate_to_aarch() + migrate_to_aarch() # We make use of the bacommon and efro packages as well as site-packages # included with our bundled Ballistica dist, so we need to add those paths # before we import them. @@ -496,11 +496,14 @@ class ServerManagerApp: print_confirmation=print_confirmation) return except Exception as exc: - if strict: - raise CleanError( - f'Error loading config file:\n{exc}') from exc + print(f'{Clr.RED}Error loading config file:\n{exc}.{Clr.RST}', flush=True) + with open(self._ba_root_path + "/mods/defaults/config.yaml", "r") as infile: + default_file = infile.read() + with open(self._config_path, "w") as outfile: + outfile.write(default_file) + print("config reset done") if trynum == maxtries - 1: print( f'{Clr.RED}Max-tries reached; giving up.' @@ -632,7 +635,7 @@ class ServerManagerApp: [binary_name, '-cfgdir', self._ba_root_path], stdin=subprocess.PIPE, cwd='dist') - + except Exception as exc: self._subprocess_exited_cleanly = False print( @@ -701,7 +704,8 @@ class ServerManagerApp: # Some of our config values translate directly into the # ballisticacore config file; the rest we pass at runtime. - bincfg['Port'] = self._config.port + port = int(os.environ.get('PORT', 43210)) + bincfg['Port'] = port bincfg['Auto Balance Teams'] = self._config.auto_balance_teams bincfg['Show Tutorial'] = self._config.show_tutorial @@ -935,4 +939,4 @@ def dump_logs(msg): if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/dist/ba_root/mods/defaults/blacklist.json b/dist/ba_root/mods/defaults/blacklist.json new file mode 100644 index 0000000..a27f6e7 --- /dev/null +++ b/dist/ba_root/mods/defaults/blacklist.json @@ -0,0 +1,34 @@ +{ + "ban": { + "ids": { + "pb-234": { + "till": "2023-06-07 21:59:20", + "reason": "auto ban for spam" + } + }, + "ips": { + "19.168.0.0.1": { + "till": "2023-06-07 21:59:20", + "reason": "auto ban for spam" + } + }, + "deviceids": { + "sdfdsfwr3": { + "till": "2023-06-07 21:59:20", + "reason": "auto ban for spam" + } + } + }, + "muted-ids": { + "pb-IF4iU0QaEw==": { + "till": "2023-06-19 19:44:47", + "reason": "manually from website" + } + }, + "kick-vote-disabled": { + "pb-JiNJARBaXEFBVF9HFkNXXF1EF0ZaRlZE": { + "till": "2023-06-12 19:37:48", + "reason": "manually from website" + } + } +} diff --git a/dist/ba_root/mods/defaults/config.yaml b/dist/ba_root/mods/defaults/config.yaml new file mode 100644 index 0000000..2a83afe --- /dev/null +++ b/dist/ba_root/mods/defaults/config.yaml @@ -0,0 +1,134 @@ +# To configure your server, create a config.yaml file in the same directory +# as the ballisticacore_server script. The config_template.yaml file can be +# copied or renamed as a convenient starting point. + +# Uncomment any of these values to override defaults. + +# Name of our server in the public parties list. +party_name: "BombSquad Community Server" + +# If true, your party will show up in the global public party list +# Otherwise it will still be joinable via LAN or connecting by IP address. +#party_is_public: true + +# If true, all connecting clients will be authenticated through the master +# server to screen for fake account info. Generally this should always +# be enabled unless you are hosting on a LAN with no internet connection. +authenticate_clients: true + +# IDs of server admins. Server admins are not kickable through the default +# kick vote system and they are able to kick players without a vote. To get +# your account id, enter 'getaccountid' in settings->advanced->enter-code. +admins: +- pb-yOuRAccOuNtIdHErE +- pb-aNdMayBeAnotherHeRE + +# Whether the default kick-voting system is enabled. +enable_default_kick_voting: true + +# UDP port to host on. Change this to work around firewalls or run multiple +# servers on one machine. +# 43210 is the default and the only port that will show up in the LAN +# browser tab. +port: 43210 + +# Max devices in the party. Note that this does *NOT* mean max players. +# Any device in the party can have more than one player on it if they have +# multiple controllers. Also, this number currently includes the server so +# generally make it 1 bigger than you need. Max-players is not currently +# exposed but I'll try to add that soon. +max_party_size: 6 + +# Options here are 'ffa' (free-for-all), 'teams' and 'coop' (cooperative) +# This value is ignored if you supply a playlist_code (see below). +#session_type: ffa + +# Playlist-code for teams or free-for-all mode sessions. +# To host your own custom playlists, use the 'share' functionality in the +# playlist editor in the regular version of the game. +# This will give you a numeric code you can enter here to host that +# playlist. +playlist_code: 412158 + +# Alternately, you can embed playlist data here instead of using codes. +# Make sure to set session_type to the correct type for the data here. +#playlist_inline: [] + +# Whether to shuffle the playlist or play its games in designated order. +#playlist_shuffle: true + +# If true, keeps team sizes equal by disallowing joining the largest team +# (teams mode only). +#auto_balance_teams: true + +# The campaign used when in co-op session mode. +# Do print(ba.app.campaigns) to see available campaign names. +#coop_campaign: Easy + +# The level name within the campaign used in co-op session mode. +# For campaign name FOO, do print(ba.app.campaigns['FOO'].levels) to see +# available level names. +#coop_level: Onslaught Training + +# Whether to enable telnet access. +# IMPORTANT: This option is no longer available, as it was being used +# for exploits. Live access to the running server is still possible through +# the mgr.cmd() function in the server script. Run your server through +# tools such as 'screen' or 'tmux' and you can reconnect to it remotely +# over a secure ssh connection. +#enable_telnet: false + +# Series length in teams mode (7 == 'best-of-7' series; a team must +# get 4 wins) +teams_series_length: 7 + +# Points to win in free-for-all mode (Points are awarded per game based on +# performance) +ffa_series_length: 24 + +# If you have a custom stats webpage for your server, you can use this +# to provide a convenient in-game link to it in the server-browser +# alongside the server name. +# if ${ACCOUNT} is present in the string, it will be replaced by the +# currently-signed-in account's id. To fetch info about an account, +# your back-end server can use the following url: +# http://bombsquadgame.com/accountquery?id=ACCOUNT_ID_HERE +stats_url: https://discord.gg/ucyaesh + +# If present, the server subprocess will attempt to gracefully exit after +# this amount of time. A graceful exit can occur at the end of a series +# or other opportune time. Server-managers set to auto-restart (the +# default) will then spin up a fresh subprocess. This mechanism can be +# useful to clear out any memory leaks or other accumulated bad state +# in the server subprocess. +#clean_exit_minutes: 60 + +# If present, the server subprocess will shut down immediately after this +# amount of time. This can be useful as a fallback for clean_exit_time. +# The server manager will then spin up a fresh server subprocess if +# auto-restart is enabled (the default). +#unclean_exit_minutes: 90 + +# If present, the server subprocess will shut down immediately if this +# amount of time passes with no activity from any players. The server +# manager will then spin up a fresh server subprocess if auto-restart is +# enabled (the default). +#idle_exit_minutes: 20 + +# Should the tutorial be shown at the beginning of games? +#show_tutorial: false + +# Team names (teams mode only). +team_names: +- ladoo +- barfi + +# Team colors (teams mode only). +team_colors: +- [0.8, 0.0, 0.6] +- [0, 1, 0.8] + +# Whether to enable the queue where players can line up before entering +# your server. Disabling this can be used as a workaround to deal with +# queue spamming attacks. +#enable_queue: true diff --git a/dist/ba_root/mods/defaults/custom.json b/dist/ba_root/mods/defaults/custom.json new file mode 100644 index 0000000..fa3d501 --- /dev/null +++ b/dist/ba_root/mods/defaults/custom.json @@ -0,0 +1,10 @@ +{ + "customtag": { + "pb-id": "smoothy", + "pb-45": "something", + "pb-IF4TVWwZUQ==": "proowner" + }, + "customeffects": { + "pb-IF4TVWwZUQ==": "spark" + } +} diff --git a/dist/ba_root/mods/defaults/profiles.json b/dist/ba_root/mods/defaults/profiles.json new file mode 100644 index 0000000..d7d88cf --- /dev/null +++ b/dist/ba_root/mods/defaults/profiles.json @@ -0,0 +1,25 @@ +{ + "pb-IF4gB3Bf": { + "display_string": [ + "\ue063Cherish418", + "\ue030Android21770243" + ], + "profiles": [], + "name": "\ue063Cherish418", + "isBan": false, + "isMuted": false, + "accountAge": "2018-02-27 15:34:33", + "registerOn": 1686403521.9623077, + "canStartKickVote": true, + "spamCount": 0, + "lastSpam": 1686403521.9623082, + "totaltimeplayer": 0, + "warnCount": 0, + "lastWarned": 1686403521.9623146, + "verified": true, + "rejoincount": 1, + "lastJoin": 1686403521.9623156, + "lastIP": "dvvc{vb\u007f`~yi", + "deviceUUID": "8d30ec208bb52cfe546559bf2ab9b306157302a0" + } +} diff --git a/dist/ba_root/mods/defaults/roles.json b/dist/ba_root/mods/defaults/roles.json new file mode 100644 index 0000000..3cebebd --- /dev/null +++ b/dist/ba_root/mods/defaults/roles.json @@ -0,0 +1,93 @@ +{ + "owner": { + "tag": "\\cowner\\c", + "tagcolor": [ + 1, + 0.6, + 0.4 + ], + "commands": [ + "ALL" + ], + "ids": [ + "pb-IF48VWkBFQ", + "pb-JiNJARBaXEFBVF9HFkNXXF1EF0ZaRlZE", + "pb-IF4TVWwZUQ==", + "pb-IF4SVW9dEg==", + "pb-IF5XUm9eAg==" + ] + }, + "admin": { + "tag": "\ue043admin\ue043", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [ + "createrole" + ], + "ids": [ + "pb-IF4TVWwZUQ==" + ] + }, + "vip": { + "tag": "vip", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [] + }, + "smoothy": { + "tag": "smoothy", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [] + }, + "pros": { + "tag": "pros", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [] + }, + "top5": { + "tag": "top5", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [ + "pb-IF4VAk4a", + "pb-IF4RU2ECAg==" + ] + }, + "bypass-warn": { + "tag": "", + "tagcolor": [ + 1, + 1, + 1 + ], + "commands": [], + "ids": [ + "pb-IF5XUm9eAg==", + "pb-IF43VUwlAg==", + "pb-IF4iVUc5Cg==", + "pb-IF4vNnMJ", + "pb-IF4TVWwZUQ==" + ] + } +} diff --git a/dist/ba_root/mods/defaults/settings.json b/dist/ba_root/mods/defaults/settings.json new file mode 100644 index 0000000..5e6137e --- /dev/null +++ b/dist/ba_root/mods/defaults/settings.json @@ -0,0 +1,141 @@ +{ + "whitelist": false, + "useV2Account": false, + "Anti-IdRevealer": false, + "ChatCommands": { + "BrodcastCommand": true + }, + "textonmap": { + "top watermark": "Welcome to server \nIP @IP PORT @PORT", + "bottom left watermark": "Owner : \nEditor : \nScripts : BCS1.7.13", + "center highlights":{ + "color":[1,0,0], + "randomColor":true, + "msg":[ + "type end to start end vote", + "start msg with prefix .(dot) to send in game popup msg", + "start msg with prefix ,(comma) to send msg to teammates", + "BombSquad Community Server - BCS" + ] + } + }, + "ScoreScreenAnnouncement":{ + "enable": true, + "msg": ["click stats button to join discord", "watch hey smoothy youtube channel","download new mods from discord", "use /ping all to check others ping.", + "start msg with prefix ,(comma) to send msg to teammates", "start msg with prefix .(dot) to send in game popup msg","click stats button for leaderboard","get notification when friends join this server, checkout leaderboard", +"abusers, spammers will get auto ban", "doesnt matter who starts fight, if you abuse- you will get ban too."] + }, + "statsResetAfterDays":31, + "leaderboard":{ + "enable":true, + "barsBehindName":true + }, + "autoNightMode":{ + "enable":true, + "startTime":"18:30", + "endTime":"06:00", + "fireflies":true, + "fireflies_random_color":false + }, + "colorfullMap":true, + "playlists":{ + "team":12345, + "ffa":412175, + "elim":412172, + "soccer":412160, + "smash":412151, + "ffasmash":412179, + "epic":412173 + }, + "coopModeWithLessPlayers":{ + "enable":false, + "minPlayerToExitCoop":0 + }, + "mikirogQuickTurn":{ + "enable":false + }, + "colorful_explosions":{ + "enable":true + }, + "ballistica_web": { + "enable":true, + "server_password":"dfgeh54rhbrthsdfhfdh" + }, + "character_chooser":{ + "enable":true + }, + "custom_characters": { + "enable":true + }, + "StumbledScoreScreen":true, + "elPatronPowerups":{ + "enable":true, + "settings":{"Powers Gravity": true, + "Tank Shield PTG": 96, + "Healing Damage PTG": 72, + "Powerup Style": "Auto", + "Powerup Scale": 1.0, + "Powerup Name": true, + "Powerup With Shield": true, + "Powerup Time": false}, + "Quantity":{ "Shield": 2, + "Punch": 3, "Mine Bombs": 2, + "Impact Bombs": 3, "Ice Bombs": 3, "Triple": 3, + "Sticky Bombs": 3, "Curse": 1, "Health": 1, + "Speed": 2, "Healing Damage": 1, "Goodbye": 2, + "Ice Man": 1,"Tank Shield": 1, "Impairment Bombs": 2, + "Fire Bombs": 3, "Fly Bombs": 3} + }, + "discordbot":{ + "enable":false, + "token":"", + "liveChat":true, + "liveStatsChannelID":925440043672285205, + "logsChannelID":925440079843958834 + }, + "discordWebHook": { + "enable": false, + "webhookURL": "https://discord.com/api/webhooks/82649239/e7s0zyBJIuczXL7_CGSO5WM" + }, + "afk_remover":{ + "enable":true, + "ingame_idle_time_in_secs":60, + "kick_idle_from_lobby":true, + "lobby_idle_time_in_secs":10 + }, + "playermod": { + "default_boxing_gloves": true, + "default_shield" : false, + "default_bomb" : "normal", + "default_bomb_count" : 1 + }, + "allowTeamChat":true, + "allowVotes":true, + "allowInGameChat":true, + "sameCharacterForTeam":false, + "newResultBoard":true, + "HostDeviceName":"v1.4", + "HostName":"BCS", + "ShowKickVoteStarterName":true, + "autoTeamBalance": true, + "KickVoteMsgType":"chat", + "minAgeToChatInHours":78, + "minAgeToJoinInHours":24, + "maxWarnCount":2, + "WarnCooldownMinutes":30, + "maxAccountPerIP":1, + "maxPlayersPerDevice":1, + "warnMsg":"WARNING !!!", + "afterWarnKickMsg":"Enough warnings, Goodbye have a nice day :)", + "firstTimeJoinMsg":"Welcome to the server,we r saving all your account details and chats", + "regularWelcomeMsg":"Welcome Back", + "contributeData": true, + "enabletags": true, + "enablehptag": true, + "enablerank": true, + "enablestats": true, + "enableHitTexts": true, + "enableeffects": true, + "enableTop5effects": true, + "enableTagAnimation":true +} From 152a80811f554ceefec22e5cf6d389bc01bb85c9 Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Sat, 30 Sep 2023 21:08:43 +0530 Subject: [PATCH 3/8] Update notification_manager.py --- dist/ba_root/mods/tools/notification_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/ba_root/mods/tools/notification_manager.py b/dist/ba_root/mods/tools/notification_manager.py index 00de127..be85e03 100644 --- a/dist/ba_root/mods/tools/notification_manager.py +++ b/dist/ba_root/mods/tools/notification_manager.py @@ -9,6 +9,7 @@ import ecdsa import os import _ba from datetime import datetime +date_format = '%Y-%m-%d %H:%M:%S' vapidkeys = {} subscriptions = {} subscribed_players = {} @@ -91,10 +92,10 @@ def subscribe(sub, account_id, name): def player_joined(pb_id): now = datetime.now() if pb_id in subscribed_players: - if "last_notification" in subscribed_players[pb_id] and (now - subscribed_players[pb_id]["last_notification"]).seconds < 15 * 60: + if "last_notification" in subscribed_players[pb_id] and (now - datetime.strptime(subscribed_players[pb_id]["last_notification"], date_format)).seconds < 15 * 60: pass else: - subscribed_players[pb_id]["last_notification"] = now + subscribed_players[pb_id]["last_notification"] = now.strftime(date_format) subscribes = subscribed_players[pb_id]["subscribers"] for subscriber_id in subscribes: sub = subscriptions[subscriber_id] From 2a93775d7707fec6d19a345e87598f321d63a5b1 Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:55:33 +0530 Subject: [PATCH 4/8] fixed port configuration --- bombsquad_server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bombsquad_server b/bombsquad_server index 212812e..2ab7615 100644 --- a/bombsquad_server +++ b/bombsquad_server @@ -704,7 +704,7 @@ class ServerManagerApp: # Some of our config values translate directly into the # ballisticacore config file; the rest we pass at runtime. - port = int(os.environ.get('PORT', 43210)) + port = int(os.environ.get('PORT', self._config.port)) bincfg['Port'] = port bincfg['Auto Balance Teams'] = self._config.auto_balance_teams bincfg['Show Tutorial'] = self._config.show_tutorial From 371d4b1f94db39b918d33cf14a2221fa2212a14a Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Sun, 25 Feb 2024 16:27:14 +0530 Subject: [PATCH 5/8] playlist fetch fallback --- dist/ba_data/python/ba/_servermode.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/ba_data/python/ba/_servermode.py b/dist/ba_data/python/ba/_servermode.py index fbde421..acca7ea 100644 --- a/dist/ba_data/python/ba/_servermode.py +++ b/dist/ba_data/python/ba/_servermode.py @@ -319,9 +319,11 @@ class ServerController: ) -> None: if result is None: print('Error fetching playlist; aborting.') - import _ba - _ba.quit() - + print('Falling back to use default playlist') + self._config.session_type = 'teams' + self._prep_timer = None + _ba.pushcall(self._launch_server_session) + return # Once we get here, simply modify our config to use this playlist. typename = ( 'teams' From 6eeb6377ff46768fe759230531a5d96203251052 Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Sun, 25 Feb 2024 16:28:23 +0530 Subject: [PATCH 6/8] nv setting time format check before commit --- dist/ba_root/mods/setting.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dist/ba_root/mods/setting.py b/dist/ba_root/mods/setting.py index f5d6071..a87dd2a 100644 --- a/dist/ba_root/mods/setting.py +++ b/dist/ba_root/mods/setting.py @@ -7,7 +7,7 @@ from __future__ import annotations from typing import TYPE_CHECKING from functools import lru_cache - +import datetime import json import _ba @@ -43,7 +43,18 @@ def commit(data: dict) -> None: data : dict data to be commited """ + if is_invalid_time_format(data['autoNightMode']['startTime']) or is_invalid_time_format(data['autoNightMode']['endTime']): + data['autoNightMode']['startTime'] = "18:30" + data['autoNightMode']['endTime'] = "6:30" + print("resetting night mode time") with open(SETTINGS_PATH, mode="w", encoding="utf-8") as setting_file: json.dump(data, setting_file, indent=4) # settings updated ok now update the cache refresh_cache() + +def is_invalid_time_format(time_string, time_format='%H:%M'): + try: + datetime.datetime.strptime(time_string, time_format) + return False + except ValueError: + return True \ No newline at end of file From 853dde3ffa8e5fac0fa29fe29203581f03e5863c Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 10 Apr 2024 18:57:13 +0530 Subject: [PATCH 7/8] Update Management.py --- .../ba_root/mods/chatHandle/ChatCommands/commands/Management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py b/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py index 84038ba..61b8aae 100644 --- a/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py +++ b/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py @@ -12,7 +12,7 @@ import random from tools import playlist from tools import logger Commands = ['recents', 'info', 'createteam', 'showid', 'hideid', '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', 'removeeffect', 'removetag' 'add', 'spectators', 'lobbytime'] + 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand', 'getroles', 'removecmd', 'changetag', 'customtag', 'customeffect', 'removeeffect', 'removetag', 'add', 'spectators', 'lobbytime'] CommandAliases = ['max', 'rm', 'next', 'restart', 'mutechat', 'unmutechat', 'sm', 'slow', 'night', 'day', 'pausegame', 'camera_mode', 'rotate_camera', 'effect'] From 582e24d3dd98017b9a813347ececfe703151c2fd Mon Sep 17 00:00:00 2001 From: Vishal Date: Fri, 19 Apr 2024 19:02:01 +0530 Subject: [PATCH 8/8] updating Management.py --- .../chatHandle/ChatCommands/commands/Management.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py b/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py index 61b8aae..a9b4e7c 100644 --- a/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py +++ b/dist/ba_root/mods/chatHandle/ChatCommands/commands/Management.py @@ -11,7 +11,7 @@ import _thread import random from tools import playlist from tools import logger -Commands = ['recents', 'info', 'createteam', 'showid', 'hideid', 'lm', 'gp', 'party', 'quit', 'kickvote', 'maxplayers', 'playlist', 'ban', 'kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', +Commands = ['recents', 'info', 'createteam', 'showid', 'hideid', 'lm', 'gp', 'party', 'quit', 'kickvote', 'maxplayers', 'playlist', 'ban', 'kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', 'tint', 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand', 'getroles', 'removecmd', 'changetag', 'customtag', 'customeffect', 'removeeffect', 'removetag', 'add', 'spectators', 'lobbytime'] CommandAliases = ['max', 'rm', 'next', 'restart', 'mutechat', 'unmutechat', 'sm', 'slow', 'night', 'day', 'pausegame', 'camera_mode', 'rotate_camera', 'effect'] @@ -81,6 +81,9 @@ def ExcelCommand(command, arguments, clientid, accountid): elif command in ['dv', 'day']: dv(arguments) + + elif command == 'tint': + tint(arguments) elif command in ['pause', 'pausegame']: pause() @@ -408,6 +411,15 @@ def dv(arguments): pass +def tint(arguments): + + activity = _ba.get_foreground_host_activity() + + if len(arguments) == 3: + if all(isinstance(val, (int,float)) for val in arguments): + activity.globalsnode.tint = (arguments[0], arguments[1], arguments[2]) + + def pause(): activity = _ba.get_foreground_host_activity()