mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Move bot owners to ini settings
- Bot owners now specified directly in the INI file - Owners list is now in Settings.cs and not in Hangman bot - Allow other bots to access owner list
This commit is contained in:
parent
a481640306
commit
fc281889c6
2 changed files with 9 additions and 25 deletions
|
|
@ -355,7 +355,6 @@ namespace MinecraftClient
|
|||
private bool[] discovered;
|
||||
private string word = "";
|
||||
private string letters = "";
|
||||
private string[] owners;
|
||||
private bool English;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -368,11 +367,6 @@ namespace MinecraftClient
|
|||
English = english;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
owners = getowners();
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (running)
|
||||
|
|
@ -398,7 +392,7 @@ namespace MinecraftClient
|
|||
|
||||
if (isPrivateMessage(text, ref message, ref username))
|
||||
{
|
||||
if (owners.Contains(username.ToUpper()))
|
||||
if (Settings.Bots_Owners.Contains(username.ToLower()))
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
|
|
@ -495,21 +489,6 @@ namespace MinecraftClient
|
|||
}
|
||||
}
|
||||
|
||||
private string[] getowners()
|
||||
{
|
||||
List<string> owners = new List<string>();
|
||||
owners.Add("CONSOLE");
|
||||
if (System.IO.File.Exists(Settings.Bots_OwnersFile))
|
||||
{
|
||||
foreach (string s in System.IO.File.ReadAllLines(Settings.Bots_OwnersFile))
|
||||
{
|
||||
owners.Add(s.ToUpper());
|
||||
}
|
||||
}
|
||||
else LogToConsole(English ? "File not found: " + Settings.Bots_OwnersFile : "Fichier introuvable : " + Settings.Bots_OwnersFile);
|
||||
return owners.ToArray();
|
||||
}
|
||||
|
||||
private string word_cached
|
||||
{
|
||||
get
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace MinecraftClient
|
|||
public static string TranslationsFile_FromMCDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\.minecraft\assets\objects\9e\9e2fdc43fc1c7024ff5922b998fadb2971a64ee0"; //MC 1.7.4 en_GB.lang
|
||||
public static string TranslationsFile_Website_Index = "https://s3.amazonaws.com/Minecraft.Download/indexes/1.7.4.json";
|
||||
public static string TranslationsFile_Website_Download = "http://resources.download.minecraft.net";
|
||||
public static string Bots_OwnersFile = "bot-owners.txt";
|
||||
public static List<string> Bots_Owners = new List<string>(new string[] { "console" });
|
||||
public static string Language = "en_GB";
|
||||
|
||||
//AntiAFK Settings
|
||||
|
|
@ -118,8 +118,13 @@ namespace MinecraftClient
|
|||
case "serverip": ServerIP = argValue; break;
|
||||
case "singlecommand": SingleCommand = argValue; break;
|
||||
case "language": Language = argValue; break;
|
||||
case "botownersfile": Bots_OwnersFile = argValue; break;
|
||||
case "consoletitle": ConsoleTitle = argValue; break;
|
||||
case "botowners":
|
||||
Bots_Owners.Clear();
|
||||
Bots_Owners.Add("console");
|
||||
foreach (string name in argValue.ToLower().Replace(" ", "").Split(','))
|
||||
Bots_Owners.Add(name);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -209,7 +214,7 @@ namespace MinecraftClient
|
|||
+ "#Advanced settings\r\n"
|
||||
+ "\r\n"
|
||||
+ "language=en_GB\r\n"
|
||||
+ "botownersfile=bot-owners.txt\r\n"
|
||||
+ "botowners=Player1,Player2,Player3\r\n"
|
||||
+ "consoletitle=%username% - Minecraft Console Client\r\n"
|
||||
+ "\r\n"
|
||||
+ "#Bot Settings\r\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue