Exemplo n.º 1
0
// Wisp/Page reception
static
int intif_parse_WisMessage(Session *, const Packet_Head<0x3801>& head, AString& buf)
{
    // rewritten by [Yor]
    dumb_ptr<map_session_data> sd;

    CharName from = head.src_char_name;
    CharName to = head.dst_char_name;

    if (battle_config.etc_log)
    {
        PRINTF("intif_parse_wismessage: id: %d, from: %s, to: %s\n"_fmt,
                head.whisper_id,
                from,
                to);
    }
    sd = map_nick2sd(to); // Searching destination player
    if (sd != nullptr && sd->status_key.name == to)
    {
        // exactly same name (inter-server have checked the name before)
        {
            // if source player not found in ignore list
            {
                clif_wis_message(sd->sess, from, buf);
                intif_wis_replay(head.whisper_id, 0);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
            }
        }
    }
    else
        intif_wis_replay(head.whisper_id, 1);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
    return 0;
}
Exemplo n.º 2
0
// Wisp/Page reception
static
int intif_parse_WisMessage (int fd)
{                               // rewritten by [Yor]
    struct map_session_data *sd;
    int  i;

    if (battle_config.etc_log)
        printf
            ("intif_parse_wismessage: id: %d, from: %s, to: %s, message: '%s'\n",
             RFIFOL (fd, 4), RFIFOP (fd, 8), RFIFOP (fd, 32), RFIFOP (fd,
                                                                      56));
    sd = map_nick2sd ((const char *)RFIFOP (fd, 32)); // Searching destination player
    if (sd != NULL && strcmp (sd->status.name, (const char *)RFIFOP (fd, 32)) == 0)
    {                           // exactly same name (inter-server have checked the name before)
        // if player ignore all
        if (sd->ignoreAll == 1)
            intif_wis_replay (RFIFOL (fd, 4), 2);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
        else
        {
            const char *wisp_source = (const char *)RFIFOP (fd, 8);   // speed up
            // if player ignore the source character
            for (i = 0; i < (sizeof (sd->ignore) / sizeof (sd->ignore[0]));
                 i++)
                if (strcmp (sd->ignore[i].name, wisp_source) == 0)
                {
                    intif_wis_replay (RFIFOL (fd, 4), 2);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
                    break;
                }
            // if source player not found in ignore list
            if (i == (sizeof (sd->ignore) / sizeof (sd->ignore[0])))
            {
                clif_wis_message (sd->fd, (const char *)RFIFOP (fd, 8), (const char *)RFIFOP (fd, 56),
                                  RFIFOW (fd, 2) - 56);
                intif_wis_replay (RFIFOL (fd, 4), 0);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
            }
        }
    }
    else
        intif_wis_replay (RFIFOL (fd, 4), 1);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
    return 0;
}
Exemplo n.º 3
0
// Wisp/Page reception
static
int intif_parse_WisMessage(int fd)
{
    // rewritten by [Yor]
    dumb_ptr<map_session_data> sd;

    CharName from = stringish<CharName>(RFIFO_STRING<24>(fd, 8));
    CharName to = stringish<CharName>(RFIFO_STRING<24>(fd, 32));

    size_t len = RFIFOW(fd, 2) - 56;
    FString buf = RFIFO_STRING(fd, 56, len);

    if (battle_config.etc_log)
    {
        PRINTF("intif_parse_wismessage: id: %d, from: %s, to: %s, message: '%s'\n",
             RFIFOL(fd, 4),
             from,
             to,
             buf);
    }
    sd = map_nick2sd(to); // Searching destination player
    if (sd != NULL && sd->status.name == to)
    {
        // exactly same name (inter-server have checked the name before)
        {
            // if source player not found in ignore list
            {
                clif_wis_message(sd->fd, from, buf);
                intif_wis_replay(RFIFOL(fd, 4), 0);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
            }
        }
    }
    else
        intif_wis_replay(RFIFOL(fd, 4), 1);   // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
    return 0;
}