Explorar el Código

Added alive packet sending to SQL char and login

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@934 54d463be-8e91-2dee-dedb-b68131a5f0ec
celest hace 20 años
padre
commit
a0d8292adc
Se han modificado 3 ficheros con 13 adiciones y 0 borrados
  1. 1 0
      Changelog.txt
  2. 8 0
      src/char_sql/char.c
  3. 4 0
      src/login_sql/login.c

+ 1 - 0
Changelog.txt

@@ -1,5 +1,6 @@
 Date	Added
 01/07
+        * Added the below-mentioned alive packet to SQL's char and login [celest]
         * Enabled login server 'anti-freeze' by default as a temporary solution
           to char-login disconnection [celest]
         * The TXT char server was rejecting login's "i'm alive" packet and disconnecting

+ 8 - 0
src/char_sql/char.c

@@ -1556,6 +1556,14 @@ int parse_tologin(int fd) {
 			RFIFOSKIP(fd,50);
 			break;
 
+		// login-server alive packet
+		case 0x2718:
+			if (RFIFOREST(fd) < 2)
+				return 0;
+			// do whatever it's supposed to do here?
+			RFIFOSKIP(fd,2);
+			break;
+
 /*		case 0x2721:	// gm reply. I don't want to support this function.
 			printf("0x2721:GM reply\n");
 		  {

+ 4 - 0
src/login_sql/login.c

@@ -629,6 +629,10 @@ int char_anti_freeze_system(int tid, unsigned int tick, int id, int data) {
 //			printf("char_anti_freeze_system: server #%d '%s', flag: %d.\n", i, server[i].name, server_freezeflag[i]);
 			if (server_freezeflag[i]-- < 1) {// Char-server anti-freeze system. Counter. 5 ok, 4...0 freezed
 				session[server_fd[i]]->eof = 1;
+			} else {
+				// send alive packet to check connection
+				WFIFOW(server_fd[i],0) = 0x2718;
+				WFIFOSET(server_fd[i],2);
 			}
 		}
 	}