diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 77 | ||||
-rw-r--r-- | src/char/int_auction.c | 2 | ||||
-rw-r--r-- | src/char/int_guild.c | 2 | ||||
-rw-r--r-- | src/char/int_party.c | 2 | ||||
-rw-r--r-- | src/char/int_rodex.c | 12 |
5 files changed, 54 insertions, 41 deletions
diff --git a/src/char/char.c b/src/char/char.c index 4687d4d6b..78b2d19fa 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -460,10 +460,10 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p) (p->int_ != cp->int_) || (p->dex != cp->dex) || (p->luk != cp->luk) || (p->option != cp->option) || (p->party_id != cp->party_id) || (p->guild_id != cp->guild_id) || - (p->pet_id != cp->pet_id) || (p->weapon != cp->weapon) || (p->hom_id != cp->hom_id) || - (p->ele_id != cp->ele_id) || (p->shield != cp->shield) || (p->head_top != cp->head_top) || - (p->head_mid != cp->head_mid) || (p->head_bottom != cp->head_bottom) || (p->delete_date != cp->delete_date) || - (p->rename != cp->rename) || (p->slotchange != cp->slotchange) || (p->robe != cp->robe) || + (p->pet_id != cp->pet_id) || (p->look.weapon != cp->look.weapon) || (p->hom_id != cp->hom_id) || + (p->ele_id != cp->ele_id) || (p->look.shield != cp->look.shield) || (p->look.head_top != cp->look.head_top) || + (p->look.head_mid != cp->look.head_mid) || (p->look.head_bottom != cp->look.head_bottom) || (p->delete_date != cp->delete_date) || + (p->rename != cp->rename) || (p->slotchange != cp->slotchange) || (p->look.robe != cp->look.robe) || (p->show_equip != cp->show_equip) || (p->allow_party != cp->allow_party) || (p->font != cp->font) || (p->uniqueitem_counter != cp->uniqueitem_counter) || (p->hotkey_rowshift != cp->hotkey_rowshift) ) { @@ -476,7 +476,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p) opt |= OPT_SHOW_EQUIP; if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d'," - "`base_exp`='%u', `job_exp`='%u', `zeny`='%d'," + "`base_exp`='%"PRIu64"', `job_exp`='%"PRIu64"', `zeny`='%d'," "`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d'," "`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d'," "`option`='%u',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',`elemental_id`='%d'," @@ -490,11 +490,11 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p) p->max_hp, p->hp, p->max_sp, p->sp, p->status_point, p->skill_point, p->str, p->agi, p->vit, p->int_, p->dex, p->luk, p->option, p->party_id, p->guild_id, p->pet_id, p->hom_id, p->ele_id, - p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom, + p->look.weapon, p->look.shield, p->look.head_top, p->look.head_mid, p->look.head_bottom, mapindex_id2name(p->last_point.map), p->last_point.x, p->last_point.y, mapindex_id2name(p->save_point.map), p->save_point.x, p->save_point.y, p->rename, (unsigned long)p->delete_date, // FIXME: platform-dependent size - p->robe,p->slotchange,opt,p->font,p->uniqueitem_counter, + p->look.robe,p->slotchange,opt,p->font,p->uniqueitem_counter, p->hotkey_rowshift, p->account_id, p->char_id) ) { @@ -927,7 +927,7 @@ int char_memitemdata_to_sql(const struct item *p_items, int guid, enum inventory if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); } - + aFree(deletes); } @@ -1072,8 +1072,8 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_SHORT, &p.class, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT, &p.base_level, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p.job_level, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT, &p.base_exp, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &p.job_exp, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT64, &p.base_exp, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT64, &p.job_exp, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_INT, &p.zeny, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 9, SQLDT_SHORT, &p.str, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 10, SQLDT_SHORT, &p.agi, 0, NULL, NULL) @@ -1094,15 +1094,15 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) || SQL_ERROR == SQL->StmtBindColumn(stmt, 25, SQLDT_SHORT, &p.hair_color, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 26, SQLDT_SHORT, &p.clothes_color, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 27, SQLDT_SHORT, &p.body, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 28, SQLDT_SHORT, &p.weapon, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 29, SQLDT_SHORT, &p.shield, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 30, SQLDT_SHORT, &p.head_top, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 31, SQLDT_SHORT, &p.head_mid, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 32, SQLDT_SHORT, &p.head_bottom, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 28, SQLDT_SHORT, &p.look.weapon, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 29, SQLDT_SHORT, &p.look.shield, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 30, SQLDT_SHORT, &p.look.head_top, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 31, SQLDT_SHORT, &p.look.head_mid, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 32, SQLDT_SHORT, &p.look.head_bottom, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 33, SQLDT_STRING, &last_map, sizeof(last_map), NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 34, SQLDT_USHORT, &p.rename, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 35, SQLDT_UINT32, &p.delete_date, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_SHORT, &p.robe, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_SHORT, &p.look.robe, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 37, SQLDT_USHORT, &p.slotchange, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 38, SQLDT_LONG, &unban_time, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 39, SQLDT_ENUM, &sex, sizeof(sex), NULL, NULL) @@ -1181,8 +1181,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_SHORT, &p->class, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p->base_level, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_INT, &p->job_level, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &p->base_exp, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_UINT, &p->job_exp, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT64, &p->base_exp, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_UINT64, &p->job_exp, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 9, SQLDT_INT, &p->zeny, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 10, SQLDT_SHORT, &p->str, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 11, SQLDT_SHORT, &p->agi, 0, NULL, NULL) @@ -1208,11 +1208,11 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every || SQL_ERROR == SQL->StmtBindColumn(stmt, 31, SQLDT_SHORT, &p->hair_color, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 32, SQLDT_SHORT, &p->clothes_color, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 33, SQLDT_SHORT, &p->body, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 34, SQLDT_SHORT, &p->weapon, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 35, SQLDT_SHORT, &p->shield, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_SHORT, &p->head_top, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 37, SQLDT_SHORT, &p->head_mid, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 38, SQLDT_SHORT, &p->head_bottom, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 34, SQLDT_SHORT, &p->look.weapon, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 35, SQLDT_SHORT, &p->look.shield, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_SHORT, &p->look.head_top, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 37, SQLDT_SHORT, &p->look.head_mid, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 38, SQLDT_SHORT, &p->look.head_bottom, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 39, SQLDT_STRING, &last_map, sizeof(last_map), NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 40, SQLDT_SHORT, &p->last_point.x, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 41, SQLDT_SHORT, &p->last_point.y, 0, NULL, NULL) @@ -1226,7 +1226,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every || SQL_ERROR == SQL->StmtBindColumn(stmt, 49, SQLDT_INT, &p->fame, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 50, SQLDT_USHORT, &p->rename, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 51, SQLDT_UINT32, &p->delete_date, 0, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 52, SQLDT_SHORT, &p->robe, 0, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 52, SQLDT_SHORT, &p->look.robe, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 53, SQLDT_USHORT, &p->slotchange, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 54, SQLDT_UINT, &opt, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 55, SQLDT_UCHAR, &p->font, 0, NULL, NULL) @@ -1909,10 +1909,23 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) { return 0; buf = WBUFP(buffer,0); + WBUFL(buf,0) = p->char_id; - WBUFL(buf,4) = min(p->base_exp, INT32_MAX); +#if PACKETVER >= 20170830 + WBUFQ(buf,4) = min(p->base_exp, INT64_MAX); + offset += 4; + buf = WBUFP(buffer, offset); +#else + WBUFL(buf,4) = min((uint32)(p->base_exp), INT32_MAX); +#endif WBUFL(buf,8) = p->zeny; - WBUFL(buf,12) = min(p->job_exp, INT32_MAX); +#if PACKETVER >= 20170830 + WBUFQ(buf,12) = min(p->job_exp, INT64_MAX); + offset += 4; + buf = WBUFP(buffer, offset); +#else + WBUFL(buf,12) = min((uint32)(p->job_exp), INT32_MAX); +#endif WBUFL(buf,16) = p->job_level; WBUFL(buf,20) = 0; // probably opt1 WBUFL(buf,24) = 0; // probably opt2 @@ -1942,14 +1955,14 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) { //When the weapon is sent and your option is riding, the client crashes on login!? // FIXME[Haru]: is OPTION_HANBOK intended to be part of this list? And if it is, should the list also include other OPTION_ costumes? - WBUFW(buf,56) = (p->option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_HANBOK)) ? 0 : p->weapon; + WBUFW(buf,56) = (p->option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_HANBOK)) ? 0 : p->look.weapon; WBUFW(buf,58) = p->base_level; WBUFW(buf,60) = min(p->skill_point, INT16_MAX); - WBUFW(buf,62) = p->head_bottom; - WBUFW(buf,64) = p->shield; - WBUFW(buf,66) = p->head_top; - WBUFW(buf,68) = p->head_mid; + WBUFW(buf,62) = p->look.head_bottom; + WBUFW(buf,64) = p->look.shield; + WBUFW(buf,66) = p->look.head_top; + WBUFW(buf,68) = p->look.head_mid; WBUFW(buf,70) = p->hair_color; WBUFW(buf,72) = p->clothes_color; memcpy(WBUFP(buf,74), p->name, NAME_LENGTH); @@ -1973,7 +1986,7 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) { offset += 4; #endif #if PACKETVER >= 20110111 - WBUFL(buf,128) = p->robe; + WBUFL(buf,128) = p->look.robe; offset += 4; #endif #if PACKETVER != 20111116 //2011-11-16 wants 136, ask gravity. diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 2dd65f213..05914c3a0 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -113,7 +113,7 @@ unsigned int inter_auction_create(struct auction_data *auction) StrBuf->Printf(&buf, ",'%d'", auction->item.card[j]); for (j = 0; j < MAX_ITEM_OPTIONS; j++) StrBuf->Printf(&buf, ",'%d','%d'", auction->item.option[j].index, auction->item.option[j].value); - + StrBuf->AppendStr(&buf, ")"); stmt = SQL->StmtMalloc(inter->sql_handle); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index b4b4bdde4..0102f11a0 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -138,7 +138,7 @@ int inter_guild_tosql(struct guild *g,int flag) if (g->guild_id<=0 && g->guild_id != -1) return 0; #ifdef NOISY - ShowInfo("Save guild request ("CL_BOLD"%d"CL_RESET" - flag 0x%x).",g->guild_id, flag); + ShowInfo("Save guild request ("CL_BOLD"%d"CL_RESET" - flag 0x%x).\n",g->guild_id, flag); #endif SQL->EscapeStringLen(inter->sql_handle, esc_name, g->name, strnlen(g->name, NAME_LENGTH)); diff --git a/src/char/int_party.c b/src/char/int_party.c index 4b6800699..764387981 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -633,7 +633,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) return 0; //Member not found? mapif->party_withdraw(party_id, account_id, char_id); - + j = p->party.member[i].lv; if (p->party.member[i].online > 0) p->party.count--; diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c index 1fa76e4db..c45c88eb0 100644 --- a/src/char/int_rodex.c +++ b/src/char/int_rodex.c @@ -200,8 +200,8 @@ static bool inter_rodex_hasnew(int char_id, int account_id) { int count = 0; char *data; - - if (SQL_ERROR == SQL->Query(inter->sql_handle, + + if (SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT count(*) FROM `%s` WHERE (" "(`expire_date` > '%d' AND (`receiver_id` = '%d' OR `receiver_accountid` = '%d')) OR" "(`sender_id` = '%d' AND `expire_date` <= '%d' AND `send_date` + '%d' > '%d')" @@ -212,7 +212,7 @@ static bool inter_rodex_hasnew(int char_id, int account_id) Sql_ShowDebug(inter->sql_handle); return -1; } - + if (SQL_SUCCESS != SQL->NextRow(inter->sql_handle)) return false; @@ -407,12 +407,12 @@ void mapif_parse_rodex_updatemail(int fd) if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `is_read` = 1 WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id)) Sql_ShowDebug(inter->sql_handle); break; - + case 1: // Get Zeny if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `zeny` = 0, `type` = `type` & (~2) WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id)) Sql_ShowDebug(inter->sql_handle); break; - + case 2: // Get Items if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `mail_id` = '%"PRId64"'", rodex_item_db, mail_id)) Sql_ShowDebug(inter->sql_handle); @@ -436,7 +436,7 @@ void mapif_rodex_send(int fd, int sender_id, int receiver_id, int receiver_accou { Assert_retv(sender_id >= 0); Assert_retv(receiver_id + receiver_accountid > 0); - + WFIFOHEAD(fd,15); WFIFOW(fd,0) = 0x3897; WFIFOL(fd,2) = sender_id; |