Skip to content

Commit

Permalink
Use access token and ice breaker
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Apr 21, 2024
1 parent e4ff009 commit e3c197b
Showing 1 changed file with 8 additions and 3 deletions.
@@ -1,5 +1,7 @@
package com.faforever.client.fa.relay.ice;

import com.faforever.client.api.TokenRetriever;
import com.faforever.client.config.ClientProperties;
import com.faforever.client.domain.server.PlayerInfo;
import com.faforever.client.fa.GameFullNotifier;
import com.faforever.client.mapstruct.IceServerMapper;
Expand Down Expand Up @@ -63,9 +65,11 @@ public class IceAdapterImpl implements IceAdapter, InitializingBean, DisposableB
private final IceServerMapper iceServerMapper;
private final Preferences preferences;
private final ForgedAlliancePrefs forgedAlliancePrefs;
private final TokenRetriever tokenRetriever;
private final ObjectFactory<IceAdapterCallbacks> iceAdapterCallbacksFactory;
@Lazy
private final GameFullNotifier gameFullNotifier;
private final ClientProperties clientProperties;

private final IceAdapterApi iceAdapterProxy = newIceAdapterProxy();
private GameType gameType;
Expand Down Expand Up @@ -223,8 +227,9 @@ List<String> buildCommand(Path workDirectory, int adapterPort, int gpgPort, int
"--id", String.valueOf(currentPlayer.getId()),
"--game-id", String.valueOf(gameId),
"--login", currentPlayer.getUsername(),
"--rpc-port", String.valueOf(adapterPort),
"--gpgnet-port", String.valueOf(gpgPort));
"--rpc-port", String.valueOf(adapterPort), "--gpgnet-port", String.valueOf(gpgPort), "--access-token",
tokenRetriever.getRefreshedTokenValue().block(), "--icebreaker-base-url",
clientProperties.getApi().getBaseUrl() + "/ice");

cmd.addAll(standardIceOptions);

Expand All @@ -243,7 +248,7 @@ private String getJavaFXClassPathJars() {
}

private String getBinaryName(Path workDirectory) {
return workDirectory.resolve("faf-ice-adapter.jar").toString();
return workDirectory.resolve("kia-cli-1.0-SNAPSHOT-all.jar").toString();
}

@Override
Expand Down

0 comments on commit e3c197b

Please sign in to comment.