Skip to content

Commit

Permalink
Veto system fields
Browse files Browse the repository at this point in the history
  • Loading branch information
K-ETFreeman authored and Brutus5000 committed Nov 28, 2024
1 parent 9972c3d commit 9bd066e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class MatchmakerQueueMapPool extends AbstractEntity<MatchmakerQueueMapPoo
@ToString.Include
private Integer maxTokensPerMap;
@ToString.Include
private Float minimalMapsAllowed;
private Float minimumMapsAfterVeto;

@Relationship("matchmakerQueue")
@ToString.Include
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface LobbyProtocolMessage {
JsonSubTypes.Type(value = UnreadyPartyRequest::class, name = "unready_party"),
JsonSubTypes.Type(value = SelectPartyFactionsRequest::class, name = "set_party_factions"),
JsonSubTypes.Type(value = GameMatchmakingRequest::class, name = "game_matchmaking"),
JsonSubTypes.Type(value = SetPlayerVetoesRequest::class, name = "set_player_vetoes"),
JsonSubTypes.Type(value = MatchmakerInfoRequest::class, name = "matchmaker_info"),
JsonSubTypes.Type(value = AuthenticateRequest::class, name = "auth"),
JsonSubTypes.Type(value = IsReadyResponse::class, name = "is_ready_response"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,5 +344,7 @@ class FafLobbyClient(

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

override fun setPlayerVetoes(vetoes: List<VetoData>) = send(SetPlayerVetoesRequest(vetoes))

override fun sendGpgGameMessage(message: GpgGameOutboundMessage) = send(message)
}
14 changes: 14 additions & 0 deletions lobby/src/main/kotlin/com/faforever/commons/lobby/MatchmakerApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ interface MatchmakerApi {

fun setPartyFactions(factions: Set<Faction>)

fun setPlayerVetoes(vetoes: List<VetoData>)

fun sendReady(requestId: String)

}
Expand All @@ -40,6 +42,13 @@ enum class MatchmakerState {
STOP
}

data class VetoData(
@JsonProperty("map_pool_map_version_id")
val mapPoolMapVersionId: Int,
@JsonProperty("veto_tokens_applied")
val vetoTokensApplied: Int
)


// ***********************
// *** SERVER MESSAGES ***
Expand Down Expand Up @@ -146,6 +155,11 @@ internal data class InviteToPartyRequest(
val playerId: Int
) : ClientMessage

internal data class SetPlayerVetoesRequest(
@JsonProperty("vetoes")
val vetoes: List<VetoData>
) : ClientMessage

internal data class AcceptInviteToPartyRequest(
@JsonProperty("sender_id")
val playerId: Int
Expand Down

0 comments on commit 9bd066e

Please sign in to comment.