Skip to content

Commit

Permalink
luabridge: reject the conneciton when too much clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarsnik committed Nov 8, 2020
1 parent 481ee2a commit 846afda
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions devices/luabridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ void LuaBridge::onNewConnection()
QStringList names;
names << "Cloudchaser" << "Flitter" << "Bonbon" << "Thunderlane" << "Cloud Kicker"
<< "Derpy Hooves" << "Roseluck" << "Octavia Melody" << "Dj-Pon3" << "Berrypunch";
if (allocatedNames.size() == names.size())
{
newclient->close();
return ;
}
//#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QString devName = names.at(rng->bounded(10));
while (allocatedNames.contains(devName))
Expand Down

0 comments on commit 846afda

Please sign in to comment.