Added OTP structure to ggs_coordinator

This commit is contained in:
Jonatan Pålsson 2011-02-16 17:19:00 +01:00
parent a801008cd9
commit 5d71202a00

View file

@ -1,5 +1,11 @@
-module(ggs_coordinator). -module(ggs_coordinator).
-export().
%% API Exports
-export([start_link/1, stop/1]).
%% gen_server callback exports
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
code_change/3]).
%% @doc This module act as "the man in the middle". %% @doc This module act as "the man in the middle".
%% Creates the starting connection between table and players. %% Creates the starting connection between table and players.
@ -9,15 +15,15 @@ start_link() ->
not_implemented. not_implemented.
%% @doc Terminates the coordinator process. %% @doc Terminates the coordinator process.
stop() -> stop(_Reason) ->
not_implemented. not_implemented.
%% @doc Creates a unique token for the table. %% @doc Joins table with specified token
join_table() -> join_table(_Token) ->
not_implemented. not_implemented.
%% @doc %% @doc Create a new table
create_table() -> create_table(_Params) ->
not_implemented. not_implemented.
%% @doc This is the first function run by a newly created players. %% @doc This is the first function run by a newly created players.
@ -26,13 +32,30 @@ join_lobby() ->
not_implemented. not_implemented.
%% @doc Act as a supervisor to player and respawns player when it gets bad data. %% @doc Act as a supervisor to player and respawns player when it gets bad data.
respawn_player(Player, Socket) -> respawn_player(_Player, _Socket) ->
not_implemented. not_implemented.
%% @doc Act as a supervisor to table and respawns table when it gets bad data. %% @doc Act as a supervisor to table and respawns table when it gets bad data.
respawn_table() -> respawn_table(_Token) ->
not_implemented. not_implemented.
%% @doc Removes a player from coordinator. %% @doc Removes a player from coordinator.
remove_player(From, Player) -> remove_player(From, Player) ->
not_implemented. not_implemented.
%% gen_server callbacks
init([Port]) ->
{ok, ok}.
handle_call(_Message, _From, State) ->
{noreply, State}.
handle_cast(_Message, State) ->
{noreply, State}.
terminate(normal, _State) ->
ok.
code_change(_OldVsn, State, Extra) ->
{ok, State}.