aboutsummaryrefslogtreecommitdiffstats
path: root/server/dispatcher.erl
diff options
context:
space:
mode:
Diffstat (limited to 'server/dispatcher.erl')
-rw-r--r--server/dispatcher.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/dispatcher.erl b/server/dispatcher.erl
index 27c2d4c..b3db9bb 100644
--- a/server/dispatcher.erl
+++ b/server/dispatcher.erl
@@ -1,5 +1,5 @@
-module(dispatcher).
--export([start/0, handle/2]).
+-export([start/0, handle/2, register/2, login/2]).
checkUserExists([_|_]) ->
%% helper function to check if given array contains at least one element
@@ -74,3 +74,13 @@ handle({'EXIT', From, _}, State) ->
handle(Cmd, State) ->
%% standard command, to find invalid commands and emit an error
{{error, {unknown_command, Cmd}}, State}.
+
+register(Client, {Name, Password}) ->
+ %% forward the register messages to the dispatcher (called form
+ %% the client)
+ dis ! {Client, {register, {Name, Password}}}.
+
+login(Client, {Node, Name, Password}) ->
+ %% forward the login messages to the dispatcher (called form the
+ %% client)
+ dis ! {Client, {login, {Node, Name, Password}}}.