anchor.diff:  			reload,
   			?MODULE:loop(CSocket, SessionID);
   		{error, closed} ->
  -			log(SessionID, "recv error, closing"),
  +			log(SessionID, "quit"),
   			egs_db:users_delete(SessionID)
   	end.
   
   %% @doc Game server info request handler.
   
   handle(16#0217, CSocket, SessionID, _) ->
  -	log(SessionID, "send game server info"),
  +	log(SessionID, "forward to game server"),
   	IP = ?GAME_IP,
   	Port = ?GAME_PORT,
   	Packet = << 16#02160300:32, 0:192, SessionID:32/little-unsigned-integer, 0:64, IP/binary, Port:32/little-unsigned-integer >>,
  
positive.code: 
  handle(Command, CSocket, SessionID, Orig) when Command =:= 16#0226; Command =:= 16#023f ->
  	<< _:352, Page:8/little-unsigned-integer, _/bits >> = Orig,
  	log(SessionID, io_lib:format("send MOTD page ~.10b", [Page + 1])),
  	{ok, File} = file:read_file("conf/motd.txt"),
  	Tokens = re:split(File, "\n."),
  	MOTD = << << Line/binary, "\n", 0 >> || Line <- lists:sublist(Tokens, 1 + Page * 15, 15) >>,
  
negative.code: %% @doc Unknown command handler. Do nothing.
  
  handle(Command, _, SessionID, _) ->
  	log(SessionID, "dismissed packet ~4.16.0b", [Command]).
  
  %% @doc Log message to the console.
  
  log(SessionID, Message) ->
  	io:format("login (~.10b): ~s~n", [SessionID, Message]).
  
  log(SessionID, Message, Format) ->
  	RealMessage = io_lib:format(Message, Format),
  	log(SessionID, RealMessage).
  