Skip to content
Merged
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
4 changes: 3 additions & 1 deletion GenOnlineService/Controllers/Lobby/LobbyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public async Task<APIResult> Delete(Int64 lobbyID)
&& data.ContainsKey("units_lost")
&& data.ContainsKey("total_money")
&& data.ContainsKey("won")
&& data.ContainsKey("side")
)
{
Int64 user_id = TokenHelper.GetUserID(this);
Expand All @@ -318,6 +319,7 @@ public async Task<APIResult> Delete(Int64 lobbyID)
int units_killed = data["units_killed"].GetInt32();
int units_lost = data["units_lost"].GetInt32();
int total_money = data["total_money"].GetInt32();
int side = data["side"].GetInt32();
bool won = data["won"].GetBoolean();
UInt64 match_id = data["match_id"].GetUInt64();

Expand All @@ -337,7 +339,7 @@ public async Task<APIResult> Delete(Int64 lobbyID)

// store in DB
await using var db = await _dbFactory.CreateDbContextAsync();
await Database.MatchHistory.CommitPlayerOutcome(db, slotIndexInLobby, match_id,
await Database.MatchHistory.CommitPlayerOutcome(db, slotIndexInLobby, match_id, side,
buildings_built, buildings_killed, buildings_lost, units_built, units_killed, units_lost, total_money, won);
}
}
Expand Down
2 changes: 2 additions & 0 deletions GenOnlineService/Database/Database.MatchHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ public static async Task CommitPlayerOutcome(
AppDbContext db,
int slotIndex,
ulong matchId,
int side,
int buildingsBuilt,
int buildingsKilled,
int buildingsLost,
Expand All @@ -357,6 +358,7 @@ public static async Task CommitPlayerOutcome(

// 3. Update fields
MatchdataMemberModel model = modelNullable.Value;
model.side = side;
model.buildings_built = buildingsBuilt;
model.buildings_killed = buildingsKilled;
model.buildings_lost = buildingsLost;
Expand Down
Loading