From f2cc4011005d47f568ef83d5498cf6abf5dfd388 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 22 Apr 2017 11:53:44 +1000 Subject: [PATCH] Add node messaging --- ansis_default/mainmenu.ans | Bin 2242 -> 2412 bytes bbs.h | 2 ++ magicka.strings | 5 ++++ main_menu.c | 57 +++++++++++++++++++++++++++++++++++++ menus.c | 8 +++++- menus_default/main.mnu | 3 ++ 6 files changed, 74 insertions(+), 1 deletion(-) diff --git a/ansis_default/mainmenu.ans b/ansis_default/mainmenu.ans index b46bc4b79af99c37aa7b8e09b48757b0cfecb913..76613de4f1d3d3f9c4a33ec7f257210a37f744c4 100644 GIT binary patch delta 178 zcmX>k_(o{MA66ylXoFnoXhUOX>1boKTt5W`AjjI+JU2KsFGayGKP6RR^H conf.nodes) { + s_printf(get_string(218)); + return; + } + s_printf(get_string(219)); + + s_readstring(msg, 256); + + snprintf(buffer, PATH_MAX, "%s/node%d", conf.bbs_path, nodetomsg); + + if (stat(buffer, &s) != 0) { + mkdir(buffer, 0755); + } + snprintf(buffer, PATH_MAX, "%s/node%d/nodemsg.txt", conf.bbs_path, nodetomsg); + + fptr = fopen(buffer, "a"); + if (fptr) { + fprintf(fptr, get_string(220), gUser->loginname, mynode, msg); + fclose(fptr); + } +} + void display_textfiles() { int i; char buffer[5]; diff --git a/menus.c b/menus.c index 1df2005..3e85002 100644 --- a/menus.c +++ b/menus.c @@ -44,6 +44,7 @@ #define MENU_PREVFILESUB 35 #define MENU_LISTMESSAGES 36 #define MENU_DOSCRIPT 37 +#define MENU_SENDNODEMSG 38 extern struct bbs_config conf; extern struct user_record *gUser; @@ -181,6 +182,8 @@ int menu_system(char *menufile) { menu[menu_items-1]->command = MENU_LISTMESSAGES; } else if (strncasecmp(&buffer[8], "DOSCRIPT", 8) == 0) { menu[menu_items-1]->command = MENU_DOSCRIPT; + } else if (strncasecmp(&buffer[8], "SENDNODEMSG", 11) == 0) { + menu[menu_items-1]->command = MENU_SENDNODEMSG; } } else if (strncasecmp(buffer, "SECLEVEL", 8) == 0) { menu[menu_items-1]->seclevel = atoi(&buffer[9]); @@ -451,7 +454,10 @@ int menu_system(char *menufile) { break; case MENU_DOSCRIPT: do_lua_script(menu[i]->data); - break; + break; + case MENU_SENDNODEMSG: + send_node_msg(); + break; } break; } diff --git a/menus_default/main.mnu b/menus_default/main.mnu index aa93710..cda75ff 100644 --- a/menus_default/main.mnu +++ b/menus_default/main.mnu @@ -37,6 +37,9 @@ DATA file HOTKEY S COMMAND SETTINGS +HOTKEY N +COMMAND SENDNODEMSG + HOTKEY G COMMAND SUBMENU DATA logoff