Maxim Sokhatsky 11 years ago
parent
commit
1a8c3ebde2

+ 1 - 1
apps/server/src/game_manager.erl

@@ -15,7 +15,7 @@
 destroy_game(Pid,Sup) -> game_sup:stop_game(Sup,Pid).
 destroy_game(Pid,Sup) -> game_sup:stop_game(Sup,Pid).
 
 
 gen_game_id() ->
 gen_game_id() ->
-    PoolNum = nsx_opt:get_env(nsx_idgen,game_pool,5000000) div 1000000,
+    PoolNum = wf:config(nsx_idgen,game_pool,5000000) div 1000000,
     PoolNumStr = integer_to_list(PoolNum),
     PoolNumStr = integer_to_list(PoolNum),
     nsm_db:next_id("game_id_pool_"++PoolNumStr, PoolNum*1000000 + 200, 1). %% 200 is reserved for lucky games and for already created games
     nsm_db:next_id("game_id_pool_"++PoolNumStr, PoolNum*1000000 + 200, 1). %% 200 is reserved for lucky games and for already created games
 
 

+ 1 - 1
apps/server/src/gas.erl

@@ -1,7 +1,7 @@
 -module(gas).
 -module(gas).
 -compile(export_all).
 -compile(export_all).
 
 
--define(ALLOWED, [nsg_trn_lucky,game_sessoin,game_manager]).
+-define(ALLOWED, [nsg_trn_lucky,game_manager,game_okey_ng_table_trn]).
 
 
 info(Module,String, Args) ->
 info(Module,String, Args) ->
     case lists:member(Module,?ALLOWED) of
     case lists:member(Module,?ALLOWED) of

+ 1 - 1
apps/server/src/id_generator.erl

@@ -10,7 +10,7 @@ get_id() -> gen_server:call(?MODULE, get_id).
 get_id2() -> gen_server:call(?MODULE, get_id2).
 get_id2() -> gen_server:call(?MODULE, get_id2).
 start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
 start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
 
 
-init([]) -> {ok, #state{lastid=nsx_opt:get_env(nsx_idgen,game_pool,1000000)}}.
+init([]) -> {ok, #state{lastid=wf:config(nsx_idgen,game_pool,1000000)}}.
 handle_call(get_id, _From, #state{lastid = LID} = State) -> Reply = LID + 1, {reply, Reply, State#state{lastid = Reply}};
 handle_call(get_id, _From, #state{lastid = LID} = State) -> Reply = LID + 1, {reply, Reply, State#state{lastid = Reply}};
 handle_call(get_id2, _From, #state{robotid = RID} = State) -> Reply = RID + 1, {reply, Reply, State#state{robotid = Reply}};
 handle_call(get_id2, _From, #state{robotid = RID} = State) -> Reply = RID + 1, {reply, Reply, State#state{robotid = Reply}};
 handle_call(_Request, _From, State) -> Reply = ok, {reply, Reply, State}.
 handle_call(_Request, _From, State) -> Reply = ok, {reply, Reply, State}.

+ 0 - 79
apps/server/src/nsx_opt.erl

@@ -1,79 +0,0 @@
-%%----------------------------------------------------------------------
-%% @author Vladimir Baranov <baranoff.vladimir@gmail.com>
-%% @copyright Paynet Internet ve Bilisim Hizmetleri A.S. All Rights Reserved.
-%% @doc nsm_mq routines
-%% @end
-%%--------------------------------------------------------------------
--module(nsx_opt).
-
-%%
-%% Include files
-%%
-
-%%
-%% Exported Functions
-%%
--export([
-         encode/1,
-         decode/1
-        ]).
-
--export([opt/3,
-         override_opt/3,
-         get_env/2,
-         get_env/3]).
-
-%%
-%% API Functions
-%%
-
-encode(Term) ->
-    term_to_binary(Term).
-
-decode(Binary) when is_binary(Binary) ->
-    binary_to_term(Binary).
-
-%% Get option from list. Option can be either single option, like 'name', or
-%% tuple {name, "Name"}. Single options are boolean, but return value can be
-%% overwritten with default value. If option not found in options List - returns
-%% default value.
-opt(Option, List, Default) ->
-    case lists:member(Option, List) of
-        true ->
-            true;
-        false ->
-            proplists:get_value(Option, List, Default)
-    end.
-
--spec override_opt(atom(), any(), list()) -> list().
-
-override_opt(Option, Value, Options) ->
-    CleanOptions = lists:filter(
-                     fun({O, _}) when O == Option -> false;
-                        (O)      when O == Option -> false;
-                        (_)                       -> true
-                     end, Options),
-
-    [{Option, Value} | CleanOptions].
-
-
-%% @doc Get env options from application config. If parameter not set - default
-%% value will be returned
--spec get_env(Par::atom(), Default::term()) -> term().
-
-get_env(Par, DefaultValue) ->
-    case application:get_env(Par) of
-        undefined ->
-            DefaultValue;
-        {ok, Value} ->
-            Value
-    end.
-
-get_env(App, Par, DefaultValue) ->
-    case application:get_env(App, Par) of
-        undefined ->
-            DefaultValue;
-        {ok, Value} ->
-            Value
-    end.
-