Skip to content

Commit 9bd066e

Browse files
K-ETFreemanBrutus5000
authored andcommitted
Veto system fields
1 parent 9972c3d commit 9bd066e

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

api/src/main/java/com/faforever/commons/api/dto/MatchmakerQueueMapPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class MatchmakerQueueMapPool extends AbstractEntity<MatchmakerQueueMapPoo
2121
@ToString.Include
2222
private Integer maxTokensPerMap;
2323
@ToString.Include
24-
private Float minimalMapsAllowed;
24+
private Float minimumMapsAfterVeto;
2525

2626
@Relationship("matchmakerQueue")
2727
@ToString.Include

lobby/src/main/kotlin/com/faforever/commons/lobby/FafLobbyApi.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ interface LobbyProtocolMessage {
4545
JsonSubTypes.Type(value = UnreadyPartyRequest::class, name = "unready_party"),
4646
JsonSubTypes.Type(value = SelectPartyFactionsRequest::class, name = "set_party_factions"),
4747
JsonSubTypes.Type(value = GameMatchmakingRequest::class, name = "game_matchmaking"),
48+
JsonSubTypes.Type(value = SetPlayerVetoesRequest::class, name = "set_player_vetoes"),
4849
JsonSubTypes.Type(value = MatchmakerInfoRequest::class, name = "matchmaker_info"),
4950
JsonSubTypes.Type(value = AuthenticateRequest::class, name = "auth"),
5051
JsonSubTypes.Type(value = IsReadyResponse::class, name = "is_ready_response"),

lobby/src/main/kotlin/com/faforever/commons/lobby/FafLobbyClient.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,5 +344,7 @@ class FafLobbyClient(
344344

345345
override fun setPartyFactions(factions: Set<Faction>) = send(SelectPartyFactionsRequest(factions))
346346

347+
override fun setPlayerVetoes(vetoes: List<VetoData>) = send(SetPlayerVetoesRequest(vetoes))
348+
347349
override fun sendGpgGameMessage(message: GpgGameOutboundMessage) = send(message)
348350
}

lobby/src/main/kotlin/com/faforever/commons/lobby/MatchmakerApi.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ interface MatchmakerApi {
2727

2828
fun setPartyFactions(factions: Set<Faction>)
2929

30+
fun setPlayerVetoes(vetoes: List<VetoData>)
31+
3032
fun sendReady(requestId: String)
3133

3234
}
@@ -40,6 +42,13 @@ enum class MatchmakerState {
4042
STOP
4143
}
4244

45+
data class VetoData(
46+
@JsonProperty("map_pool_map_version_id")
47+
val mapPoolMapVersionId: Int,
48+
@JsonProperty("veto_tokens_applied")
49+
val vetoTokensApplied: Int
50+
)
51+
4352

4453
// ***********************
4554
// *** SERVER MESSAGES ***
@@ -146,6 +155,11 @@ internal data class InviteToPartyRequest(
146155
val playerId: Int
147156
) : ClientMessage
148157

158+
internal data class SetPlayerVetoesRequest(
159+
@JsonProperty("vetoes")
160+
val vetoes: List<VetoData>
161+
) : ClientMessage
162+
149163
internal data class AcceptInviteToPartyRequest(
150164
@JsonProperty("sender_id")
151165
val playerId: Int

0 commit comments

Comments
 (0)