Jump to content
  • 0

@maintenance command


Question

Posted

Hello I was wondering how to create a command that causes the server to enter for maintenance when typing the command giving en kick all players and not letting them connect until the command is enabledagain.

Recommended Posts

Posted

Hmm how do you make it GM's with group_id ranges from 80 above not get kicked can still enter Server during maintenance?

tried editing this line:

if( runflag != CHARSERVER_ST_RUNNING && (runflag != CHARSERVER_ST_MAINTENANCE || group_id != 99) )

to group_id >= 99) )

also this one

if (atoi(data) != 99) {

to if (atoi(data) >= 80) {

still kicks GM level 80

doesnt seem to work.

Posted

There is a config in ../conf/login_athena.conf

// Required account group id to connect to server.
// -1: disabled
// 0 or more: group id
group_id_to_connect: -1

Posted

There is a config in ../conf/login_athena.conf

// Required account group id to connect to server.
// -1: disabled
// 0 or more: group id
group_id_to_connect: -1

@Brian how do you configure it? group_id_to_connect: 80?

Posted

Hmm how do you make it GM's with group_id ranges from 80 above not get kicked can still enter Server during maintenance?

rAthena:

Find:

if( runflag != CHARSERVER_ST_RUNNING && (runflag != CHARSERVER_ST_MAINTENANCE || group_id != 99) )

Change to:

if( runflag != CHARSERVER_ST_RUNNING && (runflag != CHARSERVER_ST_MAINTENANCE || group_id < 80) ) // Below 80 can't enter..

Find:

if( (runflag == CHARSERVER_ST_RUNNING || (runflag == CHARSERVER_ST_MAINTENANCE && node->group_id == 99)) &&

Change to:

if( (runflag == CHARSERVER_ST_RUNNING || (runflag == CHARSERVER_ST_MAINTENANCE && node->group_id >= 80)) && // Equal/Above 80 can login

Find:

if (atoi(data) != 99) {

Change to:

if (atoi(data) < 80) { //Below 80 can't login

Find:

if (pc_get_group_level(pl_sd) != 99) { // Only Admin(99) that will stay in maintenance

Change to:

if (pc_get_group_level(pl_sd) < 80) { // Kick player with group id below 80

eAthena:

Find:

< 99

Change to:

< 80

Find:

>= 99

Change to:

>= 80

  • Upvote 1
Posted (edited)

Was adding the command in rathena when I was testing, he kicks only players in the map command is used and not all of the server.

Edited by DeMoNiAC
Posted

When it comes to those errors, I manually patch my source manually without using a patcher like TortoiseSVN for instance.

Oh so , I'll have to open the patch file then do it manually on my own without patching it automatically instead?

Posted

:P I don't want to make things complicated ^_^

eathena --

// Indicate the minimum GM level of player that the server accepts to connection.

// 0: all players (normal player are 0. it's default), 1-99: GM level at least with level x

min_level_to_connect: 0

rathena --

// Required account group id to connect to server.

// -1: disabled

// 0 or more: group id

group_id_to_connect: -1

Posted

Hello I was wondering how to create a command that causes the server to enter for maintenance when typing the command giving en kick all players and not letting them connect until the command is enabledagain.

@maintenance → kick all players except Admin → change map-server status to Maintenance → tell char-server to change status to Maintenance

Player login → check if (server is in Maintenance and player is not an admin), if yes → block player

at_maintenance.patch

Usage: @maintenance <on/off>

Thanks! ^_^

Posted (edited)

There's a problem on algorithm security:

runflag = MAPSERVER_ST_MAINTENANCE; //Activate maintenance, disable all player except Admin to login

Should be before the routine which kicks players from server, not after:

+	iter = mapit_getallusers();
+	for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) {
+	 if (pc_isGM(pl_sd) < 99) { // Kick anyone with level below Admin(99)
+	  clif_GM_kick(NULL, pl_sd);
+	 }
+	}
+	mapit_free(iter);

As someone could get in right before the flag being set and just after kicking sequence.

Also, apparently while flag is not set, if a player login and wait in char selection page, he just need to wait till kicking routine end to give Ok and play.

Edited by MarkZD

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...