mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-11 15:52:25 -05:00
updated portuguese translation
fixed issue with locale when no config present changed kick color on webfront aliased owner to iamgod (for b3 familiar users) hopefully fixed stats issue added T5M (V2 BO2) support made dvar grab at beginning minimal to prevent throttling on older CODS
This commit is contained in:
11
Application/EventParsers/T5MEventParser.cs
Normal file
11
Application/EventParsers/T5MEventParser.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace IW4MAdmin.Application.EventParsers
|
||||
{
|
||||
class T5MEventParser : IW4EventParser
|
||||
{
|
||||
public override string GetGameDir() => "v2";
|
||||
}
|
||||
}
|
@ -11,8 +11,8 @@ namespace IW4MAdmin.Application.Localization
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
string currentLocale = Program.ServerManager.GetApplicationSettings().Configuration().CustomLocale ??
|
||||
CultureInfo.CurrentCulture.Name?.Substring(0, 2);
|
||||
string currentLocale = Program.ServerManager.GetApplicationSettings().Configuration()?.CustomLocale ??
|
||||
CultureInfo.CurrentCulture?.Name?.Substring(0, 2);
|
||||
|
||||
if (currentLocale == null)
|
||||
throw new Exception("Computer CurrentCulture does not exist");
|
||||
|
@ -1,9 +1,8 @@
|
||||
// translated by Daniel aka Vou te comer
|
||||
{
|
||||
{
|
||||
"LocalizationName": "pt-BR",
|
||||
"LocalizationSet": {
|
||||
"MANAGER_VERSION_FAIL": "Não foi possível obter a versão mais recente do IW4MAdmin",
|
||||
"MANAGER_VERSION_UPDATE": "Tem uma atualização. A versão mais recente é",
|
||||
"MANAGER_VERSION_UPDATE": "Há uma atualização disponível. A versão mais recente é",
|
||||
"MANAGER_VERSION_CURRENT": "Está é a sua versão",
|
||||
"MANAGER_VERSION_SUCCESS": "O IW4MAdmin está atualizado",
|
||||
"MANAGER_INIT_FAIL": "Erro fatal durante a inicialização",
|
||||
@ -12,7 +11,7 @@
|
||||
"MANAGER_MONITORING_TEXT": "Agora monitorando",
|
||||
"MANAGER_CONNECTION_REST": "A conexão foi reestabelecida com",
|
||||
"SETUP_ENABLE_WEBFRONT": "Habilitar o módulo da web do IW4MAdmin",
|
||||
"SETUP_ENABLE_MULTIOWN": "Ativar vários propietários",
|
||||
"SETUP_ENABLE_MULTIOWN": "Ativar vários proprietários",
|
||||
"SETUP_ENABLE_STEPPEDPRIV": "Ativar hierarquia de privilégios escalonada",
|
||||
"SETUP_ENABLE_CUSTOMSAY": "Habilitar a customização do nome do comando say",
|
||||
"SETUP_SAY_NAME": "Digite o nome customizado do comando say",
|
||||
@ -39,10 +38,10 @@
|
||||
"SERVER_ERROR_PLUGIN": "Ocorreu um erro ao carregar o plug-in",
|
||||
"SERVER_ERROR_ADDPLAYER": "Não foi possível adicionar o jogador",
|
||||
"SERVER_ERROR_POLLING": "reduzir a taxa de sondagem do server",
|
||||
"SERVER_ERROR_COMMUNICATION": "Não foi possivel fazer a comunicação com",
|
||||
"SERVER_ERROR_COMMUNICATION": "Não foi possível fazer a comunicação com",
|
||||
"SERVER_ERROR_EXCEPTION": "Exceção inesperada em",
|
||||
"SERVER_KICK_VPNS_NOTALLOWED": "VPNs não são permitidas neste servidor",
|
||||
"SERVER_KICK_TEXT": "Você foi expluso",
|
||||
"SERVER_KICK_TEXT": "Você foi expulso",
|
||||
"SERVER_KICK_MINNAME": "Seu nome deve conter no mínimo três caracteres",
|
||||
"SERVER_KICK_NAME_INUSE": "Seu nome já está sendo usado por outra pessoa",
|
||||
"SERVER_KICK_GENERICNAME": "Por favor, mude o seu nome usando o comando /name no console",
|
||||
@ -83,9 +82,9 @@
|
||||
"COMMANDS_HELP_NOTFOUND": "Não foi possível encontrar esse comando",
|
||||
"COMMANDS_HELP_MOREINFO": "Digite !help <comando> para saber como usar o comando",
|
||||
"COMMANDS_FASTRESTART_UNMASKED": "reiniciou rapidamente o mapa",
|
||||
"COMMANDS_FASTRESTART_MASKED": "O mapa foi reniciado rapidamente",
|
||||
"COMMANDS_FASTRESTART_MASKED": "O mapa foi reiniciado rapidamente",
|
||||
"COMMANDS_MAPROTATE": "Rotacionando o mapa em ^55 ^7segundos",
|
||||
"COMMANDS_SETLEVEL_SELF": "Você não pode mudar seu própio nível",
|
||||
"COMMANDS_SETLEVEL_SELF": "Você não pode mudar seu próprio nível",
|
||||
"COMMANDS_SETLEVEL_OWNER": "Só pode haver 1 dono. Modifique suas configurações se vários proprietários forem necessários",
|
||||
"COMMANDS_SETLEVEL_STEPPEDDISABLED": "Este servidor não permite que você promova",
|
||||
"COMMANDS_SETLEVEL_LEVELTOOHIGH": "Você só pode promover do ^5{0} ^7para ^5{1} ^7ou um nível menor",
|
||||
@ -109,9 +108,9 @@
|
||||
"COMMANDS_REPORTS_CLEAR_SUCCESS": "Lista de denúncias limpa com sucesso",
|
||||
"COMMANDS_REPORTS_NONE": "Ninguém foi denunciado ainda",
|
||||
"COMMANDS_MASK_ON": "Você foi mascarado",
|
||||
"COMMANDS_MASK_OFF": "Você foi desmarcarado",
|
||||
"COMMANDS_MASK_OFF": "Você foi desmascarado",
|
||||
"COMMANDS_BANINFO_NONE": "Nenhum banimento ativo foi encontrado para esse jogador",
|
||||
"COMMANDS_BANINO_SUCCESS": "foi bannido por ^5{0} ^7por:",
|
||||
"COMMANDS_BANINO_SUCCESS": "foi banido por ^5{0} ^7por:",
|
||||
"COMMANDS_ALIAS_ALIASES": "Nomes registrados",
|
||||
"COMMANDS_ALIAS_IPS": "IPs",
|
||||
"COMMANDS_RCON_SUCCESS": "O comando para o RCon foi enviado com sucesso",
|
||||
@ -135,7 +134,7 @@
|
||||
"COMMANDS_WHO_DESC": "dá informações sobre você",
|
||||
"COMMANDS_LIST_DESC": "lista os jogadores ativos na partida",
|
||||
"COMMANDS_HELP_DESC": "lista todos os comandos disponíveis",
|
||||
"COMMANDS_FASTRESTART_DESC": "renincializa rapidamente o mapa, não recomendável o uso várias vezes seguidas",
|
||||
"COMMANDS_FASTRESTART_DESC": "reinicializa rapidamente o mapa, não recomendável o uso várias vezes seguidas",
|
||||
"COMMANDS_MAPROTATE_DESC": "avança para o próximo mapa da rotação",
|
||||
"COMMANDS_SETLEVEL_DESC": "define o jogador para o nível de privilégio especificado",
|
||||
"COMMANDS_USAGE_DESC": "vê quanto o aplicativo está usando de memória ram do seu computador",
|
||||
@ -164,7 +163,7 @@
|
||||
"COMMANDS_ARGS_MESSAGE": "mensagem",
|
||||
"COMMANDS_ARGS_DURATION": "duração (minutos|horas|dias|semanas|anos)",
|
||||
"COMMANDS_ARGS_CLIENTID": "id do jogador",
|
||||
"COMMANDS_ARGS_COMMANDS": "commandos",
|
||||
"COMMANDS_ARGS_COMMANDS": "comandos",
|
||||
"COMMANDS_ARGS_LEVEL": "nível",
|
||||
"COMMANDS_ARGS_MAP": "mapa",
|
||||
"COMMANDS_ARGS_CLEAR": "limpar",
|
||||
@ -175,7 +174,7 @@
|
||||
"PLUGINS_LOGIN_COMMANDS_LOGIN_FAIL": "Sua senha está errada",
|
||||
"PLUGINS_STATS_COMMANDS_RESET_DESC": "reinicia suas estatísticas para uma nova",
|
||||
"PLUGINS_STATS_COMMANDS_RESET_SUCCESS": "Suas estatísticas nesse servidor foram reiniciadas",
|
||||
"PLUGINS_STATS_COMMANDS_RESET_FAIL": "Você deve estar connectado a um servidor para reiniciar as suas estatísticas",
|
||||
"PLUGINS_STATS_COMMANDS_RESET_FAIL": "Você deve estar conectado a um servidor para reiniciar as suas estatísticas",
|
||||
"PLUGINS_STATS_COMMANDS_VIEW_DESC": "mostra suas estatísticas",
|
||||
"PLUGINS_STATS_COMMANDS_VIEW_FAIL_INGAME": "o jogador especificado deve estar jogando",
|
||||
"PLUGINS_STATS_COMMANDS_VIEW_FAIL_INGAME_SELF": "Você deve estar no jogo para ver suas estatísticas",
|
||||
@ -195,4 +194,4 @@
|
||||
"GLOBAL_INFO": "Informação",
|
||||
"GLOBAL_VERBOSE": "Verbose"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ namespace IW4MAdmin.Application
|
||||
|
||||
ServerManager = ApplicationManager.GetInstance();
|
||||
|
||||
using (var db = new DatabaseContext(ServerManager.GetApplicationSettings().Configuration().ConnectionString))
|
||||
using (var db = new DatabaseContext(ServerManager.GetApplicationSettings().Configuration()?.ConnectionString))
|
||||
new ContextSeed(db).Seed().Wait();
|
||||
|
||||
var api = API.Master.Endpoint.Get();
|
||||
|
@ -92,10 +92,14 @@ namespace IW4MAdmin.Application
|
||||
|
||||
public void UpdateStatus(object state)
|
||||
{
|
||||
var taskList = new List<Task>();
|
||||
|
||||
foreach (var server in Servers)
|
||||
{
|
||||
Task.Run(() => server.ProcessUpdatesAsync(new CancellationToken()));
|
||||
taskList.Add(Task.Run(() => server.ProcessUpdatesAsync(new CancellationToken())));
|
||||
}
|
||||
|
||||
Task.WaitAll(taskList.ToArray());
|
||||
}
|
||||
|
||||
public async Task Init()
|
||||
|
@ -183,9 +183,10 @@ namespace IW4MAdmin
|
||||
|
||||
Logger.WriteInfo($"Client {player} connecting...");
|
||||
|
||||
var e = new GameEvent(GameEvent.EventType.Connect, "", player, null, this);
|
||||
Manager.GetEventHandler().AddEvent(e);
|
||||
|
||||
Manager.GetEventHandler().AddEvent(new GameEvent(GameEvent.EventType.Connect, "", player, null, this));
|
||||
|
||||
e.OnProcessed.Wait();
|
||||
|
||||
if (!Manager.GetApplicationSettings().Configuration().EnableClientVPNs &&
|
||||
await VPNCheck.UsingVPN(player.IPAddressString, Manager.GetApplicationSettings().Configuration().IPHubAPIKey))
|
||||
@ -212,7 +213,9 @@ namespace IW4MAdmin
|
||||
Player Leaving = Players[cNum];
|
||||
Logger.WriteInfo($"Client {Leaving} disconnecting...");
|
||||
|
||||
Manager.GetEventHandler().AddEvent(new GameEvent(GameEvent.EventType.Disconnect, "", Leaving, null, this));
|
||||
var e = new GameEvent(GameEvent.EventType.Disconnect, "", Leaving, null, this);
|
||||
Manager.GetEventHandler().AddEvent(e);
|
||||
e.OnProcessed.Wait();
|
||||
|
||||
Leaving.TotalConnectionTime += (int)(DateTime.UtcNow - Leaving.ConnectionTime).TotalSeconds;
|
||||
Leaving.LastConnection = DateTime.UtcNow;
|
||||
@ -394,7 +397,7 @@ namespace IW4MAdmin
|
||||
// hack: this prevents commands from getting executing that 'shouldn't' be
|
||||
if (E.Type == GameEvent.EventType.Command &&
|
||||
E.Extra != null &&
|
||||
(canExecuteCommand ||
|
||||
(canExecuteCommand ||
|
||||
E.Origin?.Level == Player.Permission.Console))
|
||||
{
|
||||
await (((Command)E.Extra).ExecuteAsync(E));
|
||||
@ -697,6 +700,7 @@ namespace IW4MAdmin
|
||||
if (ServerConfig.UseIW5MParser)
|
||||
RconParser = new IW5MRConParser();
|
||||
|
||||
|
||||
var version = await this.GetDvarAsync<string>("version");
|
||||
GameName = Utilities.GetGame(version.Value);
|
||||
|
||||
@ -704,26 +708,41 @@ namespace IW4MAdmin
|
||||
EventParser = new IW4EventParser();
|
||||
else if (GameName == Game.IW5)
|
||||
EventParser = new IW5EventParser();
|
||||
else if (GameName == Game.T5M)
|
||||
EventParser = new T5MEventParser();
|
||||
else if (GameName == Game.T6M)
|
||||
EventParser = new T6MEventParser();
|
||||
else if (GameName == Game.UKN)
|
||||
Logger.WriteWarning($"Game name not recognized: {version}");
|
||||
else
|
||||
EventParser = new IW3EventParser(); // this uses the 'main' folder for log paths
|
||||
|
||||
var shortversion = await this.GetDvarAsync<string>("shortversion");
|
||||
var hostname = await this.GetDvarAsync<string>("sv_hostname");
|
||||
var mapname = await this.GetDvarAsync<string>("mapname");
|
||||
var maxplayers = (GameName == Game.IW4) ? // gotta love IW4 idiosyncrasies
|
||||
await this.GetDvarAsync<int>("party_maxplayers") :
|
||||
await this.GetDvarAsync<int>("sv_maxclients");
|
||||
var gametype = await this.GetDvarAsync<string>("g_gametype");
|
||||
if (GameName == Game.UKN)
|
||||
Logger.WriteWarning($"Game name not recognized: {version}");
|
||||
|
||||
var infoResponse = await this.GetInfoAsync();
|
||||
// this is normally slow, but I'm only doing it because different games have different prefixes
|
||||
var hostname = infoResponse == null ?
|
||||
(await this.GetDvarAsync<string>("sv_hostname")).Value :
|
||||
infoResponse.Where(kvp => kvp.Key.Contains("hostname")).Select(kvp => kvp.Value).First();
|
||||
var mapname = infoResponse == null ?
|
||||
(await this.GetDvarAsync<string>("mapname")).Value :
|
||||
infoResponse["mapname"];
|
||||
int maxplayers = (GameName == Game.IW4) ? // gotta love IW4 idiosyncrasies
|
||||
(await this.GetDvarAsync<int>("party_maxplayers")).Value :
|
||||
infoResponse == null ?
|
||||
(await this.GetDvarAsync<int>("sv_maxclients")).Value :
|
||||
Convert.ToInt32(infoResponse["sv_maxclients"]);
|
||||
var gametype = infoResponse == null ?
|
||||
(await this.GetDvarAsync<string>("g_gametype")).Value :
|
||||
infoResponse.Where(kvp => kvp.Key.Contains("gametype")).Select(kvp => kvp.Value).First();
|
||||
var basepath = await this.GetDvarAsync<string>("fs_basepath");
|
||||
WorkingDirectory = basepath.Value;
|
||||
var game = await this.GetDvarAsync<string>("fs_game");
|
||||
var game = infoResponse == null || !infoResponse.ContainsKey("fs_game") ?
|
||||
(await this.GetDvarAsync<string>("fs_game")).Value :
|
||||
infoResponse["fs_game"];
|
||||
var logfile = await this.GetDvarAsync<string>("g_log");
|
||||
var logsync = await this.GetDvarAsync<int>("g_logsync");
|
||||
|
||||
WorkingDirectory = basepath.Value;
|
||||
|
||||
try
|
||||
{
|
||||
var website = await this.GetDvarAsync<string>("_website");
|
||||
@ -737,11 +756,11 @@ namespace IW4MAdmin
|
||||
|
||||
InitializeMaps();
|
||||
|
||||
this.Hostname = hostname.Value.StripColors();
|
||||
this.CurrentMap = Maps.Find(m => m.Name == mapname.Value) ?? new Map() { Alias = mapname.Value, Name = mapname.Value };
|
||||
this.MaxClients = maxplayers.Value;
|
||||
this.FSGame = game.Value;
|
||||
this.Gametype = gametype.Value;
|
||||
this.Hostname = hostname.StripColors();
|
||||
this.CurrentMap = Maps.Find(m => m.Name == mapname) ?? new Map() { Alias = mapname, Name = mapname };
|
||||
this.MaxClients = maxplayers;
|
||||
this.FSGame = game;
|
||||
this.Gametype = gametype;
|
||||
|
||||
//wait this.SetDvarAsync("sv_kickbantime", 60);
|
||||
|
||||
@ -759,7 +778,7 @@ namespace IW4MAdmin
|
||||
CustomCallback = await ScriptLoaded();
|
||||
string mainPath = EventParser.GetGameDir();
|
||||
#if DEBUG
|
||||
basepath.Value = @"\\192.168.88.253\mw2\";
|
||||
basepath.Value = @"\\192.168.88.253\Call of Duty 4\";
|
||||
#endif
|
||||
string logPath;
|
||||
if (GameName == Game.IW5)
|
||||
@ -768,9 +787,9 @@ namespace IW4MAdmin
|
||||
}
|
||||
else
|
||||
{
|
||||
logPath = game.Value == string.Empty ?
|
||||
logPath = game == string.Empty ?
|
||||
$"{basepath.Value.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{mainPath}{Path.DirectorySeparatorChar}{logfile.Value}" :
|
||||
$"{basepath.Value.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{game.Value.Replace('/', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{logfile.Value}";
|
||||
$"{basepath.Value.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{game.Replace('/', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{logfile.Value}";
|
||||
}
|
||||
|
||||
|
||||
@ -789,10 +808,9 @@ namespace IW4MAdmin
|
||||
}
|
||||
else
|
||||
{
|
||||
// LogFile = new IFile(logPath);
|
||||
|
||||
LogEvent = new GameLogEvent(this, logPath, logfile.Value);
|
||||
}
|
||||
LogEvent = new GameLogEvent(this, logPath, logfile.Value);
|
||||
|
||||
Logger.WriteInfo($"Log file is {logPath}");
|
||||
#if DEBUG
|
||||
// LogFile = new RemoteFile("https://raidmax.org/IW4MAdmin/getlog.php");
|
||||
|
Reference in New Issue
Block a user