Merge branch 'jonte_rewrite' into rewrite

Conflicts:
	src/ggs_coordinator.erl
	src/ggs_dispatcher.erl
	src/ggs_player.erl
This commit is contained in:
Jonatan Pålsson 2011-02-16 20:08:43 +01:00
commit c63e243564
3 changed files with 11 additions and 2 deletions

View file

@ -42,7 +42,11 @@ respawn_table(_Token) ->
%% @doc Removes a player from coordinator.
remove_player(_From, _Player) ->
<<<<<<< HEAD
helpers:not_implemented().
=======
not_implemented.
>>>>>>> jonte_rewrite
%% gen_server callbacks

View file

@ -31,6 +31,7 @@ start_link(Port) ->
%% Reason = String
stop(_Reason) -> helpers:not_implemented().
%% gen_server callbacks
%% @doc Initiate the dispatcher. This is called from gen_server

View file

@ -30,13 +30,17 @@ get_token(_Player) ->
%% @doc Properly terminates the player process. The player token will be destroyed.
%% Makes table token unreferenced and destroys the process in the end.
%% @spec stop(Table::pid()) -> Reason::string()
stop(Table) ->
stop(_Table) ->
helpers:not_implemented().
%% Internals
loop(Socket) ->
% The socket is in 'active' mode, and that means we are pushed any data
% that arrives on it, we do not need to recv() manually. Since the socket
% was opened in our parent process, we need to change the owner of it to
% us, otherwise these messages end up in our parent.
erlang:port_connect(Socket, self()),
receive {tcp, Socket, Data} -> % Just echo for now..
gen_tcp:send(Socket,Data),
loop(Socket)