diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-07 21:41:53 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-07 21:41:53 +0200 |
commit | def8975617e5c6da431e41cc889d167b0f2e2bb0 (patch) | |
tree | f538102c17d81b596834fad7f47528fe2fc04b19 /src/main/scala/Server/Client.scala | |
parent | 891b6f877ba848a3f78851a757734ebd1f066798 (diff) | |
download | scalevalapokalypsi-def8975617e5c6da431e41cc889d167b0f2e2bb0.tar.gz scalevalapokalypsi-def8975617e5c6da431e41cc889d167b0f2e2bb0.zip |
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
Diffstat (limited to 'src/main/scala/Server/Client.scala')
-rw-r--r-- | src/main/scala/Server/Client.scala | 5 |
1 files changed, 4 insertions, 1 deletions
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 * |