Jump to content
  • 0
Echoes

A way to kick a player to character selection

Question

As the title say, is there a way to kick the player to character selection instead of account login when using @kick command?

It may need some src edits at worst.

 

Thank you

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Basically you have, in atcommand.c:

/*==========================================
 *
 *------------------------------------------*/
ACMD(kick)
{
    struct map_session_data *pl_sd;

    memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));

    if (!*message) {
        clif->message(fd, msg_fd(fd,1026)); // Please enter a player name (usage: @kick <char name/ID>).
        return false;
    }

    if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
        clif->message(fd, msg_fd(fd,3)); // Character not found.
        return false;
    }

    if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
    {
        clif->message(fd, msg_fd(fd,81)); // Your GM level don't authorize you to do this action on this player.
        return false;
    }

    clif->GM_kick(sd, pl_sd);

    return true;
}

 

Change:

    clif->GM_kick(sd, pl_sd);

To:

    chrif->charselectreq(pl_sd, sockt->session[pl_sd->fd]->client_addr);

 

And this made the trick...

Share this post


Link to post
Share on other sites
  • 0

You need to change @kick or create a new one like @kick2charselect

 

In clif.c you have this:

static void clif_parse_Restart(int fd, struct map_session_data *sd)
{
	switch(RFIFOB(fd,2)) {
		case 0x00:
			pc->respawn(sd,CLR_OUTSIGHT);
			break;
		case 0x01:
			/* Rovert's Prevent logout option - Fixed [Valaris] */
			if (!sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK]
			 && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] && !sd->sc.data[SC_SUHIDE]
			 && (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)
			) {
				//Send to char-server for character selection.
				chrif->charselectreq(sd, sockt->session[fd]->client_addr);
			} else {
				clif->disconnect_ack(sd, 1);
			}
			break;
	}
}

Need to use this:

//Send to char-server for character selection.
chrif->charselectreq(sd, sockt->session[fd]->client_addr);

=]

Share this post


Link to post
Share on other sites
  • 0

@CarlosHenrq Weird, I have the same code:

static void clif_parse_Restart(int fd, struct map_session_data *sd)
{
	switch(RFIFOB(fd,2)) {
		case 0x00:
			pc->respawn(sd,CLR_OUTSIGHT);
			break;
		case 0x01:
			/* Rovert's Prevent logout option - Fixed [Valaris] */
			if (!sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK]
			 && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] && !sd->sc.data[SC_SUHIDE]
			 && (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)
			) {
				//Send to char-server for character selection.
				chrif->charselectreq(sd, sockt->session[fd]->client_addr);
			} else {
				clif->disconnect_ack(sd, 1);
			}
			break;
	}
}

 

What do you mean by use that portion of the code? How can I use only that portion? o.0

Share this post


Link to post
Share on other sites
  • 0
48 minutes ago, Echoes said:

What do you mean by use that portion of the code? How can I use only that portion? o.0

The "secret" is here:

//Send to char-server for character selection.
chrif->charselectreq(sd, sockt->session[fd]->client_addr);

This sends the packet to char-server and char-server should respond with OK or NOT OK.

If OK, map-server should disconnect the character and the client'll popup the character selection.

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, CarlosHenrq said:

The "secret" is here:


//Send to char-server for character selection.
chrif->charselectreq(sd, sockt->session[fd]->client_addr);

This sends the packet to char-server and char-server should respond with OK or NOT OK.

If OK, map-server should disconnect the character and the client'll popup the character selection.

Ah, yeah, I understand that part, but how do I make the command to read that line instead of the kicking to login one Dx

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.