// storage data recive and save int mapif_parse_SaveStorage(int fd) { int account_id=RFIFOL(fd,4); int len=RFIFOW(fd,2); if(sizeof(struct storage)!=len-8) { printf("inter storage: data size error %d %d\n",sizeof(struct storage),len-8); } else { memcpy(&storage[0],RFIFOP(fd,8),sizeof(struct storage)); storage_tosql(account_id, storage); mapif_save_storage_ack(fd,account_id); } return 0; }
// 倉庫データ受信&保存 int mapif_parse_SaveStorage(int fd) { int account_id=RFIFOL(fd,4); int len=RFIFOW(fd,2); int i; if(sizeof(struct storage)!=len-8){ printf("inter storage: data size error %d %d\n",sizeof(struct storage),len-8); }else{ i=account2storage(account_id); memcpy(&storage[i],RFIFOP(fd,8),sizeof(struct storage)); inter_storage_save(); // 一応セーブ mapif_save_storage_ack(fd,account_id); } return 0; }
// 倉庫データ受信&保存 static void mapif_parse_SaveStorage(int fd) { struct storage *s; int account_id = RFIFOL(fd, 4); int len = RFIFOW(fd, 2); if (sizeof(struct storage) != len - 8) { PRINTF("inter storage: data size error %zu %d\n", sizeof(struct storage), len - 8); } else { s = account2storage(account_id); RFIFO_STRUCT(fd, 8, *s); mapif_save_storage_ack(fd, account_id); } }