Added goodbye ansi, port now specified on cmd line
This commit is contained in:
parent
cafc5b4e37
commit
56c092674f
14
ansis/goodbye.ans
Normal file
14
ansis/goodbye.ans
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[?7h[255D[40m
|
||||||
|
[0;1m[26Cワワ[19Cワ
|
||||||
|
[13Cワワ[12C[47mイロロ[40mワワ[8Cワワ [47mイア[40mロ
|
||||||
|
[14C[47mイロロ[40mワワ [0mワ[1mロロロロロ゚ロロロ[33mロ[37mン[9C[47mイロロ[40mワワ [0mロ [1mワワ ワワ゚
|
||||||
|
[7C[0mワ[1mロロロロロ゚ロロロ[33mロ[37mン [47mイイロロロ[40mワワロロロロン [0mワ[1mロロロロロ゚ロロロ[33mロ[37mン [0mワ[1;47mイイロロ[2C[40mロロロ[33mロロ[9C[37mワワワ゚
|
||||||
|
[7C゚[47mイロロロ[40mワワワワワワ [0m゙[1;47mロロロロイ[30;40mア [37mワワワワワ [0m゙[1;47mイイロロロ[40mワワロロロロン [0m゙[1;47mアイロロロ[30;40mーー[37;47mイロロロロ[2C[0mワ[1mワ[47mイイロロ[40m゚[47mイロロ[33mロロ[40m
|
||||||
|
[7C[37mワワワワワ ロロロロロ[47mアー゚ロイー[0mン [1;47mイイロロア[1Cアロロロロイ[30;40mア [37mワワワワワ [0mロ[1;47mーロロロイ[30;40mーア[37;47mアロロロイ[1C[0m゙[1;47mアロロロロ[40mン[30mー[37;47mイロロロイ[40m
|
||||||
|
[6C[0m゙[1;47mー゚ロイー[0mン [1;47mイイロロア[0m゙゚[47m [1mー゚[0;47mロロ[40mワロ[1;47mーー゚ー[1C[0m゙[1;47mー゚ロイー[0mン [1;47mイイロロア[1C[0m゙[1;47mー゚ロアア[0mン[1;30mー[37;47mーロロロア[1C[0mロ[1;47mーロロロア[1C[30;40mア[0mロ[1;47mアロロア[40m
|
||||||
|
[7C[0m゚[47m [1mー゚[0;47mロロ[40mワロ[1;47mーー゚ー[7C[0mワ[1;30;47mーー[0;47mロロ[40mロン ゚[47m [1mー゚[0;47mロロ[40mワロ[1;47mーー゚ー[2C[0m゚[1;30;47mー[0;47mロ [1mー[0;47mロ[40mワロ[1;47mーロンー[1C[0m゙ロ[1;47mアア゚ー[0mン[1;30mー[47mー[37mー゚ンー[40m
|
||||||
|
[10C[0mワ゚ワワ[1;30;47mーー[0m゚゚[12C゚゚゚[7Cワ[1;30;47mーー[0;47mロロ[40mロン ワワ [1;30;47mイ[37mー゚[0;47mロ[1;30mア[2C[0m゚[1;30;47mー [0;47mロ [40mワロ[47m [40mロ[47m [40mイ
|
||||||
|
[44C゚゚゚ ゚[1;30m゚ [0m゚゚゚゚゚゚゚
|
||||||
|
|
||||||
|
[21CThanks for visiting! Come back soon!
|
||||||
|
[0m[255D
|
3
bbs.c
3
bbs.c
@ -520,5 +520,8 @@ void runbbs(int socket, char *config_path) {
|
|||||||
|
|
||||||
// main menu
|
// main menu
|
||||||
main_menu(socket, user);
|
main_menu(socket, user);
|
||||||
|
|
||||||
|
s_displayansi(socket, "goodbye");
|
||||||
|
|
||||||
disconnect(socket);
|
disconnect(socket);
|
||||||
}
|
}
|
||||||
|
2
doors.c
2
doors.c
@ -65,7 +65,7 @@ int door_menu(int socket, struct user_record *user) {
|
|||||||
while (!dodoors) {
|
while (!dodoors) {
|
||||||
s_displayansi(socket, "doors");
|
s_displayansi(socket, "doors");
|
||||||
|
|
||||||
sprintf(prompt, "TL: %dm :> ", user->timeleft);
|
sprintf(prompt, "\r\nTL: %dm :> ", user->timeleft);
|
||||||
s_putstring(socket, prompt);
|
s_putstring(socket, prompt);
|
||||||
|
|
||||||
c = s_getc(socket);
|
c = s_getc(socket);
|
||||||
|
8
main.c
8
main.c
@ -11,9 +11,10 @@ int main(int argc, char **argv) {
|
|||||||
int socket_desc, client_sock, c, *new_sock;
|
int socket_desc, client_sock, c, *new_sock;
|
||||||
int pid;
|
int pid;
|
||||||
struct sockaddr_in server, client;
|
struct sockaddr_in server, client;
|
||||||
|
int port;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 3) {
|
||||||
printf("Usage ./magicka bbs.ini\n");
|
printf("Usage ./magicka bbs.ini port\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,10 +23,11 @@ int main(int argc, char **argv) {
|
|||||||
printf("Couldn't create socket..\n");
|
printf("Couldn't create socket..\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
port = atoi(argv[2]);
|
||||||
|
|
||||||
server.sin_family = AF_INET;
|
server.sin_family = AF_INET;
|
||||||
server.sin_addr.s_addr = INADDR_ANY;
|
server.sin_addr.s_addr = INADDR_ANY;
|
||||||
server.sin_port = htons(2300);
|
server.sin_port = htons(port);
|
||||||
|
|
||||||
if (bind(socket_desc, (struct sockaddr *)&server, sizeof(server)) < 0) {
|
if (bind(socket_desc, (struct sockaddr *)&server, sizeof(server)) < 0) {
|
||||||
perror("Bind Failed, Error\n");
|
perror("Bind Failed, Error\n");
|
||||||
|
@ -14,7 +14,7 @@ void main_menu(int socket, struct user_record *user) {
|
|||||||
s_displayansi(socket, "mainmenu");
|
s_displayansi(socket, "mainmenu");
|
||||||
|
|
||||||
|
|
||||||
sprintf(prompt, "TL: %dm :> ", user->timeleft);
|
sprintf(prompt, "\r\nTL: %dm :> ", user->timeleft);
|
||||||
s_putstring(socket, prompt);
|
s_putstring(socket, prompt);
|
||||||
|
|
||||||
c = s_getc(socket);
|
c = s_getc(socket);
|
||||||
|
Reference in New Issue
Block a user