/*========================================== * 他鯖管理のマップをdbに追加 *------------------------------------------ */ int map_setipport(char *name,unsigned long ip,int port) { struct map_data *md; struct map_data_other_server *mdos; md=strdb_search(map_db,name); if(md==NULL){ // not exist -> add new data mdos=malloc(sizeof(*mdos)); if(mdos==NULL){ printf("out of memory : map_setipport\n"); exit(1); } memcpy(mdos->name,name,24); mdos->gat = NULL; mdos->ip = ip; mdos->port = port; strdb_insert(map_db,mdos->name,mdos); } else { if(md->gat){ // local -> check data if(ip!=clif_getip() || port!=clif_getport()){ printf("from char server : %s -> %08lx:%d\n",name,ip,port); return 1; } } else { // update mdos=(struct map_data_other_server *)md; mdos->ip = ip; mdos->port = port; } } return 0; }
/*========================================== * *------------------------------------------ */ static int chrif_connect(Session *s) { Packet_Fixed<0x2af8> fixed_f8; fixed_f8.account_name = userid; fixed_f8.account_pass = passwd; fixed_f8.unused = 0; fixed_f8.ip = clif_getip(); fixed_f8.port = clif_getport(); send_fpacket<0x2af8, 60>(s, fixed_f8); return 0; }
// connects to char-server (plaintext) int chrif_connect(int fd) { ShowStatus("Logging in to char server...\n", char_fd); WFIFOHEAD(fd,60); WFIFOW(fd,0) = 0x2af8; memcpy(WFIFOP(fd,2), userid, NAME_LENGTH); memcpy(WFIFOP(fd,26), passwd, NAME_LENGTH); WFIFOL(fd,50) = 0; WFIFOL(fd,54) = htonl(clif_getip()); WFIFOW(fd,58) = htons(clif_getport()); WFIFOSET(fd,60); return 0; }
// connects to char-server (plaintext) int chrif_connect(int fd) { ShowStatus("Entrando no servidor de personagens...\n", char_fd); WFIFOHEAD(fd,60); WFIFOW(fd,0) = 0x2af8; memcpy(WFIFOP(fd,2), userid, NAME_LENGTH); memcpy(WFIFOP(fd,26), passwd, NAME_LENGTH); WFIFOL(fd,50) = 0; WFIFOL(fd,54) = htonl(clif_getip()); WFIFOW(fd,58) = htons(clif_getport()); WFIFOSET(fd,60); return 0; }