This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TR1T0N_'s profile picture

Bank system (still in dev)

Started by TR1T0N_, 18 May 2014 - 09:01 AM
TR1T0N_ #1
Posted 18 May 2014 - 11:01 AM
hello this is an early release of my Bank System that i have revived from a while ago there is still alot of changes but its partially functional at the moment it is quite secure however needs alot of improvements including security, bank transfers and gui's

the computers are arranged in
id computer
1 = firewall
2 = atm
3 = mainserver

the mainserver contains 2 files registration and mainserver.lua whilst the atm contains atm.lua and firewall contains firewall.lua

firewall: pastebin get ddA4gsFh or http://pastebin.com/ddA4gsFh
atm: pastebin get wBK0c6Q5 or http://pastebin.com/wBK0c6Q5
mainserver: pastebin get uuhb5Nee or http://pastebin.com/uuhb5Nee
registration (put on the same computer as mainserver): pastebin get qLLDWUzX or http://pastebin.com/qLLDWUzX

you will have to change some ids of the computers but using the find function in sublime or notepad ++ and searching for the ids above they can be easily changed this will be updated soon not much to show as of no gui and debug text is still in there this will be cleaned up once basic functionality is there
flaghacker #2
Posted 18 May 2014 - 11:28 AM
A few suggestions:
  • Maybe add a description of what it does in detail?
  • Can you please indent your code properly? It makes it much easier to read…
  • (http://www.computerc...al-indentation/)
  • And why don't you do just do:
  • 
    local serverId = 1
    rednet.send(serverId, <message>)
    
    instead of:
    
    rednet.send(1, <message>)
    
    The first one is far easier to read, understand and configure.
I'm going to try and "hack" it now…
Edited on 18 May 2014 - 09:35 AM
flaghacker #3
Posted 18 May 2014 - 11:48 AM
I tried setting up your programs, and I started all of then.When I insert my disk next to the ATM computer it crashes:

ATM:27: attempt to index ? (a nil value)
The file you're trying to open (/disk/keycode) ofcource doesn't exists yet. Is there something I have to put in there manually?


I made that file and now it says:
ATM computer:

1
please enter your disk
--I enter my disk
3
4
4a
4b
24
denied
24denied
10
an error occured
Firewall computer:

id = 25
msg = denied
distance = 2
2
7
8
9
10
Mainserver computer:

load
activating server
get
24request2
request
24request2
deny
I presume that's not what's supposed to happen?
Edited on 18 May 2014 - 09:59 AM
TR1T0N_ #4
Posted 18 May 2014 - 01:47 PM
ok in the mainserver there should be a program called registration this creates the keycode file and lets the floppy disk act as a sort of credit card this will also create 4 folders each with user information i will eventually intergrate the mainserver and registration into the same program to avoid confusion and maximize ease of use
Edited on 18 May 2014 - 12:19 PM
flaghacker #5
Posted 19 May 2014 - 11:13 AM
Ok, I did. Next? Should I run registration?
Edited on 19 May 2014 - 09:13 AM
TR1T0N_ #6
Posted 19 May 2014 - 03:58 PM
yea run the registration program to create all of the folders an a user account this will require a floppy disk
flaghacker #7
Posted 19 May 2014 - 11:01 PM
O, I see. I thought (haven't looked at the code to much) main server would run that file…

Maybe look into making the creation of new disks something client-side?
mistamadd001 #8
Posted 20 May 2014 - 01:00 AM
hey Triton I have recently created something similar, though I dont have a firewall computer, in fact I only have client authentication on the server, feel free to take a look at it, the code is basic but the system works quite well.

http://www.computerc...__fromsearch__1

I have a separate client computer designed specifically for user account creation.
Edited on 19 May 2014 - 11:03 PM
mistamadd001 #9
Posted 20 May 2014 - 01:07 AM
If you want to pick my brain about my code feel free to PM me, I will be happy to go over it as there is a lot going on, you should recognise most of it though.