Skip to content

Commit

Permalink
maint: update number of max servers per game
Browse files Browse the repository at this point in the history
  • Loading branch information
diamante0018 committed Dec 3, 2023
1 parent 42b5e31 commit fa24128
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
fail-fast: false
matrix:
configuration:
- Debug
- Release
arch:
- x64
Expand Down Expand Up @@ -68,10 +69,13 @@ jobs:
fail-fast: false
matrix:
configuration:
- Debug
- Release
arch:
- x64
include:
- configuration: Debug
config: debug
- configuration: Release
config: release
steps:
Expand Down Expand Up @@ -122,11 +126,14 @@ jobs:
fail-fast: false
matrix:
configuration:
- Debug
- Release
arch:
- x64
- arm64
include:
- configuration: Debug
config: debug
- configuration: Release
config: release
- arch: x64
Expand Down
12 changes: 5 additions & 7 deletions src/services/elimination_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

constexpr auto T7_PROTOCOL = 7;

constexpr size_t MAX_SERVERS_PER_GAME = 15;
constexpr size_t MAX_SERVERS_PER_GAME = 10;

void elimination_handler::run_frame()
{
Expand All @@ -29,19 +29,17 @@ void elimination_handler::run_frame()
if (server.game == game_type::t7 && server.protocol < T7_PROTOCOL)
{
#ifdef _DEBUG
console::info("Removing T7 server '%s' because protocol %i is less than %i\n",
context.get_address().to_string().data(), server.protocol, T7_PROTOCOL);
console::log("Removing T7 server '%s' because they are using an outdated protocol (%i)\n",
context.get_address().to_string().data(), server.protocol);
#endif
context.remove();
}

++server_count[server.game][context.get_address()];
if (server_count[server.game][context.get_address()] >= MAX_SERVERS_PER_GAME)
{
#ifdef _DEBUG
console::info("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME\n",
context.get_address().to_string().data());
#endif
console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME\n",
context.get_address().to_string().data());
context.remove();
}
});
Expand Down

0 comments on commit fa24128

Please sign in to comment.