浏览代码

- Login-sql server will no longer change an account's state to "7" when banning a player. This should fix being able to use @ban to clear out a @blocked player. Players will now be identified as banned only through the banned-until timestamp.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7604 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 年之前
父节点
当前提交
ef4320d056
共有 3 个文件被更改,包括 18 次插入8 次删除
  1. 4 0
      Changelog-Trunk.txt
  2. 12 6
      src/login_sql/login.c
  3. 2 2
      src/map/chrif.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/07/10
 2006/07/10
+	* Login-sql server will no longer change an account's state to "7" when
+	  banning a player. This should fix being able to use @ban to clear out a
+	  @blocked player. Players will now be identified as banned only through the
+	  banned-until timestamp. [Skotlex]
 	* Fixed a crash when using Gospel... [Skotlex]
 	* Fixed a crash when using Gospel... [Skotlex]
 	* The on-place function won't be invoked on setting ground skills if the
 	* The on-place function won't be invoked on setting ground skills if the
 	  group's tick is greater than the current tick. As Buuyo pointed out, this
 	  group's tick is greater than the current tick. As Buuyo pointed out, this

+ 12 - 6
src/login_sql/login.c

@@ -787,12 +787,18 @@ int mmo_auth( struct mmo_account* account , int fd){
 
 
 	//login {0-account_id/1-userid/2-user_pass/3-lastlogin/4-logincount/5-sex/6-connect_untl/7-last_ip/8-ban_until/9-state}
 	//login {0-account_id/1-userid/2-user_pass/3-lastlogin/4-logincount/5-sex/6-connect_untl/7-last_ip/8-ban_until/9-state}
 	if (ban_until_time != 0) { // if account is banned
 	if (ban_until_time != 0) { // if account is banned
-		strftime(tmpstr, 20, date_format, localtime(&ban_until_time));
-		tmpstr[19] = '\0';
-		if (ban_until_time > time(NULL)) { // always banned
+		if (ban_until_time > time(NULL)) // always banned
 			return 6; // 6 = Your are Prohibited to log in until %s
 			return 6; // 6 = Your are Prohibited to log in until %s
-		} else { // ban is finished
+
+		sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE %s `%s`='%s'", login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid);
+		if (mysql_query(&mysql_handle, tmpsql)) {
+			ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
+			ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+		}
+
+		// ban is finished
 			// reset the ban time
 			// reset the ban time
+/*		//Removed "state" of bans, it behaves now like their TXT counter-part. [Skotlex]
 			if (atoi(sql_row[9])==7) {//it was a temp ban - so we set STATE to 0
 			if (atoi(sql_row[9])==7) {//it was a temp ban - so we set STATE to 0
 				sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0', `state`='0' WHERE %s `%s`='%s'", login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid);
 				sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0', `state`='0' WHERE %s `%s`='%s'", login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid);
 				strcpy(sql_row[9],"0"); //we clear STATE
 				strcpy(sql_row[9],"0"); //we clear STATE
@@ -803,7 +809,7 @@ int mmo_auth( struct mmo_account* account , int fd){
 				ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
 				ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
 				ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
 				ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
 			}
 			}
-		}
+*/
 	}
 	}
 
 
 	if (atoi(sql_row[9])) {
 	if (atoi(sql_row[9])) {
@@ -1198,7 +1204,7 @@ int parse_fromchar(int fd){
 						charif_sendallwos(-1, buf, 11);
 						charif_sendallwos(-1, buf, 11);
 					}
 					}
 					ShowNotice("Account: %d Banned until: %ld\n", acc, timestamp);
 					ShowNotice("Account: %d Banned until: %ld\n", acc, timestamp);
-					sprintf(tmpsql, "UPDATE `%s` SET `ban_until` = '%ld', `state`='7' WHERE `%s` = '%d'", login_db, (unsigned long)timestamp, login_db_account_id, acc);
+					sprintf(tmpsql, "UPDATE `%s` SET `ban_until` = '%ld' WHERE `%s` = '%d'", login_db, (unsigned long)timestamp, login_db_account_id, acc);
 					// query
 					// query
 					if (mysql_query(&mysql_handle, tmpsql)) {
 					if (mysql_query(&mysql_handle, tmpsql)) {
 						ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
 						ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));

+ 2 - 2
src/map/chrif.c

@@ -684,7 +684,7 @@ int chrif_char_ask_name(int id, char * character_name, short operation_type, int
 		WFIFOW(char_fd, 40) = minute;
 		WFIFOW(char_fd, 40) = minute;
 		WFIFOW(char_fd, 42) = second;
 		WFIFOW(char_fd, 42) = second;
 	}
 	}
-	ShowInfo("chrif : sended 0x2b0e\n");
+//	ShowInfo("chrif : sent 0x2b0e\n");
 	WFIFOSET(char_fd,44);
 	WFIFOSET(char_fd,44);
 
 
 	return 0;
 	return 0;
@@ -702,7 +702,7 @@ int chrif_changesex(int id, int sex) {
 	WFIFOW(char_fd,2) = 9;
 	WFIFOW(char_fd,2) = 9;
 	WFIFOL(char_fd,4) = id;
 	WFIFOL(char_fd,4) = id;
 	WFIFOB(char_fd,8) = sex;
 	WFIFOB(char_fd,8) = sex;
-	ShowInfo("chrif : sent 0x3000(changesex)\n");
+//	ShowInfo("chrif : sent 0x3000(changesex)\n");
 	WFIFOSET(char_fd,9);
 	WFIFOSET(char_fd,9);
 	return 0;
 	return 0;
 }
 }