فهرست منبع

Add debug logs for debugging client connections (#7701)

Vincent Stumpf 2 سال پیش
والد
کامیت
579dea8fad
3فایلهای تغییر یافته به همراه17 افزوده شده و 0 حذف شده
  1. 5 0
      src/char/char_clif.cpp
  2. 7 0
      src/login/loginclif.cpp
  3. 5 0
      src/map/clif.cpp

+ 5 - 0
src/char/char_clif.cpp

@@ -816,6 +816,11 @@ void chclif_send_map_data( int fd, std::shared_ptr<struct mmo_charstatus> cd, ui
 	WFIFOW(fd,26) = ntows(htons(map_server[map_server_index].port)); // [!] LE byte order here [!]
 #if PACKETVER >= 20170315
 	memset(WFIFOP(fd, 28), 0, 128); // Unknown
+#endif
+#ifdef DEBUG
+	ShowDebug("Sending the client (%d %d.%d.%d.%d) to map-server with ip %d.%d.%d.%d and port %hu\n",
+			  cd->account_id, CONVIP(ipl), CONVIP((subnet_map_ip) ? subnet_map_ip : map_server[map_server_index].ip),
+			  map_server[map_server_index].port);
 #endif
 	WFIFOSET(fd,size);
 }

+ 7 - 0
src/login/loginclif.cpp

@@ -144,6 +144,13 @@ static void logclif_auth_ok(struct login_session_data* sd) {
 		WFIFOW(fd,header+n*size+30) = ch_server[i].new_;
 #if PACKETVER >= 20170315
 		memset(WFIFOP(fd, header+n*size+32), 0, 128); // Unknown
+#endif
+#ifdef DEBUG
+		ShowDebug(
+			"Sending the client (%d %d.%d.%d.%d) to char-server %s with ip %d.%d.%d.%d and port "
+			"%hu\n",
+			sd->account_id, CONVIP(ip), ch_server[i].name,
+			CONVIP((subnet_char_ip) ? subnet_char_ip : ch_server[i].ip), ch_server[i].port);
 #endif
 		n++;
 	}

+ 5 - 0
src/map/clif.cpp

@@ -2146,6 +2146,11 @@ void clif_changemapserver(map_session_data* sd, const char* map, int x, int y, u
 	WFIFOW(fd,26) = ntows(htons(port)); // [!] LE byte order here [!]
 #if PACKETVER >= 20170315
 	memset(WFIFOP(fd, 28), 0, 128); // Unknown
+#endif
+#ifdef DEBUG
+	ShowDebug(
+		"Sending the client (%d %d.%d.%d.%d) to map-server with ip %d.%d.%d.%d and port %hu\n",
+		sd->status.account_id, CONVIP(session[fd]->client_addr), CONVIP(ip), port);
 #endif
 	WFIFOSET(fd,packet_len(cmd));
 }