mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
Clean up some old files
This commit is contained in:
@ -10,7 +10,7 @@ namespace SharedLibraryCore.Configuration
|
||||
{
|
||||
|
||||
[LocalizedDisplayName("SETUP_ENABLE_WEBFRONT")]
|
||||
[ConfiguratinLinked("WebfrontBindUrl", "ManualWebfrontUrl")]
|
||||
[ConfigurationLinked("WebfrontBindUrl", "ManualWebfrontUrl")]
|
||||
public bool EnableWebFront { get; set; }
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_BIND_URL")]
|
||||
public string WebfrontBindUrl { get; set; }
|
||||
@ -27,14 +27,14 @@ namespace SharedLibraryCore.Configuration
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_IGNORE_BOTS")]
|
||||
public bool IgnoreBots { get; set; }
|
||||
|
||||
[ConfiguratinLinked("CustomSayName")]
|
||||
[ConfigurationLinked("CustomSayName")]
|
||||
[LocalizedDisplayName("SETUP_ENABLE_CUSTOMSAY")]
|
||||
public bool EnableCustomSayName { get; set; }
|
||||
[LocalizedDisplayName("SETUP_SAY_NAME")]
|
||||
public string CustomSayName { get; set; }
|
||||
|
||||
[LocalizedDisplayName("SETUP_DISPLAY_SOCIAL")]
|
||||
[ConfiguratinLinked("SocialLinkAddress", "SocialLinkTitle")]
|
||||
[ConfigurationLinked("SocialLinkAddress", "SocialLinkTitle")]
|
||||
public bool EnableSocialLink { get; set; }
|
||||
[LocalizedDisplayName("SETUP_SOCIAL_LINK")]
|
||||
public string SocialLinkAddress { get; set; }
|
||||
@ -42,19 +42,19 @@ namespace SharedLibraryCore.Configuration
|
||||
public string SocialLinkTitle { get; set; }
|
||||
|
||||
[LocalizedDisplayName("SETUP_USE_CUSTOMENCODING")]
|
||||
[ConfiguratinLinked("CustomParserEncoding")]
|
||||
[ConfigurationLinked("CustomParserEncoding")]
|
||||
public bool EnableCustomParserEncoding { get; set; }
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_ENCODING")]
|
||||
public string CustomParserEncoding { get; set; }
|
||||
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_ENABLE_WHITELIST")]
|
||||
[ConfiguratinLinked("WebfrontConnectionWhitelist")]
|
||||
[ConfigurationLinked("WebfrontConnectionWhitelist")]
|
||||
public bool EnableWebfrontConnectionWhitelist { get; set; }
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_WHITELIST_LIST")]
|
||||
public List<string> WebfrontConnectionWhitelist { get; set; }
|
||||
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_CUSTOM_LOCALE")]
|
||||
[ConfiguratinLinked("CustomLocale")]
|
||||
[ConfigurationLinked("CustomLocale")]
|
||||
public bool EnableCustomLocale { get; set; }
|
||||
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_CUSTOM_LOCALE")]
|
||||
public string CustomLocale { get; set; }
|
||||
|
@ -3,11 +3,11 @@
|
||||
namespace SharedLibraryCore.Configuration.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property, Inherited = false)]
|
||||
public class ConfiguratinLinked : Attribute
|
||||
public class ConfigurationLinked : Attribute
|
||||
{
|
||||
public string[] LinkedPropertyNames { get; set; }
|
||||
|
||||
public ConfiguratinLinked(params string[] linkedPropertyNames)
|
||||
public ConfigurationLinked(params string[] linkedPropertyNames)
|
||||
{
|
||||
LinkedPropertyNames = linkedPropertyNames;
|
||||
}
|
@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace SharedLibraryCore.Database.Models
|
||||
{
|
||||
public partial class EFAlias : SharedEntity
|
||||
public partial class EFAlias
|
||||
{
|
||||
[Key]
|
||||
public int AliasId { get; set; }
|
||||
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharedLibraryCore.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// represents change from one value to another
|
||||
/// </summary>
|
||||
class Change
|
||||
{
|
||||
/// <summary>
|
||||
/// represents the previous value of the item
|
||||
/// </summary>
|
||||
public string PreviousValue { get; set; }
|
||||
/// <summary>
|
||||
/// represents the new/current value of the item
|
||||
/// </summary>
|
||||
public string NewValue { get; set; }
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Helpers
|
||||
{
|
||||
public sealed class AsyncStatus
|
||||
{
|
||||
DateTime StartTime;
|
||||
int TimesRun;
|
||||
int UpdateFrequency;
|
||||
public double RunAverage { get; private set; }
|
||||
public object Dependant { get; private set; }
|
||||
public Task RequestedTask { get; private set; }
|
||||
public CancellationTokenSource TokenSrc { get; private set; }
|
||||
|
||||
public AsyncStatus(object dependant, int frequency)
|
||||
{
|
||||
TokenSrc = new CancellationTokenSource();
|
||||
StartTime = DateTime.Now;
|
||||
Dependant = dependant;
|
||||
UpdateFrequency = frequency;
|
||||
// technically 0 but it's faster than checking for division by 0
|
||||
TimesRun = 1;
|
||||
}
|
||||
|
||||
public CancellationToken GetToken()
|
||||
{
|
||||
return TokenSrc.Token;
|
||||
}
|
||||
|
||||
public double ElapsedMillisecondsTime()
|
||||
{
|
||||
return (DateTime.Now - StartTime).TotalMilliseconds;
|
||||
}
|
||||
|
||||
public void Update(Task<bool> T)
|
||||
{
|
||||
// reset the token source
|
||||
TokenSrc.Dispose();
|
||||
TokenSrc = new CancellationTokenSource();
|
||||
|
||||
RequestedTask = T;
|
||||
// Console.WriteLine($"Starting Task {T.Id} ");
|
||||
RequestedTask.Start();
|
||||
|
||||
if (TimesRun > 25)
|
||||
TimesRun = 1;
|
||||
|
||||
RunAverage = RunAverage + ((DateTime.Now - StartTime).TotalMilliseconds - RunAverage - UpdateFrequency) / TimesRun;
|
||||
StartTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public void Abort()
|
||||
{
|
||||
RequestedTask = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
interface ISerializable<T>
|
||||
{
|
||||
void Write();
|
||||
}
|
||||
|
||||
public class Serialize<T> : ISerializable<T>
|
||||
{
|
||||
public static T Read(string filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
string configText = File.ReadAllText(filename);
|
||||
return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(configText);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exceptions.SerializeException($"Could not deserialize file {filename}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public void Write()
|
||||
{
|
||||
try
|
||||
{
|
||||
string configText = Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
File.WriteAllText(Filename(), configText);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exceptions.SerializeException($"Could not serialize file {Filename()}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void Write(string filename, T data)
|
||||
{
|
||||
try
|
||||
{
|
||||
string configText = Newtonsoft.Json.JsonConvert.SerializeObject(data, Newtonsoft.Json.Formatting.Indented);
|
||||
File.WriteAllText(filename, configText);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exceptions.SerializeException($"Could not serialize file {filename}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string Filename() { return ToString(); }
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
namespace SharedLibraryCore.Database.Models
|
||||
{
|
||||
public partial class EFAlias
|
||||
public partial class EFAlias : SharedEntity
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace SharedLibraryCore.RCon
|
||||
/// </summary>
|
||||
public static readonly int FloodProtectionInterval = 650;
|
||||
/// <summary>
|
||||
/// how mant failed connection attempts before aborting connection
|
||||
/// how many failed connection attempts before aborting connection
|
||||
/// </summary>
|
||||
public static readonly int AllowedConnectionFails = 3;
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ namespace SharedLibraryCore
|
||||
/// <returns></returns>
|
||||
public static PenaltyType[] LinkedPenaltyTypes()
|
||||
{
|
||||
return new PenaltyType[]
|
||||
return new[]
|
||||
{
|
||||
PenaltyType.Ban,
|
||||
PenaltyType.Unban,
|
||||
|
Reference in New Issue
Block a user