Compare commits

..

4 Commits

Author SHA1 Message Date
TeamCity
1542906edf ci: bump version to v4.25.0 2026-01-07 15:59:57 +00:00
cf1854976a feat: Update joinGame endpoint to accept gameId as a path parameter 2026-01-07 16:56:35 +01:00
TeamCity
723a4be33f ci: bump version to v4.24.0 2026-01-07 15:27:29 +00:00
2f89951c25 feat: Update Gateway to use ArrayList for game IDs and bound users 2026-01-07 16:24:51 +01:00
6 changed files with 31 additions and 31 deletions

View File

@@ -302,3 +302,13 @@
### Features ### Features
* Add Health and Login endpoints with updated Redis configuration ([4a5af36](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/4a5af36ae0dcb540e02b7a1cd042e54cc6342c78)) * Add Health and Login endpoints with updated Redis configuration ([4a5af36](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/4a5af36ae0dcb540e02b7a1cd042e54cc6342c78))
## (2026-01-07)
### Features
* Update Gateway to use ArrayList for game IDs and bound users ([2f89951](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/2f89951c25484d6bc412536a83019ee6d0b7f780))
## (2026-01-07)
### Features
* Update joinGame endpoint to accept gameId as a path parameter ([cf18549](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/cf1854976a51eb4931d50cf93640498ed18686fc))

View File

@@ -55,32 +55,21 @@ class MainMenuController @Inject()(
} }
def joinGame(): Action[AnyContent] = authAction { implicit request: AuthenticatedRequest[AnyContent] => def joinGame(gameId: String): Action[AnyContent] = authAction { implicit request: AuthenticatedRequest[AnyContent] =>
val jsonBody = request.body.asJson val game = PodManager.getGame(gameId)
val gameId: Option[String] = jsonBody.flatMap { jsValue => game match {
(jsValue \ "gameId").asOpt[String] case Some(g) =>
} g.addUser(request.user)
if (gameId.isDefined) { Ok(Json.obj(
val game = PodManager.getGame(gameId.get) "status" -> "success",
game match { "redirectUrl" -> routes.IngameController.game(g.id).url,
case Some(g) => "content" -> IngameController.returnInnerHTML(g, g.logic.getCurrentState, request.user).toString
g.addUser(request.user) ))
Ok(Json.obj( case None =>
"status" -> "success", NotFound(Json.obj(
"redirectUrl" -> routes.IngameController.game(g.id).url, "status" -> "failure",
"content" -> IngameController.returnInnerHTML(g, g.logic.getCurrentState, request.user).toString "errorMessage" -> "No Game found"
)) ))
case None =>
NotFound(Json.obj(
"status" -> "failure",
"errorMessage" -> "No Game found"
))
}
} else {
BadRequest(Json.obj(
"status" -> "failure",
"errorMessage" -> "Invalid form submission"
))
} }
} }

View File

@@ -7,6 +7,7 @@ import org.redisson.config.Config
import play.api.Logger import play.api.Logger
import play.api.inject.ApplicationLifecycle import play.api.inject.ApplicationLifecycle
import java.util
import java.util.UUID import java.util.UUID
import javax.inject.* import javax.inject.*
import scala.concurrent.ExecutionContext import scala.concurrent.ExecutionContext
@@ -45,8 +46,8 @@ class Gateway @Inject()(
PodManager.podName, PodManager.podName,
PodManager.podIp, PodManager.podIp,
9000, 9000,
PodManager.getAllGameIds().asJava, new util.ArrayList[String](PodManager.getAllGameIds().asJava),
PodManager.allBoundUsers().asJava new util.ArrayList[String](PodManager.allBoundUsers().asJava)
) )
} }

View File

@@ -15,7 +15,7 @@ GET /rules controllers.MainMenuController.rules()
GET /navSPA/:pType controllers.MainMenuController.navSPA(pType) GET /navSPA/:pType controllers.MainMenuController.navSPA(pType)
POST /createGame controllers.MainMenuController.createGame() POST /createGame controllers.MainMenuController.createGame()
POST /joinGame controllers.MainMenuController.joinGame() POST /joinGame/:gameId controllers.MainMenuController.joinGame(gameId: String)
# User authentication routes # User authentication routes
POST /login controllers.UserController.login_Post() POST /login controllers.UserController.login_Post()

View File

@@ -1,3 +1,3 @@
MAJOR=4 MAJOR=4
MINOR=23 MINOR=25
PATCH=0 PATCH=0