Explorar o código

* [Fixed]:
- Compilation warnings and errors.
[Improved]:
- Changed and moved IP sync status messages to elaborate more.

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

Lance %!s(int64=19) %!d(string=hai) anos
pai
achega
50ebb5e959
Modificáronse 7 ficheiros con 15 adicións e 8 borrados
  1. 4 0
      Changelog-Trunk.txt
  2. 2 2
      src/char/char.c
  3. 2 2
      src/char_sql/char.c
  4. 2 2
      src/login/login.c
  5. 1 1
      src/login_sql/login.c
  6. 1 1
      src/map/chrif.c
  7. 3 0
      src/map/map.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.
 
 2006/06/21
+	* [Fixed]:
+	  - Compilation warnings and errors.
+	  [Improved]:
+	  - Changed and moved IP sync status messages to elaborate more. [Lance]
 	* Tested and fixed resolve_hostbyname. Applied said function around most of
 	  the code where needed. Removed includes for the OS/network system pretty
 	  much from every file (our socket.c file should handle this) [Skotlex]

+ 2 - 2
src/char/char.c

@@ -2290,9 +2290,9 @@ int parse_tologin(int fd) {
 		case 0x2735:
 		{
 			unsigned char ip[4];
-			ShowInfo("IP Sync in progress...\n");
 			if (char_server_dns && resolve_hostbyname(char_server_dns, ip, NULL))
 			{
+				ShowInfo("IP Sync [%s] in progress...\n",char_server_dns);
 				WFIFOW(fd,0) = 0x2736;
 				WFIFOB(fd,2) = ip[0];
 				WFIFOB(fd,3) = ip[1];
@@ -3073,7 +3073,7 @@ int parse_frommap(int fd) {
 		case 0x2736:
 			for(i = 0; i < MAX_MAP_SERVERS; i++){
 				if(server_fd[i] == fd){
-					ShowInfo("IP Sync (Server #%d) successful.\n",i);
+					ShowInfo("IP Sync (Server #%d %d.%d.%d.%d) successful.\n",i,(int)RFIFOB(fd,2),(int)RFIFOB(fd,3),(int)RFIFOB(fd,4),(int)RFIFOB(fd,5));
 					server[i].ip = RFIFOL(fd, 2);
 				}
 			}

+ 2 - 2
src/char_sql/char.c

@@ -2175,9 +2175,9 @@ int parse_tologin(int fd) {
 		case 0x2735:
 		{
 			unsigned char ip_str[4];
-			ShowInfo("IP Sync in progress...\n");
 			if (char_server_dns && resolve_hostbyname(char_server_dns, ip_str, NULL))
 			{
+				ShowInfo("IP Sync [%s] in progress...\n",char_server_dns);
 				WFIFOW(fd,0) = 0x2736;
 				WFIFOB(fd,2) = ip_str[0];
 				WFIFOB(fd,3) = ip_str[1];
@@ -2990,7 +2990,7 @@ int parse_frommap(int fd) {
 		case 0x2736:
 			for(i = 0; i < MAX_MAP_SERVERS; i++){
 				if(server_fd[i] == fd){
-					ShowInfo("IP Sync (Server #%d) successful.\n",i);
+					ShowInfo("IP Sync (Server #%d %d.%d.%d.%d) successful.\n",i,(int)RFIFOB(fd,2),(int)RFIFOB(fd,3),(int)RFIFOB(fd,4),(int)RFIFOB(fd,5));
 					server[i].ip = RFIFOL(fd, 2);
 				}
 			}

+ 2 - 2
src/login/login.c

@@ -1172,7 +1172,7 @@ int mmo_auth(struct mmo_account* account, int fd) {
 
 		while((dnsbl_serv=strtok(dnsbl_servs,","))) {
 			sprintf(ip_dnsbl,"%s.%s",r_ip,dnsbl_serv);
-			if(resolve_hostbyname(ip_dnsbl,NULL,NULL)!=NULL) {
+			if(resolve_hostbyname(ip_dnsbl,NULL,NULL)!=0) {
 				ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n",ip);
 				return 3;
 			}
@@ -1958,7 +1958,7 @@ int parse_fromchar(int fd) {
 		case 0x2736: // WAN IP update from char-server
 			for(i = 0; i < MAX_SERVERS; i++) {
 				if (server_fd[i] == fd) {
-					ShowInfo("IP Sync (Server #%d) successful.\n",i);
+					ShowInfo("IP Sync (Server #%d %d.%d.%d.%d) successful.\n",i,(int)RFIFOB(fd,2),(int)RFIFOB(fd,3),(int)RFIFOB(fd,4),(int)RFIFOB(fd,5));
 					server[i].ip = RFIFOL(fd,2);
 				}
 			}

+ 1 - 1
src/login_sql/login.c

@@ -1398,7 +1398,7 @@ int parse_fromchar(int fd){
 		case 0x2736: // WAN IP update from char-server
 			for(i = 0; i < MAX_SERVERS; i++) {
 				if (server_fd[i] == fd) {
-					ShowInfo("IP Sync (Server #%d) successful.\n",i);
+					ShowInfo("IP Sync (Server #%d %d.%d.%d.%d) successful.\n",i,(int)RFIFOB(fd,2),(int)RFIFOB(fd,3),(int)RFIFOB(fd,4),(int)RFIFOB(fd,5));
 					server[i].ip = RFIFOL(fd,2);
 				}
 			}

+ 1 - 1
src/map/chrif.c

@@ -1414,8 +1414,8 @@ int chrif_disconnect(int fd) {
 
 void chrif_update_ip(int fd){
 	char ip[4];
-	ShowInfo("IP Sync in progress...\n");
 	if (map_server_dns && resolve_hostbyname(map_server_dns, ip, NULL)) {
+		ShowInfo("IP Sync [%s] in progress...\n",map_server_dns);
 		WFIFOW(fd, 0) = 0x2736;
 		WFIFOB(fd, 2) = ip[0];
 		WFIFOB(fd, 3) = ip[1];

+ 3 - 0
src/map/map.c

@@ -6,7 +6,10 @@
 #include <string.h>
 #include <stdarg.h>
 #include <math.h>
+
+#ifndef _WIN32
 #include <unistd.h>
+#endif
 
 #include "../common/core.h"
 #include "../common/timer.h"