Skip to content

Commit

Permalink
Adding new BotEnabled column to GameServers
Browse files Browse the repository at this point in the history
  • Loading branch information
frasermolyneux committed Jan 6, 2024
1 parent e5f54a5 commit 95ccfd2
Show file tree
Hide file tree
Showing 21 changed files with 834 additions and 744 deletions.
59 changes: 33 additions & 26 deletions src/data-lib/AdminAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,38 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace XtremeIdiots.Portal.DataLib
namespace XtremeIdiots.Portal.DataLib;

[Index("AdminActionId", Name = "IX_AdminActionId", IsUnique = true)]
[Index("PlayerId", Name = "IX_PlayerId")]
[Index("UserProfileId", Name = "IX_UserProfileId")]
public partial class AdminAction
{
[Index("AdminActionId", Name = "IX_AdminActionId", IsUnique = true)]
[Index("PlayerId", Name = "IX_PlayerId")]
[Index("UserProfileId", Name = "IX_UserProfileId")]
public partial class AdminAction
{
[Key]
public Guid AdminActionId { get; set; }
public Guid PlayerId { get; set; }
public Guid? UserProfileId { get; set; }
public int? ForumTopicId { get; set; }
public int Type { get; set; }
[Required]
public string Text { get; set; }
[Column(TypeName = "datetime")]
public DateTime Created { get; set; }
[Column(TypeName = "datetime")]
public DateTime? Expires { get; set; }

[ForeignKey("PlayerId")]
[InverseProperty("AdminActions")]
public virtual Player Player { get; set; }
[ForeignKey("UserProfileId")]
[InverseProperty("AdminActions")]
public virtual UserProfile UserProfile { get; set; }
}
[Key]
public Guid AdminActionId { get; set; }

public Guid PlayerId { get; set; }

public Guid? UserProfileId { get; set; }

public int? ForumTopicId { get; set; }

public int Type { get; set; }

[Required]
public string Text { get; set; }

[Column(TypeName = "datetime")]
public DateTime Created { get; set; }

[Column(TypeName = "datetime")]
public DateTime? Expires { get; set; }

[ForeignKey("PlayerId")]
[InverseProperty("AdminActions")]
public virtual Player Player { get; set; }

[ForeignKey("UserProfileId")]
[InverseProperty("AdminActions")]
public virtual UserProfile UserProfile { get; set; }
}
37 changes: 20 additions & 17 deletions src/data-lib/BanFileMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace XtremeIdiots.Portal.DataLib
namespace XtremeIdiots.Portal.DataLib;

[Index("BanFileMonitorId", Name = "IX_BanFileMonitorId", IsUnique = true)]
[Index("GameServerId", Name = "IX_GameServerId")]
public partial class BanFileMonitor
{
[Index("BanFileMonitorId", Name = "IX_BanFileMonitorId", IsUnique = true)]
[Index("GameServerId", Name = "IX_GameServerId")]
public partial class BanFileMonitor
{
[Key]
public Guid BanFileMonitorId { get; set; }
public Guid GameServerId { get; set; }
[Required]
public string FilePath { get; set; }
public long? RemoteFileSize { get; set; }
[Column(TypeName = "datetime")]
public DateTime? LastSync { get; set; }
[Key]
public Guid BanFileMonitorId { get; set; }

public Guid GameServerId { get; set; }

[Required]
public string FilePath { get; set; }

public long? RemoteFileSize { get; set; }

[Column(TypeName = "datetime")]
public DateTime? LastSync { get; set; }

[ForeignKey("GameServerId")]
[InverseProperty("BanFileMonitors")]
public virtual GameServer GameServer { get; set; }
}
[ForeignKey("GameServerId")]
[InverseProperty("BanFileMonitors")]
public virtual GameServer GameServer { get; set; }
}
61 changes: 34 additions & 27 deletions src/data-lib/ChatMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,39 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace XtremeIdiots.Portal.DataLib
namespace XtremeIdiots.Portal.DataLib;

[Index("PlayerId", "GameServerId", Name = "IX_ChatMessages")]
[Index("GameServerId", Name = "IX_GameServerId")]
[Index("PlayerId", Name = "IX_PlayerId")]
[Index("Timestamp", Name = "IX_Timestamp")]
public partial class ChatMessage
{
[Index("PlayerId", "GameServerId", Name = "IX_ChatMessages")]
[Index("GameServerId", Name = "IX_GameServerId")]
[Index("PlayerId", Name = "IX_PlayerId")]
[Index("Timestamp", Name = "IX_Timestamp")]
public partial class ChatMessage
{
[Key]
public Guid ChatMessageId { get; set; }
public Guid GameServerId { get; set; }
public Guid PlayerId { get; set; }
[Required]
public string Username { get; set; }
public int ChatType { get; set; }
[Required]
public string Message { get; set; }
[Column(TypeName = "datetime")]
public DateTime Timestamp { get; set; }
public bool Locked { get; set; }

[ForeignKey("GameServerId")]
[InverseProperty("ChatMessages")]
public virtual GameServer GameServer { get; set; }
[ForeignKey("PlayerId")]
[InverseProperty("ChatMessages")]
public virtual Player Player { get; set; }
}
[Key]
public Guid ChatMessageId { get; set; }

public Guid GameServerId { get; set; }

public Guid PlayerId { get; set; }

[Required]
public string Username { get; set; }

public int ChatType { get; set; }

[Required]
public string Message { get; set; }

[Column(TypeName = "datetime")]
public DateTime Timestamp { get; set; }

public bool Locked { get; set; }

[ForeignKey("GameServerId")]
[InverseProperty("ChatMessages")]
public virtual GameServer GameServer { get; set; }

[ForeignKey("PlayerId")]
[InverseProperty("ChatMessages")]
public virtual Player Player { get; set; }
}
58 changes: 34 additions & 24 deletions src/data-lib/Demo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,39 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace XtremeIdiots.Portal.DataLib
namespace XtremeIdiots.Portal.DataLib;

[Index("DemoId", Name = "IX_DemoId", IsUnique = true)]
[Index("UserProfileId", Name = "IX_UserProfileId")]
public partial class Demo
{
[Index("DemoId", Name = "IX_DemoId", IsUnique = true)]
[Index("UserProfileId", Name = "IX_UserProfileId")]
public partial class Demo
{
[Key]
public Guid DemoId { get; set; }
public Guid? UserProfileId { get; set; }
public int GameType { get; set; }
public string Title { get; set; }
public string FileName { get; set; }
[Column(TypeName = "datetime")]
public DateTime? Created { get; set; }
public string Map { get; set; }
public string Mod { get; set; }
public string GameMode { get; set; }
public string ServerName { get; set; }
public long FileSize { get; set; }
public string FileUri { get; set; }

[ForeignKey("UserProfileId")]
[InverseProperty("Demos")]
public virtual UserProfile UserProfile { get; set; }
}
[Key]
public Guid DemoId { get; set; }

public Guid? UserProfileId { get; set; }

public int GameType { get; set; }

public string Title { get; set; }

public string FileName { get; set; }

[Column(TypeName = "datetime")]
public DateTime? Created { get; set; }

public string Map { get; set; }

public string Mod { get; set; }

public string GameMode { get; set; }

public string ServerName { get; set; }

public long FileSize { get; set; }

public string FileUri { get; set; }

[ForeignKey("UserProfileId")]
[InverseProperty("Demos")]
public virtual UserProfile UserProfile { get; set; }
}
139 changes: 78 additions & 61 deletions src/data-lib/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,83 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace XtremeIdiots.Portal.DataLib
namespace XtremeIdiots.Portal.DataLib;

[Index("GameServerId", Name = "IX_GameServerId", IsUnique = true)]
public partial class GameServer
{
[Index("GameServerId", Name = "IX_GameServerId", IsUnique = true)]
public partial class GameServer
{
public GameServer()
{
BanFileMonitors = new HashSet<BanFileMonitor>();
ChatMessages = new HashSet<ChatMessage>();
GameServerEvents = new HashSet<GameServerEvent>();
GameServerStats = new HashSet<GameServerStat>();
LivePlayers = new HashSet<LivePlayer>();
MapVotes = new HashSet<MapVote>();
RecentPlayers = new HashSet<RecentPlayer>();
Reports = new HashSet<Report>();
}

[Key]
public Guid GameServerId { get; set; }
[Required]
[StringLength(60)]
public string Title { get; set; }
public int GameType { get; set; }
[Required]
public string Hostname { get; set; }
public int QueryPort { get; set; }
public string FtpHostname { get; set; }
public int? FtpPort { get; set; }
public string FtpUsername { get; set; }
public string FtpPassword { get; set; }
public string RconPassword { get; set; }
public int ServerListPosition { get; set; }
public string HtmlBanner { get; set; }
public bool BannerServerListEnabled { get; set; }
public bool PortalServerListEnabled { get; set; }
public bool ChatLogEnabled { get; set; }
public bool LiveTrackingEnabled { get; set; }
public string LiveTitle { get; set; }
public string LiveMap { get; set; }
public string LiveMod { get; set; }
public int? LiveMaxPlayers { get; set; }
public int? LiveCurrentPlayers { get; set; }
[Column(TypeName = "datetime")]
public DateTime? LiveLastUpdated { get; set; }

[InverseProperty("GameServer")]
public virtual ICollection<BanFileMonitor> BanFileMonitors { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<ChatMessage> ChatMessages { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<GameServerEvent> GameServerEvents { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<GameServerStat> GameServerStats { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<LivePlayer> LivePlayers { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<MapVote> MapVotes { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<RecentPlayer> RecentPlayers { get; set; }
[InverseProperty("GameServer")]
public virtual ICollection<Report> Reports { get; set; }
}
[Key]
public Guid GameServerId { get; set; }

[Required]
[StringLength(60)]
public string Title { get; set; }

public int GameType { get; set; }

[Required]
public string Hostname { get; set; }

public int QueryPort { get; set; }

public string FtpHostname { get; set; }

public int? FtpPort { get; set; }

public string FtpUsername { get; set; }

public string FtpPassword { get; set; }

public string RconPassword { get; set; }

public int ServerListPosition { get; set; }

public string HtmlBanner { get; set; }

public bool BotEnabled { get; set; }

public bool BannerServerListEnabled { get; set; }

public bool PortalServerListEnabled { get; set; }

public bool ChatLogEnabled { get; set; }

public bool LiveTrackingEnabled { get; set; }

public string LiveTitle { get; set; }

public string LiveMap { get; set; }

public string LiveMod { get; set; }

public int? LiveMaxPlayers { get; set; }

public int? LiveCurrentPlayers { get; set; }

[Column(TypeName = "datetime")]
public DateTime? LiveLastUpdated { get; set; }

[InverseProperty("GameServer")]
public virtual ICollection<BanFileMonitor> BanFileMonitors { get; set; } = new List<BanFileMonitor>();

[InverseProperty("GameServer")]
public virtual ICollection<ChatMessage> ChatMessages { get; set; } = new List<ChatMessage>();

[InverseProperty("GameServer")]
public virtual ICollection<GameServerEvent> GameServerEvents { get; set; } = new List<GameServerEvent>();

[InverseProperty("GameServer")]
public virtual ICollection<GameServerStat> GameServerStats { get; set; } = new List<GameServerStat>();

[InverseProperty("GameServer")]
public virtual ICollection<LivePlayer> LivePlayers { get; set; } = new List<LivePlayer>();

[InverseProperty("GameServer")]
public virtual ICollection<MapVote> MapVotes { get; set; } = new List<MapVote>();

[InverseProperty("GameServer")]
public virtual ICollection<RecentPlayer> RecentPlayers { get; set; } = new List<RecentPlayer>();

[InverseProperty("GameServer")]
public virtual ICollection<Report> Reports { get; set; } = new List<Report>();
}
Loading

0 comments on commit 95ccfd2

Please sign in to comment.