blob: 7139e6789c8f90562037e2a61a92445500fdad81 (
plain) (
tree)
|
|
-module(client).
-export([start/1, loop/1, register/2, login/2]).
start(Client) ->
spawn(client, loop, Client).
loop(Client) ->
receive
{list} ->
Client ! {ok, media ! {all}};
true ->
Client ! {error, unknown_command},
loop(Client)
end.
register(Client, {Name, Password}) ->
dis ! {Client, {register, {Name, Password}}}.
login(Client, {Name, Password}) ->
dis ! {Client, {login, {Name, Password}}}.
|