Skip to content

Commit

Permalink
provide the server's id
Browse files Browse the repository at this point in the history
  • Loading branch information
pschichtel committed Oct 5, 2024
1 parent 33d53e3 commit 6cdf4cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/Ld56C2Controller.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object JoinRequestMessage {
implicit val format: Format[JoinRequestMessage] = Json.format
}

final case class JoinAcceptMessage(peerId: Int, answer: String)
final case class JoinAcceptMessage(id: UUID, peerId: Int, answer: String)
object JoinAcceptMessage {
implicit val format: Format[JoinAcceptMessage] = Json.format
}
Expand All @@ -32,7 +32,7 @@ object IceCandidateMessage {

sealed trait HosterMessage
final case class HostingMessage(playerCount: Int) extends HosterMessage
final case class HostAcceptsJoinMessage(id: UUID, peerId: Option[Int], answer: String) extends HosterMessage
final case class HostAcceptsJoinMessage(id: UUID, peerId: Int, answer: String) extends HosterMessage


object HosterMessage {
Expand Down Expand Up @@ -102,7 +102,7 @@ class HostHandler(out: ActorRef,
case controllers.HostAcceptsJoinMessage(id, peerId, answer) =>
val joiner = joiners.get(id)
if (joiner != null) {
joiner ! Json.toJson(JoinAcceptMessage(peerId.getOrElse(2), answer)).toString
joiner ! Json.toJson(JoinAcceptMessage(id, peerId, answer)).toString
}
case candidate @ IceCandidateMessage(_, dest, _, _, _) =>
joiners.get(dest) ! Json.toJson(candidate)
Expand Down

0 comments on commit 6cdf4cb

Please sign in to comment.