예제 #1
0
파일: intif.cpp 프로젝트: themanaworld/tmwa
// アカウント変数通知
static
int intif_parse_AccountReg(Session *, const Packet_Head<0x3804>& head, const std::vector<Packet_Repeat<0x3804>>& repeat)
{
    dumb_ptr<map_session_data> sd = map_id2sd(account_to_block(head.account_id));
    if (sd == nullptr)
        return 1;

    size_t jlim = std::min(ACCOUNT_REG_NUM, repeat.size());
    for (size_t j = 0; j < jlim; j++)
    {
        sd->status.account_reg[j].str = repeat[j].name;
        sd->status.account_reg[j].value = repeat[j].value;
    }
    sd->status.account_reg_num = jlim;

    return 0;
}
예제 #2
0
파일: chrif.cpp 프로젝트: Rosalila/tswa
/*==========================================
 * マップ受信
 *------------------------------------------
 */
static
int chrif_recvmap(Session *, Packet_Head<0x2b04> head, const std::vector<Packet_Repeat<0x2b04>>& repeat)
{
    if (chrif_state < 2)        // まだ準備中
        return -1;

    IP4Address ip = head.ip;
    uint16_t port = head.port;
    for (const Packet_Repeat<0x2b04>& i : repeat)
    {
        MapName map = i.map_name;
        map_setipport(map, ip, port);
    }
    if (battle_config.etc_log)
        PRINTF("recv map on %s:%d (%zu maps)\n"_fmt,
                ip, port, repeat.size());

    return 0;
}