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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue