diff options
-rw-r--r-- | server/dispatcher.erl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/server/dispatcher.erl b/server/dispatcher.erl index 27c2d4c..08b19ec 100644 --- a/server/dispatcher.erl +++ b/server/dispatcher.erl @@ -13,10 +13,10 @@ start() -> code:purge(server), code:load_abs("../common/server"), - %% initalize database + %% initalize client database cldb:init(), - %% spawn media backend in seperat process + %% spawn media backend in seperate process try spawn(media, init, []) of _ -> io:format("Media-Backend started!~n") @@ -26,11 +26,11 @@ start() -> exit(1) end, - %% start server (registered as dis, arriving messages will call + %% start server (registered as "dis", arriving messages will call %% the handle function to get the result) %% The state of the server is true if register is allowed (no user - %% exists) -> first created user is admit and after the first - %% registration only the admit could register the other user + %% exists) -> first created user is admin and after the first + %% registration only the admin can register other users UserExists = checkUserExists(cldb:all()), try server:start(dis, dispatcher, UserExists) of true -> @@ -47,12 +47,12 @@ handle({register, {User, Password}}, true) -> {cldb:register(User, Password, admin), false}; handle({register, _}, false) -> - %% if state of the server is false, no registration allowed, - %% because the admin user allready exists + %% if state of the server is false, registration is not allowed, + %% because the admin user already exists {{error, no_rights}, false}; handle({login, {Node, User, Password}}, State) -> - %% login user if Password match + %% login user if password correct case cldb:login(User, Password) of {ok, UserRow} -> case client:start(Node, UserRow) of @@ -67,10 +67,10 @@ handle({login, {Node, User, Password}}, State) -> handle({'EXIT', From, _}, State) -> %% handle the exit messages from the client, so that the client - %% logouts if the connection between server and client breaks + %% logs out if the connection between server and client breaks cldb:logout(From), State; handle(Cmd, State) -> - %% standard command, to find invalid commands and emit an error + %% standard command to find invalid commands and emit an error {{error, {unknown_command, Cmd}}, State}. |