From def8975617e5c6da431e41cc889d167b0f2e2bb0 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Thu, 7 Nov 2024 21:41:53 +0200 Subject: Added possibility to join in the middle of the game & fixed bugs and inaccuracies: * Adding the player didn't add it to the starting area. Fixed. * Refactored some code a bit by extracting functions * Changed the areas of `Adventure` to be private --- src/main/scala/Server/Client.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/scala/Server/Client.scala') diff --git a/src/main/scala/Server/Client.scala b/src/main/scala/Server/Client.scala index d9bb529..d9fa684 100644 --- a/src/main/scala/Server/Client.scala +++ b/src/main/scala/Server/Client.scala @@ -24,7 +24,10 @@ class Client(val socket: Socket): * * @return false if there has been a protocol violation, true otherwise */ - def isIntactProtocolWise: Boolean = protocolIsIntact + def isIntactProtocolWise: Boolean = this.protocolIsIntact + + /** Marks that this client misbehaved in eyes of the protocol */ + def failedProtocol(): Unit = this.protocolIsIntact = false /** Tests whether this client is initialized and ready to start the game * -- cgit v1.2.3