- Did some cleaning in pc_authok and clif_parse_LoadEndAck
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9175 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
69c98bdfa2
commit
b4e089ee01
134
src/map/clif.c
134
src/map/clif.c
@ -8248,8 +8248,6 @@ static int clif_nighttimer(int tid, unsigned int tick, int id, int data)
|
|||||||
*/
|
*/
|
||||||
void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
if(sd->bl.prev != NULL)
|
if(sd->bl.prev != NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -8260,41 +8258,16 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sd->npc_id) npc_event_dequeue(sd);
|
// look
|
||||||
|
#if PACKETVER < 4
|
||||||
|
clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
|
||||||
|
clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
|
||||||
|
#else
|
||||||
|
clif_changelook(&sd->bl,LOOK_WEAPON,0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(sd->state.connect_new) {
|
if(sd->vd.cloth_color)
|
||||||
|
clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
|
||||||
if (sd->sc.option&OPTION_FALCON)
|
|
||||||
clif_status_load(&sd->bl, SI_FALCON, 1);
|
|
||||||
if (sd->sc.option&OPTION_RIDING)
|
|
||||||
clif_status_load(&sd->bl, SI_RIDING, 1);
|
|
||||||
|
|
||||||
//Auron reported that This skill only triggers when you logon on the map o.O [Skotlex]
|
|
||||||
if ((i = pc_checkskill(sd,SG_KNOWLEDGE)) > 0) {
|
|
||||||
if(sd->bl.m == sd->feel_map[0].m
|
|
||||||
|| sd->bl.m == sd->feel_map[1].m
|
|
||||||
|| sd->bl.m == sd->feel_map[2].m)
|
|
||||||
sc_start(&sd->bl, SC_KNOWLEDGE, 100, i, skill_get_time(SG_KNOWLEDGE, i));
|
|
||||||
}
|
|
||||||
|
|
||||||
clif_skillinfoblock(sd);
|
|
||||||
clif_updatestatus(sd,SP_NEXTBASEEXP);
|
|
||||||
clif_updatestatus(sd,SP_NEXTJOBEXP);
|
|
||||||
clif_updatestatus(sd,SP_SKILLPOINT);
|
|
||||||
clif_initialstatus(sd);
|
|
||||||
//Removed, for some reason chars get stuck on map-change when you send this packet!? [Skotlex]
|
|
||||||
//[LuzZza]
|
|
||||||
//clif_guild_send_onlineinfo(sd);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
//For some reason the client "loses" these on map-change.
|
|
||||||
clif_updatestatus(sd,SP_STR);
|
|
||||||
clif_updatestatus(sd,SP_AGI);
|
|
||||||
clif_updatestatus(sd,SP_VIT);
|
|
||||||
clif_updatestatus(sd,SP_INT);
|
|
||||||
clif_updatestatus(sd,SP_DEX);
|
|
||||||
clif_updatestatus(sd,SP_LUK);
|
|
||||||
}
|
|
||||||
|
|
||||||
// item
|
// item
|
||||||
pc_checkitem(sd);
|
pc_checkitem(sd);
|
||||||
@ -8320,17 +8293,16 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
map_addblock(&sd->bl); // ƒuƒ<75>ƒbƒN“o˜^
|
map_addblock(&sd->bl); // ƒuƒ<75>ƒbƒN“o˜^
|
||||||
clif_spawn(&sd->bl); // spawn
|
clif_spawn(&sd->bl); // spawn
|
||||||
|
|
||||||
// party
|
// Party
|
||||||
|
if(sd->status.party_id) {
|
||||||
party_send_movemap(sd);
|
party_send_movemap(sd);
|
||||||
|
clif_party_hp(sd); // Show hp after displacement [LuzZza]
|
||||||
|
}
|
||||||
|
|
||||||
// guild
|
// guild
|
||||||
|
if(sd->status.guild_id)
|
||||||
guild_send_memberinfoshort(sd,1);
|
guild_send_memberinfoshort(sd,1);
|
||||||
|
|
||||||
// Show hp after displacement [LuzZza]
|
|
||||||
if(sd->status.party_id)
|
|
||||||
clif_party_hp(sd);
|
|
||||||
|
|
||||||
sd->state.using_fake_npc = 0;
|
|
||||||
|
|
||||||
// pvp
|
// pvp
|
||||||
//if(sd->pvp_timer!=-1 && !battle_config.pk_mode) /PVP Client crash fix* Removed timer deletion
|
//if(sd->pvp_timer!=-1 && !battle_config.pk_mode) /PVP Client crash fix* Removed timer deletion
|
||||||
// delete_timer(sd->pvp_timer,pc_calc_pvprank_timer);
|
// delete_timer(sd->pvp_timer,pc_calc_pvprank_timer);
|
||||||
@ -8345,24 +8317,21 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
sd->pvp_lost=0;
|
sd->pvp_lost=0;
|
||||||
}
|
}
|
||||||
clif_set0199(fd,1);
|
clif_set0199(fd,1);
|
||||||
} else {
|
} else
|
||||||
sd->pvp_timer=-1;
|
|
||||||
// set flag, if it's a duel [LuzZza]
|
// set flag, if it's a duel [LuzZza]
|
||||||
if(sd->duel_group)
|
if(sd->duel_group)
|
||||||
clif_set0199(fd, 1);
|
clif_set0199(fd, 1);
|
||||||
}
|
|
||||||
if(map_flag_gvg(sd->bl.m))
|
if(map_flag_gvg(sd->bl.m))
|
||||||
clif_set0199(fd,3);
|
clif_set0199(fd,3);
|
||||||
|
|
||||||
// pet
|
// pet
|
||||||
if(sd->status.pet_id > 0 && sd->pd) {
|
if(sd->pd) {
|
||||||
map_addblock(&sd->pd->bl);
|
map_addblock(&sd->pd->bl);
|
||||||
clif_spawn(&sd->pd->bl);
|
clif_spawn(&sd->pd->bl);
|
||||||
clif_send_petdata(sd,0,0);
|
clif_send_petdata(sd,0,0);
|
||||||
clif_send_petdata(sd,5,battle_config.pet_hair_style);
|
clif_send_petdata(sd,5,battle_config.pet_hair_style);
|
||||||
clif_send_petstatus(sd);
|
clif_send_petstatus(sd);
|
||||||
if(sd->state.connect_new && sd->pd->pet.intimate > 900)
|
|
||||||
clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//homunculus [blackhole89]
|
//homunculus [blackhole89]
|
||||||
@ -8378,34 +8347,53 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
status_calc_bl(&sd->hd->bl, SCB_SPEED);
|
status_calc_bl(&sd->hd->bl, SCB_SPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// view equipment item
|
if(sd->state.connect_new) {
|
||||||
#if PACKETVER < 4
|
int lv;
|
||||||
clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
|
|
||||||
clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
|
|
||||||
#else
|
|
||||||
clif_changelook(&sd->bl,LOOK_WEAPON,0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(sd->vd.cloth_color)
|
sd->state.connect_new = 0;
|
||||||
clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
|
clif_skillinfoblock(sd);
|
||||||
|
clif_updatestatus(sd,SP_NEXTBASEEXP);
|
||||||
|
clif_updatestatus(sd,SP_NEXTJOBEXP);
|
||||||
|
clif_updatestatus(sd,SP_SKILLPOINT);
|
||||||
|
clif_initialstatus(sd);
|
||||||
|
|
||||||
|
if (sd->sc.option&OPTION_FALCON)
|
||||||
|
clif_status_load(&sd->bl, SI_FALCON, 1);
|
||||||
|
|
||||||
|
if (sd->sc.option&OPTION_RIDING)
|
||||||
|
clif_status_load(&sd->bl, SI_RIDING, 1);
|
||||||
|
|
||||||
if(sd->status.manner < 0)
|
if(sd->status.manner < 0)
|
||||||
sc_start(&sd->bl,SC_NOCHAT,100,0,0);
|
sc_start(&sd->bl,SC_NOCHAT,100,0,0);
|
||||||
|
|
||||||
if(sd->state.connect_new) {
|
//Auron reported that This skill only triggers when you logon on the map o.O [Skotlex]
|
||||||
sd->state.connect_new = 0;
|
if ((lv = pc_checkskill(sd,SG_KNOWLEDGE)) > 0) {
|
||||||
//Delayed night effect on log-on fix for the glow-issue. Thanks to Larry.
|
if(sd->bl.m == sd->feel_map[0].m
|
||||||
if (night_flag) {
|
|| sd->bl.m == sd->feel_map[1].m
|
||||||
char tmpstr[1024];
|
|| sd->bl.m == sd->feel_map[2].m)
|
||||||
strcpy(tmpstr, msg_txt(500)); // Actually, it's the night...
|
sc_start(&sd->bl, SC_KNOWLEDGE, 100, lv, skill_get_time(SG_KNOWLEDGE, lv));
|
||||||
clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
|
|
||||||
|
|
||||||
if (map[sd->bl.m].flag.nightenabled)
|
|
||||||
add_timer(gettick()+1000,clif_nighttimer,sd->bl.id,0);
|
|
||||||
}
|
}
|
||||||
//On Login Script.
|
|
||||||
|
if(sd->pd && sd->pd->pet.intimate > 900)
|
||||||
|
clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd));
|
||||||
|
|
||||||
|
//Delayed night effect on log-on fix for the glow-issue. Thanks to Larry.
|
||||||
|
if (night_flag && map[sd->bl.m].flag.nightenabled)
|
||||||
|
add_timer(gettick()+1000,clif_nighttimer,sd->bl.id,0);
|
||||||
|
|
||||||
|
//Login Event
|
||||||
npc_script_event(sd, NPCE_LOGIN);
|
npc_script_event(sd, NPCE_LOGIN);
|
||||||
} else
|
} else {
|
||||||
|
//For some reason the client "loses" these on map-change.
|
||||||
|
clif_updatestatus(sd,SP_STR);
|
||||||
|
clif_updatestatus(sd,SP_AGI);
|
||||||
|
clif_updatestatus(sd,SP_VIT);
|
||||||
|
clif_updatestatus(sd,SP_INT);
|
||||||
|
clif_updatestatus(sd,SP_DEX);
|
||||||
|
clif_updatestatus(sd,SP_LUK);
|
||||||
|
|
||||||
|
sd->state.using_fake_npc = 0;
|
||||||
|
|
||||||
//New 'night' effect by dynamix [Skotlex]
|
//New 'night' effect by dynamix [Skotlex]
|
||||||
if (night_flag && map[sd->bl.m].flag.nightenabled)
|
if (night_flag && map[sd->bl.m].flag.nightenabled)
|
||||||
{ //Display night.
|
{ //Display night.
|
||||||
@ -8419,7 +8407,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
clif_status_load(&sd->bl, SI_NIGHT, 0);
|
clif_status_load(&sd->bl, SI_NIGHT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lance
|
if(sd->npc_id)
|
||||||
|
npc_event_dequeue(sd);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lance
|
||||||
if(sd->state.event_loadmap && map[sd->bl.m].flag.loadevent){
|
if(sd->state.event_loadmap && map[sd->bl.m].flag.loadevent){
|
||||||
pc_setregstr(sd, add_str("@maploaded$"), map[sd->bl.m].name);
|
pc_setregstr(sd, add_str("@maploaded$"), map[sd->bl.m].name);
|
||||||
npc_script_event(sd, NPCE_LOADMAP);
|
npc_script_event(sd, NPCE_LOADMAP);
|
||||||
|
32
src/map/pc.c
32
src/map/pc.c
@ -706,13 +706,22 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
|
|||||||
sd->state.event_disconnect = 1;
|
sd->state.event_disconnect = 1;
|
||||||
sd->state.event_kill_mob = 1;
|
sd->state.event_kill_mob = 1;
|
||||||
|
|
||||||
sd->state.auth = 1; //Do not auth him until the initial stats have been placed.
|
sd->state.auth = 1;
|
||||||
{ //Add IP field
|
{ //Add IP field
|
||||||
unsigned char *ip = (unsigned char *) &session[sd->fd]->client_addr.sin_addr;
|
unsigned char *ip = (unsigned char *) &session[sd->fd]->client_addr.sin_addr;
|
||||||
if (pc_isGM(sd))
|
if (pc_isGM(sd))
|
||||||
ShowInfo("GM Character '"CL_WHITE"%s"CL_RESET"' logged in. (Acc. ID: '"CL_WHITE"%d"CL_RESET"', Connection: '"CL_WHITE"%d"CL_RESET"', Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"', GM Level '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, sd->fd, sd->packet_ver, ip[0],ip[1],ip[2],ip[3], pc_isGM(sd));
|
ShowInfo("GM '"CL_WHITE"%s"CL_RESET"' logged in."
|
||||||
|
" (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"',"
|
||||||
|
" Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"',"
|
||||||
|
" GM Level '"CL_WHITE"%d"CL_RESET"').\n",
|
||||||
|
sd->status.name, sd->status.account_id, sd->status.char_id,
|
||||||
|
sd->packet_ver, ip[0],ip[1],ip[2],ip[3], pc_isGM(sd));
|
||||||
else
|
else
|
||||||
ShowInfo("Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"', Connection: '"CL_WHITE"%d"CL_RESET"', Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, sd->fd, sd->packet_ver, ip[0],ip[1],ip[2],ip[3]);
|
ShowInfo("'"CL_WHITE"%s"CL_RESET"' logged in."
|
||||||
|
" (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"',"
|
||||||
|
" Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"').\n",
|
||||||
|
sd->status.name, sd->status.account_id, sd->status.char_id,
|
||||||
|
sd->packet_ver, ip[0],ip[1],ip[2],ip[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send friends list
|
// Send friends list
|
||||||
@ -725,14 +734,11 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Message of the Day [Valaris]
|
// Message of the Day [Valaris]
|
||||||
{
|
for(i=0; motd_text[i][0] && i < MOTD_LINE_SIZE; i++) {
|
||||||
int ln;
|
|
||||||
for(ln=0; motd_text[ln][0] && ln < MOTD_LINE_SIZE; ln++) {
|
|
||||||
if (battle_config.motd_type)
|
if (battle_config.motd_type)
|
||||||
clif_disp_onlyself(sd,motd_text[ln],strlen(motd_text[ln]));
|
clif_disp_onlyself(sd,motd_text[i],strlen(motd_text[i]));
|
||||||
else
|
else
|
||||||
clif_displaymessage(sd->fd, motd_text[ln]);
|
clif_displaymessage(sd->fd, motd_text[i]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TXT_ONLY
|
#ifndef TXT_ONLY
|
||||||
@ -747,6 +753,14 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
|
|||||||
clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
|
clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Night message
|
||||||
|
if (night_flag)
|
||||||
|
{
|
||||||
|
char tmpstr[1024];
|
||||||
|
strcpy(tmpstr, msg_txt(500)); // Actually, it's the night...
|
||||||
|
clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user