From 00a51880b9522402e285e29f911e8d2538eaf401 Mon Sep 17 00:00:00 2001 From: rolleander Date: Wed, 1 Nov 2023 19:39:12 +0100 Subject: [PATCH] update --- .../java/com/broll/networklib/client/impl/DummyLobby.java | 1 + .../com/broll/networklib/server/impl/DummyServerLobby.java | 6 ++++++ .../java/com/broll/networklib/server/impl/ServerLobby.java | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/broll/networklib/client/impl/DummyLobby.java b/src/main/java/com/broll/networklib/client/impl/DummyLobby.java index 06a8801..41750cd 100644 --- a/src/main/java/com/broll/networklib/client/impl/DummyLobby.java +++ b/src/main/java/com/broll/networklib/client/impl/DummyLobby.java @@ -5,4 +5,5 @@ public class DummyLobby extends GameLobby{ public DummyLobby(){ } + } diff --git a/src/main/java/com/broll/networklib/server/impl/DummyServerLobby.java b/src/main/java/com/broll/networklib/server/impl/DummyServerLobby.java index a3b03d4..8cafde4 100644 --- a/src/main/java/com/broll/networklib/server/impl/DummyServerLobby.java +++ b/src/main/java/com/broll/networklib/server/impl/DummyServerLobby.java @@ -1,7 +1,13 @@ package com.broll.networklib.server.impl; + public class DummyServerLobby extends ServerLobby{ public DummyServerLobby() { super(null, null, -1, null); } + + public void addDummyPlayer(DummyPlayer

player){ + addPlayer(player); + } + } diff --git a/src/main/java/com/broll/networklib/server/impl/ServerLobby.java b/src/main/java/com/broll/networklib/server/impl/ServerLobby.java index d95a50d..7f833eb 100644 --- a/src/main/java/com/broll/networklib/server/impl/ServerLobby.java +++ b/src/main/java/com/broll/networklib/server/impl/ServerLobby.java @@ -134,7 +134,7 @@ private void assignOwner() { if (owner == null) { if (!activePlayers.isEmpty()) { //find next non bot and make him owner - getActivePlayers().stream().filter(it -> it instanceof BotPlayer == false).findFirst().ifPresent(player -> { + getActivePlayers().stream().filter(it -> !(it instanceof BotPlayer)).findFirst().ifPresent(player -> { this.owner = player; }); }