// Save guild_storage data to sql int guild_storage_tosql(int guild_id, struct guild_storage *p) { int i,j; // int eqcount=1; // int noteqcount=1; int count=0; struct itemtmp mapitem[MAX_GUILD_STORAGE]; for(i=0; i<MAX_GUILD_STORAGE; i++) { if(p->storage_[i].nameid>0) { mapitem[count].flag=0; mapitem[count].id = p->storage_[i].id; mapitem[count].nameid=p->storage_[i].nameid; mapitem[count].amount = p->storage_[i].amount; mapitem[count].equip = p->storage_[i].equip; mapitem[count].identify = p->storage_[i].identify; mapitem[count].refine = p->storage_[i].refine; mapitem[count].attribute = p->storage_[i].attribute; for (j=0; j<MAX_SLOTS; j++) mapitem[count].card[j] = p->storage_[i].card[j]; count++; } } memitemdata_to_sql(mapitem, count, guild_id,TABLE_GUILD_STORAGE); ShowInfo ("guild storage save to DB - id: %d (total: %d)\n", guild_id,i); return 0; }
// storage data -> DB conversion int storage_tosql(int account_id,struct storage *p) { int i,j; // int eqcount=1; // int noteqcount=1; int count=0; struct itemtmp mapitem[MAX_STORAGE]; for(i=0; i<MAX_STORAGE; i++) { if(p->storage_[i].nameid>0) { mapitem[count].flag=0; mapitem[count].id = p->storage_[i].id; mapitem[count].nameid=p->storage_[i].nameid; mapitem[count].amount = p->storage_[i].amount; mapitem[count].equip = p->storage_[i].equip; mapitem[count].identify = p->storage_[i].identify; mapitem[count].refine = p->storage_[i].refine; mapitem[count].attribute = p->storage_[i].attribute; for(j=0; j<MAX_SLOTS; j++) mapitem[count].card[j] = p->storage_[i].card[j]; count++; } } memitemdata_to_sql(mapitem, count, account_id,TABLE_STORAGE); //printf ("storage dump to DB - id: %d (total: %d)\n", account_id, j); return 0; }
// storage data -> DB conversion int storage_tosql(int account_id,struct storage *p) { int i; int eqcount=1; int noteqcount=1; struct itemtemp mapitem; for(i=0; i<MAX_INVENTORY; i++) { if(p->storage[i].nameid>0) { if(itemdb_isequip(p->storage[i].nameid)==1) { mapitem.equip[eqcount].flag=0; mapitem.equip[eqcount].id = p->storage[i].id; mapitem.equip[eqcount].nameid=p->storage[i].nameid; mapitem.equip[eqcount].amount = p->storage[i].amount; mapitem.equip[eqcount].equip = p->storage[i].equip; mapitem.equip[eqcount].identify = p->storage[i].identify; mapitem.equip[eqcount].refine = p->storage[i].refine; mapitem.equip[eqcount].attribute = p->storage[i].attribute; mapitem.equip[eqcount].card[0] = p->storage[i].card[0]; mapitem.equip[eqcount].card[1] = p->storage[i].card[1]; mapitem.equip[eqcount].card[2] = p->storage[i].card[2]; mapitem.equip[eqcount].card[3] = p->storage[i].card[3]; eqcount++; } else if(itemdb_isequip(p->storage[i].nameid)==0) { mapitem.notequip[noteqcount].flag=0; mapitem.notequip[noteqcount].id = p->storage[i].id; mapitem.notequip[noteqcount].nameid=p->storage[i].nameid; mapitem.notequip[noteqcount].amount = p->storage[i].amount; mapitem.notequip[noteqcount].equip = p->storage[i].equip; mapitem.notequip[noteqcount].identify = p->storage[i].identify; mapitem.notequip[noteqcount].refine = p->storage[i].refine; mapitem.notequip[noteqcount].attribute = p->storage[i].attribute; mapitem.notequip[noteqcount].card[0] = p->storage[i].card[0]; mapitem.notequip[noteqcount].card[1] = p->storage[i].card[1]; mapitem.notequip[noteqcount].card[2] = p->storage[i].card[2]; mapitem.notequip[noteqcount].card[3] = p->storage[i].card[3]; noteqcount++; } } } memitemdata_to_sql(mapitem, eqcount, noteqcount, account_id,TABLE_STORAGE); //printf ("storage dump to DB - id: %d (total: %d)\n", account_id, j); return 0; }
/// Save guild_storage data to sql int guild_storage_tosql(int guild_id, struct guild_storage* p) { memitemdata_to_sql(p->items, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE); ShowInfo ("guild storage save to DB - guild: %d\n", guild_id); return 0; }
/// Save storage data to sql int storage_tosql(int account_id, struct storage_data* p) { memitemdata_to_sql(p->items, MAX_STORAGE, account_id, TABLE_STORAGE); return 0; }
/// Save guild_storage data to sql int storage_tosql(int account_id, struct storage* p) { memitemdata_to_sql(p->storage_, MAX_STORAGE, account_id, TABLE_STORAGE); //ShowInfo ("storage save to DB - account: %d\n", account_id); return 0; }
/// Save guild_storage data to sql int guild_storage_tosql(int guild_id, struct guild_storage* p) { memitemdata_to_sql(p->items, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE); ShowInfo(read_message("Source.char.storage_gtosql"), guild_id); return 0; }
/// Save guild_storage data to sql int guild_storage_tosql(int guild_id, struct guild_storage* p) { memitemdata_to_sql(p->items, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE); ShowInfo ("Salvamento dos dados do armazem de guild completado! (GID:%d).\n", guild_id); return 0; }