forked from scott/threaded_network_chat
message box clears now, + fix server interface not refreshing the bottom line
This commit is contained in:
10
main.cc
10
main.cc
@@ -97,6 +97,7 @@ main(int argc, char *argv[])
|
|||||||
} else if (mode == 1) {
|
} else if (mode == 1) {
|
||||||
writeToFile(logFileName, "SERVER MODE");
|
writeToFile(logFileName, "SERVER MODE");
|
||||||
setupServer(PORT_NUM);
|
setupServer(PORT_NUM);
|
||||||
|
linePos++; /* No idea why, but this needs to be here. */
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!exit) {
|
while (!exit) {
|
||||||
@@ -107,10 +108,17 @@ main(int argc, char *argv[])
|
|||||||
if (linesInFile(logFileName) > LOG_LENGTH)
|
if (linesInFile(logFileName) > LOG_LENGTH)
|
||||||
linePos++;
|
linePos++;
|
||||||
|
|
||||||
|
/* clear message box / reset cursor */
|
||||||
move(12, 0);
|
move(12, 0);
|
||||||
printw("> ");
|
printw(">\t\t\t");
|
||||||
|
move(12,2);
|
||||||
|
|
||||||
getstr(userInput);
|
getstr(userInput);
|
||||||
writeToFile(logFileName, userInput);
|
writeToFile(logFileName, userInput);
|
||||||
|
|
||||||
|
if (!strncmp(userInput, "/quit", 5))
|
||||||
|
exit = true;
|
||||||
|
|
||||||
if (mode == 1)
|
if (mode == 1)
|
||||||
send(clientSocketDescriptor, (char *)userInput, strlen(userInput), 0);
|
send(clientSocketDescriptor, (char *)userInput, strlen(userInput), 0);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user