-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser.cpp
More file actions
44 lines (34 loc) · 775 Bytes
/
user.cpp
File metadata and controls
44 lines (34 loc) · 775 Bytes
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
#include "user.hpp"
User::User(std::string username){
this->username = username;
this->numSessions = 0;
this->userFolder = setUpUserFolder(username);
this->folderVersion = 1;
this->files = readFolder(this->userFolder);
}
User::~User(){
std::cout << "Deleting User" << std::endl;
}
bool User::canConnect(){
return (numSessions < 2);
}
int User::addSession(usersession_ptr userSession){
userSessions.push_back(userSession);
numSessions++;
return 0;
}
int User::endUserSession(){
return 0;
}
uint32_t User::getFolderVersion(){
return folderVersion;
}
void User::bumpFolderVersion(){
folderVersion++;
}
std::string User::getUserFolder(){
return userFolder;
}
std::string User::getUsername(){
return username;
}