RamSaw / SoftwareDesign

Repository for software design course assignments
MIT License
0 stars 1 forks source link

Exception when fighiting between players #12

Closed vladimirrim closed 5 years ago

vladimirrim commented 5 years ago

Fighting between players when 4 players joined session

Expected: Hp extraction

Actual:

SEVERE: Exception while executing runnable io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable@56cd0e7f
java.util.NoSuchElementException: Collection contains no element matching the predicate.
    at ru.hse.spb.model.WorldModel.movePlayer(WorldModel.kt:249)
    at ru.hse.spb.actions.MoveUpAction.execute(MoveUpAction.kt:7)
    at ru.hse.spb.server.RoguelikeServer$ConnectionSetUpperImpl$communicate$1.onNext(RoguelikeServer.kt:87)
    at ru.hse.spb.server.RoguelikeServer$ConnectionSetUpperImpl$communicate$1.onNext(RoguelikeServer.kt:62)
    at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:249)
    at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:297)
    at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:738)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
RamSaw commented 5 years ago

Fixed. Actually, players do not fight with each other, so they just skip their moves when going into a cell that is occupied by other players.