summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-20 05:16:09 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-21 20:21:20 +0300
commitd6c996ae31d1875950783ecf25f055975281150d (patch)
treed614b936df1bab97483ed801297be6f696662ded /src/char/char.c
parent7cbd35644b73f254fc976070cd1e993aa43a7cfc (diff)
downloadhercules-d6c996ae31d1875950783ecf25f055975281150d.tar.gz
hercules-d6c996ae31d1875950783ecf25f055975281150d.tar.bz2
hercules-d6c996ae31d1875950783ecf25f055975281150d.tar.xz
hercules-d6c996ae31d1875950783ecf25f055975281150d.zip
Change char server packets for 20170830 and newer clients.
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/char/char.c b/src/char/char.c
index fc2f28997..78b2d19fa 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -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',"
@@ -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)
@@ -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)
@@ -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