-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbank.h
executable file
·51 lines (42 loc) · 860 Bytes
/
bank.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __bank_h__
#define __bank_h__
#include <string.h>
#include <vector>
#include "account.h"
class Bank
{
public:
void addAccount(Account* account);
Account* getAccountByName(const std::string& username);
Account* connectToAccount();
Account* tryLoginHash(const std::string& hash);
std::string appSalt;
~Bank();
std::vector<byte*> keys;
std::vector<bool> keysInUse;
private:
std::vector<Account*> accounts;
};
struct BankSocketThread
{
Bank* bank;
int *csock;
};
struct BankSession
{
//Construct
BankSession() : state(0),error(false),account(0) {}
//Functions
bool sendP(long int &csock, void* packet, std::string command);
bool validateNonce(std::string packet);
void endSession();
//Variables
Account* account;
unsigned int state;
Bank* bank;
bool error;
std::string bankNonce;
std::string atmNonce;
byte* key;
};
#endif