Code: Select all
void SmallPacket0x0B6(map_session_data_t* session, CCharEntity* PChar, int8* data)
{
string_t RecipientName = data+5;
string_t message = data+20;
ShowNotice(CL_RED"SENDING MESSAGE %s TO PLAYER %s FROM PLAYER %s\n" CL_RESET,message.c_str(),RecipientName.c_str(),PChar->GetName());
if(jailutils::InPrison(PChar))
{
ShowNotice(CL_GREEN"SENDING MESSAGE: TO SENDER JAIL\n" CL_RESET);
PChar->pushPacket(new CMessageBasicPacket(PChar, PChar, 0, 0, 316));
return;
}
CCharEntity* PTargetChar = zoneutils::GetCharByName(data+5);
if(PTargetChar != NULL )
{
ShowNotice(CL_GREEN"SENDING MESSAGE IS NOT NULL OK TO SEND\n" CL_RESET);
if (PTargetChar->nameflags.flags == FLAG_AWAY)
{
ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER HAS AWAY FLAG SET TELL SENDER\n" CL_RESET);
PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 181));
return;
}
if( PTargetChar->status != STATUS_DISAPPEAR)
{
ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER IS NOT ZONING SEND MESSAGE OK\n" CL_RESET);
PTargetChar->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL,data+20 ));
return;
}
else
{
ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER IS ZONEING TELL SENDER\n" CL_RESET);
PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 125));
return;
}
return;
}
else
{
ShowNotice(CL_GREEN"SENDING MESSAGE: DO A FULL SWEEP\n" CL_RESET);
map_session_list_t::iterator it = map_session_list.begin();
while(it != map_session_list.end())
{
map_session_data_t* map_session_data = it->second;
CCharEntity* PCharInMog = map_session_data->PChar;
if(PCharInMog!=NULL)
{
ShowNotice(CL_GREEN"SENDING MESSAGE: PLAYER IS NOT NULL\n" CL_RESET);
PTargetChar = PCharInMog;
PCharInMog->pushPacket(new CChatMessagePacket(PChar, MESSAGE_TELL,data+20 ));
break;
}
else
{
ShowNotice(CL_GREEN"SENDING MESSAGE: RECEIVER IS NOT ONLINE TELL SENDER\n" CL_RESET);
PChar->pushPacket(new CMessageStandardPacket(PChar, 0, 0, 125));
break;
}
++it;
}
return;
}
return;
}