ggs_logger got lost somewhere? I added it again, also replaced all references to helpers with ggs_logger

This commit is contained in:
Jonatan Pålsson 2011-02-17 08:33:55 +01:00
parent ea1557e2d7
commit 94d9dc6d7f
5 changed files with 23 additions and 15 deletions

View file

@ -17,32 +17,32 @@ start_link() ->
%% @doc Terminates the coordinator process.
stop(_Reason) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Joins table with specified token
join_table(_Token) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Create a new table
create_table(_Params) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc This is the first function run by a newly created players.
%% Generates a unique token that we use to identify the player.
join_lobby() ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Act as a supervisor to player and respawns player when it gets bad data.
respawn_player(_Player, _Socket) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Act as a supervisor to table and respawns table when it gets bad data.
respawn_table(_Token) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Removes a player from coordinator.
remove_player(_From, _Player) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% gen_server callbacks

View file

@ -29,7 +29,7 @@ start_link(Port) ->
%% @doc Stops the dispatcher with the specified reason.
%% @spec stop(Reason) -> ok.
%% Reason = String
stop(_Reason) -> helpers:not_implemented().
stop(_Reason) -> ggs_logger:not_implemented().
%% gen_server callbacks

8
src/ggs_logger.erl Normal file
View file

@ -0,0 +1,8 @@
-module(ggs_logger).
-export([not_implemented/0, log/2]).
not_implemented() ->
exit(not_implemented).
log(Format, Args) ->
error_logger:info_msg(Format, Args).

View file

@ -20,19 +20,19 @@ start_link(Socket) ->
%% @spec notify(Player::Pid(), From::Pid(),
%% {Command::String(), Message::string()}) -> ok
notify(Player, From, Message) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Get the player token uniquely representing the player.
%% @spec get_token() -> string()
get_token(_Player) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Properly terminates the player process. The player token will be lost
%% together with the table token. It should also close the player socket and the
%% process should return in the end.
%% @spec stop(Table::pid()) -> Reason::string()
stop(_Player,_Table) ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% Internals

View file

@ -4,20 +4,20 @@
%% @doc start_link should always return ok for any valid socket. A valid socket
%% should always return {ok, Pid} and {error, Reason} otherwise.
start_link_test() ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Given that start_link returned {ok, Player}. Notify shall always return ok and
%% deliver a specified message through the socket.
notify_test() ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Given that start_link returned {ok, Player}. get_token shall always return a valid
%% player token. a valid token should be unique.
get_token_test() ->
helpers:not_implemented().
ggs_logger:not_implemented().
%% @doc Given that start_link returned {ok, Pid}. There shouldn't be possible to
%% execute this function with the same Player and Table arguments twice.
stop_test() ->
helpers:not_implemented().
ggs_logger:not_implemented().