Browse Source

CharSQL: fixed the 0x2b05 packet, now the multi mapservers works ...
Login/LoginSQL: fixed the version check finaly :) now the servers can connect XD


git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1110 54d463be-8e91-2dee-dedb-b68131a5f0ec

sirius 20 năm trước cách đây
mục cha
commit
f0586beb14
4 tập tin đã thay đổi với 33 bổ sung15 xóa
  1. 2 0
      Changelog-SVN.txt
  2. 22 2
      src/char_sql/char.c
  3. 1 3
      src/login/login.c
  4. 8 10
      src/login_sql/login.c

+ 2 - 0
Changelog-SVN.txt

@@ -1,6 +1,8 @@
 Date	Added
 
 02/15
+	* Login / Login SQL: Fixed the EXE-Version check (now it works finally :) [Sirius]
+	* Char SQL: Fixed the '0x2b05' reply to the mapserver (now multi - mapservers works again!)
         * Rewrote skill blocking system that was allowing people to bypass blocking
           time simply by casting a different skill [celest]
         * Edited out some inconsistencies with skillnotok [celest]

+ 22 - 2
src/char_sql/char.c

@@ -2105,12 +2105,29 @@ int parse_frommap(int fd) {
 			auth_fifo[auth_fifo_pos].sex = RFIFOB(fd,44);
 			auth_fifo[auth_fifo_pos].ip = RFIFOL(fd,45);
 
-			sprintf(tmp_sql, "SELECT count(*) FROM `%s` WHERE `account_id` = '%d' AND `char_id`='%d'", char_db, RFIFOL(fd,2), RFIFOL(fd,14));
+			sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_id`='%d'", char_db, RFIFOL(fd,2), RFIFOL(fd,14));
 			if (mysql_query(&mysql_handle, tmp_sql)) {
 				printf("DB server Error - %s\n", mysql_error(&mysql_handle));
 			}
 			sql_res = mysql_store_result(&mysql_handle);
-
+			if(sql_res){
+				i = atoi(sql_row[0]);
+				mysql_free_result(sql_res);
+				auth_fifo[auth_fifo_pos].char_pos = auth_fifo[auth_fifo_pos].char_id;
+				auth_fifo_pos++;
+				WFIFOL(fd,6) = 0;
+			}else{
+				return 0;
+			}
+			
+			if(i == 0){
+				WFIFOW(fd, 6) = 0;
+			}
+			
+			WFIFOSET(fd, 44);
+			RFIFOSKIP(fd, 49);
+			
+			/*
 			if (( sql_row = mysql_fetch_row(sql_res))) {
 				i = atoi(sql_row[0]);
 				mysql_free_result(sql_res);
@@ -2127,7 +2144,10 @@ int parse_frommap(int fd) {
 			WFIFOSET(fd,44);
 			RFIFOSKIP(fd,49);
 			break;
+			*/
 
+		break;
+		
 		// char name check
 		case 0x2b08:
 			if (RFIFOREST(fd) < 6)

+ 1 - 3
src/login/login.c

@@ -1122,12 +1122,10 @@ int mmo_auth(struct mmo_account* account, int fd) {
 	}
 	
 	//EXE Version check [Sirius]
-	if(account->sex != 0){
-	        if(check_client_version == 1){
+	if(check_client_version == 1 && account->version != 0){
         		if(account->version != client_version_to_connect){
         			return 5;
 			}
-		}
 	}
 	
 	// Strict account search

+ 8 - 10
src/login_sql/login.c

@@ -437,16 +437,6 @@ int mmo_auth( struct mmo_account* account , int fd){
 	jstrescapecpy(t_pass, account->passwd);
 
 
-	//check for lasted version (exe version check) [Sirius]
-	if(account->sex != 0){
-        	if(check_client_version == 1){
-			if(account->version != client_version_to_connect){
-				return 6;
-			}
-		}
-	}
-                                                                        
-
 	// make query
 	sprintf(tmpsql, "SELECT `%s`,`%s`,`%s`,`lastlogin`,`logincount`,`sex`,`connect_until`,`last_ip`,`ban_until`,`state`,`%s`"
 	                " FROM `%s` WHERE %s `%s`='%s'", login_db_account_id, login_db_userid, login_db_user_pass, login_db_level, login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid);
@@ -469,6 +459,14 @@ int mmo_auth( struct mmo_account* account , int fd){
 		printf("mmo_auth DB result error ! \n");
 		return 0;
 	}
+	
+	//Client Version check[Sirius]
+        if(check_client_version == 1 && account->version != 0){
+        	if(account->version != client_version_to_connect){
+			mysql_free_result(sql_res);
+			return 6;
+		}
+	}           
 	                                                                        
 	// Documented by CLOWNISIUS || LLRO || Gunstar lead this one with me
 	// IF changed to diferent returns~ you get diferent responses from your msgstringtable.txt