Skip to content

Commit

Permalink
Fix "create match" data structures
Browse files Browse the repository at this point in the history
  • Loading branch information
micheljung committed May 22, 2018
1 parent 4a74761 commit 8570315
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
@Getter
@AllArgsConstructor
@NoArgsConstructor
class CreateMatchMessage extends V2ClientMessage {
class CreateMatchClientMessage extends V2ClientMessage {
private UUID requestId;
private String title;
/** ID of the map version to be played. */
private int map;
/** Name of the featured mod that will be played. */
private String featuredMod;
/** In which lobby mode to start the game in. */
private LobbyMode lobbyMode;

private List<Participant> participants;

@Getter
Expand All @@ -27,8 +30,6 @@ public static class Participant {
int id;
/** The faction that will be played by this player. */
Faction faction;
/** The game slot this player will be assigned to. */
int slot;
/** The team this player will be assigned to. */
int team;
/**
Expand All @@ -39,4 +40,20 @@ public static class Participant {
/** ID of the slot on the map the player will start in. */
int startSpot;
}

/**
* See values for description.
*/
public enum LobbyMode {

/**
* Default lobby where players can select their faction, teams and so on.
*/
DEFAULT,

/**
* The lobby is skipped; the game starts straight away,
*/
NONE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public interface V2ClientMessageMapper {
GameModsReport map(GameModsClientMessage message);

@Mapping(source = "map", target = "mapVersionId")
CreateMatchRequest map(CreateMatchMessage message);
CreateMatchRequest map(CreateMatchClientMessage message);

LoginRequest map(LoginClientMessage message);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class V2ClientMessageWrapper {
@Type(value = RestoreGameSessionClientMessage.class, name = "restoreGameSession"),
@Type(value = SelectAvatarClientMessage.class, name = "selectAvatar"),
@Type(value = TeamKillClientMessage.class, name = "teamKill"),
@Type(value = CreateMatchMessage.class, name = "createMatch"),
@Type(value = CreateMatchClientMessage.class, name = "createMatch"),
@Type(value = GameChatMessageClientMessage.class, name = "gameChatMessage")
})
private V2ClientMessage data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.faforever.server.common.ClientMessage;
import com.faforever.server.game.Faction;
import com.faforever.server.game.LobbyMode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
Expand Down Expand Up @@ -32,20 +33,4 @@ public static class Participant {
private String name;
private int startSpot;
}

/**
* See values for description.
*/
public enum LobbyMode {

/**
* Default lobby where players can select their faction, teams and so on.
*/
DEFAULT,

/**
* The lobby is skipped; the game starts straight away,
*/
NONE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.faforever.server.entity.Player;
import com.faforever.server.entity.User;
import com.faforever.server.game.Faction;
import com.faforever.server.game.LobbyMode;
import com.faforever.server.matchmaker.CreateMatchRequest;
import com.faforever.server.matchmaker.CreateMatchRequest.LobbyMode;
import com.faforever.server.matchmaker.CreateMatchRequest.Participant;
import com.faforever.server.matchmaker.MatchMakerCancelRequest;
import com.faforever.server.matchmaker.MatchMakerMapper;
Expand Down

0 comments on commit 8570315

Please sign in to comment.