Changeset View
Changeset View
Standalone View
Standalone View
source/network/tests/test_Net.h
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | for (size_t j = 0; j < clients.size(); ++j) | |||||||||
if (clients[j]->GetCurrState() != state) | if (clients[j]->GetCurrState() != state) | |||||||||
return false; | return false; | |||||||||
return true; | return true; | |||||||||
} | } | |||||||||
void connect(CNetServer& server, const std::vector<CNetClient*>& clients) | void connect(CNetServer& server, const std::vector<CNetClient*>& clients) | |||||||||
{ | { | |||||||||
TS_ASSERT(server.SetupConnection(PS_DEFAULT_PORT)); | TS_ASSERT(server.SetupConnection(PS_DEFAULT_PORT)); | |||||||||
for (size_t j = 0; j < clients.size(); ++j) | for (size_t j = 0; j < clients.size(); ++j) | |||||||||
vladislavbelov: Range-based for. | ||||||||||
TS_ASSERT(clients[j]->SetupConnection("127.0.0.1", PS_DEFAULT_PORT, nullptr)); | { | |||||||||
clients[j]->SetupServerData("127.0.0.1", PS_DEFAULT_PORT, false); | ||||||||||
StanUnsubmitted Not Done Inline ActionsNo constant for that default IP? Stan: No constant for that default IP? | ||||||||||
SilierAuthorUnsubmitted Done Inline Actionsdont think it is worth the space Silier: dont think it is worth the space | ||||||||||
TS_ASSERT(clients[j]->SetupConnection(nullptr)); | ||||||||||
} | ||||||||||
Not Done Inline Actions
Maybe. Stan: Maybe. | ||||||||||
for (size_t i = 0; ; ++i) | for (size_t i = 0; ; ++i) | |||||||||
{ | { | |||||||||
// debug_printf("."); | // debug_printf("."); | |||||||||
for (size_t j = 0; j < clients.size(); ++j) | for (size_t j = 0; j < clients.size(); ++j) | |||||||||
clients[j]->Poll(); | clients[j]->Poll(); | |||||||||
if (clients_are_all(clients, NCS_PREGAME)) | if (clients_are_all(clients, NCS_PREGAME)) | |||||||||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | void test_rejoin_DISABLED() | |||||||||
debug_printf("==== Connecting client 2B\n"); | debug_printf("==== Connecting client 2B\n"); | |||||||||
CGame client2BGame(false); | CGame client2BGame(false); | |||||||||
CNetClient client2B(&client2BGame, false); | CNetClient client2B(&client2BGame, false); | |||||||||
client2B.SetUserName(L"bob"); | client2B.SetUserName(L"bob"); | |||||||||
clients.push_back(&client2B); | clients.push_back(&client2B); | |||||||||
TS_ASSERT(client2B.SetupConnection("127.0.0.1", PS_DEFAULT_PORT, nullptr)); | client2B.SetupServerData("127.0.0.1", PS_DEFAULT_PORT, false); | |||||||||
TS_ASSERT(client2B.SetupConnection(nullptr)); | ||||||||||
for (size_t i = 0; ; ++i) | for (size_t i = 0; ; ++i) | |||||||||
{ | { | |||||||||
debug_printf("[%u]\n", client2B.GetCurrState()); | debug_printf("[%u]\n", client2B.GetCurrState()); | |||||||||
client2B.Poll(); | client2B.Poll(); | |||||||||
if (client2B.GetCurrState() == NCS_PREGAME) | if (client2B.GetCurrState() == NCS_PREGAME) | |||||||||
break; | break; | |||||||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Range-based for.