Removed new account functionality; player's account is created at login

This commit is contained in:
Vitalie Ciubotaru 2016-03-05 23:01:00 +09:00
parent c2ba4eb797
commit 5eaa5db555
2 changed files with 1 additions and 19 deletions

19
atm.lua
View File

@ -6,7 +6,6 @@ local atm_form = "global_exchange:atm_form"
local main_menu =[[ local main_menu =[[
size[6,2] size[6,2]
button[0,0;2,1;new_account;New Account]
button[2,0;2,1;info;Account Info] button[2,0;2,1;info;Account Info]
button[4,0;2,1;wire;Wire Monies] button[4,0;2,1;wire;Wire Monies]
button[1,1;4,1;transaction_log;Transaction Log] button[1,1;4,1;transaction_log;Transaction Log]
@ -39,20 +38,6 @@ local function unique()
end 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 function info_fs(p_name)
local balance = exchange:get_balance(p_name) local balance = exchange:get_balance(p_name)
@ -148,10 +133,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
minetest.show_formspec(p_name, atm_form, main_menu) minetest.show_formspec(p_name, atm_form, main_menu)
end end
if fields.new_account then
minetest.show_formspec(p_name, atm_form, new_account_fs(p_name))
end
if fields.info then if fields.info then
minetest.show_formspec(p_name, atm_form, info_fs(p_name)) minetest.show_formspec(p_name, atm_form, info_fs(p_name))
end end

View File

@ -57,6 +57,7 @@ local main_state = {}
-- sell: A boolean whether the player has sell selected -- sell: A boolean whether the player has sell selected
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
exchange:new_account(player:get_player_name()) --just to make sure
main_state[player:get_player_name()] = { main_state[player:get_player_name()] = {
old_fields = {}, old_fields = {},
search_results = {}, search_results = {},