From 636f0212bd2ea7f0f55d2859fcbea9f91d633903 Mon Sep 17 00:00:00 2001 From: mekolat Date: Wed, 13 Apr 2016 12:35:27 -0400 Subject: do not send superfluous info on LoadEndAck --- src/map/clif.cpp | 54 ++++++++++++++++++++++++++---------------------------- src/map/map.hpp | 1 - src/map/pc.cpp | 5 +---- 3 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index ea11bbf..31ecaf8 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -3504,21 +3504,10 @@ RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr sd) //clif_authok(); if (sd->npc_id) npc_event_dequeue(sd); - clif_skillinfoblock(sd); - pc_checkitem(sd); //guild_info(); // loadendack時 // next exp - clif_updatestatus(sd, SP::NEXTBASEEXP); - clif_updatestatus(sd, SP::NEXTJOBEXP); - // skill point - clif_updatestatus(sd, SP::SKILLPOINT); - // item - clif_itemlist(sd); - clif_equiplist(sd); - // param all - clif_initialstatus(sd); // party party_send_movemap(sd); // 119 @@ -3532,14 +3521,11 @@ RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr sd) map_addblock(sd); // ブロック登録 clif_spawnpc(sd); // spawn - clif_map_pvp(sd); // send map pvp status - - // weight max , now - clif_updatestatus(sd, SP::MAXWEIGHT); - clif_updatestatus(sd, SP::WEIGHT); + if (sd->bl_m->flag.get(MapFlag::PVP)) + clif_map_pvp(sd); // send map pvp status // pvp - if (!battle_config.pk_mode) + /*if (!battle_config.pk_mode) sd->pvp_timer.cancel(); if (sd->bl_m->flag.get(MapFlag::PVP)) @@ -3557,18 +3543,13 @@ RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr sd) else { // sd->pvp_timer = nullptr; - } - - sd->state.connect_new = 0; + }*/ // view equipment item - clif_changelook(sd, LOOK::WEAPON, static_cast(ItemLook::NONE)); - if (battle_config.save_clothcolor == 1 && sd->status.clothes_color > 0) - clif_changelook(sd, LOOK::CLOTHES_COLOR, - sd->status.clothes_color); + //if (battle_config.save_clothcolor == 1 && sd->status.clothes_color > 0) + // clif_changelook(sd, LOOK::CLOTHES_COLOR, + // sd->status.clothes_color); - // option - clif_changeoption(sd); // broken equipment // clif_changelook_accessories(sd, nullptr); @@ -3579,8 +3560,25 @@ RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr sd) sd->bl_x + AREA_SIZE, sd->bl_y + AREA_SIZE, BL::NUL); - if (!sd->state.seen_motd) - pc_show_motd(sd); + if (!sd->state.connect_new) + return rv; + + // all the code below is only executed once, on login + pc_show_motd(sd); + clif_skillinfoblock(sd); + pc_checkitem(sd); + clif_updatestatus(sd, SP::NEXTBASEEXP); + clif_updatestatus(sd, SP::NEXTJOBEXP); + clif_updatestatus(sd, SP::SKILLPOINT); + clif_itemlist(sd); + clif_equiplist(sd); + clif_initialstatus(sd); + clif_changeoption(sd); + clif_changelook(sd, LOOK::WEAPON, static_cast(ItemLook::NONE)); + clif_updatestatus(sd, SP::MAXWEIGHT); + clif_updatestatus(sd, SP::WEIGHT); + npc_event_doall_l(stringish("OnPCLoginEvent"_s), sd->bl_id, nullptr); + sd->state.connect_new = 0; return rv; } diff --git a/src/map/map.hpp b/src/map/map.hpp index 25fdba5..7732af9 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -145,7 +145,6 @@ struct map_session_data : block_list, SessionData unsigned shroud_hides_name_talking:1; unsigned shroud_disappears_on_pickup:1; unsigned shroud_disappears_on_talk:1; - unsigned seen_motd:1; unsigned pvpchannel; unsigned pvp_rank; unsigned npc_dialog_mes:1; diff --git a/src/map/pc.cpp b/src/map/pc.cpp index db3b372..066484d 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -850,10 +850,7 @@ void pc_show_motd(dumb_ptr sd) // If you remove the sending of this message, // the license does not permit you to publicly use this software. - clif_displaymessage(sd->sess, "Server : ##7This server is Free Software, for details type @source in chat or use the tmwa-source tool"_s); - npc_event_doall_l(stringish("OnPCLoginEvent"_s), sd->bl_id, nullptr); - - sd->state.seen_motd = true; + clif_displaymessage(sd->sess, "Server : ##7This server is Free Software, for details type @source in chat."_s); } /*========================================== -- cgit v1.2.3-60-g2f50