a ton of stuff and fix migations
This commit is contained in:
parent
0f9d2e92e1
commit
5d93e7ac57
@ -23,20 +23,6 @@ namespace IW4MAdmin.Application
|
|||||||
|
|
||||||
public void AddEvent(GameEvent gameEvent)
|
public void AddEvent(GameEvent gameEvent)
|
||||||
{
|
{
|
||||||
//IsProcessingEvent.Wait();
|
|
||||||
((Manager as ApplicationManager).OnServerEvent)(this, new GameEventArgs(null, false, gameEvent));
|
|
||||||
//IsProcessingEvent.Release(1);
|
|
||||||
//if (gameEvent.Type == GameEvent.EventType.Connect)
|
|
||||||
//{
|
|
||||||
// IsProcessingEvent.Wait();
|
|
||||||
// if (!gameEvent.OnProcessed.Wait(10 * 1000))
|
|
||||||
// {
|
|
||||||
// Manager.GetLogger().WriteError($"{Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_COMMAND_TIMEOUT"]} [{gameEvent.Id}, {gameEvent.Type}]");
|
|
||||||
// }
|
|
||||||
// IsProcessingEvent.Release(1);
|
|
||||||
//}
|
|
||||||
|
|
||||||
return;
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Manager.GetLogger().WriteDebug($"Got new event of type {gameEvent.Type} for {gameEvent.Owner} with id {gameEvent.Id}");
|
Manager.GetLogger().WriteDebug($"Got new event of type {gameEvent.Type} for {gameEvent.Owner} with id {gameEvent.Id}");
|
||||||
#endif
|
#endif
|
||||||
@ -61,40 +47,11 @@ namespace IW4MAdmin.Application
|
|||||||
// event occurs
|
// event occurs
|
||||||
if (gameEvent.Id == Interlocked.Read(ref NextEventId))
|
if (gameEvent.Id == Interlocked.Read(ref NextEventId))
|
||||||
{
|
{
|
||||||
//#if DEBUG == true
|
|
||||||
// Manager.GetLogger().WriteDebug($"sent event with id {gameEvent.Id} to be processed");
|
|
||||||
// IsProcessingEvent.Wait();
|
|
||||||
//#else
|
|
||||||
// if (GameEvent.IsEventTimeSensitive(gameEvent) &&
|
|
||||||
// !IsProcessingEvent.Wait(30 * 1000))
|
|
||||||
// {
|
|
||||||
// Manager.GetLogger().WriteError($"{Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_COMMAND_TIMEOUT"]} [{gameEvent.Id}, {gameEvent.Type}]");
|
|
||||||
// }
|
|
||||||
//#endif
|
|
||||||
((Manager as ApplicationManager).OnServerEvent)(this, new GameEventArgs(null, false, gameEvent));
|
((Manager as ApplicationManager).OnServerEvent)(this, new GameEventArgs(null, false, gameEvent));
|
||||||
|
#if DEBUG == true
|
||||||
//if (GameEvent.IsEventTimeSensitive(gameEvent))
|
Manager.GetLogger().WriteDebug($"notified event {gameEvent.Type} for {gameEvent.Owner} with id {gameEvent.Id}");
|
||||||
//{
|
#endif
|
||||||
// if( !gameEvent.OnProcessed.Wait(30 * 1000))
|
|
||||||
// {
|
|
||||||
// Manager.GetLogger().WriteError($"{Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_EVENT_TIMEOUT"]} [{gameEvent.Id}, {gameEvent.Type}]");
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
Interlocked.Increment(ref NextEventId);
|
Interlocked.Increment(ref NextEventId);
|
||||||
//#if DEBUG == true
|
|
||||||
// gameEvent.OnProcessed.Wait();
|
|
||||||
//#else
|
|
||||||
// if (GameEvent.IsEventTimeSensitive(gameEvent) &&
|
|
||||||
// !gameEvent.OnProcessed.Wait(30 * 1000))
|
|
||||||
// {
|
|
||||||
// Manager.GetLogger().WriteError($"{Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_EVENT_TIMEOUT"]} [{gameEvent.Id}, {gameEvent.Type}]");
|
|
||||||
// }
|
|
||||||
//#endif
|
|
||||||
// Interlocked.Increment(ref NextEventId);
|
|
||||||
// if (GameEvent.IsEventTimeSensitive(gameEvent))
|
|
||||||
// {
|
|
||||||
// IsProcessingEvent.Release();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// a "newer" event has been added before and "older" one has been added (due to threads and context switching)
|
// a "newer" event has been added before and "older" one has been added (due to threads and context switching)
|
||||||
|
@ -52,6 +52,7 @@ namespace IW4MAdmin.Application
|
|||||||
GameEventHandler Handler;
|
GameEventHandler Handler;
|
||||||
ManualResetEventSlim OnQuit;
|
ManualResetEventSlim OnQuit;
|
||||||
readonly IPageList PageList;
|
readonly IPageList PageList;
|
||||||
|
readonly SemaphoreSlim ProcessingEvent = new SemaphoreSlim(1, 1);
|
||||||
|
|
||||||
private ApplicationManager()
|
private ApplicationManager()
|
||||||
{
|
{
|
||||||
@ -74,6 +75,11 @@ namespace IW4MAdmin.Application
|
|||||||
|
|
||||||
private async void OnServerEventAsync(object sender, GameEventArgs args)
|
private async void OnServerEventAsync(object sender, GameEventArgs args)
|
||||||
{
|
{
|
||||||
|
//if (!await ProcessingEvent.WaitAsync(60000))
|
||||||
|
//{
|
||||||
|
// Logger.WriteWarning(Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_EVENT_TIMEOUT"]);
|
||||||
|
//}
|
||||||
|
|
||||||
var newEvent = args.Event;
|
var newEvent = args.Event;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -90,7 +96,7 @@ namespace IW4MAdmin.Application
|
|||||||
// offload it to the player to keep
|
// offload it to the player to keep
|
||||||
newEvent.Origin.DelayedEvents.Enqueue(newEvent);
|
newEvent.Origin.DelayedEvents.Enqueue(newEvent);
|
||||||
newEvent.OnProcessed.Set();
|
newEvent.OnProcessed.Set();
|
||||||
return;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the target client is not in an authorized state (detected by RCon) don't execute the event
|
// if the target client is not in an authorized state (detected by RCon) don't execute the event
|
||||||
@ -100,7 +106,7 @@ namespace IW4MAdmin.Application
|
|||||||
// offload it to the player to keep
|
// offload it to the player to keep
|
||||||
newEvent.Target.DelayedEvents.Enqueue(newEvent);
|
newEvent.Target.DelayedEvents.Enqueue(newEvent);
|
||||||
newEvent.OnProcessed.Set();
|
newEvent.OnProcessed.Set();
|
||||||
return;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
await newEvent.Owner.ExecuteEvent(newEvent);
|
await newEvent.Owner.ExecuteEvent(newEvent);
|
||||||
@ -140,7 +146,8 @@ namespace IW4MAdmin.Application
|
|||||||
if (e.Target == null)
|
if (e.Target == null)
|
||||||
{
|
{
|
||||||
Logger.WriteWarning($"Delayed event for {e.Origin} was removed because the target has left");
|
Logger.WriteWarning($"Delayed event for {e.Origin} was removed because the target has left");
|
||||||
continue;
|
// hack: don't do anything with the event because the target is invalid
|
||||||
|
e.Type = GameEvent.EventType.Unknown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger.WriteDebug($"Adding delayed event of type {e.Type} for {e.Origin} back for processing");
|
Logger.WriteDebug($"Adding delayed event of type {e.Type} for {e.Origin} back for processing");
|
||||||
@ -162,6 +169,7 @@ namespace IW4MAdmin.Application
|
|||||||
catch (NetworkException ex)
|
catch (NetworkException ex)
|
||||||
{
|
{
|
||||||
Logger.WriteError(ex.Message);
|
Logger.WriteError(ex.Message);
|
||||||
|
Logger.WriteDebug(ex.GetExceptionInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (ServerException ex)
|
catch (ServerException ex)
|
||||||
@ -172,9 +180,14 @@ namespace IW4MAdmin.Application
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteError($"{Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_EXCEPTION"]} {newEvent.Owner}");
|
Logger.WriteError($"{Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_EXCEPTION"]} {newEvent.Owner}");
|
||||||
Logger.WriteDebug("Error Message: " + ex.Message);
|
Logger.WriteDebug(ex.GetExceptionInfo());
|
||||||
Logger.WriteDebug("Error Trace: " + ex.StackTrace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
|
//if (ProcessingEvent.CurrentCount < 1)
|
||||||
|
//{
|
||||||
|
// ProcessingEvent.Release(1);
|
||||||
|
//}
|
||||||
// tell anyone waiting for the output that we're done
|
// tell anyone waiting for the output that we're done
|
||||||
newEvent.OnProcessed.Set();
|
newEvent.OnProcessed.Set();
|
||||||
|
|
||||||
@ -239,8 +252,7 @@ namespace IW4MAdmin.Application
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.WriteWarning($"Failed to update status for {server}");
|
Logger.WriteWarning($"Failed to update status for {server}");
|
||||||
Logger.WriteDebug($"Exception: {e.Message}");
|
Logger.WriteDebug(e.GetExceptionInfo());
|
||||||
Logger.WriteDebug($"StackTrace: {e.StackTrace}");
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -256,6 +268,9 @@ namespace IW4MAdmin.Application
|
|||||||
await Task.Delay(ConfigHandler.Configuration().RConPollRate);
|
await Task.Delay(ConfigHandler.Configuration().RConPollRate);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// trigger the event processing loop to end
|
||||||
|
SetHasEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Init()
|
public async Task Init()
|
||||||
@ -263,7 +278,7 @@ namespace IW4MAdmin.Application
|
|||||||
Running = true;
|
Running = true;
|
||||||
|
|
||||||
#region DATABASE
|
#region DATABASE
|
||||||
using (var db = new DatabaseContext(GetApplicationSettings().Configuration()?.ConnectionString))
|
using (var db = new DatabaseContext(GetApplicationSettings().Configuration()?.ConnectionString, GetApplicationSettings().Configuration().DatabaseProvider))
|
||||||
{
|
{
|
||||||
await new ContextSeed(db).Seed();
|
await new ContextSeed(db).Seed();
|
||||||
}
|
}
|
||||||
@ -340,7 +355,7 @@ namespace IW4MAdmin.Application
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(config.WebfrontBindUrl))
|
if (string.IsNullOrEmpty(config.WebfrontBindUrl))
|
||||||
{
|
{
|
||||||
config.WebfrontBindUrl = "http://127.0.0.1:1624";
|
config.WebfrontBindUrl = "http://0.0.0.0:1624";
|
||||||
await ConfigHandler.Save();
|
await ConfigHandler.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,13 +547,11 @@ namespace IW4MAdmin.Application
|
|||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
// this needs to be run seperately from the main thread
|
// this needs to be run seperately from the main thread
|
||||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
// start heartbeat
|
// start heartbeat
|
||||||
Task.Run(() => SendHeartbeat(new HeartbeatState()));
|
var _ = Task.Run(() => SendHeartbeat(new HeartbeatState()));
|
||||||
#endif
|
#endif
|
||||||
Task.Run(() => UpdateServerStates());
|
_ = Task.Run(() => UpdateServerStates());
|
||||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
|
|
||||||
while (Running)
|
while (Running)
|
||||||
{
|
{
|
||||||
@ -551,9 +564,6 @@ namespace IW4MAdmin.Application
|
|||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
Running = false;
|
Running = false;
|
||||||
|
|
||||||
// trigger the event processing loop to end
|
|
||||||
SetHasEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ILogger GetLogger()
|
public ILogger GetLogger()
|
||||||
@ -566,15 +576,7 @@ namespace IW4MAdmin.Application
|
|||||||
return MessageTokens;
|
return MessageTokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<Player> GetActiveClients()
|
public IList<Player> GetActiveClients() => _servers.SelectMany(s => s.Players).Where(p => p != null).ToList();
|
||||||
{
|
|
||||||
var ActiveClients = new List<Player>();
|
|
||||||
|
|
||||||
foreach (var server in _servers)
|
|
||||||
ActiveClients.AddRange(server.Players.Where(p => p != null));
|
|
||||||
|
|
||||||
return ActiveClients;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientService GetClientService() => ClientSvc;
|
public ClientService GetClientService() => ClientSvc;
|
||||||
public AliasService GetAliasService() => AliasSvc;
|
public AliasService GetAliasService() => AliasSvc;
|
||||||
|
@ -286,7 +286,10 @@ namespace IW4MAdmin
|
|||||||
public override async Task ExecuteEvent(GameEvent E)
|
public override async Task ExecuteEvent(GameEvent E)
|
||||||
{
|
{
|
||||||
bool canExecuteCommand = true;
|
bool canExecuteCommand = true;
|
||||||
await ProcessEvent(E);
|
if (!await ProcessEvent(E))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Command C = null;
|
Command C = null;
|
||||||
if (E.Type == GameEvent.EventType.Command)
|
if (E.Type == GameEvent.EventType.Command)
|
||||||
@ -321,13 +324,7 @@ namespace IW4MAdmin
|
|||||||
catch (Exception Except)
|
catch (Exception Except)
|
||||||
{
|
{
|
||||||
Logger.WriteError($"{loc["SERVER_PLUGIN_ERROR"]} [{plugin.Name}]");
|
Logger.WriteError($"{loc["SERVER_PLUGIN_ERROR"]} [{plugin.Name}]");
|
||||||
Logger.WriteDebug(String.Format("Error Message: {0}", Except.Message));
|
Logger.WriteDebug(Except.GetExceptionInfo());
|
||||||
Logger.WriteDebug(String.Format("Error Trace: {0}", Except.StackTrace));
|
|
||||||
while (Except.InnerException != null)
|
|
||||||
{
|
|
||||||
Except = Except.InnerException;
|
|
||||||
Logger.WriteDebug($"Inner exception: {Except.Message}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,7 +343,7 @@ namespace IW4MAdmin
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="E"></param>
|
/// <param name="E"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
override protected async Task ProcessEvent(GameEvent E)
|
override protected async Task<bool> ProcessEvent(GameEvent E)
|
||||||
{
|
{
|
||||||
if (E.Type == GameEvent.EventType.Connect)
|
if (E.Type == GameEvent.EventType.Connect)
|
||||||
{
|
{
|
||||||
@ -355,7 +352,8 @@ namespace IW4MAdmin
|
|||||||
if (!await AddPlayer(E.Origin))
|
if (!await AddPlayer(E.Origin))
|
||||||
{
|
{
|
||||||
E.Origin.State = Player.ClientState.Connecting;
|
E.Origin.State = Player.ClientState.Connecting;
|
||||||
throw new ServerException("client didn't pass authentication, so we are discontinuing event");
|
Logger.WriteDebug("client didn't pass authentication, so we are discontinuing event");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
// hack: makes the event propgate with the correct info
|
// hack: makes the event propgate with the correct info
|
||||||
E.Origin = Players[E.Origin.ClientNumber];
|
E.Origin = Players[E.Origin.ClientNumber];
|
||||||
@ -505,6 +503,8 @@ namespace IW4MAdmin
|
|||||||
// so there will still be at least 1 client left
|
// so there will still be at least 1 client left
|
||||||
if (ClientNum < 2)
|
if (ClientNum < 2)
|
||||||
ChatHistory.Clear();
|
ChatHistory.Clear();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -558,8 +558,8 @@ namespace IW4MAdmin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only check every 2 minutes if the server doesn't seem to be responding
|
// only check every 2 minutes if the server doesn't seem to be responding
|
||||||
if ((DateTime.Now - LastPoll).TotalMinutes < 2 && ConnectionErrors >= 1)
|
/* if ((DateTime.Now - LastPoll).TotalMinutes < 0.5 && ConnectionErrors >= 1)
|
||||||
return true;
|
return true;*/
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -683,6 +683,7 @@ namespace IW4MAdmin
|
|||||||
if (e is NetworkException)
|
if (e is NetworkException)
|
||||||
{
|
{
|
||||||
Logger.WriteError($"{loc["SERVER_ERROR_COMMUNICATION"]} {IP}:{Port}");
|
Logger.WriteError($"{loc["SERVER_ERROR_COMMUNICATION"]} {IP}:{Port}");
|
||||||
|
Logger.WriteDebug(e.GetExceptionInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -691,8 +692,7 @@ namespace IW4MAdmin
|
|||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
Logger.WriteError($"{loc["SERVER_ERROR_EXCEPTION"]} {IP}:{Port}");
|
Logger.WriteError($"{loc["SERVER_ERROR_EXCEPTION"]} {IP}:{Port}");
|
||||||
Logger.WriteDebug("Error Message: " + E.Message);
|
Logger.WriteDebug(E.GetExceptionInfo());
|
||||||
Logger.WriteDebug("Error Trace: " + E.StackTrace);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -811,7 +811,7 @@ namespace IW4MAdmin
|
|||||||
Logger.WriteError($"{logPath} {loc["SERVER_ERROR_DNE"]}");
|
Logger.WriteError($"{logPath} {loc["SERVER_ERROR_DNE"]}");
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
throw new ServerException($"{loc["SERVER_ERROR_LOG"]} {logPath}");
|
throw new ServerException($"{loc["SERVER_ERROR_LOG"]} {logPath}");
|
||||||
#else
|
//#else
|
||||||
LogEvent = new GameLogEventDetection(this, logPath, logfile.Value);
|
LogEvent = new GameLogEventDetection(this, logPath, logfile.Value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ class LogReader(object):
|
|||||||
# (if the file changes more than this, ignore ) - 1 MB
|
# (if the file changes more than this, ignore ) - 1 MB
|
||||||
self.max_file_size_change = 1000000
|
self.max_file_size_change = 1000000
|
||||||
# (if the time between checks is greater, ignore ) - 5 minutes
|
# (if the time between checks is greater, ignore ) - 5 minutes
|
||||||
self.max_file_time_change = 300
|
self.max_file_time_change = 1000
|
||||||
|
|
||||||
def read_file(self, path):
|
def read_file(self, path):
|
||||||
# prevent traversing directories
|
# prevent traversing directories
|
||||||
|
@ -16,9 +16,9 @@ namespace IW4MAdmin.Plugins.ProfanityDeterment
|
|||||||
{
|
{
|
||||||
OffensiveWords = new List<string>()
|
OffensiveWords = new List<string>()
|
||||||
{
|
{
|
||||||
"nigger",
|
@"\s*n+.*i+.*g+.*e+.*r+\s*",
|
||||||
"nigga",
|
@"\s*n+.*i+.*g+.*a+\s*",
|
||||||
"fuck"
|
@"\s*f+u+.*c+.*k+.*\s*"
|
||||||
};
|
};
|
||||||
|
|
||||||
var loc = Utilities.CurrentLocalization.LocalizationIndex;
|
var loc = Utilities.CurrentLocalization.LocalizationIndex;
|
||||||
|
@ -139,8 +139,11 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// flag
|
// flag
|
||||||
if (currentStrain > Thresholds.MaxStrainFlag
|
if (
|
||||||
&& HitCount >= 10)
|
#if DEBUG == false
|
||||||
|
currentStrain > Thresholds.MaxStrainFlag &&
|
||||||
|
#endif
|
||||||
|
HitCount >= 10)
|
||||||
{
|
{
|
||||||
result = new DetectionPenaltyResult()
|
result = new DetectionPenaltyResult()
|
||||||
{
|
{
|
||||||
@ -356,7 +359,6 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
|
|||||||
|
|
||||||
Tracker.OnChange(new EFACSnapshot()
|
Tracker.OnChange(new EFACSnapshot()
|
||||||
{
|
{
|
||||||
Active = true,
|
|
||||||
When = kill.When,
|
When = kill.When,
|
||||||
ClientId = ClientStats.ClientId,
|
ClientId = ClientStats.ClientId,
|
||||||
SessionAngleOffset = AngleDifferenceAverage,
|
SessionAngleOffset = AngleDifferenceAverage,
|
||||||
@ -366,7 +368,9 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
|
|||||||
Hits = HitCount,
|
Hits = HitCount,
|
||||||
Kills = Kills,
|
Kills = Kills,
|
||||||
Deaths = ClientStats.SessionDeaths,
|
Deaths = ClientStats.SessionDeaths,
|
||||||
|
HitDestinationId = kill.DeathOrigin.Vector3Id,
|
||||||
HitDestination = kill.DeathOrigin,
|
HitDestination = kill.DeathOrigin,
|
||||||
|
HitOriginId = kill.KillOrigin.Vector3Id,
|
||||||
HitOrigin = kill.KillOrigin,
|
HitOrigin = kill.KillOrigin,
|
||||||
EloRating = ClientStats.EloRating,
|
EloRating = ClientStats.EloRating,
|
||||||
HitLocation = kill.HitLoc,
|
HitLocation = kill.HitLoc,
|
||||||
|
@ -23,12 +23,9 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
|||||||
$"^5--{Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_COMMANDS_TOP_TEXT"]}--"
|
$"^5--{Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_COMMANDS_TOP_TEXT"]}--"
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var db = new DatabaseContext())
|
using (var db = new DatabaseContext(true))
|
||||||
{
|
{
|
||||||
db.ChangeTracker.AutoDetectChangesEnabled = false;
|
var fifteenDaysAgo = DateTime.UtcNow.AddDays(-15);
|
||||||
db.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
|
||||||
|
|
||||||
var thirtyDaysAgo = DateTime.UtcNow.AddMonths(-1);
|
|
||||||
|
|
||||||
var iqStats = (from stats in db.Set<EFClientStatistics>()
|
var iqStats = (from stats in db.Set<EFClientStatistics>()
|
||||||
join client in db.Clients
|
join client in db.Clients
|
||||||
@ -36,9 +33,9 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
|||||||
join alias in db.Aliases
|
join alias in db.Aliases
|
||||||
on client.CurrentAliasId equals alias.AliasId
|
on client.CurrentAliasId equals alias.AliasId
|
||||||
where stats.ServerId == serverId
|
where stats.ServerId == serverId
|
||||||
where stats.TimePlayed >= 3600
|
where stats.TimePlayed >= Plugin.Config.Configuration().TopPlayersMinPlayTime
|
||||||
where client.Level != Player.Permission.Banned
|
where client.Level != Player.Permission.Banned
|
||||||
where client.LastConnection >= thirtyDaysAgo
|
where client.LastConnection >= fifteenDaysAgo
|
||||||
orderby stats.Performance descending
|
orderby stats.Performance descending
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
@ -48,6 +45,10 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
|||||||
})
|
})
|
||||||
.Take(5);
|
.Take(5);
|
||||||
|
|
||||||
|
#if DEBUG == true
|
||||||
|
var statsSql = iqStats.ToSql();
|
||||||
|
#endif
|
||||||
|
|
||||||
var statsList = (await iqStats.ToListAsync())
|
var statsList = (await iqStats.ToListAsync())
|
||||||
.Select(stats => $"^3{stats.Name}^7 - ^5{stats.KDR} ^7{Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_TEXT_KDR"]} | ^5{stats.Performance} ^7{Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_COMMANDS_PERFORMANCE"]}");
|
.Select(stats => $"^3{stats.Name}^7 - ^5{stats.KDR} ^7{Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_TEXT_KDR"]} | ^5{stats.Performance} ^7{Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_COMMANDS_PERFORMANCE"]}");
|
||||||
|
|
||||||
@ -74,12 +75,18 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
|||||||
if (!E.Message.IsBroadcastCommand())
|
if (!E.Message.IsBroadcastCommand())
|
||||||
{
|
{
|
||||||
foreach (var stat in topStats)
|
foreach (var stat in topStats)
|
||||||
|
{
|
||||||
await E.Origin.Tell(stat);
|
await E.Origin.Tell(stat);
|
||||||
|
await Task.Delay(SharedLibraryCore.RCon.StaticHelpers.FloodProtectionInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var stat in topStats)
|
foreach (var stat in topStats)
|
||||||
|
{
|
||||||
await E.Owner.Broadcast(stat);
|
await E.Owner.Broadcast(stat);
|
||||||
|
await Task.Delay(SharedLibraryCore.RCon.StaticHelpers.FloodProtectionInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
|
|
||||||
public EFClientStatistics GetClientStats(int clientId, int serverId) => Servers[serverId].PlayerStats[clientId];
|
public EFClientStatistics GetClientStats(int clientId, int serverId) => Servers[serverId].PlayerStats[clientId];
|
||||||
|
|
||||||
public Expression<Func<EFRating, bool>> GetRankingFunc(int? serverId = null)
|
public static Expression<Func<EFRating, bool>> GetRankingFunc(int? serverId = null)
|
||||||
{
|
{
|
||||||
var fifteenDaysAgo = DateTime.UtcNow.AddDays(-15);
|
var fifteenDaysAgo = DateTime.UtcNow.AddDays(-15);
|
||||||
return (r) => r.ServerId == serverId &&
|
return (r) => r.ServerId == serverId &&
|
||||||
@ -52,7 +52,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
r.ActivityAmount >= Plugin.Config.Configuration().TopPlayersMinPlayTime;
|
r.ActivityAmount >= Plugin.Config.Configuration().TopPlayersMinPlayTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// gets a ranking across all servers for given client id
|
/// gets a ranking across all servers for given client id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -293,7 +292,18 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
Location = hl
|
Location = hl
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
//await statsSvc.ClientStatSvc.SaveChangesAsync();
|
await statsSvc.ClientStatSvc.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// adjusts for adding new hit location
|
||||||
|
if (clientStats.HitLocations.Count == 19)
|
||||||
|
{
|
||||||
|
clientStats.HitLocations.Add(new EFHitLocationCount()
|
||||||
|
{
|
||||||
|
Location = IW4Info.HitLocation.shield
|
||||||
|
});
|
||||||
|
|
||||||
|
await statsSvc.ClientStatSvc.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
// for stats before rating
|
// for stats before rating
|
||||||
@ -351,10 +361,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
// get individual client's stats
|
// get individual client's stats
|
||||||
var clientStats = playerStats[pl.ClientId];
|
var clientStats = playerStats[pl.ClientId];
|
||||||
|
|
||||||
#if DEBUG == true
|
|
||||||
await UpdateStatHistory(pl, clientStats);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// remove the client from the stats dictionary as they're leaving
|
// remove the client from the stats dictionary as they're leaving
|
||||||
playerStats.TryRemove(pl.ClientId, out EFClientStatistics removedValue3);
|
playerStats.TryRemove(pl.ClientId, out EFClientStatistics removedValue3);
|
||||||
detectionStats.TryRemove(pl.ClientId, out Cheat.Detection removedValue4);
|
detectionStats.TryRemove(pl.ClientId, out Cheat.Detection removedValue4);
|
||||||
@ -454,8 +460,8 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
AnglesList = snapshotAngles
|
AnglesList = snapshotAngles
|
||||||
};
|
};
|
||||||
|
|
||||||
if (hit.DeathType == IW4Info.MeansOfDeath.MOD_SUICIDE &&
|
if ((hit.DeathType == IW4Info.MeansOfDeath.MOD_SUICIDE &&
|
||||||
hit.Damage == 100000)
|
hit.Damage == 100000) || hit.HitLoc == IW4Info.HitLocation.shield)
|
||||||
{
|
{
|
||||||
// suicide by switching teams so let's not count it against them
|
// suicide by switching teams so let's not count it against them
|
||||||
return;
|
return;
|
||||||
@ -484,43 +490,49 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
clientStats.HitLocations.Single(hl => hl.Location == hit.HitLoc).HitCount += 1;
|
clientStats.HitLocations.Single(hl => hl.Location == hit.HitLoc).HitCount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Plugin.Config.Configuration().EnableAntiCheat)
|
using (var ctx = new DatabaseContext())
|
||||||
{
|
{
|
||||||
await ApplyPenalty(clientDetection.ProcessKill(hit, isDamage), clientDetection, attacker);
|
await OnProcessingPenalty.WaitAsync();
|
||||||
await ApplyPenalty(clientDetection.ProcessTotalRatio(clientStats), clientDetection, attacker);
|
|
||||||
|
|
||||||
await clientStatsSvc.SaveChangesAsync();
|
try
|
||||||
}
|
|
||||||
|
|
||||||
if (Plugin.Config.Configuration().StoreClientKills)
|
|
||||||
{
|
|
||||||
using (var ctx = new DatabaseContext())
|
|
||||||
{
|
{
|
||||||
ctx.Set<EFClientKill>().Add(hit);
|
if (Plugin.Config.Configuration().StoreClientKills)
|
||||||
|
{
|
||||||
|
ctx.Set<EFClientKill>().Add(hit);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Plugin.Config.Configuration().EnableAntiCheat)
|
||||||
|
{
|
||||||
|
await ApplyPenalty(clientDetection.ProcessKill(hit, isDamage), clientDetection, attacker, ctx);
|
||||||
|
await ApplyPenalty(clientDetection.ProcessTotalRatio(clientStats), clientDetection, attacker, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
await ctx.SaveChangesAsync();
|
await ctx.SaveChangesAsync();
|
||||||
|
await clientStatsSvc.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
OnProcessingPenalty.Release(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task ApplyPenalty(Cheat.DetectionPenaltyResult penalty, Cheat.Detection clientDetection, Player attacker)
|
async Task ApplyPenalty(Cheat.DetectionPenaltyResult penalty, Cheat.Detection clientDetection, Player attacker, DatabaseContext ctx)
|
||||||
{
|
{
|
||||||
try
|
switch (penalty.ClientPenalty)
|
||||||
{
|
{
|
||||||
switch (penalty.ClientPenalty)
|
case Penalty.PenaltyType.Ban:
|
||||||
{
|
if (attacker.Level == Player.Permission.Banned)
|
||||||
case Penalty.PenaltyType.Ban:
|
{
|
||||||
if (attacker.Level == Player.Permission.Banned)
|
break;
|
||||||
{
|
}
|
||||||
break;
|
await attacker.Ban(Utilities.CurrentLocalization.LocalizationIndex["PLUGIN_STATS_CHEAT_DETECTED"], new Player()
|
||||||
}
|
{
|
||||||
if (clientDetection.Tracker.HasChanges)
|
ClientId = 1,
|
||||||
{
|
AdministeredPenalties = new List<EFPenalty>()
|
||||||
await SaveTrackedSnapshots(clientDetection);
|
|
||||||
}
|
|
||||||
await attacker.Ban(Utilities.CurrentLocalization.LocalizationIndex["PLUGIN_STATS_CHEAT_DETECTED"], new Player()
|
|
||||||
{
|
|
||||||
ClientId = 1,
|
|
||||||
AdministeredPenalties = new List<EFPenalty>()
|
|
||||||
{
|
{
|
||||||
new EFPenalty()
|
new EFPenalty()
|
||||||
{
|
{
|
||||||
@ -529,71 +541,96 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
$"{penalty.Type}-{Math.Round(penalty.Value, 2)}@{penalty.HitCount}",
|
$"{penalty.Type}-{Math.Round(penalty.Value, 2)}@{penalty.HitCount}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (clientDetection.Tracker.HasChanges)
|
||||||
|
{
|
||||||
|
SaveTrackedSnapshots(clientDetection, ctx);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Penalty.PenaltyType.Flag:
|
||||||
|
if (attacker.Level != Player.Permission.User)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
case Penalty.PenaltyType.Flag:
|
}
|
||||||
if (attacker.Level != Player.Permission.User)
|
var e = new GameEvent()
|
||||||
|
{
|
||||||
|
Data = penalty.Type == Cheat.Detection.DetectionType.Bone ?
|
||||||
|
$"{penalty.Type}-{(int)penalty.Location}-{Math.Round(penalty.Value, 2)}@{penalty.HitCount}" :
|
||||||
|
$"{penalty.Type}-{Math.Round(penalty.Value, 2)}@{penalty.HitCount}",
|
||||||
|
Origin = new Player()
|
||||||
{
|
{
|
||||||
break;
|
ClientId = 1,
|
||||||
}
|
Level = Player.Permission.Console,
|
||||||
if (clientDetection.Tracker.HasChanges)
|
ClientNumber = -1,
|
||||||
{
|
CurrentServer = attacker.CurrentServer
|
||||||
await SaveTrackedSnapshots(clientDetection);
|
},
|
||||||
}
|
Target = attacker,
|
||||||
var e = new GameEvent()
|
Owner = attacker.CurrentServer,
|
||||||
{
|
Type = GameEvent.EventType.Flag
|
||||||
Data = penalty.Type == Cheat.Detection.DetectionType.Bone ?
|
};
|
||||||
$"{penalty.Type}-{(int)penalty.Location}-{Math.Round(penalty.Value, 2)}@{penalty.HitCount}" :
|
// because we created an event it must be processed by the manager
|
||||||
$"{penalty.Type}-{Math.Round(penalty.Value, 2)}@{penalty.HitCount}",
|
// even if it didn't really do anything
|
||||||
Origin = new Player()
|
Manager.GetEventHandler().AddEvent(e);
|
||||||
{
|
await new CFlag().ExecuteAsync(e);
|
||||||
ClientId = 1,
|
if (clientDetection.Tracker.HasChanges)
|
||||||
Level = Player.Permission.Console,
|
{
|
||||||
ClientNumber = -1,
|
SaveTrackedSnapshots(clientDetection, ctx);
|
||||||
CurrentServer = attacker.CurrentServer
|
}
|
||||||
},
|
break;
|
||||||
Target = attacker,
|
|
||||||
Owner = attacker.CurrentServer,
|
|
||||||
Type = GameEvent.EventType.Flag
|
|
||||||
};
|
|
||||||
// because we created an event it must be processed by the manager
|
|
||||||
// even if it didn't really do anything
|
|
||||||
Manager.GetEventHandler().AddEvent(e);
|
|
||||||
await new CFlag().ExecuteAsync(e);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task SaveTrackedSnapshots(Cheat.Detection clientDetection)
|
void SaveTrackedSnapshots(Cheat.Detection clientDetection, DatabaseContext ctx)
|
||||||
{
|
{
|
||||||
await OnProcessingPenalty.WaitAsync();
|
// todo: why does this cause duplicate primary key
|
||||||
|
var change = clientDetection.Tracker.GetNextChange();
|
||||||
using (var ctx = new DatabaseContext(true))
|
while ((change = clientDetection.Tracker.GetNextChange()) != default(EFACSnapshot))
|
||||||
{
|
{
|
||||||
// todo: why does this cause duplicate primary key
|
|
||||||
var change = clientDetection.Tracker.GetNextChange();
|
//if (change.HitOriginId == 0)
|
||||||
while ((change = clientDetection.Tracker.GetNextChange()) != default(EFACSnapshot))
|
//{
|
||||||
|
// change.HitOriginId = change.HitOrigin.Vector3Id;
|
||||||
|
// change.HitOrigin = null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (change.HitDestinationId == 0)
|
||||||
|
//{
|
||||||
|
// change.HitDestinationId = change.HitDestination.Vector3Id;
|
||||||
|
// change.HitDestination = null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (change.CurrentViewAngleId == 0)
|
||||||
|
//{
|
||||||
|
// change.CurrentViewAngleId = change.CurrentViewAngle.Vector3Id;
|
||||||
|
// change.CurrentViewAngle = null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (change.LastStrainAngleId == 0)
|
||||||
|
//{
|
||||||
|
// change.LastStrainAngleId = change.LastStrainAngle.Vector3Id;
|
||||||
|
// change.LastStrainAngle = null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
if (change.HitOrigin.Vector3Id > 0)
|
||||||
{
|
{
|
||||||
ctx.Add(change);
|
ctx.Attach(change.HitOrigin);
|
||||||
|
}
|
||||||
|
if (change.HitDestination.Vector3Id > 0)
|
||||||
|
{
|
||||||
|
ctx.Attach(change.HitDestination);
|
||||||
|
}
|
||||||
|
if (change.CurrentViewAngle.Vector3Id > 0)
|
||||||
|
{
|
||||||
|
ctx.Attach(change.CurrentViewAngle);
|
||||||
|
}
|
||||||
|
if (change.LastStrainAngle.Vector3Id > 0)
|
||||||
|
{
|
||||||
|
ctx.Attach(change.LastStrainAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
ctx.Add(change);
|
||||||
{
|
|
||||||
await ctx.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.WriteWarning(ex.GetExceptionInfo());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OnProcessingPenalty.Release(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task AddStandardKill(Player attacker, Player victim)
|
public async Task AddStandardKill(Player attacker, Player victim)
|
||||||
|
@ -65,6 +65,7 @@ namespace IW4MAdmin.Plugins.Stats
|
|||||||
right_foot,
|
right_foot,
|
||||||
left_foot,
|
left_foot,
|
||||||
gun,
|
gun,
|
||||||
|
shield
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WeaponName
|
public enum WeaponName
|
||||||
@ -1369,7 +1370,9 @@ namespace IW4MAdmin.Plugins.Stats
|
|||||||
dragunov_mp,
|
dragunov_mp,
|
||||||
cobra_player_minigun_mp,
|
cobra_player_minigun_mp,
|
||||||
destructible_car,
|
destructible_car,
|
||||||
sentry_minigun_mp
|
sentry_minigun_mp,
|
||||||
|
cobra_20mm_mp,
|
||||||
|
shield
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum MapName
|
public enum MapName
|
||||||
|
@ -30,10 +30,18 @@ namespace IW4MAdmin.Plugins.Stats.Models
|
|||||||
public double CurrentStrain { get; set; }
|
public double CurrentStrain { get; set; }
|
||||||
public double StrainAngleBetween { get; set; }
|
public double StrainAngleBetween { get; set; }
|
||||||
public double SessionAngleOffset { get; set; }
|
public double SessionAngleOffset { get; set; }
|
||||||
|
public int LastStrainAngleId { get; set; }
|
||||||
|
[ForeignKey("LastStrainAngleId")]
|
||||||
public Vector3 LastStrainAngle { get; set; }
|
public Vector3 LastStrainAngle { get; set; }
|
||||||
|
public int HitOriginId { get; set; }
|
||||||
|
[ForeignKey("HitOriginId")]
|
||||||
public Vector3 HitOrigin { get; set; }
|
public Vector3 HitOrigin { get; set; }
|
||||||
|
public int HitDestinationId { get; set; }
|
||||||
|
[ForeignKey("HitDestinationId")]
|
||||||
public Vector3 HitDestination { get; set; }
|
public Vector3 HitDestination { get; set; }
|
||||||
public double Distance { get; set; }
|
public double Distance { get; set; }
|
||||||
|
public int CurrentViewAngleId { get; set; }
|
||||||
|
[ForeignKey("CurrentViewAngleId")]
|
||||||
public Vector3 CurrentViewAngle { get; set; }
|
public Vector3 CurrentViewAngle { get; set; }
|
||||||
public IW4Info.WeaponName WeaponId { get; set; }
|
public IW4Info.WeaponName WeaponId { get; set; }
|
||||||
public IW4Info.HitLocation HitLocation { get; set; }
|
public IW4Info.HitLocation HitLocation { get; set; }
|
||||||
|
@ -18,6 +18,7 @@ namespace SharedLibraryCore.Configuration
|
|||||||
public string WebfrontBindUrl { get; set; }
|
public string WebfrontBindUrl { get; set; }
|
||||||
public string CustomParserEncoding { get; set; }
|
public string CustomParserEncoding { get; set; }
|
||||||
public string CustomLocale { get; set; }
|
public string CustomLocale { get; set; }
|
||||||
|
public string DatabaseProvider { get; set; } = "sqlite";
|
||||||
public string ConnectionString { get; set; }
|
public string ConnectionString { get; set; }
|
||||||
public int RConPollRate { get; set; } = 5000;
|
public int RConPollRate { get; set; } = 5000;
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
@ -10,6 +10,8 @@ using SharedLibraryCore.Interfaces;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Npgsql;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
namespace SharedLibraryCore.Database
|
namespace SharedLibraryCore.Database
|
||||||
{
|
{
|
||||||
@ -26,6 +28,7 @@ namespace SharedLibraryCore.Database
|
|||||||
/// this only works if there's one connection string
|
/// this only works if there's one connection string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static string _ConnectionString;
|
private static string _ConnectionString;
|
||||||
|
private static string _provider;
|
||||||
|
|
||||||
public DatabaseContext(DbContextOptions<DatabaseContext> opt) : base(opt) { }
|
public DatabaseContext(DbContextOptions<DatabaseContext> opt) : base(opt) { }
|
||||||
|
|
||||||
@ -41,9 +44,10 @@ namespace SharedLibraryCore.Database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DatabaseContext(string connStr)
|
public DatabaseContext(string connStr, string provider)
|
||||||
{
|
{
|
||||||
_ConnectionString = connStr;
|
_ConnectionString = connStr;
|
||||||
|
_provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
@ -59,13 +63,26 @@ namespace SharedLibraryCore.Database
|
|||||||
var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = $"{currentPath}{Path.DirectorySeparatorChar}Database.db".Substring(6) };
|
var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = $"{currentPath}{Path.DirectorySeparatorChar}Database.db".Substring(6) };
|
||||||
var connectionString = connectionStringBuilder.ToString();
|
var connectionString = connectionStringBuilder.ToString();
|
||||||
var connection = new SqliteConnection(connectionString);
|
var connection = new SqliteConnection(connectionString);
|
||||||
|
#if DEBUG == true
|
||||||
|
optionsBuilder.UseMySql("UserId=root;Password=dev;Host=127.0.0.1;port=3306;Database=IW4MAdmin");
|
||||||
|
// optionsBuilder.UseNpgsql("UserId=dev;Password=dev;Host=127.0.0.1;port=5432;Database=IW4MAdmin");
|
||||||
|
#else
|
||||||
optionsBuilder.UseSqlite(connection);
|
optionsBuilder.UseSqlite(connection);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
optionsBuilder.UseMySql(_ConnectionString);
|
switch (_provider)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case "mysql":
|
||||||
|
optionsBuilder.UseMySql(_ConnectionString);
|
||||||
|
break;
|
||||||
|
case "postgresql":
|
||||||
|
optionsBuilder.UseNpgsql(_ConnectionString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,13 +122,6 @@ namespace SharedLibraryCore.Database
|
|||||||
ent.HasIndex(a => a.Name);
|
ent.HasIndex(a => a.Name);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<EFChangeHistory>(ent =>
|
|
||||||
{
|
|
||||||
ent.Property(c => c.ChangeHistoryId)
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
|
||||||
});
|
|
||||||
|
|
||||||
// force full name for database conversion
|
// force full name for database conversion
|
||||||
modelBuilder.Entity<EFClient>().ToTable("EFClients");
|
modelBuilder.Entity<EFClient>().ToTable("EFClients");
|
||||||
modelBuilder.Entity<EFAlias>().ToTable("EFAlias");
|
modelBuilder.Entity<EFAlias>().ToTable("EFAlias");
|
||||||
@ -134,11 +144,11 @@ namespace SharedLibraryCore.Database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.Contains(".dll"));
|
directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.EndsWith(".dll"));
|
||||||
#if DEBUG == TRUE
|
#if DEBUG == TRUE
|
||||||
foreach (string dllPath in Directory.GetFiles(@"C:\Projects\IW4M-Admin\Application\bin\Debug\netcoreapp2.1\Plugins"))
|
foreach (string dllPath in Directory.GetFiles(@"C:\Projects\IW4M-Admin\Application\bin\Debug\netcoreapp2.1\Plugins").Where(f => f.EndsWith(".dll")))
|
||||||
#else
|
#else
|
||||||
foreach (string dllPath in directoryFiles)
|
foreach (string dllPath in directoryFiles)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Assembly library;
|
Assembly library;
|
||||||
|
@ -14,7 +14,8 @@ namespace SharedLibraryCore.Database.Models
|
|||||||
public enum ChangeType
|
public enum ChangeType
|
||||||
{
|
{
|
||||||
Permission,
|
Permission,
|
||||||
Ban
|
Ban,
|
||||||
|
Command
|
||||||
}
|
}
|
||||||
|
|
||||||
[Key]
|
[Key]
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using SharedLibraryCore.Database;
|
|
||||||
using SharedLibraryCore.Database.Models;
|
|
||||||
using SharedLibraryCore.Dtos;
|
using SharedLibraryCore.Dtos;
|
||||||
|
|
||||||
namespace SharedLibraryCore.Events
|
namespace SharedLibraryCore.Events
|
||||||
@ -10,7 +8,7 @@ namespace SharedLibraryCore.Events
|
|||||||
public class EventApi
|
public class EventApi
|
||||||
{
|
{
|
||||||
const int MaxEvents = 100;
|
const int MaxEvents = 100;
|
||||||
static Queue<EventInfo> RecentEvents = new Queue<EventInfo>();
|
static ConcurrentQueue<EventInfo> RecentEvents = new ConcurrentQueue<EventInfo>();
|
||||||
|
|
||||||
public static IEnumerable<EventInfo> GetEvents(bool shouldConsume)
|
public static IEnumerable<EventInfo> GetEvents(bool shouldConsume)
|
||||||
{
|
{
|
||||||
@ -75,7 +73,7 @@ namespace SharedLibraryCore.Events
|
|||||||
{
|
{
|
||||||
// remove the first added event
|
// remove the first added event
|
||||||
if (RecentEvents.Count >= MaxEvents)
|
if (RecentEvents.Count >= MaxEvents)
|
||||||
RecentEvents.Dequeue();
|
RecentEvents.TryDequeue(out _);
|
||||||
|
|
||||||
RecentEvents.Enqueue(info);
|
RecentEvents.Enqueue(info);
|
||||||
}
|
}
|
||||||
|
@ -160,14 +160,14 @@ namespace SharedLibraryCore
|
|||||||
public static bool ShouldOriginEventBeDelayed(GameEvent queuedEvent)
|
public static bool ShouldOriginEventBeDelayed(GameEvent queuedEvent)
|
||||||
{
|
{
|
||||||
return queuedEvent.Origin != null &&
|
return queuedEvent.Origin != null &&
|
||||||
queuedEvent.Origin.State != Player.ClientState.Connected &&
|
(queuedEvent.Origin.State != Player.ClientState.Connected &&
|
||||||
// we want to allow join and quit events
|
// we want to allow join and quit events
|
||||||
queuedEvent.Type != EventType.Connect &&
|
queuedEvent.Type != EventType.Connect &&
|
||||||
queuedEvent.Type != EventType.Join &&
|
queuedEvent.Type != EventType.Join &&
|
||||||
queuedEvent.Type != EventType.Quit &&
|
queuedEvent.Type != EventType.Quit &&
|
||||||
queuedEvent.Type != EventType.Disconnect &&
|
queuedEvent.Type != EventType.Disconnect &&
|
||||||
// we don't care about unknown events
|
// we don't care about unknown events
|
||||||
queuedEvent.Origin.NetworkId != 0;
|
queuedEvent.Origin.NetworkId != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -179,10 +179,8 @@ namespace SharedLibraryCore
|
|||||||
public static bool ShouldTargetEventBeDelayed(GameEvent queuedEvent)
|
public static bool ShouldTargetEventBeDelayed(GameEvent queuedEvent)
|
||||||
{
|
{
|
||||||
return queuedEvent.Target != null &&
|
return queuedEvent.Target != null &&
|
||||||
queuedEvent.Target.State != Player.ClientState.Connected &&
|
(queuedEvent.Target.State != Player.ClientState.Connected &&
|
||||||
queuedEvent.Target.NetworkId != 0;
|
queuedEvent.Target.NetworkId != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsEventTimeSensitive(GameEvent gameEvent) => gameEvent.Type == EventType.Connect;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,8 @@ namespace SharedLibraryCore.Migrations
|
|||||||
b.Property<int>("LinkId");
|
b.Property<int>("LinkId");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired();
|
.IsRequired()
|
||||||
|
.HasMaxLength(24);
|
||||||
|
|
||||||
b.HasKey("AliasId");
|
b.HasKey("AliasId");
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@ -13,7 +15,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
AliasLinkId = table.Column<int>(nullable: false)
|
AliasLinkId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false)
|
Active = table.Column<bool>(nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
@ -25,7 +29,10 @@ namespace SharedLibraryCore.Migrations
|
|||||||
name: "EFServers",
|
name: "EFServers",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ServerId = table.Column<int>(nullable: false),
|
ServerId = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
Port = table.Column<int>(nullable: false)
|
Port = table.Column<int>(nullable: false)
|
||||||
},
|
},
|
||||||
@ -39,7 +46,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Vector3Id = table.Column<int>(nullable: false)
|
Vector3Id = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
X = table.Column<float>(nullable: false),
|
X = table.Column<float>(nullable: false),
|
||||||
Y = table.Column<float>(nullable: false),
|
Y = table.Column<float>(nullable: false),
|
||||||
Z = table.Column<float>(nullable: false)
|
Z = table.Column<float>(nullable: false)
|
||||||
@ -54,12 +63,14 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
AliasId = table.Column<int>(nullable: false)
|
AliasId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
DateAdded = table.Column<DateTime>(nullable: false),
|
DateAdded = table.Column<DateTime>(nullable: false),
|
||||||
IPAddress = table.Column<int>(nullable: false),
|
IPAddress = table.Column<int>(nullable: false),
|
||||||
LinkId = table.Column<int>(nullable: false),
|
LinkId = table.Column<int>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: false)
|
Name = table.Column<string>(maxLength: 128, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -77,7 +88,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
StatisticId = table.Column<int>(nullable: false)
|
StatisticId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
ServerId = table.Column<int>(nullable: false),
|
ServerId = table.Column<int>(nullable: false),
|
||||||
TotalKills = table.Column<long>(nullable: false),
|
TotalKills = table.Column<long>(nullable: false),
|
||||||
@ -99,7 +112,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ClientId = table.Column<int>(nullable: false)
|
ClientId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
AliasLinkId = table.Column<int>(nullable: false),
|
AliasLinkId = table.Column<int>(nullable: false),
|
||||||
Connections = table.Column<int>(nullable: false),
|
Connections = table.Column<int>(nullable: false),
|
||||||
@ -135,7 +150,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
KillId = table.Column<long>(nullable: false)
|
KillId = table.Column<long>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true).
|
||||||
|
Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
AttackerId = table.Column<int>(nullable: false),
|
AttackerId = table.Column<int>(nullable: false),
|
||||||
Damage = table.Column<int>(nullable: false),
|
Damage = table.Column<int>(nullable: false),
|
||||||
@ -196,7 +213,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
MessageId = table.Column<long>(nullable: false)
|
MessageId = table.Column<long>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(nullable: false),
|
||||||
Message = table.Column<string>(nullable: true),
|
Message = table.Column<string>(nullable: true),
|
||||||
@ -255,7 +274,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
PenaltyId = table.Column<int>(nullable: false)
|
PenaltyId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
Expires = table.Column<DateTime>(nullable: false),
|
Expires = table.Column<DateTime>(nullable: false),
|
||||||
LinkId = table.Column<int>(nullable: false),
|
LinkId = table.Column<int>(nullable: false),
|
||||||
@ -293,7 +314,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
HitLocationCountId = table.Column<int>(nullable: false)
|
HitLocationCountId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true).
|
||||||
|
Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn).
|
||||||
|
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
EFClientStatistics_ClientId = table.Column<int>(nullable: false),
|
EFClientStatistics_ClientId = table.Column<int>(nullable: false),
|
||||||
HitCount = table.Column<int>(nullable: false),
|
HitCount = table.Column<int>(nullable: false),
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@ -18,7 +20,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
RatingHistoryId = table.Column<int>(nullable: false)
|
RatingHistoryId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
ClientId = table.Column<int>(nullable: false)
|
ClientId = table.Column<int>(nullable: false)
|
||||||
},
|
},
|
||||||
@ -38,7 +42,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
RatingId = table.Column<int>(nullable: false)
|
RatingId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
Newest = table.Column<bool>(nullable: false),
|
Newest = table.Column<bool>(nullable: false),
|
||||||
Performance = table.Column<double>(nullable: false),
|
Performance = table.Column<double>(nullable: false),
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@ -13,7 +15,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
MetaId = table.Column<int>(nullable: false)
|
MetaId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(nullable: false),
|
||||||
Created = table.Column<DateTime>(nullable: false),
|
Created = table.Column<DateTime>(nullable: false),
|
||||||
|
@ -34,7 +34,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@ -18,12 +20,14 @@ namespace SharedLibraryCore.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
SnapshotId = table.Column<int>(nullable: false)
|
SnapshotId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
Active = table.Column<bool>(nullable: false),
|
Active = table.Column<bool>(nullable: false),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(nullable: false),
|
||||||
CurrentSessionLength = table.Column<int>(nullable: false),
|
CurrentSessionLength = table.Column<int>(nullable: false),
|
||||||
CurrentStrain = table.Column<double>(nullable: false),
|
CurrentStrain = table.Column<double>(nullable: false),
|
||||||
CurrentViewAngleVector3Id = table.Column<int>(nullable: true),
|
CurrentViewAngleId = table.Column<int>(nullable: true),
|
||||||
Deaths = table.Column<int>(nullable: false),
|
Deaths = table.Column<int>(nullable: false),
|
||||||
Distance = table.Column<double>(nullable: false),
|
Distance = table.Column<double>(nullable: false),
|
||||||
EloRating = table.Column<double>(nullable: false),
|
EloRating = table.Column<double>(nullable: false),
|
||||||
@ -52,8 +56,8 @@ namespace SharedLibraryCore.Migrations
|
|||||||
principalColumn: "ClientId",
|
principalColumn: "ClientId",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_EFACSnapshot_Vector3_CurrentViewAngleVector3Id",
|
name: "FK_EFACSnapshot_Vector3_CurrentViewAngleId",
|
||||||
column: x => x.CurrentViewAngleVector3Id,
|
column: x => x.CurrentViewAngleId,
|
||||||
principalTable: "Vector3",
|
principalTable: "Vector3",
|
||||||
principalColumn: "Vector3Id",
|
principalColumn: "Vector3Id",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
@ -88,9 +92,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
column: "ClientId");
|
column: "ClientId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_EFACSnapshot_CurrentViewAngleVector3Id",
|
name: "IX_EFACSnapshot_CurrentViewAngleId",
|
||||||
table: "EFACSnapshot",
|
table: "EFACSnapshot",
|
||||||
column: "CurrentViewAngleVector3Id");
|
column: "CurrentViewAngleId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_EFACSnapshot_HitDestinationVector3Id",
|
name: "IX_EFACSnapshot_HitDestinationVector3Id",
|
||||||
@ -107,13 +111,16 @@ namespace SharedLibraryCore.Migrations
|
|||||||
table: "EFACSnapshot",
|
table: "EFACSnapshot",
|
||||||
column: "LastStrainAngleVector3Id");
|
column: "LastStrainAngleVector3Id");
|
||||||
|
|
||||||
/* migrationBuilder.AddForeignKey(
|
if (migrationBuilder.ActiveProvider != "Microsoft.EntityFrameworkCore.Sqlite")
|
||||||
|
{
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
name: "FK_Vector3_EFACSnapshot_EFACSnapshotSnapshotId",
|
name: "FK_Vector3_EFACSnapshot_EFACSnapshotSnapshotId",
|
||||||
table: "Vector3",
|
table: "Vector3",
|
||||||
column: "EFACSnapshotSnapshotId",
|
column: "EFACSnapshotSnapshotId",
|
||||||
principalTable: "EFACSnapshot",
|
principalTable: "EFACSnapshot",
|
||||||
principalColumn: "SnapshotId",
|
principalColumn: "SnapshotId",
|
||||||
onDelete: ReferentialAction.Restrict);*/
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
@ -34,7 +34,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
namespace SharedLibraryCore.Migrations
|
namespace SharedLibraryCore.Migrations
|
||||||
{
|
{
|
||||||
@ -23,9 +25,11 @@ namespace SharedLibraryCore.Migrations
|
|||||||
name: "EFChangeHistory",
|
name: "EFChangeHistory",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Active = table.Column<bool>(nullable: false),
|
|
||||||
ChangeHistoryId = table.Column<int>(nullable: false)
|
ChangeHistoryId = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Active = table.Column<bool>(nullable: false),
|
||||||
OriginEntityId = table.Column<int>(nullable: false),
|
OriginEntityId = table.Column<int>(nullable: false),
|
||||||
TargetEntityId = table.Column<int>(nullable: false),
|
TargetEntityId = table.Column<int>(nullable: false),
|
||||||
TypeOfChange = table.Column<int>(nullable: false),
|
TypeOfChange = table.Column<int>(nullable: false),
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -501,7 +501,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -503,7 +503,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace SharedLibraryCore.Migrations
|
|
||||||
{
|
|
||||||
public partial class AddEFAliasNameMaxLength : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -508,7 +508,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -12,6 +12,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
nullable: true);
|
nullable: true);
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
migrationBuilder.AddColumn<string>(
|
||||||
|
|
||||||
name: "PreviousValue",
|
name: "PreviousValue",
|
||||||
table: "EFChangeHistory",
|
table: "EFChangeHistory",
|
||||||
nullable: true);
|
nullable: true);
|
||||||
|
@ -31,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationVector3Id");
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace SharedLibraryCore.Migrations
|
|
||||||
{
|
|
||||||
public partial class ForceAutoIncrementChangeHistory : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
// hack: we can't alter the column on SQLite, but we need max length limit for the Index in MySQL etc
|
|
||||||
if (migrationBuilder.ActiveProvider != "Microsoft.EntityFrameworkCore.Sqlite")
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "ChangeHistoryId",
|
|
||||||
table: "EFChangeHistory"
|
|
||||||
).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,78 +9,14 @@ using SharedLibraryCore.Database;
|
|||||||
namespace SharedLibraryCore.Migrations
|
namespace SharedLibraryCore.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DatabaseContext))]
|
[DbContext(typeof(DatabaseContext))]
|
||||||
[Migration("20180911190418_AddEFAliasNameMaxLength")]
|
[Migration("20180922231310_RemoveACSnapShot")]
|
||||||
partial class AddEFAliasNameMaxLength
|
partial class RemoveACSnapShot
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "2.1.2-rtm-30932");
|
.HasAnnotation("ProductVersion", "2.1.3-rtm-32065");
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("SnapshotId")
|
|
||||||
.ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
b.Property<bool>("Active");
|
|
||||||
|
|
||||||
b.Property<int>("ClientId");
|
|
||||||
|
|
||||||
b.Property<int>("CurrentSessionLength");
|
|
||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
|
||||||
|
|
||||||
b.Property<double>("Distance");
|
|
||||||
|
|
||||||
b.Property<double>("EloRating");
|
|
||||||
|
|
||||||
b.Property<int?>("HitDestinationVector3Id");
|
|
||||||
|
|
||||||
b.Property<int>("HitLocation");
|
|
||||||
|
|
||||||
b.Property<int?>("HitOriginVector3Id");
|
|
||||||
|
|
||||||
b.Property<int>("HitType");
|
|
||||||
|
|
||||||
b.Property<int>("Hits");
|
|
||||||
|
|
||||||
b.Property<int>("Kills");
|
|
||||||
|
|
||||||
b.Property<int?>("LastStrainAngleVector3Id");
|
|
||||||
|
|
||||||
b.Property<double>("SessionAngleOffset");
|
|
||||||
|
|
||||||
b.Property<double>("SessionSPM");
|
|
||||||
|
|
||||||
b.Property<int>("SessionScore");
|
|
||||||
|
|
||||||
b.Property<double>("StrainAngleBetween");
|
|
||||||
|
|
||||||
b.Property<int>("TimeSinceLastEvent");
|
|
||||||
|
|
||||||
b.Property<int>("WeaponId");
|
|
||||||
|
|
||||||
b.Property<DateTime>("When");
|
|
||||||
|
|
||||||
b.HasKey("SnapshotId");
|
|
||||||
|
|
||||||
b.HasIndex("ClientId");
|
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
|
||||||
|
|
||||||
b.HasIndex("HitOriginVector3Id");
|
|
||||||
|
|
||||||
b.HasIndex("LastStrainAngleVector3Id");
|
|
||||||
|
|
||||||
b.ToTable("EFACSnapshot");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
||||||
{
|
{
|
||||||
@ -157,6 +93,8 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ServerId");
|
b.HasIndex("ServerId");
|
||||||
|
|
||||||
|
b.HasIndex("TimeSent");
|
||||||
|
|
||||||
b.ToTable("EFClientMessages");
|
b.ToTable("EFClientMessages");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -358,8 +296,12 @@ namespace SharedLibraryCore.Migrations
|
|||||||
b.Property<string>("Comment")
|
b.Property<string>("Comment")
|
||||||
.HasMaxLength(128);
|
.HasMaxLength(128);
|
||||||
|
|
||||||
|
b.Property<string>("CurrentValue");
|
||||||
|
|
||||||
b.Property<int>("OriginEntityId");
|
b.Property<int>("OriginEntityId");
|
||||||
|
|
||||||
|
b.Property<string>("PreviousValue");
|
||||||
|
|
||||||
b.Property<int>("TargetEntityId");
|
b.Property<int>("TargetEntityId");
|
||||||
|
|
||||||
b.Property<DateTime>("TimeChanged");
|
b.Property<DateTime>("TimeChanged");
|
||||||
@ -480,8 +422,6 @@ namespace SharedLibraryCore.Migrations
|
|||||||
b.Property<int>("Vector3Id")
|
b.Property<int>("Vector3Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<int?>("EFACSnapshotSnapshotId");
|
|
||||||
|
|
||||||
b.Property<float>("X");
|
b.Property<float>("X");
|
||||||
|
|
||||||
b.Property<float>("Y");
|
b.Property<float>("Y");
|
||||||
@ -490,35 +430,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasKey("Vector3Id");
|
b.HasKey("Vector3Id");
|
||||||
|
|
||||||
b.HasIndex("EFACSnapshotSnapshotId");
|
|
||||||
|
|
||||||
b.ToTable("Vector3");
|
b.ToTable("Vector3");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("SharedLibraryCore.Database.Models.EFClient", "Client")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ClientId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("HitDestinationVector3Id");
|
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitOrigin")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("HitOriginVector3Id");
|
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "LastStrainAngle")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("LastStrainAngleVector3Id");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("SharedLibraryCore.Database.Models.EFClient", "Attacker")
|
b.HasOne("SharedLibraryCore.Database.Models.EFClient", "Attacker")
|
||||||
@ -667,13 +581,6 @@ namespace SharedLibraryCore.Migrations
|
|||||||
.HasForeignKey("PunisherId")
|
.HasForeignKey("PunisherId")
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("SharedLibraryCore.Helpers.Vector3", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot")
|
|
||||||
.WithMany("PredictedViewAngles")
|
|
||||||
.HasForeignKey("EFACSnapshotSnapshotId");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
139
SharedLibraryCore/Migrations/20180922231310_RemoveACSnapShot.cs
Normal file
139
SharedLibraryCore/Migrations/20180922231310_RemoveACSnapShot.cs
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
namespace SharedLibraryCore.Migrations
|
||||||
|
{
|
||||||
|
public partial class RemoveACSnapShot : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
if (migrationBuilder.ActiveProvider != "Microsoft.EntityFrameworkCore.Sqlite")
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Vector3_EFACSnapshot_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3");
|
||||||
|
}
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "EFACSnapshot");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "EFACSnapshot",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
SnapshotId = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Active = table.Column<bool>(nullable: false),
|
||||||
|
ClientId = table.Column<int>(nullable: false),
|
||||||
|
CurrentSessionLength = table.Column<int>(nullable: false),
|
||||||
|
CurrentStrain = table.Column<double>(nullable: false),
|
||||||
|
CurrentViewAngleId = table.Column<int>(nullable: true),
|
||||||
|
Deaths = table.Column<int>(nullable: false),
|
||||||
|
Distance = table.Column<double>(nullable: false),
|
||||||
|
EloRating = table.Column<double>(nullable: false),
|
||||||
|
HitDestinationVector3Id = table.Column<int>(nullable: true),
|
||||||
|
HitLocation = table.Column<int>(nullable: false),
|
||||||
|
HitOriginVector3Id = table.Column<int>(nullable: true),
|
||||||
|
HitType = table.Column<int>(nullable: false),
|
||||||
|
Hits = table.Column<int>(nullable: false),
|
||||||
|
Kills = table.Column<int>(nullable: false),
|
||||||
|
LastStrainAngleVector3Id = table.Column<int>(nullable: true),
|
||||||
|
SessionAngleOffset = table.Column<double>(nullable: false),
|
||||||
|
SessionSPM = table.Column<double>(nullable: false),
|
||||||
|
SessionScore = table.Column<int>(nullable: false),
|
||||||
|
StrainAngleBetween = table.Column<double>(nullable: false),
|
||||||
|
TimeSinceLastEvent = table.Column<int>(nullable: false),
|
||||||
|
WeaponId = table.Column<int>(nullable: false),
|
||||||
|
When = table.Column<DateTime>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_EFACSnapshot", x => x.SnapshotId);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_EFClients_ClientId",
|
||||||
|
column: x => x.ClientId,
|
||||||
|
principalTable: "EFClients",
|
||||||
|
principalColumn: "ClientId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_CurrentViewAngleId",
|
||||||
|
column: x => x.CurrentViewAngleId,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_HitDestinationVector3Id",
|
||||||
|
column: x => x.HitDestinationVector3Id,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_HitOriginVector3Id",
|
||||||
|
column: x => x.HitOriginVector3Id,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_LastStrainAngleVector3Id",
|
||||||
|
column: x => x.LastStrainAngleVector3Id,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Vector3_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3",
|
||||||
|
column: "EFACSnapshotSnapshotId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_ClientId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "ClientId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_CurrentViewAngleId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "CurrentViewAngleId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_HitDestinationVector3Id",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "HitDestinationVector3Id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_HitOriginVector3Id",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "HitOriginVector3Id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_LastStrainAngleVector3Id",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "LastStrainAngleVector3Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Vector3_EFACSnapshot_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3",
|
||||||
|
column: "EFACSnapshotSnapshotId",
|
||||||
|
principalTable: "EFACSnapshot",
|
||||||
|
principalColumn: "SnapshotId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
using SharedLibraryCore.Database;
|
using SharedLibraryCore.Database;
|
||||||
@ -10,14 +9,14 @@ using SharedLibraryCore.Database;
|
|||||||
namespace SharedLibraryCore.Migrations
|
namespace SharedLibraryCore.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DatabaseContext))]
|
[DbContext(typeof(DatabaseContext))]
|
||||||
[Migration("20180915164118_ForceAutoIncrementChangeHistory")]
|
[Migration("20180922231600_ReaddACSnapshot")]
|
||||||
partial class ForceAutoIncrementChangeHistory
|
partial class ReaddACSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "2.1.2-rtm-30932");
|
.HasAnnotation("ProductVersion", "2.1.3-rtm-32065");
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot", b =>
|
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot", b =>
|
||||||
{
|
{
|
||||||
@ -32,7 +31,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int?>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -40,11 +39,11 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("EloRating");
|
b.Property<double>("EloRating");
|
||||||
|
|
||||||
b.Property<int?>("HitDestinationVector3Id");
|
b.Property<int>("HitDestinationId");
|
||||||
|
|
||||||
b.Property<int>("HitLocation");
|
b.Property<int>("HitLocation");
|
||||||
|
|
||||||
b.Property<int?>("HitOriginVector3Id");
|
b.Property<int>("HitOriginId");
|
||||||
|
|
||||||
b.Property<int>("HitType");
|
b.Property<int>("HitType");
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<int>("Kills");
|
b.Property<int>("Kills");
|
||||||
|
|
||||||
b.Property<int?>("LastStrainAngleVector3Id");
|
b.Property<int>("LastStrainAngleId");
|
||||||
|
|
||||||
b.Property<double>("SessionAngleOffset");
|
b.Property<double>("SessionAngleOffset");
|
||||||
|
|
||||||
@ -72,13 +71,13 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationId");
|
||||||
|
|
||||||
b.HasIndex("HitOriginVector3Id");
|
b.HasIndex("HitOriginId");
|
||||||
|
|
||||||
b.HasIndex("LastStrainAngleVector3Id");
|
b.HasIndex("LastStrainAngleId");
|
||||||
|
|
||||||
b.ToTable("EFACSnapshot");
|
b.ToTable("EFACSnapshot");
|
||||||
});
|
});
|
||||||
@ -354,8 +353,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
modelBuilder.Entity("SharedLibraryCore.Database.Models.EFChangeHistory", b =>
|
modelBuilder.Entity("SharedLibraryCore.Database.Models.EFChangeHistory", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ChangeHistoryId")
|
b.Property<int>("ChangeHistoryId")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd();
|
||||||
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
|
||||||
|
|
||||||
b.Property<bool>("Active");
|
b.Property<bool>("Active");
|
||||||
|
|
||||||
@ -512,19 +510,22 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("HitDestinationVector3Id");
|
.HasForeignKey("HitDestinationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitOrigin")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitOrigin")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("HitOriginVector3Id");
|
.HasForeignKey("HitOriginId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "LastStrainAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "LastStrainAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("LastStrainAngleVector3Id");
|
.HasForeignKey("LastStrainAngleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
145
SharedLibraryCore/Migrations/20180922231600_ReaddACSnapshot.cs
Normal file
145
SharedLibraryCore/Migrations/20180922231600_ReaddACSnapshot.cs
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
namespace SharedLibraryCore.Migrations
|
||||||
|
{
|
||||||
|
public partial class ReaddACSnapshot : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "EFACSnapshot",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Active = table.Column<bool>(nullable: false),
|
||||||
|
SnapshotId = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("Sqlite:Autoincrement", true)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
ClientId = table.Column<int>(nullable: false),
|
||||||
|
When = table.Column<DateTime>(nullable: false),
|
||||||
|
CurrentSessionLength = table.Column<int>(nullable: false),
|
||||||
|
TimeSinceLastEvent = table.Column<int>(nullable: false),
|
||||||
|
EloRating = table.Column<double>(nullable: false),
|
||||||
|
SessionScore = table.Column<int>(nullable: false),
|
||||||
|
SessionSPM = table.Column<double>(nullable: false),
|
||||||
|
Hits = table.Column<int>(nullable: false),
|
||||||
|
Kills = table.Column<int>(nullable: false),
|
||||||
|
Deaths = table.Column<int>(nullable: false),
|
||||||
|
CurrentStrain = table.Column<double>(nullable: false),
|
||||||
|
StrainAngleBetween = table.Column<double>(nullable: false),
|
||||||
|
SessionAngleOffset = table.Column<double>(nullable: false),
|
||||||
|
LastStrainAngleId = table.Column<int>(nullable: false),
|
||||||
|
HitOriginId = table.Column<int>(nullable: false),
|
||||||
|
HitDestinationId = table.Column<int>(nullable: false),
|
||||||
|
Distance = table.Column<double>(nullable: false),
|
||||||
|
CurrentViewAngleId = table.Column<int>(nullable: true),
|
||||||
|
WeaponId = table.Column<int>(nullable: false),
|
||||||
|
HitLocation = table.Column<int>(nullable: false),
|
||||||
|
HitType = table.Column<int>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_EFACSnapshot", x => x.SnapshotId);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_EFClients_ClientId",
|
||||||
|
column: x => x.ClientId,
|
||||||
|
principalTable: "EFClients",
|
||||||
|
principalColumn: "ClientId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_CurrentViewAngleId",
|
||||||
|
column: x => x.CurrentViewAngleId,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_HitDestinationId",
|
||||||
|
column: x => x.HitDestinationId,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_HitOriginId",
|
||||||
|
column: x => x.HitOriginId,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EFACSnapshot_Vector3_LastStrainAngleId",
|
||||||
|
column: x => x.LastStrainAngleId,
|
||||||
|
principalTable: "Vector3",
|
||||||
|
principalColumn: "Vector3Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (migrationBuilder.ActiveProvider != "Microsoft.EntityFrameworkCore.Sqlite")
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Vector3_EFACSnapshot_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3",
|
||||||
|
column: "EFACSnapshotSnapshotId",
|
||||||
|
principalTable: "EFACSnapshot",
|
||||||
|
principalColumn: "SnapshotId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Vector3_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3",
|
||||||
|
column: "EFACSnapshotSnapshotId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_ClientId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "ClientId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_CurrentViewAngleId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "CurrentViewAngleId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_HitDestinationId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "HitDestinationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_HitOriginId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "HitOriginId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EFACSnapshot_LastStrainAngleId",
|
||||||
|
table: "EFACSnapshot",
|
||||||
|
column: "LastStrainAngleId");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Vector3_EFACSnapshot_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "EFACSnapshot");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Vector3_EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "EFACSnapshotSnapshotId",
|
||||||
|
table: "Vector3");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,8 +2,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
using SharedLibraryCore.Database;
|
using SharedLibraryCore.Database;
|
||||||
|
|
||||||
namespace SharedLibraryCore.Migrations
|
namespace SharedLibraryCore.Migrations
|
||||||
@ -15,7 +15,9 @@ namespace SharedLibraryCore.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "2.1.2-rtm-30932");
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||||
|
.HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot", b =>
|
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFACSnapshot", b =>
|
||||||
{
|
{
|
||||||
@ -30,7 +32,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("CurrentStrain");
|
b.Property<double>("CurrentStrain");
|
||||||
|
|
||||||
b.Property<int?>("CurrentViewAngleVector3Id");
|
b.Property<int>("CurrentViewAngleId");
|
||||||
|
|
||||||
b.Property<int>("Deaths");
|
b.Property<int>("Deaths");
|
||||||
|
|
||||||
@ -38,11 +40,11 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<double>("EloRating");
|
b.Property<double>("EloRating");
|
||||||
|
|
||||||
b.Property<int?>("HitDestinationVector3Id");
|
b.Property<int>("HitDestinationId");
|
||||||
|
|
||||||
b.Property<int>("HitLocation");
|
b.Property<int>("HitLocation");
|
||||||
|
|
||||||
b.Property<int?>("HitOriginVector3Id");
|
b.Property<int>("HitOriginId");
|
||||||
|
|
||||||
b.Property<int>("HitType");
|
b.Property<int>("HitType");
|
||||||
|
|
||||||
@ -50,7 +52,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.Property<int>("Kills");
|
b.Property<int>("Kills");
|
||||||
|
|
||||||
b.Property<int?>("LastStrainAngleVector3Id");
|
b.Property<int>("LastStrainAngleId");
|
||||||
|
|
||||||
b.Property<double>("SessionAngleOffset");
|
b.Property<double>("SessionAngleOffset");
|
||||||
|
|
||||||
@ -70,13 +72,13 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClientId");
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
b.HasIndex("CurrentViewAngleVector3Id");
|
b.HasIndex("CurrentViewAngleId");
|
||||||
|
|
||||||
b.HasIndex("HitDestinationVector3Id");
|
b.HasIndex("HitDestinationId");
|
||||||
|
|
||||||
b.HasIndex("HitOriginVector3Id");
|
b.HasIndex("HitOriginId");
|
||||||
|
|
||||||
b.HasIndex("LastStrainAngleVector3Id");
|
b.HasIndex("LastStrainAngleId");
|
||||||
|
|
||||||
b.ToTable("EFACSnapshot");
|
b.ToTable("EFACSnapshot");
|
||||||
});
|
});
|
||||||
@ -352,8 +354,7 @@ namespace SharedLibraryCore.Migrations
|
|||||||
modelBuilder.Entity("SharedLibraryCore.Database.Models.EFChangeHistory", b =>
|
modelBuilder.Entity("SharedLibraryCore.Database.Models.EFChangeHistory", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ChangeHistoryId")
|
b.Property<int>("ChangeHistoryId")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd();
|
||||||
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
|
||||||
|
|
||||||
b.Property<bool>("Active");
|
b.Property<bool>("Active");
|
||||||
|
|
||||||
@ -510,19 +511,23 @@ namespace SharedLibraryCore.Migrations
|
|||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "CurrentViewAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("CurrentViewAngleVector3Id");
|
.HasForeignKey("CurrentViewAngleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitDestination")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("HitDestinationVector3Id");
|
.HasForeignKey("HitDestinationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitOrigin")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "HitOrigin")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("HitOriginVector3Id");
|
.HasForeignKey("HitOriginId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("SharedLibraryCore.Helpers.Vector3", "LastStrainAngle")
|
b.HasOne("SharedLibraryCore.Helpers.Vector3", "LastStrainAngle")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("LastStrainAngleVector3Id");
|
.HasForeignKey("LastStrainAngleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
modelBuilder.Entity("IW4MAdmin.Plugins.Stats.Models.EFClientKill", b =>
|
||||||
|
@ -107,7 +107,7 @@ namespace SharedLibraryCore
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="E">Event</param>
|
/// <param name="E">Event</param>
|
||||||
/// <returns>True on sucess</returns>
|
/// <returns>True on sucess</returns>
|
||||||
abstract protected Task ProcessEvent(GameEvent E);
|
abstract protected Task<bool> ProcessEvent(GameEvent E);
|
||||||
abstract public Task ExecuteEvent(GameEvent E);
|
abstract public Task ExecuteEvent(GameEvent E);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -32,6 +32,15 @@ namespace SharedLibraryCore.Services
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case GameEvent.EventType.Command:
|
case GameEvent.EventType.Command:
|
||||||
|
change = new EFChangeHistory()
|
||||||
|
{
|
||||||
|
OriginEntityId = e.Origin.ClientId,
|
||||||
|
TargetEntityId = e.Target?.ClientId ?? 0,
|
||||||
|
Comment = "Executed command",
|
||||||
|
PreviousValue = "",
|
||||||
|
CurrentValue = e.Message,
|
||||||
|
TypeOfChange = EFChangeHistory.ChangeType.Command
|
||||||
|
};
|
||||||
break;
|
break;
|
||||||
case GameEvent.EventType.ChangePermission:
|
case GameEvent.EventType.ChangePermission:
|
||||||
change = new EFChangeHistory()
|
change = new EFChangeHistory()
|
||||||
@ -59,6 +68,7 @@ namespace SharedLibraryCore.Services
|
|||||||
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
e.Owner.Logger.WriteWarning(ex.Message);
|
||||||
e.Owner.Logger.WriteDebug(ex.GetExceptionInfo());
|
e.Owner.Logger.WriteDebug(ex.GetExceptionInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ namespace SharedLibraryCore.Services
|
|||||||
{
|
{
|
||||||
if (_context == null)
|
if (_context == null)
|
||||||
{
|
{
|
||||||
_context = new DatabaseContext();
|
_context = new DatabaseContext(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _context;
|
return _context;
|
||||||
|
@ -14,19 +14,26 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Migrations\20180502195240_Update.cs" />
|
<Compile Remove="Migrations\20180502195240_Update.cs" />
|
||||||
|
<Compile Remove="Migrations\20180923025324_FixForPostgreSQL.cs" />
|
||||||
|
<Compile Remove="Migrations\20180923025702_FixForPostgreSQL.cs" />
|
||||||
|
<Compile Remove="Migrations\20180923030248_FixForPostgreSQL.cs" />
|
||||||
|
<Compile Remove="Migrations\20180923030426_FixForPostgreSQL.cs" />
|
||||||
|
<Compile Remove="Migrations\20180923030528_FixForPostgreSQL.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Jint" Version="2.11.58" />
|
<PackageReference Include="Jint" Version="2.11.58" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.3" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="2.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Localization" Version="2.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||||
|
<PackageReference Include="Npgsql" Version="4.0.3" />
|
||||||
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.2" />
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.2" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.2" />
|
||||||
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
|
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
|
<RazorCompileOnBuild>false</RazorCompileOnBuild>
|
||||||
|
<RazorCompileOnPublish>false</RazorCompileOnPublish>
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||||
<TypeScriptToolsVersion>2.6</TypeScriptToolsVersion>
|
<TypeScriptToolsVersion>2.6</TypeScriptToolsVersion>
|
||||||
<PackageId>RaidMax.IW4MAdmin.WebfrontCore</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.WebfrontCore</PackageId>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user