diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-10-14 11:05:09 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-10-14 11:05:09 +0200 |
commit | 40d28960b17bfe6b09fabdcfc0555c9db9cd5971 (patch) | |
tree | 4f3f26ca45813caec004f7a9cc0594666617179c /server | |
parent | b008056e15f165b8d51bfbd2b5a06f993b88a1a2 (diff) | |
download | erlang-40d28960b17bfe6b09fabdcfc0555c9db9cd5971.tar.gz erlang-40d28960b17bfe6b09fabdcfc0555c9db9cd5971.tar.xz erlang-40d28960b17bfe6b09fabdcfc0555c9db9cd5971.zip |
fixed errors
Diffstat (limited to 'server')
-rw-r--r-- | server/client.erl | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/server/client.erl b/server/client.erl index bf8bc22..ce7c99b 100644 --- a/server/client.erl +++ b/server/client.erl @@ -20,6 +20,18 @@ loop(Client) -> Client ! {ok, {foo}}, loop(Client); + get_votes -> + Client ! {ok, media:getVotes(Client)}, + loop(Client); + + {vote, Artist, Title} -> + Client ! media:vote(Artist, Title), + loop(Client); + + {devote, Artist, Title} -> + Client ! media:devote(Artist, Title), + loop(Client); + Cmd -> Client ! {error, {unknown_command, Cmd}}, loop(Client) @@ -30,16 +42,3 @@ register(Client, {Name, Password}) -> login(Client, {Node, Name, Password}) -> dis ! {Client, {login, {Node, Name, Password}}}. - -getVotes() -> - media:getVotes(self()), - receive - Msg -> - Client ! Msg - end. - -vote(Artist,Title) -> - media:vote(Artist, Title). - -devote(Artist,Title) -> - media:devote(Artist, Title). |