diff options
Diffstat (limited to 'src/char_sql/int_pet.c')
-rw-r--r-- | src/char_sql/int_pet.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/char_sql/int_pet.c b/src/char_sql/int_pet.c index 5d5dc0615..69eb4ec02 100644 --- a/src/char_sql/int_pet.c +++ b/src/char_sql/int_pet.c @@ -141,6 +141,7 @@ int inter_pet_delete(int pet_id){ //------------------------------------------------------
int mapif_pet_created(int fd, int account_id, struct s_pet *p)
{
+ WFIFOHEAD(fd, 11);
WFIFOW(fd, 0) =0x3880;
WFIFOL(fd, 2) =account_id;
if(p!=NULL){
@@ -157,6 +158,7 @@ int mapif_pet_created(int fd, int account_id, struct s_pet *p) }
int mapif_pet_info(int fd, int account_id, struct s_pet *p){
+ WFIFOHEAD(fd, sizeof(struct s_pet) + 9);
WFIFOW(fd, 0) =0x3881;
WFIFOW(fd, 2) =sizeof(struct s_pet) + 9;
WFIFOL(fd, 4) =account_id;
@@ -168,6 +170,7 @@ int mapif_pet_info(int fd, int account_id, struct s_pet *p){ }
int mapif_pet_noinfo(int fd, int account_id){
+ WFIFOHEAD(fd, sizeof(struct s_pet) + 9);
WFIFOW(fd, 0) =0x3881;
WFIFOW(fd, 2) =sizeof(struct s_pet) + 9;
WFIFOL(fd, 4) =account_id;
@@ -179,6 +182,7 @@ int mapif_pet_noinfo(int fd, int account_id){ }
int mapif_save_pet_ack(int fd, int account_id, int flag){
+ WFIFOHEAD(fd, 7);
WFIFOW(fd, 0) =0x3882;
WFIFOL(fd, 2) =account_id;
WFIFOB(fd, 6) =flag;
@@ -188,6 +192,7 @@ int mapif_save_pet_ack(int fd, int account_id, int flag){ }
int mapif_delete_pet_ack(int fd, int flag){
+ WFIFOHEAD(fd, 3);
WFIFOW(fd, 0) =0x3883;
WFIFOB(fd, 2) =flag;
WFIFOSET(fd, 3);
@@ -196,6 +201,7 @@ int mapif_delete_pet_ack(int fd, int flag){ }
int mapif_rename_pet_ack(int fd, int account_id, int char_id, int flag, char *name){
+ WFIFOHEAD(fd, NAME_LENGTH+12);
WFIFOW(fd, 0) =0x3884;
WFIFOL(fd, 2) =account_id;
WFIFOL(fd, 6) =char_id;
@@ -268,7 +274,9 @@ int mapif_load_pet(int fd, int account_id, int char_id, int pet_id){ int mapif_save_pet(int fd, int account_id, struct s_pet *data) {
//here process pet save request.
- int len=RFIFOW(fd, 2);
+ int len;
+ RFIFOHEAD(fd);
+ len=RFIFOW(fd, 2);
if(sizeof(struct s_pet)!=len-8) {
ShowError("inter pet: data size error %d %d\n", sizeof(struct s_pet), len-8);
}
@@ -318,32 +326,38 @@ int mapif_rename_pet(int fd, int account_id, int char_id, char *name){ }
int mapif_parse_CreatePet(int fd){
+ RFIFOHEAD(fd);
mapif_create_pet(fd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOW(fd, 10), RFIFOW(fd, 12), RFIFOW(fd, 14), RFIFOW(fd, 16), RFIFOW(fd, 18),
RFIFOW(fd, 20), RFIFOB(fd, 22), RFIFOB(fd, 23), (char*)RFIFOP(fd, 24));
return 0;
}
int mapif_parse_LoadPet(int fd){
+ RFIFOHEAD(fd);
mapif_load_pet(fd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOL(fd, 10));
return 0;
}
int mapif_parse_SavePet(int fd){
+ RFIFOHEAD(fd);
mapif_save_pet(fd, RFIFOL(fd, 4), (struct s_pet *) RFIFOP(fd, 8));
return 0;
}
int mapif_parse_DeletePet(int fd){
+ RFIFOHEAD(fd);
mapif_delete_pet(fd, RFIFOL(fd, 2));
return 0;
}
int mapif_parse_RenamePet(int fd){
+ RFIFOHEAD(fd);
mapif_rename_pet(fd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOP(fd, 10));
return 0;
}
int inter_pet_parse_frommap(int fd){
+ RFIFOHEAD(fd);
switch(RFIFOW(fd, 0)){
case 0x3080: mapif_parse_CreatePet(fd); break;
case 0x3081: mapif_parse_LoadPet(fd); break;
|