From 2fc490c3bef52a3489be622b3bded33c2aff1483 Mon Sep 17 00:00:00 2001 From: Vitalie Ciubotaru Date: Mon, 23 May 2016 23:00:00 +0900 Subject: [PATCH] Removed new account functionality; player's account is created at login --- atm.lua | 19 ------------------- exchange_machine.lua | 1 + 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/atm.lua b/atm.lua index 05844e4..f6342a8 100644 --- a/atm.lua +++ b/atm.lua @@ -5,7 +5,6 @@ local atm_form = "global_exchange:atm_form" local main_menu =[[ size[6,2] -button[0,0;2,1;new_account;New Account] button[2,0;2,1;info;Account Info] button[4,0;2,1;wire;Wire Monies] button[1,1;4,1;transaction_log;Transaction Log] @@ -38,20 +37,6 @@ local function unique() end -local function new_account_fs(p_name) - local act_suc, err = exchange:new_account(p_name) - - local fs - if not act_suc then - fs = label(0.5,0.5, "Error: " .. err) - else - fs = label(0.5,0.5, "Congratulations on \nyour new account.") - end - - return "size[4,3]" .. fs .. logout(0.5,2) -end - - local function info_fs(p_name) local balance = exchange:get_balance(p_name) @@ -147,10 +132,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.show_formspec(p_name, atm_form, main_menu) end - if fields.new_account then - minetest.show_formspec(p_name, atm_form, new_account_fs(p_name)) - end - if fields.info then minetest.show_formspec(p_name, atm_form, info_fs(p_name)) end diff --git a/exchange_machine.lua b/exchange_machine.lua index a3a12ba..341f43d 100644 --- a/exchange_machine.lua +++ b/exchange_machine.lua @@ -57,6 +57,7 @@ local main_state = {} -- sell: A boolean whether the player has sell selected minetest.register_on_joinplayer(function(player) + exchange:new_account(player:get_player_name()) --just to make sure main_state[player:get_player_name()] = { old_fields = {}, search_results = {},