more work on relay

This commit is contained in:
Thibault Duplessis 2014-11-22 14:41:12 +01:00
parent f2fca8e6a9
commit 478fdf2c51
4 changed files with 5 additions and 8 deletions

View file

@ -46,7 +46,6 @@ private[relay] final class RelayFSM(importer: Importer) extends Actor with AkkaF
case Event(In(str), _) if str endsWith "fics% " =>
send("unobserve")
send("observe /l")
send("moves")
// wait so other messages pass and the movelist is full
context.system.scheduler.scheduleOnce(700 millis) { send("moves") }
goto(Create)
@ -70,10 +69,6 @@ private[relay] final class RelayFSM(importer: Importer) extends Actor with AkkaF
case Event(In(str), _) if (str contains "Removing game ") =>
log(str)
goto(Lobby) using none
case Event(In(str), None) if str contains "<12>" => stay
case Event(In(str), _) =>
println(str)
stay
}
when(Observe) {

View file

@ -35,7 +35,7 @@ private[relay] final class Telnet(remote: InetSocketAddress, listener: ActorRef)
listener ! Telnet.WriteFailed
case Received(data) =>
val msg = data decodeString "UTF-8"
println("{telnet} " + msg)
println(s"<telnet>$msg</telnet>")
listener ! Telnet.In(msg)
case "close" =>
connection ! Close

View file

@ -174,6 +174,7 @@ final class JsonView(
"spectator" -> true,
"ai" -> player.aiLevel,
"user" -> playerUser.map { userJsonView(_, true) },
"name" -> player.name,
"rating" -> player.rating,
"ratingDiff" -> player.ratingDiff,
"onGame" -> (player.isAi || socket.onGame(player.color)),
@ -184,6 +185,7 @@ final class JsonView(
"color" -> opponent.color.name,
"ai" -> opponent.aiLevel,
"user" -> opponentUser.map { userJsonView(_, true) },
"name" -> player.name,
"rating" -> opponent.rating,
"ratingDiff" -> opponent.ratingDiff,
"onGame" -> (opponent.isAi || socket.onGame(opponent.color)),

View file

@ -38,7 +38,7 @@ module.exports = function(ctrl, player, klass) {
]),
m('span.status')
] : m('span.user_link', [
'Anonymous',
m('span.status')
player.name || 'Anonymous',
ctrl.data.game.source == 'relay' ? null : m('span.status')
]);
}