Skip to content

Commit

Permalink
Document the header of a replay
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas committed May 7, 2024
1 parent c7f75b4 commit bccff78
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.faforever.commons.replay.header;

/**
* Populated by the game mods field of the table that is passed to `CLobby:LaunchGame`
* @param location
* @param name
* @param description
* @param author
* @param uid
* @param version
* @param url
* @param urlGithub
*/
public record GameMod(String location, String name, String description, String author, String uid, String version,
String url, String urlGithub) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.faforever.commons.replay.header;

/**
* Populated by the game options field of the table that is passed to `CLobby:LaunchGame`
* @param autoTeams
* @param teamLock
* @param teamSpawn
* @param allowObservers
* @param cheatsEnabled
* @param prebuiltUnits
* @param revealedCivilians
* @param scoreEnabled
* @param unitCap
* @param unRated
* @param victory
*/
public record GameOption(AutoTeams autoTeams, TeamLock teamLock, TeamSpawn teamSpawn, boolean allowObservers,
boolean cheatsEnabled, boolean prebuiltUnits, boolean revealedCivilians, boolean scoreEnabled,
int unitCap, boolean unRated, Victory victory) {

public enum AutoTeams {
none("None"),
manual("Manual"),
tvsb("Top versus bottom"),
lvsr("Left versus right"),
pvsi("Even versus uneven");

private final String string;

AutoTeams(String string) {
this.string = string;
}
}

public enum TeamLock {
locked("Locked"), unlocked("Unlocked");

private final String string;

TeamLock(String string) {
this.string = string;
}
}

public enum TeamSpawn {
fixed("Fixed"),
random("Random"),
balanced("Balanced"),
balanced_flex("Flexible balanced"),
random_reveal("Random and revealed"),
balanced_reveal("Balanced and revealed"),
balanced_reveal_mirrored("Mirror balanced and revealed"),
balanced_flex_reveal("Flexible balanced and revealed");

private final String string;

TeamSpawn(String string) {
this.string = string;
}
}

public enum Victory {
demoralization("Assasination"),
domination("Supremacy"),
eradication("Annihilation"),
sandbox("Sandbox");

private final String string;

Victory(String string) {
this.string = string;
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.faforever.commons.replay.header;

import java.util.List;

/**
* Populated by the table that is passed to `CLobby:LaunchGame`
*/
public record Header(String gameVersion, String replayVersion, String mapName, boolean cheatsEnabled, int seed,
List<Source> sources,
List<GameMod> mods,
List<GameOption> gameOptions,
List<PlayerOption> playerOptions
) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.faforever.commons.replay.header;

/**
* Populated by the player options field of the table that is passed to `CLobby:LaunchGame`
*
* @param isHuman
* @param aiPersonality
* @param ratingMean
* @param ratingDeviation
* @param clan
* @param isCivilian
* @param isReady
* @param isBadMap
* @param lobbyIndex
* @param armyName
* @param armyColor
* @param playerColor
* @param playerName
* @param ratedGamesPlayed
* @param country
* @param team
* @param faction
* @param sourceId
*/
public record PlayerOption(boolean isHuman, String aiPersonality, float ratingMean, float ratingDeviation, String clan,
boolean isCivilian, boolean isReady, boolean isBadMap, int lobbyIndex,
String armyName, String armyColor, String playerColor, String playerName,
int ratedGamesPlayed, String country,
int team, int faction, int sourceId) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.faforever.commons.replay.header;

/**
* Populated by the engine to map clients to players
* @param name
* @param sourceId
*/
public record Source(String name, int sourceId) {
}

0 comments on commit bccff78

Please sign in to comment.