예제 #1
0
파일: chrif.cpp 프로젝트: Rosalila/tswa
/*==========================================
 * マップ鯖間移動ack
 *------------------------------------------
 */
static
int chrif_changemapserverack(Session *, const Packet_Fixed<0x2b06>& fixed)
{
    dumb_ptr<map_session_data> sd = map_id2sd(account_to_block(fixed.account_id));

    if (sd == nullptr || sd->status_key.char_id != fixed.char_id)
        return -1;

    // I am fairly certain that this is not possible
    if (fixed.error == 1)
    {
        if (battle_config.error_log)
            PRINTF("map server change failed.\n"_fmt);
        pc_authfail(sd->status_key.account_id);
        return 0;
    }
    MapName mapname = fixed.map_name;
    uint16_t x = fixed.x;
    uint16_t y = fixed.y;
    IP4Address ip = fixed.map_ip;
    uint16_t port = fixed.map_port;
    clif_changemapserver(sd, mapname, x, y, ip, port);

    return 0;
}
예제 #2
0
/// map-server change request acknowledgement (positive or negative)
/// R 2b06 <account_id>.L <login_id1>.L <login_id2>.L <char_id>.L <map_index>.W <x>.W <y>.W <ip>.L <port>.W
int chrif_changemapserverack(int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port)
{
	struct auth_node *node;
	if (!(node=chrif_auth_check(account_id, char_id, ST_MAPCHANGE)))
		return -1;

	if (!login_id1) {
		ShowError("map server change failed.\n");
		clif_authfail_fd(node->fd, 0);
	} else
		clif_changemapserver(node->sd, map_index, x, y, ntohl(ip), ntohs(port));

	//Player has been saved already, remove him from memory. [Skotlex]
	chrif_auth_delete(account_id, char_id, ST_MAPCHANGE);
	return 0;
}
예제 #3
0
/// map-server change request acknowledgement (positive or negative)
/// R 2b06 <account_id>.L <login_id1>.L <login_id2>.L <char_id>.L <map_index>.W <x>.W <y>.W <ip>.L <port>.W
int chrif_changemapserverack(int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port)
{
	struct map_session_data *sd;
	sd = map_id2sd(account_id);

	if (sd == NULL || sd->status.char_id != char_id)
		return -1;

	if (login_id1 == 1) {
		if (battle_config.error_log)
			ShowError("map server change failed.\n");
		clif_authfail_fd(sd->fd, 0);
		return 0;
	}

	clif_changemapserver(sd, map_index, x, y, ntohl(ip), ntohs(port));

	//Player has been saved already, remove him from memory. [Skotlex]	
	map_quit(sd);
	map_quit_ack(sd);
	return 0;
}