Browse Source

Minor stuff (typos, socket.c, junk in login reply packet)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9886 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 18 years ago
parent
commit
84cb63e650
5 changed files with 14 additions and 26 deletions
  1. 3 2
      Changelog-Trunk.txt
  2. 1 1
      doc/script_commands.txt
  3. 8 21
      src/common/socket.c
  4. 1 1
      src/login/login.c
  5. 1 1
      src/login_sql/login.c

+ 3 - 2
Changelog-Trunk.txt

@@ -3,11 +3,12 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 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.
 
 
+2007/02/21
+	* Minor stuff (typos, socket.c, junk in login reply packet) [ultramage]
 2007/02/19
 2007/02/19
 	* Fixed @cartlist info message typo [Lupus]
 	* Fixed @cartlist info message typo [Lupus]
 2007/02/17
 2007/02/17
-	* Fixed a typo from r9778, allowing non-gm chars to use /kick [ultramage]
-
+	* Fixed a typo from r9778, allowing non-gm chars to use /kill [ultramage]
 2007/02/16
 2007/02/16
 	* Fixed the structure of packet 0x6d (new char info). It's the same as the 
 	* Fixed the structure of packet 0x6d (new char info). It's the same as the 
 	  one used for packet 0x6b (chars info). [FlavioJS]
 	  one used for packet 0x6b (chars info). [FlavioJS]

+ 1 - 1
doc/script_commands.txt

@@ -4855,7 +4855,7 @@ By default timers do not have a RID attached, which lets the timers continue eve
 if the player that started them logs off. To attach a RID to a timer, you can
 if the player that started them logs off. To attach a RID to a timer, you can
 either use the "attach flag" optional value when using initnpctimer/startnpctimer, 
 either use the "attach flag" optional value when using initnpctimer/startnpctimer, 
 likewise, the optional flag of stopnpctimer detaches any RID after stopping
 likewise, the optional flag of stopnpctimer detaches any RID after stopping
-the timer. One a player is attached to a timer, it stays attached to all
+the timer. Once a player is attached to a timer, it stays attached to all
 timers from that script until detached manually. You can have multiple
 timers from that script until detached manually. You can have multiple
 npctimers going on at the same time as long as each one has a different player
 npctimers going on at the same time as long as each one has a different player
 attached (think of each RID being used as an independant timer).
 attached (think of each RID being used as an independant timer).

+ 8 - 21
src/common/socket.c

@@ -589,42 +589,29 @@ int do_sendrecv(int next)
 		if(session[rfd.fd_array[i]])
 		if(session[rfd.fd_array[i]])
 			session[rfd.fd_array[i]]->func_recv(rfd.fd_array[i]);
 			session[rfd.fd_array[i]]->func_recv(rfd.fd_array[i]);
 	}
 	}
-
+#else
+	// otherwise assume that the fd_set is a bit-array and enumerate it in a standard way
+	//TODO: select() returns the number of readable sockets; use that to exit the fd_max loop faster
 	for (i = 1; i < fd_max; i++)
 	for (i = 1; i < fd_max; i++)
 	{
 	{
-		if(!session[i])
-			continue;
-
-		if(session[i]->wdata_size)
-			session[i]->func_send(i);
-
-		if(session[i]->eof) //func_send can't free a session, this is safe.
-		{	//Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
-			session[i]->func_parse(i); //This should close the session inmediately.
-		}
+		if(FD_ISSET(i,&rfd) && session[i])
+			session[i]->func_recv(i);
 	}
 	}
+#endif
 
 
-#else
-	// otherwise assume that the fd_set is a bit-array and enumerate it in a standard way
 	for (i = 1; i < fd_max; i++)
 	for (i = 1; i < fd_max; i++)
 	{
 	{
 		if(!session[i])
 		if(!session[i])
 			continue;
 			continue;
 
 
-		if(FD_ISSET(i,&rfd)){
-			//ShowMessage("read:%d\n",i);
-			session[i]->func_recv(i);
-		}
-
 		if(session[i]->wdata_size)
 		if(session[i]->wdata_size)
 			session[i]->func_send(i);
 			session[i]->func_send(i);
-	
-		if(session[i]->eof)
+
+		if(session[i]->eof) //func_send can't free a session, this is safe.
 		{	//Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
 		{	//Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
 			session[i]->func_parse(i); //This should close the session inmediately.
 			session[i]->func_parse(i); //This should close the session inmediately.
 		}
 		}
 	}
 	}
-#endif
 
 
 	return 0;
 	return 0;
 }
 }

+ 1 - 1
src/login/login.c

@@ -3193,7 +3193,7 @@ int parse_login(int fd) {
 						WFIFOL(fd,8) = account.account_id;
 						WFIFOL(fd,8) = account.account_id;
 						WFIFOL(fd,12) = account.login_id2;
 						WFIFOL(fd,12) = account.login_id2;
 						WFIFOL(fd,16) = 0; // in old version, that was for ip (not more used)
 						WFIFOL(fd,16) = 0; // in old version, that was for ip (not more used)
-						memcpy(WFIFOP(fd,20), account.lastlogin, 24); // in old version, that was for name (not more used)
+						//memcpy(WFIFOP(fd,20), account.lastlogin, 24); // in old version, that was for name (not more used)
 						WFIFOB(fd,46) = account.sex;
 						WFIFOB(fd,46) = account.sex;
 						WFIFOSET(fd,47+32*server_num);
 						WFIFOSET(fd,47+32*server_num);
 						if (auth_fifo_pos >= AUTH_FIFO_SIZE)
 						if (auth_fifo_pos >= AUTH_FIFO_SIZE)

+ 1 - 1
src/login_sql/login.c

@@ -1656,7 +1656,7 @@ int parse_login(int fd) {
 						WFIFOL(fd,8)=account.account_id;
 						WFIFOL(fd,8)=account.account_id;
 						WFIFOL(fd,12)=account.login_id2;
 						WFIFOL(fd,12)=account.login_id2;
 						WFIFOL(fd,16)=0;
 						WFIFOL(fd,16)=0;
-						memcpy(WFIFOP(fd,20),account.lastlogin,24);
+						//memcpy(WFIFOP(fd,20),account.lastlogin,24);
 						WFIFOB(fd,46)=account.sex;
 						WFIFOB(fd,46)=account.sex;
 						WFIFOSET(fd,47+32*server_num);
 						WFIFOSET(fd,47+32*server_num);
 						if(auth_fifo_pos>=AUTH_FIFO_SIZE)
 						if(auth_fifo_pos>=AUTH_FIFO_SIZE)