Skip to content

Commit

Permalink
fix(testclient): update TestClient to load gameType from ServiceLoader(
Browse files Browse the repository at this point in the history
…#367)

Co-authored-by: xerus2000 <[email protected]>
  • Loading branch information
anarchuser and xeruf authored Jan 19, 2021
1 parent 7457426 commit 17ca22a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helpers/test-client/src/sc/TestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jargs.gnu.CmdLineParser;
import jargs.gnu.CmdLineParser.Option;
import org.slf4j.LoggerFactory;
import sc.api.plugins.IGamePlugin;
import sc.framework.plugins.Player;
import sc.networking.INetworkInterface;
import sc.networking.TcpNetwork;
Expand All @@ -20,6 +21,7 @@
import java.net.Socket;
import java.util.Arrays;
import java.util.List;
import java.util.ServiceLoader;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
Expand All @@ -42,7 +44,7 @@
public class TestClient extends XStreamClient {
private static final Logger logger = (Logger) LoggerFactory.getLogger(TestClient.class);

private static final String gameType = "swc_2020_hive";
private static final String gameType = ServiceLoader.load(IGamePlugin.class).iterator().next().id();
private static final ClientPlayer[] players = {new ClientPlayer(), new ClientPlayer()};
private static final File logDir = new File("logs").getAbsoluteFile();

Expand Down

0 comments on commit 17ca22a

Please sign in to comment.