moved stats to protocol for message

This commit is contained in:
Jeena Paradies 2011-04-26 14:13:45 +02:00
parent cae2b51056
commit 28ef543265
2 changed files with 2 additions and 1 deletions

View file

@ -111,7 +111,6 @@ handle_cast({srv_cmd, "define", _Headers, Data}, #state { table = Table } = Stat
{noreply, State}; {noreply, State};
handle_cast({game_cmd, Command, _Headers, Data}, #state { table = Table } = State) -> handle_cast({game_cmd, Command, _Headers, Data}, #state { table = Table } = State) ->
ggs_stats:message(),
ggs_table:notify(Table, self(), {game, Command, Data}), ggs_table:notify(Table, self(), {game, Command, Data}),
{noreply, State}; {noreply, State};

View file

@ -43,6 +43,7 @@ create_message({Command, Data}) ->
%% Assemble a message which can b %% Assemble a message which can b
%e used as a reply to a client %e used as a reply to a client
create_message(Cmd, Enc, Acc, Data) -> create_message(Cmd, Enc, Acc, Data) ->
ggs_stats:message(),
Length = integer_to_list(string:len(Data)), Length = integer_to_list(string:len(Data)),
Msg = "Client-Command: " ++ Cmd ++ "\n" ++ Msg = "Client-Command: " ++ Cmd ++ "\n" ++
"Client-Encoding: " ++ Enc ++ "\n" ++ "Client-Encoding: " ++ Enc ++ "\n" ++
@ -109,6 +110,7 @@ code_change(_OldVsn, State, _Extra) ->
prettify(Args, Data) -> prettify(Args, Data) ->
ggs_stats:message(),
case lists:keyfind("Server-Command", 1, Args) of case lists:keyfind("Server-Command", 1, Args) of
{_, Value} -> {_, Value} ->
{srv_cmd, Value, Args, Data}; {srv_cmd, Value, Args, Data};