|
@@ -279,7 +279,7 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|
(p->job_level != cp->job_level) || (p->job_exp != cp->job_exp) ||
|
|
(p->job_level != cp->job_level) || (p->job_exp != cp->job_exp) ||
|
|
(p->zeny != cp->zeny) ||
|
|
(p->zeny != cp->zeny) ||
|
|
( strncmp( p->last_point.map, cp->last_point.map, sizeof( p->last_point.map ) ) != 0 ) ||
|
|
( strncmp( p->last_point.map, cp->last_point.map, sizeof( p->last_point.map ) ) != 0 ) ||
|
|
- (p->last_point.x != cp->last_point.x) || (p->last_point.y != cp->last_point.y) ||
|
|
|
|
|
|
+ (p->last_point.x != cp->last_point.x) || (p->last_point.y != cp->last_point.y) || (p->last_point_instanceid != cp->last_point_instanceid) ||
|
|
( strncmp( p->save_point.map, cp->save_point.map, sizeof( p->save_point.map ) ) != 0 ) ||
|
|
( strncmp( p->save_point.map, cp->save_point.map, sizeof( p->save_point.map ) ) != 0 ) ||
|
|
( p->save_point.x != cp->save_point.x ) || ( p->save_point.y != cp->save_point.y ) ||
|
|
( p->save_point.x != cp->save_point.x ) || ( p->save_point.y != cp->save_point.y ) ||
|
|
(p->max_hp != cp->max_hp) || (p->hp != cp->hp) ||
|
|
(p->max_hp != cp->max_hp) || (p->hp != cp->hp) ||
|
|
@@ -307,7 +307,8 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%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',"
|
|
"`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',`elemental_id`='%d',"
|
|
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
|
|
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
|
|
- "`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
|
|
|
|
|
|
+ "`last_map`='%s',`last_x`='%d',`last_y`='%d',`last_instanceid`='%d',"
|
|
|
|
+ "`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
|
|
"`delete_date`='%lu',`robe`='%d',`moves`='%d',`font`='%u',`uniqueitem_counter`='%u',"
|
|
"`delete_date`='%lu',`robe`='%d',`moves`='%d',`font`='%u',`uniqueitem_counter`='%u',"
|
|
"`hotkey_rowshift`='%d', `clan_id`='%d', `title_id`='%lu', `show_equip`='%d', `hotkey_rowshift2`='%d',"
|
|
"`hotkey_rowshift`='%d', `clan_id`='%d', `title_id`='%lu', `show_equip`='%d', `hotkey_rowshift2`='%d',"
|
|
"`max_ap`='%u',`ap`='%u',`trait_point`='%d',"
|
|
"`max_ap`='%u',`ap`='%u',`trait_point`='%d',"
|
|
@@ -319,7 +320,7 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|
p->str, p->agi, p->vit, p->int_, p->dex, p->luk,
|
|
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->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->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom,
|
|
- p->last_point.map, p->last_point.x, p->last_point.y,
|
|
|
|
|
|
+ p->last_point.map, p->last_point.x, p->last_point.y, p->last_point_instanceid,
|
|
p->save_point.map, p->save_point.x, p->save_point.y, p->rename,
|
|
p->save_point.map, p->save_point.x, p->save_point.y, p->rename,
|
|
(unsigned long)p->delete_date, // FIXME: platform-dependent size
|
|
(unsigned long)p->delete_date, // FIXME: platform-dependent size
|
|
p->robe, p->character_moves, p->font, p->uniqueitem_counter,
|
|
p->robe, p->character_moves, p->font, p->uniqueitem_counter,
|
|
@@ -1060,7 +1061,7 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
|
"`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`, `moves`,"
|
|
"`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`, `moves`,"
|
|
"`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`title_id`,`show_equip`,`hotkey_rowshift2`,"
|
|
"`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`title_id`,`show_equip`,`hotkey_rowshift2`,"
|
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
|
- "`inventory_slots`,`body_direction`,`disable_call`"
|
|
|
|
|
|
+ "`inventory_slots`,`body_direction`,`disable_call`,`last_instanceid`"
|
|
" FROM `%s` WHERE `char_id`=? LIMIT 1", schema_config.char_db)
|
|
" FROM `%s` WHERE `char_id`=? LIMIT 1", schema_config.char_db)
|
|
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|
|
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|
@@ -1138,7 +1139,8 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 71, SQLDT_SHORT, &p->crt, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 71, SQLDT_SHORT, &p->crt, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 72, SQLDT_UINT16, &p->inventory_slots, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 72, SQLDT_UINT16, &p->inventory_slots, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 73, SQLDT_UINT8, &p->body_direction, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 73, SQLDT_UINT8, &p->body_direction, 0, NULL, NULL)
|
|
- || SQL_ERROR == SqlStmt_BindColumn(stmt, 74, SQLDT_UINT16, &p->disable_call, 0, NULL, NULL)
|
|
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 74, SQLDT_UINT8, &p->disable_call, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 75, SQLDT_INT, &p->last_point_instanceid, 0, NULL, NULL)
|
|
)
|
|
)
|
|
{
|
|
{
|
|
SqlStmt_ShowDebug(stmt);
|
|
SqlStmt_ShowDebug(stmt);
|
|
@@ -1516,8 +1518,8 @@ int char_make_new_char( struct char_session_data* sd, char* name_, int str, int
|
|
|
|
|
|
//Insert the new char entry to the database
|
|
//Insert the new char entry to the database
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `status_point`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `status_point`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
|
|
- "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`, `sex`) VALUES ("
|
|
|
|
- "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%u', '%u', '%u', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%c')",
|
|
|
|
|
|
+ "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`, `sex`, `last_instanceid`) VALUES ("
|
|
|
|
+ "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%u', '%u', '%u', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%c', '0')",
|
|
schema_config.char_db, sd->account_id , slot, esc_name, start_job, charserv_config.start_zeny, status_points, str, agi, vit, int_, dex, luk,
|
|
schema_config.char_db, sd->account_id , slot, esc_name, start_job, charserv_config.start_zeny, status_points, str, agi, vit, int_, dex, luk,
|
|
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
|
|
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
|
|
tmp_start_point[start_point_idx].map, tmp_start_point[start_point_idx].x, tmp_start_point[start_point_idx].y, tmp_start_point[start_point_idx].map, tmp_start_point[start_point_idx].x, tmp_start_point[start_point_idx].y, sex ) )
|
|
tmp_start_point[start_point_idx].map, tmp_start_point[start_point_idx].x, tmp_start_point[start_point_idx].y, tmp_start_point[start_point_idx].map, tmp_start_point[start_point_idx].x, tmp_start_point[start_point_idx].y, sex ) )
|
|
@@ -2330,7 +2332,7 @@ bool char_checkdb(void){
|
|
"`moves`,`unban_time`,`font`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`,`title_id`,`show_equip`,"
|
|
"`moves`,`unban_time`,`font`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`,`title_id`,`show_equip`,"
|
|
"`hotkey_rowshift2`,"
|
|
"`hotkey_rowshift2`,"
|
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
|
- "`inventory_slots`,`body_direction`,`disable_call`"
|
|
|
|
|
|
+ "`inventory_slots`,`body_direction`,`disable_call`,`last_instanceid`"
|
|
" FROM `%s` LIMIT 1;", schema_config.char_db) ){
|
|
" FROM `%s` LIMIT 1;", schema_config.char_db) ){
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
return false;
|
|
return false;
|