// receive maps from some other map-server (relayed via char-server) int chrif_recvmap(int fd) { int i, j; uint32 ip = ntohl(RFIFOL(fd,4)); uint16 port = ntohs(RFIFOW(fd,8)); for(i = 10, j = 0; i < RFIFOW(fd,2); i += 4, j++) { map_setipport(RFIFOW(fd,i), ip, port); } if (battle_config.etc_log) ShowStatus("Received maps from %d.%d.%d.%d:%d (%d maps)\n", CONVIP(ip), port, j); other_mapserver_count++; return 0; }
/*========================================== * マップ受信 *------------------------------------------ */ static int chrif_recvmap(Session *, Packet_Head<0x2b04> head, const std::vector<Packet_Repeat<0x2b04>>& repeat) { if (chrif_state < 2) // まだ準備中 return -1; IP4Address ip = head.ip; uint16_t port = head.port; for (const Packet_Repeat<0x2b04>& i : repeat) { MapName map = i.map_name; map_setipport(map, ip, port); } if (battle_config.etc_log) PRINTF("recv map on %s:%d (%zu maps)\n"_fmt, ip, port, repeat.size()); return 0; }