From 23aa8816357a24e480f133e7138e8ac78af757e5 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 24 Oct 2013 11:18:23 -0700 Subject: Show MOTD after GUI is created --- src/map/clif.cpp | 2 ++ src/map/pc.cpp | 29 +++++++++++++++-------------- src/map/pc.hpp | 2 ++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 1728041..3d6ef98 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -3596,6 +3596,8 @@ void clif_parse_LoadEndAck(int, dumb_ptr sd) sd->bl_x - AREA_SIZE, sd->bl_y - AREA_SIZE, sd->bl_x + AREA_SIZE, sd->bl_y + AREA_SIZE, BL::NUL); + + pc_show_motd(sd); } /*========================================== diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 042be3c..06b7ceb 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -746,20 +746,6 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time, PRINTF("Connection accepted: Character '%s' (account: %d).\n", sd->status.name, sd->status.account_id); - // TODO fix this to cache and use inotify - // this is far from the only such thing, but most of the others are logs - { - std::ifstream in(motd_txt.c_str()); - if (in.is_open()) - { - FString buf; - while (io::getline(in, buf)) - { - clif_displaymessage(sd->fd, buf); - } - } - } - sd->auto_ban_info.in_progress = 0; // Initialize antispam vars @@ -787,6 +773,21 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time, return 0; } +// TODO fix this to cache and use inotify +// this is far from the only such thing, but most of the others are logs +void pc_show_motd(dumb_ptr sd) +{ + std::ifstream in(motd_txt.c_str()); + if (in.is_open()) + { + FString buf; + while (io::getline(in, buf)) + { + clif_displaymessage(sd->fd, buf); + } + } +} + /*========================================== * session idに問題ありなので後始末 *------------------------------------------ diff --git a/src/map/pc.hpp b/src/map/pc.hpp index a2b4aa4..fbd161e 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -151,6 +151,8 @@ int pc_setinvincibletimer(dumb_ptr sd, interval_t); int pc_delinvincibletimer(dumb_ptr sd); int pc_logout(dumb_ptr sd); // [fate] Player logs out +void pc_show_motd(dumb_ptr sd); + int do_init_pc(void); #endif // PC_HPP -- cgit v1.2.3-70-g09d2