From 3a01e11dc0d5e4489375f8f8a2dd149a449b5fb3 Mon Sep 17 00:00:00 2001 From: data-bomb Date: Sat, 22 Jun 2024 09:59:01 -0700 Subject: [PATCH] Adds Logging for Team Admin Command - Adds Melon Loader logging message for changing a player's team - Adds alert notification for changing a player's team --- Si_BasicTeamBalance/Si_BasicTeamBalance.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Si_BasicTeamBalance/Si_BasicTeamBalance.cs b/Si_BasicTeamBalance/Si_BasicTeamBalance.cs index 06f78a3..34649e5 100644 --- a/Si_BasicTeamBalance/Si_BasicTeamBalance.cs +++ b/Si_BasicTeamBalance/Si_BasicTeamBalance.cs @@ -38,7 +38,7 @@ You should have received a copy of the GNU General Public License using SilicaAdminMod; using System.Linq; -[assembly: MelonInfo(typeof(BasicTeamBalance), "Basic Team Balance", "1.3.0", "databomb", "https://github.com/data-bomb/Silica")] +[assembly: MelonInfo(typeof(BasicTeamBalance), "Basic Team Balance", "1.3.1", "databomb", "https://github.com/data-bomb/Silica")] [assembly: MelonGame("Bohemia Interactive", "Silica")] [assembly: MelonOptionalDependencies("Admin Mod")] @@ -277,7 +277,7 @@ public static void Command_Team(Player? callerPlayer, String args) Team team = Team.GetTeamByName(teamTarget, false); if (team == null) { - HelperMethods.ReplyToCommand(args.Split(' ')[0] + ": Ambiguous or invalid team name"); + HelperMethods.SendChatMessageToPlayer(callerPlayer, HelperMethods.chatPrefix, commandName, ": Ambiguous or invalid team name"); return; } @@ -294,7 +294,7 @@ public static void Command_Team(Player? callerPlayer, String args) if (player == null) { - HelperMethods.ReplyToCommand(args.Split(' ')[0] + ": Ambiguous or invalid player"); + HelperMethods.SendChatMessageToPlayer(callerPlayer, HelperMethods.chatPrefix, commandName, ": Ambiguous or invalid target"); return; } @@ -305,10 +305,13 @@ public static void Command_Team(Player? callerPlayer, String args) } SwapTeam(player, team); + HelperMethods.AlertAdminAction(callerPlayer, "swapped " + player.PlayerName + " to " + HelperMethods.GetTeamColor(player) + team.TeamShortName); } public static void SwapTeam(Player player, Team team) { + MelonLogger.Msg("Swapping player (" + player.PlayerName + ") to team: " + team.TeamShortName); + player.Team = team; NetworkLayer.SendPlayerSelectTeam(player, team); }