MCPcopy Create free account
hub / github.com/Blizzard/s2client-api / TestMultiplayer

Function TestMultiplayer

tests/test_multiplayer.cc:60–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58//
59
60bool TestMultiplayer(int argc, char** argv) {
61 static const char* remote_path = "temp_foo.SC2Map";
62
63 sc2::Coordinator coordinator;
64 if (!coordinator.LoadSettings(argc, argv)) {
65 return false;
66 }
67
68 coordinator.SetMultithreaded(true);
69
70 // Add the custom bot, it will control the players.
71 MultiplayerTestBot bot1, bot2;
72
73 coordinator.SetParticipants({
74 CreateParticipant(sc2::Race::Terran, &bot1),
75 CreateParticipant(sc2::Race::Terran, &bot2),
76 });
77
78 // Start the game.
79 coordinator.LaunchStarcraft();
80
81 if (!RemoteSaveMap(coordinator, sc2::kMapBelShirVestigeLE, remote_path))
82 return false;
83
84 coordinator.StartGame(remote_path);
85
86 // Step forward the game simulation.
87 while (!bot1.IsFinished() && !bot2.IsFinished()) {
88 coordinator.Update();
89 }
90
91 return true;
92}
93
94}
95

Callers

nothing calls this directly

Calls 9

CreateParticipantFunction · 0.85
RemoteSaveMapFunction · 0.85
LoadSettingsMethod · 0.80
SetMultithreadedMethod · 0.80
SetParticipantsMethod · 0.80
LaunchStarcraftMethod · 0.80
StartGameMethod · 0.80
UpdateMethod · 0.80
IsFinishedMethod · 0.45

Tested by

no test coverage detected