now this works. the former PartialFunction compiled but failed
This commit is contained in:
parent
d19ef9547a
commit
9b7e68db30
|
@ -24,21 +24,28 @@ private[lobby] final class SocketHandler(
|
|||
socket: ActorRef,
|
||||
uid: String,
|
||||
member: Member): Handler.Controller = {
|
||||
|
||||
lazy val RateLimit = new lila.memo.RateLimitGlobal(2 seconds)
|
||||
|
||||
{
|
||||
case ("p", o) => o int "v" foreach { v => socket ! PingVersion(uid, v) }
|
||||
case ("join", o) =>
|
||||
case ("join", o) => RateLimit {
|
||||
o str "d" foreach { id =>
|
||||
lobby ! BiteHook(id, uid, member.user)
|
||||
}
|
||||
}
|
||||
case ("cancel", o) => lobby ! CancelHook(uid)
|
||||
case ("joinSeek", o) =>
|
||||
case ("joinSeek", o) => RateLimit {
|
||||
for {
|
||||
id <- o str "d"
|
||||
user <- member.user
|
||||
} lobby ! BiteSeek(id, user)
|
||||
}
|
||||
case ("cancelSeek", o) => for {
|
||||
id <- o str "d"
|
||||
user <- member.user
|
||||
} lobby ! CancelSeek(id, user)
|
||||
}: Handler.Controller
|
||||
}
|
||||
|
||||
def apply(uid: String, user: Option[User]): Fu[JsSocketHandler] =
|
||||
|
|
Loading…
Reference in a new issue