summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-24 11:18:23 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-24 11:18:23 -0700
commit23aa8816357a24e480f133e7138e8ac78af757e5 (patch)
tree6fd8c540dc38de05614c57a658479b9ed779f80b
parentbbcdc2b68c2de6068d550b134381ed76b098dc0a (diff)
downloadtmwa-23aa8816357a24e480f133e7138e8ac78af757e5.tar.gz
tmwa-23aa8816357a24e480f133e7138e8ac78af757e5.tar.bz2
tmwa-23aa8816357a24e480f133e7138e8ac78af757e5.tar.xz
tmwa-23aa8816357a24e480f133e7138e8ac78af757e5.zip
Show MOTD after GUI is created
-rw-r--r--src/map/clif.cpp2
-rw-r--r--src/map/pc.cpp29
-rw-r--r--src/map/pc.hpp2
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<map_session_data> 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<map_session_data> 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<map_session_data> sd, interval_t);
int pc_delinvincibletimer(dumb_ptr<map_session_data> sd);
int pc_logout(dumb_ptr<map_session_data> sd); // [fate] Player logs out
+void pc_show_motd(dumb_ptr<map_session_data> sd);
+
int do_init_pc(void);
#endif // PC_HPP