mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Fikser en feil i serveren som hindret en spiller som ikke hadde sendt inn navnet sitt fra å koble fra
This commit is contained in:
parent
224851ce2c
commit
3924189839
@ -19,7 +19,7 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public class StartMenuScreen extends AbstractScreen {
|
public class StartMenuScreen extends AbstractScreen {
|
||||||
private final RoboRallyWrapper roboRallyWrapper;
|
private final RoboRallyWrapper roboRallyWrapper;
|
||||||
private TextField textInput;
|
private final TextField textInput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new start menu screen
|
* Instantiates a new start menu screen
|
||||||
|
@ -31,8 +31,8 @@ public class RoboRallyClient {
|
|||||||
/**
|
/**
|
||||||
* Connects to a Robo Rally server
|
* Connects to a Robo Rally server
|
||||||
*
|
*
|
||||||
* @param ipAddress The ip address of the server to join
|
* @param ipAddress The ip address of the server to join
|
||||||
* @param serverPort The port the server is hosted on
|
* @param serverPort The port the server is hosted on
|
||||||
* @throws IOException If the server cannot be connected to
|
* @throws IOException If the server cannot be connected to
|
||||||
*/
|
*/
|
||||||
public void connect(String ipAddress, int serverPort) throws IOException {
|
public void connect(String ipAddress, int serverPort) throws IOException {
|
||||||
|
@ -209,7 +209,8 @@ class RoboRallyServerListener extends Listener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected(Connection connection) {
|
public void disconnected(Connection connection) {
|
||||||
if (deadPlayers.contains(connection) || !clients.keySet().contains(connection)) {
|
if (deadPlayers.contains(connection) || !clients.containsKey(connection) ||
|
||||||
|
!playerNames.containsKey(connection)) {
|
||||||
//Remove all traces of the player ever existing
|
//Remove all traces of the player ever existing
|
||||||
clients.remove(connection);
|
clients.remove(connection);
|
||||||
playerNames.remove(connection);
|
playerNames.remove(connection);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user