Просмотр исходного кода

removed debug from bot module and experimental code from test; for run protocol test type in console test_okey_ng:main(), by default bot join to 1000001 (lucky game) and will play infinitely, so this module only for manual test

Roman Dayneko 11 лет назад
Родитель
Сommit
e4099389d8
2 измененных файлов с 1 добавлено и 7 удалено
  1. 1 3
      apps/server/src/okey/game_okey_bot.erl
  2. 0 4
      apps/server/src/okey/test_okey_ng.erl

+ 1 - 3
apps/server/src/okey/game_okey_bot.erl

@@ -63,7 +63,6 @@ handle_call({server, Msg0}, _From, #state{uid = UId, bot = BPid} = State) ->
     {reply, ok, State};
 
 handle_call({call_rpc, Msg}, From, #state{game_session = GameSession} = State) ->
-    io:format("msg ~p~n", [Msg]),
     gas:info(?MODULE,"OKEY BOT: call_rpc ~p",[Msg]),
     RR = State#state.running_requests,
     Id = State#state.request_id + 1,
@@ -77,8 +76,7 @@ handle_call({call_rpc, Msg}, From, #state{game_session = GameSession} = State) -
                                           gas:info(?MODULE,"                        REPLY: ~p",[Answer]),
                                           {reply, Id, Answer}
                                       catch
-                                          Err:Reason ->
-                                              gas:info(?MODULE," OKEY BOT crash with resason: ~p ~p ~p",[Err, Reason, erlang:get_stacktrace()]),
+                                          _Err:Reason ->
                                               {reply, Id, {error, Reason}}
                                       end,
                                 gen_server:call(Self, Res)

+ 0 - 4
apps/server/src/okey/test_okey_ng.erl

@@ -25,10 +25,6 @@ loop(BotPid) ->
     gas:info("TEST OKEY NG listen to air"),
     
     receive 
-        {server, Msg} -> 
-            gas:info("TEST OKEY NG receive msg ~p", [Msg]),
-            game_okey_bot:sendmessage(BotPid, Msg),
-            loop(BotPid);
         {'DOWN', _MonitorRef, _Type, _Object, _Info} -> ok;
         UnknowMsg -> wf:info("Unknow message: ~p", [UnknowMsg]), loop(BotPid)
     end.