From b91af95d1ef5fc893c3db784e9ab6df2c28b4638 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 15 Oct 2010 11:51:49 +0200 Subject: removed register/2 and login/2 from dispatcher (now direct call to dis) --- client/client.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/client.erl b/client/client.erl index 43dbfc6..ee9421f 100644 --- a/client/client.erl +++ b/client/client.erl @@ -15,9 +15,9 @@ buildNode(Server) -> %% build the node string of the server by using the hostname list_to_atom("distributed_music_system_main_node@" ++ Server). -rpc(Server, Function, Params) -> - %% shortcut for calling a function from the server - rpc:call(buildNode(Server), dispatcher, Function, Params). +rpc(Server, Params) -> + %% shortcut for sending something to the dispatcher on the server + {dis, buildNode(Server)} ! {self(), Params}. register(Server, Name, Password) -> %% check if client is not logged in (if client is logged in, @@ -25,7 +25,7 @@ register(Server, Name, Password) -> try checkLogin(false) of _ -> %% register a new user account on the server - rpc(Server, register, [self(), {Name, Password}]) + rpc(Server, {register, {Name, Password}}) catch {error, login_state} -> {error, logged_in} @@ -52,7 +52,7 @@ login(Server, Name, Password) -> try checkLogin(false) of _ -> %% login to the server - rpc(Server, login, [self(), {node(), Name, Password}]), + rpc(Server, {login, {node(), Name, Password}}), receive %% the server returns the Pid of the process on the %% client, that should handle the communication -- cgit v1.2.3