Jump to content
  • 0

Preventing players from logging in


magicman

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

Hi guys,

 

is it possible to prevent players from logging in? (for example during maintenance).

If yes, how?

Cheers,

 

magicman

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

rA

Index: conf/groups.conf
===================================================================
--- conf/groups.conf	(revision 15658)
+++ conf/groups.conf	(working copy)
@@ -257,6 +257,7 @@
 	level: 99
 	inherit: ( "Support", "Law Enforcement" )
 	commands: {
+		maintenance: true
 	}
 	log_commands: true
 	permissions: {
Index: src/char/char.c
===================================================================
--- src/char/char.c	(revision 15658)
+++ src/char/char.c	(working copy)
@@ -2654,7 +2654,7 @@
 		break;
 
 		case 0x2b02: // req char selection
-			if( RFIFOREST(fd) < 18 )
+			if( RFIFOREST(fd) < 19 )
 				return 0;
 		{
 			struct auth_node* node;
@@ -2663,9 +2663,10 @@
 			uint32 login_id1 = RFIFOL(fd,6);
 			uint32 login_id2 = RFIFOL(fd,10);
 			uint32 ip = RFIFOL(fd,14);
-			RFIFOSKIP(fd,18);
-			
-			if( runflag != CHARSERVER_ST_RUNNING )
+			uint8 group_id = RFIFOB(fd,18);
+			RFIFOSKIP(fd,19);
+
+			if( runflag != CHARSERVER_ST_RUNNING && (runflag != CHARSERVER_ST_MAINTENANCE || group_id != 99) )
 			{
 				WFIFOHEAD(fd,7);
 				WFIFOW(fd,0) = 0x2b03;
@@ -2717,8 +2718,7 @@
 				mmo_char_fromsql(RFIFOL(fd,14), &char_dat, true);
 				char_data = (struct mmo_charstatus*)uidb_get(char_db_,RFIFOL(fd,14));
 			}
-			
-			if( runflag == CHARSERVER_ST_RUNNING &&
+			if( (runflag == CHARSERVER_ST_RUNNING || runflag == CHARSERVER_ST_MAINTENANCE) &&
 				session_isActive(map_fd) &&
 				char_data )
 			{	//Send the map server the auth of this player.
@@ -3082,7 +3082,7 @@
 				mmo_char_fromsql(char_id, &char_dat, true);
 				cd = (struct mmo_charstatus*)uidb_get(char_db_,char_id);
 			}
-			if( runflag == CHARSERVER_ST_RUNNING &&
+			if( (runflag == CHARSERVER_ST_RUNNING || (runflag == CHARSERVER_ST_MAINTENANCE && node->group_id == 99)) &&
 				cd != NULL &&
 				node != NULL && 
 				node->account_id == account_id &&
@@ -3130,6 +3130,19 @@
 			RFIFOSKIP(fd,6);
 		break;
 
+		case 0x2737: // is it maintenance?
+			if (RFIFOB(fd, 2) == CHARSERVER_ST_MAINTENANCE) {
+				//yezzz it iss
+				runflag = CHARSERVER_ST_MAINTENANCE;
+				//ShowInfo("Maintenance: On\n");
+			} else {
+				if (runflag == CHARSERVER_ST_MAINTENANCE) {
+					runflag = CHARSERVER_ST_RUNNING;
+					//ShowInfo("Maintenance: Off\n");
+				}
+			} RFIFOSKIP(fd, 3);
+		break;
+
 		default:
 		{
 			// inter server - packet
@@ -3496,7 +3509,7 @@
 			WFIFOL(fd,0) = account_id;
 			WFIFOSET(fd,4);
 
-			if( runflag != CHARSERVER_ST_RUNNING )
+			if( runflag != CHARSERVER_ST_RUNNING && runflag != CHARSERVER_ST_MAINTENANCE )
 			{
 				WFIFOHEAD(fd,3);
 				WFIFOW(fd,0) = 0x6c;
@@ -3519,6 +3532,27 @@
 			else
 			{// authentication not found (coming from login server)
 				if (login_fd > 0) { // don't send request if no login-server
+					if (runflag == CHARSERVER_ST_MAINTENANCE) {
+						if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `group_id` FROM `login` WHERE `account_id` = %d", account_id) ) {
+							Sql_ShowDebug(sql_handle);
+							break;
+						} else if( SQL_SUCCESS == Sql_NextRow(sql_handle) ) {
+							char* data;
+							Sql_GetData(sql_handle, 0, &data, NULL);
+							Sql_FreeResult(sql_handle);
+							if (atoi(data) != 99) {
+								//Kick everyone except Admin(99)
+								WFIFOHEAD(fd,3);
+								WFIFOW(fd,0) = 0x6c;
+								WFIFOB(fd,2) = 0;
+								WFIFOSET(fd,3);
+								break;
+							}
+						} else {
+							Sql_FreeResult(sql_handle);
+							break;
+						}
+					}
 					WFIFOHEAD(login_fd,23);
 					WFIFOW(login_fd,0) = 0x2712; // ask login-server to authentify an account
 					WFIFOL(login_fd,2) = sd->account_id;
Index: src/char/char.h
===================================================================
--- src/char/char.h	(revision 15658)
+++ src/char/char.h	(working copy)
@@ -10,7 +10,8 @@
 {
 	CHARSERVER_ST_RUNNING = CORE_ST_LAST,
 	CHARSERVER_ST_SHUTDOWN,
-	CHARSERVER_ST_LAST
+	CHARSERVER_ST_LAST,
+	CHARSERVER_ST_MAINTENANCE
 };
 
 struct mmo_charstatus;
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c	(revision 15658)
+++ src/map/atcommand.c	(working copy)
@@ -8337,6 +8337,54 @@
 	return 0;
 }
 
+/*==========================================
+ * @maintenance commands [FE]
+ *------------------------------------------*/
+ACMD_FUNC(maintenance) {
+	nullpo_retr(-1, sd);
+
+	if (message && *message) {
+		if(strcmpi(message, "on") == 0) {
+			if(runflag == MAPSERVER_ST_MAINTENANCE) {
+				clif_displaymessage(fd, "Server already in maintenance");
+			} else {
+				struct map_session_data* pl_sd;
+				struct s_mapiterator* iter;
+
+				iter = mapit_getallusers();
+				for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) {
+					if (pc_get_group_level(pl_sd) != 99) { // Only Admin(99) that will stay in maintenance
+						clif_GM_kick(NULL, pl_sd);
+					}
+				}
+				mapit_free(iter);
+
+				runflag = MAPSERVER_ST_MAINTENANCE; //Activate maintenance, disable all player except Admin to login
+				chrif_maintenis(MAPSERVER_ST_MAINTENANCE);
+				//ShowInfo("Maintenance: On\n");
+				clif_displaymessage(fd, "Maintenance: On");
+			}
+		} else if(strcmpi(message, "off") == 0) {
+			if(runflag == MAPSERVER_ST_MAINTENANCE) {
+				runflag = MAPSERVER_ST_RUNNING; //Deactivate maintenance
+				chrif_maintenis(MAPSERVER_ST_RUNNING);
+				//ShowInfo("Maintenance: Off\n");
+				clif_displaymessage(fd, "Maintenance: Off");
+			} else {
+				clif_displaymessage(fd, "Server is not in maintenance");
+			}
+		} else {
+			clif_displaymessage(fd, "Usage: @maintenance <on|off>");
+			return -1;
+		}
+	} else {
+		clif_displaymessage(fd, "Usage: @maintenance <on|off>");
+		return -1;
+	}
+
+	return 0;
+}
+
 /**
  * Fills the reference of available commands in atcommand DBMap
  **/
@@ -8584,6 +8632,7 @@
 		 * For Testing Purposes, not going to be here after we're done.
 		 **/
 		ACMD_DEF2("newmount", new_mount),
+		ACMD_DEF(maintenance),
 	};
 	AtCommandInfo* atcommand;
 	int i;
Index: src/map/chrif.c
===================================================================
--- src/map/chrif.c	(revision 15658)
+++ src/map/chrif.c	(working copy)
@@ -571,6 +571,17 @@
 	chrif_sd_to_auth(sd, ST_LOGIN);
 }
 
+//Tell char-server that map-server is in maintenance
+void chrif_maintenis(int flag)
+{
+	if (!chrif_isconnected())
+		return;
+	WFIFOHEAD(char_fd, 3);
+	WFIFOW(char_fd, 0) = 0x2737;
+	WFIFOB(char_fd, 2) = flag;
+	WFIFOSET(char_fd, 3);
+}
+
 /*==========================================
  * Auth confirmation ack
  *------------------------------------------*/
@@ -624,11 +635,11 @@
 	}
 
 	sd = node->sd;
-	if( runflag == MAPSERVER_ST_RUNNING &&
+	if( (runflag == MAPSERVER_ST_RUNNING || runflag == MAPSERVER_ST_MAINTENANCE) &&
 		node->char_dat == NULL &&
 		node->account_id == account_id &&
 		node->char_id == char_id &&
-		node->login_id1 == login_id1 )
+		node->login_id1 == login_id1)
 	{ //Auth Ok
 		if (pc_authok(sd, login_id2, expiration_time, group_id, status, changing_mapservers))
 			return;
@@ -711,13 +722,14 @@
 		return -1;
 	chrif_check(-1);
 
-	WFIFOHEAD(char_fd,18);
+	WFIFOHEAD(char_fd,19);
 	WFIFOW(char_fd, 0) = 0x2b02;
 	WFIFOL(char_fd, 2) = sd->bl.id;
 	WFIFOL(char_fd, 6) = sd->login_id1;
 	WFIFOL(char_fd,10) = sd->login_id2;
 	WFIFOL(char_fd,14) = htonl(s_ip);
-	WFIFOSET(char_fd,18);
+	WFIFOB(char_fd,18) = sd->group_id;
+	WFIFOSET(char_fd,19);
 
 	return 0;
 }
Index: src/map/chrif.h
===================================================================
--- src/map/chrif.h	(revision 15658)
+++ src/map/chrif.h	(working copy)
@@ -57,6 +57,7 @@
 int chrif_changesex(struct map_session_data *sd);
 int chrif_chardisconnect(struct map_session_data *sd);
 int chrif_divorce(int partner_id1, int partner_id2);
+void chrif_maintenis(int flag); //[FE]
 /**
  * rAthena
  **/
Index: src/map/clif.c
===================================================================
--- src/map/clif.c	(revision 15658)
+++ src/map/clif.c	(working copy)
@@ -8903,7 +8903,7 @@
 		return;
 	}
 
-	if( runflag != MAPSERVER_ST_RUNNING )
+	if( runflag != MAPSERVER_ST_RUNNING && runflag != MAPSERVER_ST_MAINTENANCE )
 	{// not allowed
 		clif_authfail_fd(fd,1);// server closed
 		return;
Index: src/map/map.h
===================================================================
--- src/map/map.h	(revision 15658)
+++ src/map/map.h	(working copy)
@@ -24,7 +24,8 @@
 {
 	MAPSERVER_ST_RUNNING = CORE_ST_LAST,
 	MAPSERVER_ST_SHUTDOWN,
-	MAPSERVER_ST_LAST
+	MAPSERVER_ST_LAST,
+	MAPSERVER_ST_MAINTENANCE
 };
 
 


eA

Index: conf/atcommand_athena.conf
===================================================================
--- conf/atcommand_athena.conf	(revision 15077)
+++ conf/atcommand_athena.conf	(working copy)
@@ -802,6 +802,9 @@
 // Stop all weather effects
 clearweather: 99,99
 
+// Maintenance command[FE]
+maintenance: 99,99
+
 //---------------------------------------------------------------
 // 100: Disabled commands
 
Index: src/char_sql/char.c
===================================================================
--- src/char_sql/char.c	(revision 15077)
+++ src/char_sql/char.c	(working copy)
@@ -2650,7 +2650,7 @@
 		break;
 
 		case 0x2b02: // req char selection
-			if( RFIFOREST(fd) < 18 )
+			if( RFIFOREST(fd) < 19 )
 				return 0;
 		{
 			struct auth_node* node;
@@ -2659,9 +2659,11 @@
 			uint32 login_id1 = RFIFOL(fd,6);
 			uint32 login_id2 = RFIFOL(fd,10);
 			uint32 ip = RFIFOL(fd,14);
-			RFIFOSKIP(fd,18);
+			uint8 gm_level = RFIFOB(fd,18);
+			RFIFOSKIP(fd,19);
 			
-			if( runflag != CHARSERVER_ST_RUNNING )
+			if( runflag != CHARSERVER_ST_RUNNING &&
+			  ( runflag != CHARSERVER_ST_MAINTENANCE || gm_level < 99) ) // Player with GM Level below 99 can not enter a server in maintenance
 			{
 				WFIFOHEAD(fd,7);
 				WFIFOW(fd,0) = 0x2b03;
@@ -2715,7 +2717,7 @@
 				char_data = (struct mmo_charstatus*)uidb_get(char_db_,RFIFOL(fd,14));
 			}
 			
-			if( runflag == CHARSERVER_ST_RUNNING &&
+			if( (runflag == CHARSERVER_ST_RUNNING || runflag == CHARSERVER_ST_MAINTENANCE) &&
 				session_isActive(map_fd) &&
 				char_data )
 			{	//Send the map server the auth of this player.
@@ -3061,7 +3063,7 @@
 				mmo_char_fromsql(char_id, &char_dat, true);
 				cd = (struct mmo_charstatus*)uidb_get(char_db_,char_id);
 			}
-			if( runflag == CHARSERVER_ST_RUNNING &&
+			if( (runflag == CHARSERVER_ST_RUNNING || (runflag == CHARSERVER_ST_MAINTENANCE && node->gmlevel >= 99)) && //Equal/Above 99 can login
 				cd != NULL &&
 				node != NULL && 
 				node->account_id == account_id &&
@@ -3108,6 +3110,19 @@
 			RFIFOSKIP(fd,6);
 		break;
 
+		case 0x2737: // is it maintenance?
+			if (RFIFOB(fd, 2) == CHARSERVER_ST_MAINTENANCE) {
+				//yezzz it iss
+				runflag = CHARSERVER_ST_MAINTENANCE;
+				//ShowInfo("Maintenance: On\n");
+			} else {
+				if (runflag == CHARSERVER_ST_MAINTENANCE) {
+					runflag = CHARSERVER_ST_RUNNING;
+					//ShowInfo("Maintenance: Off\n");
+				}
+			} RFIFOSKIP(fd, 3);
+		break;
+
 		default:
 		{
 			// inter server - packet
@@ -3474,7 +3489,7 @@
 			WFIFOL(fd,0) = account_id;
 			WFIFOSET(fd,4);
 
-			if( runflag != CHARSERVER_ST_RUNNING )
+			if( runflag != CHARSERVER_ST_RUNNING && runflag != CHARSERVER_ST_MAINTENANCE )
 			{
 				WFIFOHEAD(fd,3);
 				WFIFOW(fd,0) = 0x6c;
@@ -3497,6 +3512,27 @@
 			else
 			{// authentication not found (coming from login server)
 				if (login_fd > 0) { // don't send request if no login-server
+					if (runflag == CHARSERVER_ST_MAINTENANCE) {
+						if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `level` FROM `login` WHERE `account_id` = %d", account_id) ) {
+							Sql_ShowDebug(sql_handle);
+							break;
+						} else if( SQL_SUCCESS == Sql_NextRow(sql_handle) ) {
+							char* data;
+							Sql_GetData(sql_handle, 0, &data, NULL);
+							Sql_FreeResult(sql_handle);
+							if (atoi(data) < 99) {
+								//Kick everyone with level below Admin(99)
+								WFIFOHEAD(fd,3);
+								WFIFOW(fd,0) = 0x6c;
+								WFIFOB(fd,2) = 0;
+								WFIFOSET(fd,3);
+								break;
+							}
+						} else {
+							Sql_FreeResult(sql_handle);
+							break;
+						}
+					}
 					WFIFOHEAD(login_fd,23);
 					WFIFOW(login_fd,0) = 0x2712; // ask login-server to authentify an account
 					WFIFOL(login_fd,2) = sd->account_id;
Index: src/char_sql/char.h
===================================================================
--- src/char_sql/char.h	(revision 15077)
+++ src/char_sql/char.h	(working copy)
@@ -11,7 +11,8 @@
 {
 	CHARSERVER_ST_RUNNING = CORE_ST_LAST,
 	CHARSERVER_ST_SHUTDOWN,
-	CHARSERVER_ST_LAST
+	CHARSERVER_ST_LAST,
+	CHARSERVER_ST_MAINTENANCE
 };
 #endif
 
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c	(revision 15077)
+++ src/map/atcommand.c	(working copy)
@@ -8562,7 +8562,52 @@
 	return 0;
 }
 
+/*==========================================
+ * @maintenance commands [FE]
+ *------------------------------------------*/
+ACMD_FUNC(maintenance) {
+	nullpo_retr(-1, sd);
 
+	if (message && *message) {
+		if (strcmpi(message, "on") == 0) {
+			if (runflag == MAPSERVER_ST_MAINTENANCE) {
+				clif_displaymessage(fd, "Server already in maintenance");
+			} else {
+				struct map_session_data* pl_sd;
+				struct s_mapiterator* iter;
+
+				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);
+
+				runflag = MAPSERVER_ST_MAINTENANCE; //Activate maintenance, disable all player except Admin to login
+				chrif_maintenis(MAPSERVER_ST_MAINTENANCE);
+				clif_displaymessage(fd, "Maintenance: On");
+			}
+		} else if (strcmpi(message, "off") == 0) {
+			if(runflag == MAPSERVER_ST_MAINTENANCE) {
+				runflag = MAPSERVER_ST_RUNNING; //Deactivate maintenance
+				chrif_maintenis(MAPSERVER_ST_RUNNING);
+				clif_displaymessage(fd, "Maintenance: Off");
+			} else {
+				clif_displaymessage(fd, "Server is not in maintenance");
+			}
+		} else {
+			clif_displaymessage(fd, "Usage: @maintenance <on|off>");
+			return -1;
+		}
+	} else {
+		clif_displaymessage(fd, "Usage: @maintenance <on|off>");
+		return -1;
+	}
+
+	return 0;
+}
+
 /*==========================================
  * atcommand_info[] structure definition
  *------------------------------------------*/
@@ -8865,6 +8910,7 @@
 	{ "delitem",           60,60,     atcommand_delitem },
 	{ "charcommands",       1,1,      atcommand_commands },
 	{ "font",               1,1,      atcommand_font },
+	{ "maintenance",       99,99,     atcommand_maintenance },
 };
 
 
Index: src/map/chrif.c
===================================================================
--- src/map/chrif.c	(revision 15077)
+++ src/map/chrif.c	(working copy)
@@ -574,6 +574,17 @@
 	chrif_sd_to_auth(sd, ST_LOGIN);
 }
 
+//Tell char-server that map-server is in maintenance
+void chrif_maintenis(int flag)
+{
+	if (!chrif_isconnected())
+		return;
+	WFIFOHEAD(char_fd, 3);
+	WFIFOW(char_fd, 0) = 0x2737;
+	WFIFOB(char_fd, 2) = flag;
+	WFIFOSET(char_fd, 3);
+}
+
 /*==========================================
  * Auth confirmation ack
  *------------------------------------------*/
@@ -627,7 +638,7 @@
 	}
 
 	sd = node->sd;
-	if( runflag == MAPSERVER_ST_RUNNING &&
+	if( (runflag == MAPSERVER_ST_RUNNING || runflag == MAPSERVER_ST_MAINTENANCE) &&
 		node->char_dat == NULL &&
 		node->account_id == account_id &&
 		node->char_id == char_id &&
@@ -715,13 +726,14 @@
 		return -1;
 	chrif_check(-1);
 
-	WFIFOHEAD(char_fd,18);
+	WFIFOHEAD(char_fd,19);
 	WFIFOW(char_fd, 0) = 0x2b02;
 	WFIFOL(char_fd, 2) = sd->bl.id;
 	WFIFOL(char_fd, 6) = sd->login_id1;
 	WFIFOL(char_fd,10) = sd->login_id2;
 	WFIFOL(char_fd,14) = htonl(s_ip);
-	WFIFOSET(char_fd,18);
+	WFIFOB(char_fd,18) = sd->gmlevel;
+	WFIFOSET(char_fd,19);
 
 	return 0;
 }
Index: src/map/chrif.h
===================================================================
--- src/map/chrif.h	(revision 15077)
+++ src/map/chrif.h	(working copy)
@@ -57,6 +57,7 @@
 int chrif_changesex(struct map_session_data *sd);
 int chrif_chardisconnect(struct map_session_data *sd);
 int chrif_divorce(int partner_id1, int partner_id2);
+void chrif_maintenis(int flag);
 
 int do_final_chrif(void);
 int do_init_chrif(void);
Index: src/map/clif.c
===================================================================
--- src/map/clif.c	(revision 15077)
+++ src/map/clif.c	(working copy)
@@ -8847,7 +8847,7 @@
 		return;
 	}
 
-	if( runflag != MAPSERVER_ST_RUNNING )
+	if( runflag != MAPSERVER_ST_RUNNING && runflag != MAPSERVER_ST_MAINTENANCE )
 	{// not allowed
 		clif_authfail_fd(fd,1);// server closed
 		return;
Index: src/map/map.h
===================================================================
--- src/map/map.h	(revision 15077)
+++ src/map/map.h	(working copy)
@@ -19,7 +19,8 @@
 {
 	MAPSERVER_ST_RUNNING = CORE_ST_LAST,
 	MAPSERVER_ST_SHUTDOWN,
-	MAPSERVER_ST_LAST
+	MAPSERVER_ST_LAST,
+	MAPSERVER_ST_MAINTENANCE
 };
 
 //Uncomment to enable the Cell Stack Limit mod.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

Do I just copy these entirely to my source files and recompile? That's all?
Where did you get this from?

 

How do I install this?

Edited by magicman
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

 

 

 

How do I install this?

https://rathena.org/wiki/Diff

 

 

That guide is not accurate. Can you be more specific on what exactly to do?

My server is running on linux.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   95
  • Joined:  09/30/14
  • Last Seen:  

Or just edit /conf/login_athena.conf

 

// Required account group id to connect to server.
// -1: disabled
// 0 or more: group id
group_id_to_connect: -1
 
to 10 or whatever GM level you want to be able to login and restart it. Then revert it to -1 when you're done and restart again.
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

 

Or just edit /conf/login_athena.conf

 

// Required account group id to connect to server.
// -1: disabled
// 0 or more: group id
group_id_to_connect: -1
 
to 10 or whatever GM level you want to be able to login and restart it. Then revert it to -1 when you're done and restart again.

 

 

You're  a genius :) 

Anyways, I'd like to have the "@maintenance on|off" function as it is pretty neat in my opinion.

I just don't understand how to make a .patch-file out of the above code (i read the diff guide).

Can you explain me how to do it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

 

Or just edit /conf/login_athena.conf

 

// Required account group id to connect to server.

// -1: disabled

// 0 or more: group id

group_id_to_connect: -1

 

to 10 or whatever GM level you want to be able to login and restart it. Then revert it to -1 when you're done and restart again.

 

You're  a genius :)

Anyways, I'd like to have the "@maintenance on|off" function as it is pretty neat in my opinion.

I just don't understand how to make a .patch-file out of the above code (i read the diff guide).

Can you explain me how to do it?

 

 

 

Index: = showing you what files is effected

+ = showing you that line need to be add

- = showing you that line should be deleted

 

 

example :

 

Index: src/char_sql/char.c (file that effected or need to change)

===================================================================

--- src/char_sql/char.c    (revision 15077)

+++ src/char_sql/char.c    (working copy)

@@ -2650,7 +2650,7 @@

        break;

 

case 1 code replace

        case 0x2b02: // req char selection

-            if( RFIFOREST(fd) < 18 ) (it need to be deleted, replace with the code below)

+            if( RFIFOREST(fd) < 19 ) (it need to be add/replace with the code above)

 

case 2 add a new code lines, marked with '+'

+        case 0x2737: // is it maintenance?

+            if (RFIFOB(fd, 2) == CHARSERVER_ST_MAINTENANCE) {

+                //yezzz it iss

+                runflag = CHARSERVER_ST_MAINTENANCE;

+                //ShowInfo("Maintenance: On\n");

+            } else {

+                if (runflag == CHARSERVER_ST_MAINTENANCE) {

+                    runflag = CHARSERVER_ST_RUNNING;

+                    //ShowInfo("Maintenance: Off\n");

+                }

+            } RFIFOSKIP(fd, 3);

+        break;

+

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  662
  • Reputation:   671
  • Joined:  11/12/12
  • Last Seen:  

Save the code above as a .diff or .patch file, right-click it > TortoiseGit (or TortoiseSVN) > Review/apply single patch... > Select your Git repo and use "patch all", or select what you want to patch exactly.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

Save the code above as a .diff or .patch file, right-click it > TortoiseGit (or TortoiseSVN) > Review/apply single patch... > Select your Git repo and use "patch all", or select what you want to patch exactly.

 

The problem is that I'm on linux...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

and what the problem in edit in notepad? The link I gave you explain (and this is logic, not need a guide) and elsa explain to you, what more you want to understand what to do?

Search a line withou a + or -, and the + lines you add and remove the cross symbol, and in the - you delete the line, what it's so difficult?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  04/12/13
  • Last Seen:  

I get "HAWK not found" errors when applying the patch...

Link to comment
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.   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.

×
×
  • Create New...