aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-10-14 11:05:09 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-10-14 11:05:09 +0200
commit40d28960b17bfe6b09fabdcfc0555c9db9cd5971 (patch)
tree4f3f26ca45813caec004f7a9cc0594666617179c /server
parentb008056e15f165b8d51bfbd2b5a06f993b88a1a2 (diff)
downloaderlang-40d28960b17bfe6b09fabdcfc0555c9db9cd5971.tar.gz
erlang-40d28960b17bfe6b09fabdcfc0555c9db9cd5971.tar.xz
erlang-40d28960b17bfe6b09fabdcfc0555c9db9cd5971.zip
fixed errors
Diffstat (limited to 'server')
-rw-r--r--server/client.erl25
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).