Skip to content

Commit 3e72b42

Browse files
committed
Update
1 parent f638e4a commit 3e72b42

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

client.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ class clsClient {
159159
ui.notification("Alert", {"This username is already in use."});
160160
} while (ok);
161161
sock.send(ui.getinput("Enter Password: ", 3));
162-
clear();
163162
ui.notification("Success!", {"You have registered a new account."});
163+
clear();
164+
refresh();
164165
}
165166

166167
void log() {
@@ -176,8 +177,9 @@ class clsClient {
176177
ui.notification("Alert",
177178
{"The password or username is incorrect."});
178179
} while (ok);
179-
clear();
180180
ui.notification("Success!", {"You signed in to your account."});
181+
clear();
182+
refresh();
181183
}
182184

183185
clsClient(SSL* ssl, clsUi& ui) : sock(ssl), ui(ui) {}
@@ -294,7 +296,6 @@ class project {
294296
owner.ui.notification("Alert", {"Path is invalid."});
295297
} while (ok);
296298
prjPath += '/';
297-
// prjPath = "/home/jomm/Documents/kurwa/clsClient/test/";
298299
do {
299300
prjName = owner.ui.getinput("Name of your project: ", 3);
300301
owner.sock.send(prjName);

server.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class clsClient : public clsPerson {
140140
genSha256Hash(sBuffer, hash);
141141
db.exec("insert into users (username, password) values (?, ?);",
142142
{Text, Blob}, username.c_str(), hash, sizeof(hash));
143-
cout << "[+] New user created." << endl;
143+
cout << "[+] New user created. " << sock.ip << endl;
144144
}
145145

146146
void log(clsDb& db) {
@@ -217,7 +217,7 @@ class clsProject {
217217
db.exec(
218218
"select id from projects where ownerId = ? and prjName = ?",
219219
{Id, Id, Text}, owner.id, prjName.c_str(), &prjId);
220-
cout << "[+] New project created." << endl;
220+
cout << "[+] New project created. " << owner.sock.ip << endl;
221221
owner.sock.send("ok");
222222
} else
223223
owner.sock.send("not ok");
@@ -279,7 +279,7 @@ class clsProject {
279279
}
280280
}
281281
} catch (const runtime_error& e) {
282-
cerr << e.what() << endl;
282+
cerr << e.what() << ' ' << owner.sock.ip << endl;
283283
}
284284
}
285285

@@ -302,7 +302,7 @@ void handleClient(clsClient client, clsDb& db, const string& path) {
302302
} else if (command == "signIn")
303303
client.log(db);
304304
else {
305-
client.sock.send("Dinahu huiputalo blyat, parodia na ludynu.");
305+
client.sock.send("Dinahu huiputalo blyat.");
306306
throw invalid_argument("[!] Chert detected.");
307307
}
308308
while ((command = client.sock.recv()) != "quit") {

sr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class clsSock {
119119
SSL_accept(ssl);
120120
}
121121
clsSock(SSL *ssl) : sock(socket(AF_INET, SOCK_STREAM, 0)), ssl(ssl) {
122-
sockaddr_in servAddr{};
122+
sockaddr_in servAddr;
123123
servAddr.sin_family = AF_INET;
124124
servAddr.sin_port = htons(8080);
125125
inet_pton(AF_INET, "127.0.0.1", &servAddr.sin_addr);

0 commit comments

Comments
 (0)