mirror of
https://gitlab.com/lunovox/minertrade.git
synced 2025-03-15 05:31:20 +00:00
Disabled Transfer Proof Version 2 (per Fail Code)
This commit is contained in:
parent
4cfe11e751
commit
a4db88c4fa
2 changed files with 68 additions and 4 deletions
58
item_atm.lua
58
item_atm.lua
|
@ -184,6 +184,64 @@ modMinerTrade.getSalt_Hash = function()
|
|||
return modMinerTrade.bank.salt_hash
|
||||
end
|
||||
|
||||
modMinerTrade.addTransferProof_v2 = function(player, accountname, txtBeneficiary, txtValue, txtReason)
|
||||
local playername = player:get_player_name()
|
||||
local when = os.date("%Y-%B-%d %Hh:%Mm:%Ss")
|
||||
local title = modMinerTrade.translate("TRANSFER PROOF")
|
||||
local itemDescription = core.colorize("#00FF00", title)
|
||||
.."\n"..modMinerTrade.translate("Reason: %s"):format(
|
||||
txtReason:sub(1, modMinerTrade.paperprinted.max_title_size)
|
||||
)
|
||||
|
||||
local docData = ""
|
||||
.."\n"..modMinerTrade.translate("Document Type")..": "..modMinerTrade.translate("TRANSFER PROOF")
|
||||
.."\n"..modMinerTrade.translate("Responsible Player")..": "..playername
|
||||
.."\n"..modMinerTrade.translate("Account Holder")..": "..accountname
|
||||
.."\n"..modMinerTrade.translate("Beneficiary")..": "..txtBeneficiary
|
||||
.."\n"..modMinerTrade.translate("When")..": "..when
|
||||
.."\n"..modMinerTrade.translate("Value")..": "..txtValue.." minercash"
|
||||
.."\n"..modMinerTrade.translate("Transfer Reason")..": "..txtReason
|
||||
|
||||
local Auth = minetest.get_password_hash(
|
||||
modMinerTrade.getSalt_Hash(),
|
||||
minetest.encode_base64(docData:trim())
|
||||
)
|
||||
|
||||
local htmlBody = [[
|
||||
<center>
|
||||
<img name=obj_piggy_bank.png float=center width=96 height=96>
|
||||
<style font=mono color=#FF0000 size=24><b>[MINETEST_BANK]</b></style>
|
||||
[TRANSFER_PROOF]
|
||||
</center>
|
||||
|
||||
[DOC_DATA]
|
||||
|
||||
<center>
|
||||
---------------------------------= [AUTHENTICATION_HASH] =-------------------------------------
|
||||
[AUTH]
|
||||
-----------------------------------------------------------------------------------------------
|
||||
[EXIST_MESSAGE]
|
||||
</center>
|
||||
]]
|
||||
--[[
|
||||
htmlBody = htmlBody:gsub(
|
||||
"[MINETEST_BANK]",
|
||||
modMinerTrade.translate("MINETEST BANK")
|
||||
)
|
||||
htmlBody = htmlBody:gsub(
|
||||
"[EXIST_MESSAGE]",
|
||||
modMinerTrade.translate("Press <b>ESC</b> to exit this screen!")
|
||||
)
|
||||
htmlBody = htmlBody:gsub("[TRANSFER_PROOF]", title)
|
||||
htmlBody = htmlBody:gsub("[DOC_DATA]", docData)
|
||||
htmlBody = htmlBody:gsub("[AUTH]", Auth)
|
||||
--]]
|
||||
|
||||
--local player = minetest.get_player_by_name(playername)
|
||||
modMinerTrade.addPaperPrinted(player, itemDescription, htmlBody)
|
||||
|
||||
end
|
||||
|
||||
modMinerTrade.addTransferProof = function(player, accountname, txtBeneficiary, txtValue, txtReason)
|
||||
local playername = player:get_player_name()
|
||||
local objProof = modMinerTrade.getProofStack(playername, accountname, txtBeneficiary, txtValue, txtReason)
|
||||
|
|
|
@ -30,9 +30,10 @@ modMinerTrade.addPaperPrinted = function(player, txtTitle, txtPrinted)
|
|||
local playername = player:get_player_name()
|
||||
local data = {}
|
||||
--data.title = fields.title:sub(1, max_title_size)
|
||||
data.title = txtTitle:sub(1, modMinerTrade.paperprinted.max_title_size)
|
||||
data.description = core.colorize("#00FF00", modMinerTrade.translate("PAPER WRITTEN") )
|
||||
.."\n".." * "..data.title
|
||||
--data.title = txtTitle:sub(1, modMinerTrade.paperprinted.max_title_size)
|
||||
--data.description = core.colorize("#00FF00", modMinerTrade.translate("PAPER WRITTEN") )
|
||||
--.."\n".." * "..data.title
|
||||
data.description = txtItemDescription
|
||||
data.when = os.date() --os.date("%Y-%B-%d %Hh:%Mm:%Ss")
|
||||
data.text = minetest.encode_base64(txtPrinted:trim())
|
||||
|
||||
|
@ -134,7 +135,12 @@ Pressione <b>ESC</b> para sair desta tela!
|
|||
|
||||
]]
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
modMinerTrade.addPaperPrinted(player, "Exemplo de Impressão em Papel.", txtPrintedSample:format(playername))
|
||||
modMinerTrade.addPaperPrinted(
|
||||
player,
|
||||
core.colorize("#00FF00", modMinerTrade.translate("PAPER WRITTEN") )
|
||||
.."\n * Exemplo de Impressão em Papel.",
|
||||
txtPrintedSample:format(playername)
|
||||
)
|
||||
|
||||
end,
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue