public override void RunCommand(string[] args, Optional <Player> sender) { try { string playerName = sender.IsPresent() ? sender.Get().Name : "SERVER"; serverConfig.ChangeAdminPassword(args[0]); Log.Info($"Admin password changed to \"{args[0]}\" by {playerName}"); SendMessageToPlayer(sender, "Admin password changed"); } catch (Exception ex) { Log.Error($"Error attempting to change admin password to \"{args[0]}\"", ex); } }
private void ChangeAdminPassword(string password, string name) { serverConfig.ChangeAdminPassword(password); Log.Info($"Admin password changed to \"{password}\" by {name}"); }