Adjust EXP storage to uint64 (#4377)
* Updates EXP table to 200/70 * Always store exp as uint64 no matter the client date. * Adjusts guild exp to uint64. Co-authored-by: Aleos <aleos89@users.noreply.github.com> Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
@@ -303,7 +303,7 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
||||
)
|
||||
{ //Save status
|
||||
if( SQL_ERROR == Sql_Query(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`='%u',`hp`='%u',`max_sp`='%u',`sp`='%u',`status_point`='%d',`skill_point`='%d',"
|
||||
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d',"
|
||||
"`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',`elemental_id`='%d',"
|
||||
@@ -916,8 +916,8 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* coun
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 3, SQLDT_SHORT, &p.class_, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 4, SQLDT_UINT, &p.base_level, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 5, SQLDT_UINT, &p.job_level, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 6, SQLDT_UINT, &p.base_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_UINT, &p.job_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 6, SQLDT_UINT64, &p.base_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_UINT64, &p.job_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_INT, &p.zeny, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 9, SQLDT_SHORT, &p.str, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 10, SQLDT_SHORT, &p.agi, 0, NULL, NULL)
|
||||
@@ -1034,8 +1034,8 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 4, SQLDT_SHORT, &p->class_, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 5, SQLDT_UINT, &p->base_level, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 6, SQLDT_UINT, &p->job_level, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_UINT, &p->base_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_UINT, &p->job_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_UINT64, &p->base_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_UINT64, &p->job_exp, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 9, SQLDT_INT, &p->zeny, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 10, SQLDT_SHORT, &p->str, 0, NULL, NULL)
|
||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 11, SQLDT_SHORT, &p->agi, 0, NULL, NULL)
|
||||
@@ -1756,19 +1756,19 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
|
||||
buf = WBUFP(buffer,0);
|
||||
WBUFL(buf,0) = p->char_id;
|
||||
#if PACKETVER >= 20170830
|
||||
WBUFQ(buf,4) = u64min((uint64)p->base_exp, INT64_MAX);
|
||||
WBUFQ(buf,4) = u64min(p->base_exp, MAX_EXP);
|
||||
offset += 4;
|
||||
buf = WBUFP(buffer, offset);
|
||||
#else
|
||||
WBUFL(buf,4) = umin(p->base_exp, INT32_MAX);
|
||||
WBUFL(buf,4) = (int32)u64min(p->base_exp, MAX_EXP);
|
||||
#endif
|
||||
WBUFL(buf,8) = p->zeny;
|
||||
#if PACKETVER >= 20170830
|
||||
WBUFQ(buf,12) = u64min((uint64)p->job_exp, INT64_MAX);
|
||||
WBUFQ(buf,12) = u64min(p->job_exp, MAX_EXP);
|
||||
offset += 4;
|
||||
buf = WBUFP(buffer, offset);
|
||||
#else
|
||||
WBUFL(buf,12) = umin(p->job_exp, INT32_MAX);
|
||||
WBUFL(buf,12) = (int32)u64min(p->job_exp, MAX_EXP);
|
||||
#endif
|
||||
WBUFL(buf,16) = p->job_level;
|
||||
WBUFL(buf,20) = 0; // probably opt1
|
||||
|
||||
Reference in New Issue
Block a user