Browse Source

fix pings

Maxim Sokhatsky 11 years ago
parent
commit
a1f147fa8b
1 changed files with 1 additions and 3 deletions
  1. 1 3
      apps/face/src/n2o_game.erl

+ 1 - 3
apps/face/src/n2o_game.erl

@@ -25,7 +25,6 @@ init(_Transport, Req, _Opts, _Active) ->
 
 % websocket handler
 
-stream(<<"ping">>, Req, State) -> info(<<"PING">>, Req, State);
 stream(<<"N2O",Rest/binary>> = Data, Req, State) -> info(Data,Req,State);
 stream({text,Data}, Req, State) -> info(Data,Req,State);
 stream({binary,Info}, Req, State) -> info(binary_to_term(Info,[safe]),Req,State);
@@ -61,12 +60,11 @@ info({flush,Actions}, Req, State) ->
 
 info(<<"PING">> = Ping, Req, State) ->
 %    wf:info("Ping Message: ~p",[Ping]),
-    {reply,<<>>,Req,State};
+    {reply, wf:json([]), Req, State};
 
 info(<<"N2O,",Rest/binary>> = InitMarker, Req, State) ->
     wf:info("N2O INIT: ~p",[InitMarker]),
     Module = State#context.module,
-%    InitActions = get(actions),
     Elements = try Module:main() catch X:Y -> wf:error_page(X,Y) end,
     wf_core:render(Elements),
     try Module:event(init) catch C:E -> wf:error_page(C,E) end,