Skip to content

Commit

Permalink
Queue filtering was too strict, had to loosen it a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ankbhatia19 committed Oct 7, 2024
1 parent c9b8f57 commit feb7c05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 1 addition & 4 deletions spectator/client/docker-compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ services:
image: ghcr.io/opensource-deadlock-tools/devlock/spectator/client:latest
build: .
restart: always
env_file: ../../.env
environment:
RABBITMQ_HOST:
RABBITMQ_PORT:
RABBITMQ_USER:
RABBITMQ_PASS:
STEAM_USERNAME: {{ acct.username }}
STEAM_PASSWORD: {{ acct.password }}
{% endfor %}
5 changes: 2 additions & 3 deletions spectator/server/DeadlockSpectatorServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ private static void Main(string[] args)

rmq_host = Environment.GetEnvironmentVariable("RABBITMQ_HOST") ?? "rabbitmq";
rmq_port = int.Parse(Environment.GetEnvironmentVariable("RABBITMQ_PORT") ?? "5672");
rmq_user = Environment.GetEnvironmentVariable("RABBITMQ_DEFAULT_USER") ?? "guest";
rmq_pass = Environment.GetEnvironmentVariable("RABBITMQ_DEFAULT_PASS") ?? "guest";
rmq_user = Environment.GetEnvironmentVariable("RABBITMQ_ADMIN_USER") ?? "guest";
rmq_pass = Environment.GetEnvironmentVariable("RABBITMQ_ADMIN_PASS") ?? "guest";

// Login to Steam
client = new DeadlockClient(steam_user, steam_pass);
Expand Down Expand Up @@ -92,7 +92,6 @@ private static void UpdateQueue(object? source, ElapsedEventArgs e)
// Use LINQ to filter, calculate and sort matches by priority
var sortedMatches = matches?
.Where(match => match.spectators == 0) // Only take matches with no current spectators
.Where(match => match.match_score > 500) // No low elo matches allowed
.Select(match => new
{
Match = match,
Expand Down

0 comments on commit feb7c05

Please sign in to comment.