// Send the requested account_reg int mapif_account_reg_reply(int fd,int account_id,int char_id, int type) { struct accreg *reg=accreg_pt; WFIFOHEAD(fd, 13 + 5000); inter_accreg_fromsql(account_id,char_id,reg,type); WFIFOW(fd,0)=0x3804; WFIFOL(fd,4)=account_id; WFIFOL(fd,8)=char_id; WFIFOB(fd,12)=type; if(reg->reg_num==0){ WFIFOW(fd,2)=13; }else{ int i,p; for (p=13,i = 0; i < reg->reg_num && p < 5000; i++) { p+= sprintf((char*)WFIFOP(fd,p), "%s", reg->reg[i].str)+1; //We add 1 to consider the '\0' in place. p+= sprintf((char*)WFIFOP(fd,p), "%s", reg->reg[i].value)+1; } WFIFOW(fd,2)=p; if (p>= 5000) ShowWarning("Too many acc regs for %d:%d, not all values were loaded.\n", account_id, char_id); } WFIFOSET(fd,WFIFOW(fd,2)); return 0; }
// Send the requested account_reg int mapif_account_reg_reply(int fd,int account_id) { struct accreg *reg=accreg_pt; inter_accreg_fromsql(account_id,reg); WFIFOW(fd,0)=0x3804; WFIFOL(fd,4)=account_id; if(reg->reg_num==0){ WFIFOW(fd,2)=8; }else{ int j,p; for(j=0,p=8;j<reg->reg_num;j++,p+=288){ memcpy(WFIFOP(fd,p),reg->reg[j].str,32); memcpy(WFIFOP(fd,p+32),reg->reg[j].value,256); } WFIFOW(fd,2)=p; } WFIFOSET(fd,WFIFOW(fd,2)); return 0; }
// Send the requested account_reg int mapif_account_reg_reply(int fd,int account_id,int char_id, int type) { struct accreg *reg=accreg_pt; inter_accreg_fromsql(account_id,char_id,reg,type); WFIFOW(fd,0)=0x3804; WFIFOL(fd,4)=account_id; WFIFOL(fd,8)=char_id; WFIFOB(fd,12)=type; if(reg->reg_num==0) { WFIFOW(fd,2)=13; } else { int i,p; for (p=13,i = 0; i < reg->reg_num; i++) { p+= sprintf(WFIFOP(fd,p), "%s", reg->reg[i].str)+1; //We add 1 to consider the '\0' in place. p+= sprintf(WFIFOP(fd,p), "%s", reg->reg[i].value)+1; } WFIFOW(fd,2)=p; } WFIFOSET(fd,WFIFOW(fd,2)); return 0; }
// Send the requested account_reg int mapif_account_reg_reply(int fd,int account_id,int char_id, int type) { inter_accreg_fromsql(account_id,char_id,fd,type); return 0; }