added sound to pong and fixed some bugs
This commit is contained in:
parent
c7919309e9
commit
ac4036dfc8
15 changed files with 1373 additions and 111 deletions
|
@ -40,7 +40,6 @@ start_link(Socket) ->
|
|||
%% @spec notify(Player::Pid(), From::Pid(),
|
||||
%% {Command::String(), Message::string()}) -> ok
|
||||
notify(Player, From, Message) ->
|
||||
erlang:display(Message),
|
||||
{Cmd, Data} = Message,
|
||||
Parsed = ggs_protocol:create_message(Cmd, "text","text", Data),
|
||||
Player ! {notify, From, Parsed}.
|
||||
|
@ -62,14 +61,10 @@ stop(_Player,_Table) ->
|
|||
loop(#pl_state{token = _Token, socket = Socket, table = Table} = State) ->
|
||||
receive
|
||||
{tcp, Socket, Data} -> % Just echo for now..
|
||||
io:format("Parsing via protocol module..~n"),
|
||||
erlang:display(Data),
|
||||
Parsed = ggs_protocol:parse(Data),
|
||||
erlang:display(Parsed),
|
||||
self() ! Parsed,
|
||||
loop(State);
|
||||
{notify, _From, Message} ->
|
||||
erlang:display(Message),
|
||||
gen_tcp:send(Socket, Message),
|
||||
loop(State);
|
||||
% Below are messages generated by the parser
|
||||
|
|
Reference in a new issue