tomwetjens / boardgamefiesta

Project to play board games like Great Western Trail and Dominant Species online. Backend code for Quarkus, AWS Lambda, DynamoDB. Front end code: https://github.com/tomwetjens/boardgamefiesta-app
GNU General Public License v3.0
4 stars 1 forks source link

[Ranchers] Garth doesn't upgrade last station because it's not a turnout space #2

Open tomwetjens opened 3 years ago

tomwetjens commented 3 years ago

From the Automa rules:

Garth will advance his train engine, jumping past your engine like normal, and stopping at stations he reaches. When he stops, he will place a disk and remove the station master token, if it is available (he does not need to trade an employee and will not score points for it). If his train reaches the end of the track and there are any open stations that he has not already upgraded, he will move back to the earliest such station and place a disk there now. (Cards 2, 7, 11, 14)

In https://github.com/tomwetjens/boardgamefiesta/blob/master/gwt/src/main/java/com/boardgamefiesta/gwt/logic/Garth.java there is an assumption that a station space is always a turnout space, but the last space is not a turnout space.

Specifically on these lines: https://github.com/tomwetjens/boardgamefiesta/blob/d820fce8d7b880c7105749df24fa69f5293e3500/gwt/src/main/java/com/boardgamefiesta/gwt/logic/Garth.java#L582 https://github.com/tomwetjens/boardgamefiesta/blob/d820fce8d7b880c7105749df24fa69f5293e3500/gwt/src/main/java/com/boardgamefiesta/gwt/logic/Garth.java#L605 https://github.com/tomwetjens/boardgamefiesta/blob/d820fce8d7b880c7105749df24fa69f5293e3500/gwt/src/main/java/com/boardgamefiesta/gwt/logic/Garth.java#L620

fatcow240 commented 2 years ago

@tomwetjens : I would like to contribute to this project and this looks like an easy bug to get started. I would like to update the logic in RailroadTrack.java to consider 39 as TRUE for isTurnout and check for complications related to making this change.

tomwetjens commented 2 years ago

Sure, feel free :-) Let me know if you need help setting up

fatcow240 commented 2 years ago

I think I may need help setting up. I have the front end running successfully on http://localhost:4200/. I haven't been successful at getting the backend up an running. The build is successful, but I'm not sure of the correct deployment steps. boardgamefiesta/build.sh successful

docker run -i --rm -p 8080:8080 gwt exec java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/quarkus-run.jar


--/ \/ / / / | / \/ //_/ / / / / -/ // / // / |/ , / ,< / // /\ \ --___// |//|//||____// 2022-09-22 12:02:21.509 INFO [io.und.websockets] (main) UT026003: Adding annotated server endpoint class com.boardgamefiesta.server.event.EventsServerEndpoint for path /events 2022-09-22 12:02:24.906 INFO [io.quarkus] (main) server 1.0-SNAPSHOT on JVM (powered by Quarkus 2.7.5.Final) started in 4.580s. Listening on: http://0.0.0.0:8080 2022-09-22 12:02:24.907 INFO [io.quarkus] (main) Profile prod activated. 2022-09-22 12:02:24.907 INFO [io.quarkus] (main) Installed features: [amazon-dynamodb, amazon-ses, amazon-sqs, cdi, narayana-jta, oidc, resteasy, resteasy-jackson, security, servlet, smallrye-context-propagation, smallrye-health, vertx, websockets, websockets-client]

Container appears to be up: docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e28b61e8fcbd gwt "/deployments/run-ja…" 4 minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp busy_wing I'm not sure if this is how I should be deploying the server locally.

Webpage banner on 4200: Could not connect to server. Make sure you are not offline.

-Thanks

tomwetjens commented 2 years ago

Great that you managed to get the frontend running!

To be honest, I never used the "docker" way before so not sure what would be required to make that work. Can you see if it works as described in https://github.com/tomwetjens/boardgamefiesta/blob/master/README.md ?

fatcow240 commented 2 years ago

Thank you. I did try the method in the README, but ran into issues.

Build

./mvnw package              # No errors

Run locally


./mvnw install            # No errors

./mvnw quarkus:dev -pl !lamda*
...
[ERROR] [ERROR] Could not find the selected project in the reactor: lamda* @
[ERROR] Could not find the selected project in the reactor: lamda* -> [Help 1]
...
I tried to mess around with escaping the !, but nothing worked.

I tried to explicitly call the non-lamda projects.
./mvnw quarkus:dev -pl :boardgamefiesta,:api,:domain-generic,:dynamodb-generic,:dynamodb-shared,:dynamodb-test,:user,:cognito,:game,:games,:dominant-species,:gwt,:istanbul,:table,:email,:powergrid,:websocket,:rest-api,:server
...
[ERROR] No plugin found for prefix 'quarkus' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/fatcow240/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
...

The only project I could get to run was server by itself.
./mvnw quarkus:dev -pl server
This runs an loads the front page content, but no other are loaded.

./mvnw --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/fatcow240/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.16, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.10.16.3-microsoft-standard-wsl2", arch: "amd64", family: "unix"

quarkus --version
2.12.3.Final

javac --version
javac 11.0.16
tomwetjens commented 2 years ago

I pushed a small improvement to the README.MD

Running ./mvnw quarkus:dev -pl server -am should do the trick.

Because the dev server needs a database, authentication server and queue, you must deploy a AWS stack and point your local dev server to it.

Step 1: cd aws ./deploy.sh dev

Edit: the Cognito user pool must be created manually because CloudFormation does not support everything yet. Alternatively you may use my Cognito pool (https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_s6Ypfd935). There is a default user: tom, password: gwtlover.

Step 2: Wait until all resources have been created. Edit the application.properties of the server and adjust all URLs to your own AWS account

Step 3: run server with ./mvnw quarkus:dev -pl server -am