chore(api): fixes
This commit is contained in:
@@ -219,10 +219,10 @@ body {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#nextPlayers {
|
#next-players-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@@ -231,10 +231,6 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#invisible {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#selecttrumpsuit {
|
#selecttrumpsuit {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
|||||||
lock.lock()
|
lock.lock()
|
||||||
val result = Try {
|
val result = Try {
|
||||||
eventType match {
|
eventType match {
|
||||||
case "Ping" =>
|
case "ping" =>
|
||||||
// No action needed for Ping
|
// No action needed for Ping
|
||||||
()
|
()
|
||||||
case "StartGame" =>
|
case "StartGame" =>
|
||||||
gameLobby.startGame(user)
|
gameLobby.startGame(user)
|
||||||
case "play Card" =>
|
case "PlayCard" =>
|
||||||
val maybeCardIndex: Option[Int] = (data \ "cardindex").asOpt[Int]
|
val maybeCardIndex: Option[Int] = (data \ "cardindex").asOpt[Int]
|
||||||
maybeCardIndex match {
|
maybeCardIndex match {
|
||||||
case Some(index) =>
|
case Some(index) =>
|
||||||
@@ -55,7 +55,7 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
|||||||
case None =>
|
case None =>
|
||||||
println("Card Index not found or is not a number.")
|
println("Card Index not found or is not a number.")
|
||||||
}
|
}
|
||||||
case "Picked Trumpsuit" =>
|
case "PickTrumpsuit" =>
|
||||||
val maybeSuitIndex: Option[Int] = (data \ "suitIndex").asOpt[Int]
|
val maybeSuitIndex: Option[Int] = (data \ "suitIndex").asOpt[Int]
|
||||||
maybeSuitIndex match {
|
maybeSuitIndex match {
|
||||||
case Some(index) =>
|
case Some(index) =>
|
||||||
@@ -69,6 +69,7 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
|||||||
lock.unlock()
|
lock.unlock()
|
||||||
if (result.isFailure) {
|
if (result.isFailure) {
|
||||||
val throwable = result.failed.get
|
val throwable = result.failed.get
|
||||||
|
throwable.printStackTrace()
|
||||||
throw throwable
|
throw throwable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ function receiveTurnEvent(eventData) {
|
|||||||
nextPlayerText.hide();
|
nextPlayerText.hide();
|
||||||
nextPlayersContainer.html('');
|
nextPlayersContainer.html('');
|
||||||
} else {
|
} else {
|
||||||
|
console.log("Length"+nextPlayers.length);
|
||||||
nextPlayerText.show();
|
nextPlayerText.show();
|
||||||
let nextPlayersHtml = '';
|
let nextPlayersHtml = '';
|
||||||
nextPlayers.forEach((player) => {
|
nextPlayers.forEach((player) => {
|
||||||
@@ -300,7 +301,7 @@ function receiveTurnEvent(eventData) {
|
|||||||
if (player.dog) {
|
if (player.dog) {
|
||||||
playerName += " 🐶";
|
playerName += " 🐶";
|
||||||
}
|
}
|
||||||
nextPlayersHtml += `<p className="fs-5 text-primary">${playerName}</p>`;
|
nextPlayersHtml += `<p class="fs-5 text-primary">${playerName}</p>`;
|
||||||
});
|
});
|
||||||
nextPlayersContainer.html(nextPlayersHtml);
|
nextPlayersContainer.html(nextPlayersHtml);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ function handlePlayCard(cardIndex, dog) {
|
|||||||
cardindex: cardIndex,
|
cardindex: cardIndex,
|
||||||
isDog: dog
|
isDog: dog
|
||||||
}
|
}
|
||||||
sendEventAndWait("play Card", payload).then(
|
sendEventAndWait("PlayCard", payload).then(
|
||||||
() => {
|
() => {
|
||||||
console.debug("play card successful")
|
console.debug("play card successful")
|
||||||
const datacardid = $(`#${cardIndex}`)
|
const datacardid = $(`#${cardIndex}`)
|
||||||
@@ -49,8 +49,7 @@ function handleTrumpSelection(object) {
|
|||||||
const payload = {
|
const payload = {
|
||||||
suitIndex: trumpIndex
|
suitIndex: trumpIndex
|
||||||
}
|
}
|
||||||
console.log("SENDING TRUMP SUIT SELECTION:", payload);
|
sendEvent("PickTrumpsuit", payload)
|
||||||
sendEvent("Picked Trumpsuit", payload)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function handleKickPlayer(playerId) {
|
function handleKickPlayer(playerId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user