summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/chrif.c2
-rw-r--r--src/map/clif.c13
-rw-r--r--src/map/clif.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 609c856c6..43ea7ebe3 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -459,7 +459,7 @@ static bool chrif_changemapserverack(int account_id, int login_id1, int login_id
ShowError("chrif_changemapserverack: map server change failed.\n");
clif->authfail_fd(node->fd, 0); // Disconnected from server
} else
- clif->changemapserver(node->sd, map_index, x, y, ntohl(ip), ntohs(port));
+ clif->changemapserver(node->sd, map_index, x, y, ntohl(ip), ntohs(port), NULL);
//Player has been saved already, remove him from memory. [Skotlex]
chrif->auth_delete(account_id, char_id, ST_MAPCHANGE);
diff --git a/src/map/clif.c b/src/map/clif.c
index 2076a922b..3dae902cb 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2010,8 +2010,8 @@ static void clif_changemap_airship(struct map_session_data *sd, short m, int x,
/// Notifies the client of a position change to coordinates on given map, which is on another map-server (ZC_NPCACK_SERVERMOVE).
/// 0092 <map name>.16B <x>.W <y>.W <ip>.L <port>.W
-/// 0ac7 <map name>.16B <x>.W <y>.W <ip>.L <port>.W <zero>.128B
-static void clif_changemapserver(struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port)
+/// 0ac7 <map name>.16B <x>.W <y>.W <ip>.L <port>.W <dns host>.128B
+static void clif_changemapserver(struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port, char *dnsHost)
{
int fd;
#if PACKETVER >= 20170315
@@ -2029,6 +2029,15 @@ static void clif_changemapserver(struct map_session_data *sd, unsigned short map
WFIFOW(fd, 20) = y;
WFIFOL(fd, 22) = htonl(ip);
WFIFOW(fd, 26) = sockt->ntows(htons(port)); // [!] LE byte order here [!]
+
+#if PACKETVER >= 20170315
+ if (dnsHost != NULL) {
+ safestrncpy(WFIFOP(fd, 28), dnsHost, 128);
+ } else {
+ memset(WFIFOP(fd, 28), 0, 128);
+ }
+#endif
+
WFIFOSET(fd, packet_len(cmd));
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 3af637629..1bbe6e147 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -775,7 +775,7 @@ struct clif_interface {
void (*map_type) (struct map_session_data* sd, enum map_type type);
void (*maptypeproperty2) (struct block_list *bl,enum send_target t);
/* multi-map-server */
- void (*changemapserver) (struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
+ void (*changemapserver) (struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port, char *dnsHost);
void (*changemapserver_airship) (struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
/* npc-shop-related */
void (*npcbuysell) (struct map_session_data* sd, int id);