aboutsummaryrefslogtreecommitdiffstats
path: root/server/dispatcher.erl
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-10-15 10:51:15 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-10-15 10:51:15 +0200
commit32abe1a28b74263e12afd4475fd7896d9c4e6a9d (patch)
tree596d84005dbaa7df801f477b58bb39b16f0b8e5b /server/dispatcher.erl
parent8ce78ba045474b606267e351e945ef6be1b969c0 (diff)
parentebbf2038b2e131cc43eae1d4c98fbd6efb548f0a (diff)
downloaderlang-32abe1a28b74263e12afd4475fd7896d9c4e6a9d.tar.gz
erlang-32abe1a28b74263e12afd4475fd7896d9c4e6a9d.tar.xz
erlang-32abe1a28b74263e12afd4475fd7896d9c4e6a9d.zip
Merge branch 'master' of ssh://git.animux.de/erlang
Diffstat (limited to 'server/dispatcher.erl')
-rw-r--r--server/dispatcher.erl20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/dispatcher.erl b/server/dispatcher.erl
index b3db9bb..a0a0459 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,12 +67,12 @@ 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}.
register(Client, {Name, Password}) ->