Working on server side stuff
This commit is contained in:
1 parent
a784da9fb4
commit
542fc191fa
12 files changed
+757
-64
No files matched your search
@@ -341,5 +341,25 @@ int main()
|
||||
authoritative.snapshot()->players.at("player2").state.enabled,
|
||||
"reconnected player was not enabled");
|
||||
|
||||
// Flooding past the per-second command limit kicks the player.
|
||||
for (int i = 0; i < 40; ++i)
|
||||
replacement.submit(FRG::SetCharacterDestinationCommand{
|
||||
{}, {}, point(static_cast<float>(i), 0.f, 0.f), {}});
|
||||
require(
|
||||
waitFor([&]() {
|
||||
replacement.update(0);
|
||||
return replacement.connectionFailed();
|
||||
}),
|
||||
"command flood did not get the player kicked");
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
server.update();
|
||||
require(
|
||||
waitFor([&]() {
|
||||
client->update(0);
|
||||
return !client->snapshot()->players.at("player2").state.enabled;
|
||||
}) &&
|
||||
!authoritative.snapshot()->players.at("player2").state.enabled,
|
||||
"kicked player's character was not disabled for everyone");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in new issue
Block a user