Compare commits

...

4 Commits

Author SHA1 Message Date
RaidMax
f704708264 Add XuidString and GuidString to EFClient to allow easier interfacing with mods 2020-08-31 12:16:46 -05:00
RaidMax
d9d3c75106 add website override mapping to tekno parser (_website -> sv_clanWebsite) 2020-08-31 12:16:46 -05:00
RaidMax
9d11cd5088 remove hard coded paths to make it easier for building in debug mode
auto copy script plugins/localization for local builds
2020-08-31 12:16:46 -05:00
RaidMax
9e1a178667 update pipeline file for seperate builds 2020-08-21 20:46:39 -05:00
9 changed files with 41 additions and 21 deletions

View File

@ -0,0 +1,12 @@
param (
[string]$OutputDir = $(throw "-OutputDir is required.")
)
$localizations = @("en-US", "ru-RU", "es-EC", "pt-BR", "de-DE")
foreach($localization in $localizations)
{
$url = "http://api.raidmax.org:5000/localization/{0}" -f $localization
$filePath = "{0}Localization\IW4MAdmin.{1}.json" -f $OutputDir, $localization
$response = Invoke-WebRequest $url
Out-File -FilePath $filePath -InputObject $response.Content -Encoding utf8
}

View File

@ -1,3 +1,6 @@
set SolutionDir=%1 set SolutionDir=%1
set ProjectDir=%2 set ProjectDir=%2
set TargetDir=%3 set TargetDir=%3
echo D | xcopy "%SolutionDir%Plugins\ScriptPlugins\*.js" "%TargetDir%Plugins" /y
powershell -File "%ProjectDir%BuildScripts\DownloadTranslations.ps1" %TargetDir%

View File

@ -233,7 +233,7 @@ namespace IW4MAdmin.Application
serviceCollection.AddSingleton<IServiceCollection>(_serviceProvider => serviceCollection) serviceCollection.AddSingleton<IServiceCollection>(_serviceProvider => serviceCollection)
.AddSingleton(new BaseConfigurationHandler<ApplicationConfiguration>("IW4MAdminSettings") as IConfigurationHandler<ApplicationConfiguration>) .AddSingleton(new BaseConfigurationHandler<ApplicationConfiguration>("IW4MAdminSettings") as IConfigurationHandler<ApplicationConfiguration>)
.AddSingleton(new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration") as IConfigurationHandler<CommandConfiguration>) .AddSingleton(new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration") as IConfigurationHandler<CommandConfiguration>)
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<ApplicationConfiguration>>().Configuration()) .AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<ApplicationConfiguration>>().Configuration() ?? new ApplicationConfiguration())
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<CommandConfiguration>>().Configuration() ?? new CommandConfiguration()) .AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<CommandConfiguration>>().Configuration() ?? new CommandConfiguration())
.AddSingleton<ILogger>(_serviceProvider => defaultLogger) .AddSingleton<ILogger>(_serviceProvider => defaultLogger)
.AddSingleton<IPluginImporter, PluginImporter>() .AddSingleton<IPluginImporter, PluginImporter>()

View File

@ -8,8 +8,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
GameFiles\IW4x\userraw\scripts\_commands.gsc = GameFiles\IW4x\userraw\scripts\_commands.gsc GameFiles\IW4x\userraw\scripts\_commands.gsc = GameFiles\IW4x\userraw\scripts\_commands.gsc
GameFiles\IW4x\userraw\scripts\_customcallbacks.gsc = GameFiles\IW4x\userraw\scripts\_customcallbacks.gsc GameFiles\IW4x\userraw\scripts\_customcallbacks.gsc = GameFiles\IW4x\userraw\scripts\_customcallbacks.gsc
azure-pipelines.yml = azure-pipelines.yml
PostPublish.ps1 = PostPublish.ps1 PostPublish.ps1 = PostPublish.ps1
pre-release-pipeline.yml = pre-release-pipeline.yml
README.md = README.md README.md = README.md
RunPublishPre.cmd = RunPublishPre.cmd RunPublishPre.cmd = RunPublishPre.cmd
RunPublishRelease.cmd = RunPublishRelease.cmd RunPublishRelease.cmd = RunPublishRelease.cmd

View File

@ -3,7 +3,7 @@ var eventParser;
var plugin = { var plugin = {
author: 'RaidMax', author: 'RaidMax',
version: 0.6, version: 0.7,
name: 'Tekno MW3 Parser', name: 'Tekno MW3 Parser',
isParser: true, isParser: true,
@ -29,6 +29,7 @@ var plugin = {
rconParser.Configuration.Dvar.Pattern = '^(.*)$'; rconParser.Configuration.Dvar.Pattern = '^(.*)$';
rconParser.Configuration.DefaultDvarValues.Add('sv_running', '1'); rconParser.Configuration.DefaultDvarValues.Add('sv_running', '1');
rconParser.Configuration.OverrideDvarNameMapping.Add('_website', 'sv_clanWebsite');
rconParser.Version = 'IW5 MP 1.4 build 382 latest Thu Jan 19 2012 11:09:49AM win-x86'; rconParser.Version = 'IW5 MP 1.4 build 382 latest Thu Jan 19 2012 11:09:49AM win-x86';
rconParser.GameName = 3; // IW5 rconParser.GameName = 3; // IW5

View File

@ -26,7 +26,6 @@ namespace SharedLibraryCore.Database
static string _ConnectionString; static string _ConnectionString;
static string _provider; static string _provider;
private static readonly string _migrationPluginDirectory = @"X:\IW4MAdmin\BUILD\Plugins";
private static readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder => private static readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder =>
{ {
builder.AddConsole() builder.AddConsole()
@ -72,7 +71,7 @@ namespace SharedLibraryCore.Database
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
//optionsBuilder.UseLoggerFactory(_loggerFactory) //optionsBuilder.UseLoggerFactory(_loggerFactory)
// .EnableSensitiveDataLogging(); // .EnableSensitiveDataLogging();
if (string.IsNullOrEmpty(_ConnectionString)) if (string.IsNullOrEmpty(_ConnectionString))
{ {
@ -198,11 +197,14 @@ namespace SharedLibraryCore.Database
// adapted from // adapted from
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/ // https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
#if DEBUG
string pluginDir = _migrationPluginDirectory;
#else
string pluginDir = Path.Join(Utilities.OperatingDirectory, "Plugins"); string pluginDir = Path.Join(Utilities.OperatingDirectory, "Plugins");
#endif
if (Utilities.IsDevelopment)
{
pluginDir = Path.Join(Utilities.OperatingDirectory, "..", "..", "..", "..", "BUILD", "Plugins");
}
IEnumerable<string> directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.EndsWith(".dll")); IEnumerable<string> directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.EndsWith(".dll"));
foreach (string dllPath in directoryFiles) foreach (string dllPath in directoryFiles)

View File

@ -656,6 +656,10 @@ namespace SharedLibraryCore.Database.Models
public int Score { get; set; } public int Score { get; set; }
[NotMapped] [NotMapped]
public bool IsBot => NetworkId == Name.GenerateGuidFromString(); public bool IsBot => NetworkId == Name.GenerateGuidFromString();
[NotMapped]
public string XuidString => (NetworkId + 0x110000100000000).ToString("x");
[NotMapped]
public string GuidString => NetworkId.ToString("x");
[NotMapped] [NotMapped]
public ClientState State { get; set; } public ClientState State { get; set; }

View File

@ -24,11 +24,14 @@ namespace WebfrontCore.Controllers
{ {
if (fileName.EndsWith(".css")) if (fileName.EndsWith(".css"))
{ {
#if DEBUG if (Utilities.IsDevelopment)
string cssData = await System.IO.File.ReadAllTextAsync($"X:\\IW4MAdmin\\WebfrontCore\\wwwroot\\css\\{fileName}"); {
cssData = await Manager.MiddlewareActionHandler.Execute(cssData, "custom_css_accent"); var path = Path.Join(Utilities.OperatingDirectory, "..", "..", "..", "..", "WebfrontCore", "wwwroot", "css", fileName);
return Content(cssData, "text/css"); string cssData = await System.IO.File.ReadAllTextAsync(path);
#endif cssData = await Manager.MiddlewareActionHandler.Execute(cssData, "custom_css_accent");
return Content(cssData, "text/css");
}
if (!_fileCache.ContainsKey(fileName)) if (!_fileCache.ContainsKey(fileName))
{ {

View File

@ -2,12 +2,7 @@ trigger:
batch: true batch: true
branches: branches:
include: include:
- releases/* - release/pre
- 2.4-pr
paths:
exclude:
- azure-pipelines.yml
- Master/*
pr: none pr: none