Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public MatchHistory_Entry(
bool is_limit_superweapons,
bool is_tracking_stats,
bool allow_observers,
UInt16 max_camera_height
UInt16 max_camera_height,
UInt32 exe_crc,
UInt32 ini_crc
)
{
this.match_id = match_id;
Expand All @@ -89,6 +91,8 @@ UInt16 max_camera_height
this.is_tracking_stats = is_tracking_stats;
this.allow_observers = allow_observers;
this.max_camera_height = max_camera_height;
this.exe_crc = exe_crc;
this.ini_crc = ini_crc;
}

public Int64 match_id { get; set; } = -1;
Expand All @@ -108,6 +112,8 @@ UInt16 max_camera_height
public bool is_tracking_stats { get; set; } = false;
public bool allow_observers { get; set; } = false;
public UInt16 max_camera_height { get; set; } = 0;
public UInt32 exe_crc { get; set; } = 0;
public UInt32 ini_crc { get; set; } = 0;

public List<MatchdataMemberModel?> members { get; private set; } = new();
}
Expand Down Expand Up @@ -198,4 +204,4 @@ public async Task<APIResult> GetHighestMatchID([FromHeader(Name = "X-Api-Key")]
return result;
}
}
}
}
26 changes: 23 additions & 3 deletions GenOnlineService/Database/Database.MatchHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class MatchHistoryEntry
public bool TrackStats { get; set; }
public bool AllowObservers { get; set; }
public ushort MaxCamHeight { get; set; }
public uint ExeCRC { get; set; }
public uint IniCRC { get; set; }
public string? MapPath { get; set; }

// JSON slots
Expand Down Expand Up @@ -126,6 +128,14 @@ public void Configure(EntityTypeBuilder<MatchHistoryEntry> entity)
.HasColumnName("max_cam_height")
.HasColumnType("smallint unsigned");

entity.Property(e => e.ExeCRC)
.HasColumnName("exe_crc")
.HasColumnType("int unsigned");

entity.Property(e => e.IniCRC)
.HasColumnName("ini_crc")
.HasColumnType("int unsigned");

entity.Property(e => e.MapPath)
.HasColumnName("map_path")
.HasMaxLength(128);
Expand Down Expand Up @@ -476,6 +486,8 @@ public static async Task<ulong> CreatePlaceholderMatchHistory(
TrackStats = lobby.IsTrackingStats,
AllowObservers = lobby.AllowObservers,
MaxCamHeight = lobby.MaximumCameraHeight,
ExeCRC = lobby.ExeCRC,
IniCRC = lobby.IniCRC,

MemberSlot0 = jsonSlots[0],
MemberSlot1 = jsonSlots[1],
Expand Down Expand Up @@ -750,6 +762,8 @@ public static async Task<MatchHistoryCollection> GetMatchesInRange(
m.TrackStats,
m.AllowObservers,
m.MaxCamHeight,
m.ExeCRC,
m.IniCRC,
m.MemberSlot0,
m.MemberSlot1,
m.MemberSlot2,
Expand Down Expand Up @@ -779,7 +793,9 @@ public static async Task<MatchHistoryCollection> GetMatchesInRange(
row.LimitSuperweapons,
row.TrackStats,
row.AllowObservers,
row.MaxCamHeight
row.MaxCamHeight,
row.ExeCRC,
row.IniCRC
);

AddMemberIfNotNull(entry, row.MemberSlot0);
Expand Down Expand Up @@ -831,7 +847,9 @@ public static async Task<MatchHistoryCollection> GetMatchesSince(
row.LimitSuperweapons,
row.TrackStats,
row.AllowObservers,
row.MaxCamHeight
row.MaxCamHeight,
row.ExeCRC,
row.IniCRC
);

AddMemberIfNotNull(entry, row.MemberSlot0);
Expand Down Expand Up @@ -926,7 +944,9 @@ await db.MatchHistory
row.LimitSuperweapons,
row.TrackStats,
row.AllowObservers,
row.MaxCamHeight
row.MaxCamHeight,
row.ExeCRC,
row.IniCRC
);

AddMemberIfNotNull(entry, row.MemberSlot0);
Expand Down
2 changes: 2 additions & 0 deletions GenOnlineService/Database_Structure/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ CREATE TABLE IF NOT EXISTS `match_history` (
`track_stats` tinyint(1) NOT NULL,
`allow_observers` tinyint(1) NOT NULL,
`max_cam_height` smallint(6) unsigned NOT NULL,
`exe_crc` int(10) unsigned NOT NULL DEFAULT 0,
`ini_crc` int(10) unsigned NOT NULL DEFAULT 0,
`map_path` varchar(128) DEFAULT NULL,
`member_slot_0` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`member_slot_0`)),
`member_slot_1` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`member_slot_1`)),
Expand Down
Loading