Clean up some old files
This commit is contained in:
parent
68f6be23a6
commit
2542b7de12
@ -6,7 +6,7 @@
|
||||
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
|
||||
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
||||
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
||||
<Version>2.2.7.7</Version>
|
||||
<Version>2.2.8.1</Version>
|
||||
<Authors>RaidMax</Authors>
|
||||
<Company>Forever None</Company>
|
||||
<Product>IW4MAdmin</Product>
|
||||
@ -32,8 +32,8 @@
|
||||
<PropertyGroup>
|
||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||
<TieredCompilation>true</TieredCompilation>
|
||||
<AssemblyVersion>2.2.7.7</AssemblyVersion>
|
||||
<FileVersion>2.2.7.7</FileVersion>
|
||||
<AssemblyVersion>2.2.8.1</AssemblyVersion>
|
||||
<FileVersion>2.2.8.1</FileVersion>
|
||||
<LangVersion>7.1</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -45,7 +45,6 @@ namespace IW4MAdmin.Application
|
||||
public string ExternalIPAddress { get; private set; }
|
||||
public bool IsRestartRequested { get; private set; }
|
||||
static ApplicationManager Instance;
|
||||
private readonly List<AsyncStatus> _taskStatuses;
|
||||
List<Command> Commands;
|
||||
readonly List<MessageToken> MessageTokens;
|
||||
ClientService ClientSvc;
|
||||
@ -64,7 +63,6 @@ namespace IW4MAdmin.Application
|
||||
{
|
||||
_servers = new ConcurrentBag<Server>();
|
||||
Commands = new List<Command>();
|
||||
_taskStatuses = new List<AsyncStatus>();
|
||||
MessageTokens = new List<MessageToken>();
|
||||
ClientSvc = new ClientService();
|
||||
AliasSvc = new AliasService();
|
||||
|
@ -14,9 +14,8 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
||||
{
|
||||
float X = vector.X >= 0 ? vector.X : 360.0f + vector.X;
|
||||
float Y = vector.Y >= 0 ? vector.Y : 360.0f + vector.Y;
|
||||
float Z = vector.Z >= 0 ? vector.Z : 360.0f + vector.Z;
|
||||
|
||||
return new Vector3(Y, X, Z);
|
||||
return new Vector3(Y, X, vector.Z);
|
||||
}
|
||||
|
||||
public static float ToRadians(this float value) => (float)Math.PI * value / 180.0f;
|
||||
|
@ -1,70 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using SharedLibraryCore.Helpers;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace IW4MAdmin.Plugins.Stats
|
||||
{
|
||||
public class MinimapInfo
|
||||
{
|
||||
public string MapName { get; set; }
|
||||
// distance from the edge of the minimap image
|
||||
// to the "playable" area
|
||||
public int Top { get; set; }
|
||||
public int Bottom { get; set; }
|
||||
public int Left { get; set; }
|
||||
public int Right { get; set; }
|
||||
// maximum coordinate values for the map
|
||||
public int MaxTop { get; set; }
|
||||
public int MaxBottom { get; set; }
|
||||
public int MaxLeft { get; set; }
|
||||
public int MaxRight { get; set; }
|
||||
|
||||
public int Width => MaxLeft - MaxRight;
|
||||
public int Height => MaxTop - MaxBottom;
|
||||
}
|
||||
|
||||
public class MinimapConfig : Serialize<MinimapConfig>
|
||||
{
|
||||
public List<MinimapInfo> MapInfo;
|
||||
|
||||
public static MinimapConfig IW4Minimaps()
|
||||
{
|
||||
return new MinimapConfig()
|
||||
{
|
||||
MapInfo = new List<MinimapInfo>()
|
||||
{
|
||||
new MinimapInfo()
|
||||
{
|
||||
MapName = "mp_terminal",
|
||||
Top = 85,
|
||||
Bottom = 89,
|
||||
Left = 7,
|
||||
Right = 6,
|
||||
MaxTop = 2929,
|
||||
MaxBottom = -513,
|
||||
MaxLeft = 7520,
|
||||
MaxRight = 2447
|
||||
},
|
||||
|
||||
new MinimapInfo()
|
||||
{
|
||||
MapName = "mp_rust",
|
||||
Top = 122,
|
||||
Bottom = 104,
|
||||
Left = 155,
|
||||
Right = 82,
|
||||
MaxRight = -225,
|
||||
MaxLeft = 1809,
|
||||
MaxTop = 1641,
|
||||
MaxBottom = -469
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
@ -15,8 +15,8 @@
|
||||
string[] getLinkedPropertyName(System.Reflection.PropertyInfo info)
|
||||
{
|
||||
var test = (info.GetCustomAttributes(false)
|
||||
.Where(_attr => _attr.GetType() == typeof(ConfiguratinLinked))
|
||||
.FirstOrDefault() as ConfiguratinLinked);
|
||||
.Where(_attr => _attr.GetType() == typeof(ConfigurationLinked))
|
||||
.FirstOrDefault() as ConfigurationLinked);
|
||||
|
||||
return test?.LinkedPropertyNames ?? new string[0];
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ init()
|
||||
{
|
||||
SetDvarIfUninitialized("sv_customcallbacks", true);
|
||||
SetDvarIfUninitialized("sv_framewaittime", 0.05);
|
||||
SetDvarIfUninitialized("sv_additionalwaittime", 0.05);
|
||||
SetDvarIfUninitialized("sv_maxstoredframes", 3);
|
||||
SetDvarIfUninitialized("sv_additionalwaittime", 0.1);
|
||||
SetDvarIfUninitialized("sv_maxstoredframes", 4);
|
||||
|
||||
level thread onPlayerConnect();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user