added better print

This commit is contained in:
Jeena Paradies 2011-04-26 17:16:27 +02:00
parent 612811614a
commit e5f2652ae6
5 changed files with 349 additions and 350 deletions

View file

@ -11,7 +11,7 @@
@implementation GGSNetwork
#define GGS_HOST @"ggs.jeena.net"
#define GGS_HOST @"localhost"
#define GGS_PORT 9000
#define NO_TIMEOUT -1

View file

@ -3,8 +3,8 @@
-export([read/2, send_command/3]).
connect() ->
{ok,Socket} = gen_tcp:connect("ggs.jeena.net", 9000,[{active, false}]),
%{ok,Socket} = gen_tcp:connect("localhost", 9000,[{active, false}]),
%{ok,Socket} = gen_tcp:connect("ggs.jeena.net", 9000,[{active, false}]),
{ok,Socket} = gen_tcp:connect("localhost", 9000,[{active, false}]),
Socket.
read(Socket, Ref) ->

View file

@ -46,9 +46,9 @@ handle_cast({add_one, Type}, St) ->
end,
{noreply, NewSt};
handle_cast(print, #ate { server_messages = SM, client_messages = CM } = St) ->
handle_cast(print, St) ->
CS = length(ggs_coordinator:get_all_players()),
format:print("CS:~i | CM:~i | SM:~i~n", [CS, SM, CM]),
io:fwrite("CS:~w | CM:~w | SM:~w~n", [CS, St#ate.server_messages, St#ate.client_messages]),
{noreply, St};
handle_cast(tick, _St) ->

View file

@ -4,6 +4,6 @@
start() ->
application:start(inets),
application:start(erlang_js),
%ggs_stats:start_link(),
ggs_stats:start_link(),
ggs_db:init(),
application:start(ggs).