diff options
-rw-r--r-- | client/client.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/client.erl b/client/client.erl index f500fe1..b72b5ee 100644 --- a/client/client.erl +++ b/client/client.erl @@ -2,8 +2,8 @@ -export([register/2, register/3, login/3, list/0, handle/2, getVotes/0, vote/2, devote/2]). checkLogin(Value) -> - %% check if user meets the requirements to be locked in or not by - %% locking in to the registered processes and check if the cli + %% check if user meets the requirements to be logged in or not by + %% logging in to the registered processes and checking if the cli %% process is registered LoggedIn = lists:member(cli, registered()), if LoggedIn == Value -> @@ -35,6 +35,7 @@ register(Name, Password) -> {error, not_logged_in} end. +%register the client with the server register(Server, Name, Password) -> try checkLogin(false) of _ -> @@ -45,6 +46,7 @@ register(Server, Name, Password) -> end, wait_for_reply(). +%login to the server login(Server, Name, Password) -> code:purge(server), code:load_abs("../common/server"), @@ -68,6 +70,7 @@ login(Server, Name, Password) -> {error, logged_in} end. +%request the playlist from the server list() -> try checkLogin(true) of _ -> |