Explorar o código

Client not marked online until map receives auth request from the client and is approved. Also added some online/offline sets to the auth system that were being looked over and not properly updating the char server as to what's going on.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12552 54d463be-8e91-2dee-dedb-b68131a5f0ec
Kevin %!s(int64=17) %!d(string=hai) anos
pai
achega
3c7a81a079
Modificáronse 3 ficheiros con 12 adicións e 3 borrados
  1. 3 0
      Changelog-Trunk.txt
  2. 0 1
      src/char_sql/char.c
  3. 9 2
      src/map/chrif.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ 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.
 
 2008/04/10
+	* Client not marked online until map receives auth request from the client
+	- and is approved. Also added some online/offline sets to the auth system
+	- that were being skipped.(r12552) [Kevin]
 	* Rev. 12550 Reverted the change to MAX_SQUARE_LAYOUT. [L0ne_W0lf]
 	* Rev. 12548 Updated NPC skill "Evil Land". More gravity wtfage. [L0ne_W0lf]
 	- Based on visual observation, and experience with it on iRO Sakray.

+ 0 - 1
src/char_sql/char.c

@@ -3171,7 +3171,6 @@ int parse_char(int fd)
 			node->ip = ipl;
 			idb_put(auth_db, sd->account_id, node);
 
-			set_char_online(i, char_dat.char_id, char_dat.account_id);
 		}
 		break;
 

+ 9 - 2
src/map/chrif.c

@@ -163,6 +163,7 @@ static bool chrif_auth_logout(TBL_PC* sd, enum sd_state state)
 	if(sd->fd && state == ST_LOGOUT)
   	{	//Disassociate player, and free it after saving ack returns. [Skotlex]
 		//fd info must not be lost for ST_MAPCHANGE as a final packet needs to be sent to the player.
+		chrif_char_offline(sd);
 		if (session[sd->fd])
 			session[sd->fd]->session_data = NULL;
 		sd->fd = 0;
@@ -527,16 +528,18 @@ void chrif_authreq(struct map_session_data *sd)
 		node->login_id1 == sd->login_id1)
 	{	//auth ok
 		if (!pc_authok(sd, node->login_id2, node->expiration_time, node->char_dat))
+			chrif_char_offline(sd); //Set client offline
 			chrif_auth_delete(node->account_id, node->char_id, ST_LOGIN);
 		else {
 			//char_dat no longer needed, but player auth is not completed yet.
 			aFree(node->char_dat);
 			node->char_dat = NULL;
 			node->sd = sd;
+			chrif_char_online(sd); //Set client online
 		}
 	} else { //auth failed
 		pc_authfail(sd);
-		chrif_char_offline(sd); //Set him offline, the char server likely has it set as online already.
+		chrif_char_offline(sd); //Set client offline
 		chrif_auth_delete(sd->status.account_id, sd->status.char_id, ST_LOGIN);
 	}
 	return;
@@ -576,11 +579,14 @@ void chrif_authok(int fd)
 				node->login_id1 == RFIFOL(fd, 8))
 			{ //Auth Ok
 				if (pc_authok(sd, RFIFOL(fd, 16), RFIFOL(fd, 12), status))
+				{
+					chrif_char_online(sd);
 					return;
+				}
 			} else { //Auth Failed
 				pc_authfail(sd);
-				chrif_char_offline(sd); //Set him offline, the char server likely has it set as online already.
 			}
+			chrif_char_offline(sd); //Set client offline
 			chrif_auth_delete(account_id, char_id, ST_LOGIN);
 			return;
 		}
@@ -619,6 +625,7 @@ int auth_db_cleanup_sub(DBKey key,void *data,va_list ap)
 		default:
 			//Clear data. any connected players should have timed out by now.
 			ShowInfo("auth_db: Node (state %s) timed out for %d:%d\n", states[node->state], node->account_id, node->char_id);
+			chrif_char_offline(node->sd);
 			chrif_auth_delete(node->account_id, node->char_id, node->state);
 			break;
 		}