8000 Server-built battle logs carry the current log_file_version by inada-s · Pull Request #437 · inada-s/gdxsv · GitHub
[go: up one dir, main page]

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
5 changes: 5 additions & 0 deletions gdxsv/lbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const (
GameDiskPS2 = "ps2" // PS2 DX

McsAddrP2PGame = "255.255.255.255:255"

// BattleLogFile.log_file_version of the logs this server builds (MCS rooms, live spectating).
// Flycast's replay backend reads it like a replay file's version, so keep it equal to the
// version Flycast saves. 20261023: cost 300->295 is a game patch, Flycast no longer forces it.
battleLogFileVersion = 20261023
)

func lobbyKey(platform string, disk string) string {
Expand Down
2 changes: 1 addition & 1 deletion gdxsv/lbs_spectator.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func newSpectatorSession(matching *proto.P2PMatching, gameDisk string, patches *
log := &proto.BattleLogFile{
GameDisk: gameDisk,
BattleCode: matching.GetBattleCode(),
LogFileVersion: 20250101,
LogFileVersion: battleLogFileVersion,
RuleBin: matching.GetRuleBin(),
Users: matching.GetUsers(),
StartAt: time.Now().Unix(),
Expand Down
2 changes: 1 addition & 1 deletion gdxsv/mcs_room.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func newMcsRoom(mcs *Mcs, gameInfo *McsGame) *McsRoom {
mcs: mcs,
game: gameInfo,
battleLog: &proto.BattleLogFile{
LogFileVersion: 20210803,
LogFileVersion: battleLogFileVersion,
GameDisk: gameInfo.GameDisk,
BattleCode: gameInfo.BattleCode,
RuleBin: gameInfo.RuleBin,
Expand Down
2 changes: 1 addition & 1 deletion gdxsv/mcs_room_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestMcsRoom_FinalizeWritesSortedBattleLog(t *testing.T) {
var logFile proto.BattleLogFile
must(t, pb.Unmarshal(raw, &logFile))

assertEq(t, int32(20210803), logFile.GetLogFileVersion())
assertEq(t, int32(battleLogFileVersion), logFile.GetLogFileVersion())
assertEq(t, GameDiskDC2, logFile.GetGameDisk())
assertEq(t, "ROOMLOG", logFile.GetBattleCode())
assertEq(t, SerializeRule(&DefaultRule), logFile.GetRuleBin())
Expand Down
Loading
0