|
@@ -1,7 +1,6 @@
|
|
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
|
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
|
// For more information, see LICENCE in the main folder
|
|
// For more information, see LICENCE in the main folder
|
|
|
|
|
|
-
|
|
|
|
#include <time.h>
|
|
#include <time.h>
|
|
#include <signal.h>
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <stdarg.h>
|
|
@@ -335,7 +334,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p){
|
|
(p->ele_id != cp->ele_id) || (p->shield != cp->shield) || (p->head_top != cp->head_top) ||
|
|
(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->head_mid != cp->head_mid) || (p->head_bottom != cp->head_bottom) || (p->delete_date != cp->delete_date) ||
|
|
(p->rename != cp->rename) || (p->robe != cp->robe) || (p->character_moves != cp->character_moves) ||
|
|
(p->rename != cp->rename) || (p->robe != cp->robe) || (p->character_moves != cp->character_moves) ||
|
|
- (p->unban_time != cp->unban_time) || (p->font != cp->font)
|
|
|
|
|
|
+ (p->unban_time != cp->unban_time) || (p->font != cp->font) || (p->uniqueitem_counter != cp->uniqueitem_counter)
|
|
)
|
|
)
|
|
{ //Save status
|
|
{ //Save status
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
|
|
@@ -345,7 +344,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p){
|
|
"`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',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
|
|
- "`delete_date`='%lu',`robe`='%d',`moves`='%d',`font`='%u'"
|
|
|
|
|
|
+ "`delete_date`='%lu',`robe`='%d',`moves`='%d',`font`='%u',`uniqueitem_counter`='%u'"
|
|
" WHERE `account_id`='%d' AND `char_id` = '%d'",
|
|
" WHERE `account_id`='%d' AND `char_id` = '%d'",
|
|
schema_config.char_db, p->base_level, p->job_level,
|
|
schema_config.char_db, p->base_level, p->job_level,
|
|
p->base_exp, p->job_exp, p->zeny,
|
|
p->base_exp, p->job_exp, p->zeny,
|
|
@@ -356,7 +355,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p){
|
|
mapindex_id2name(p->last_point.map), p->last_point.x, p->last_point.y,
|
|
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,
|
|
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
|
|
(unsigned long)p->delete_date, // FIXME: platform-dependent size
|
|
- p->robe,p->character_moves,p->font,
|
|
|
|
|
|
+ p->robe,p->character_moves,p->font, p->uniqueitem_counter,
|
|
p->account_id, p->char_id) )
|
|
p->account_id, p->char_id) )
|
|
{
|
|
{
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
@@ -699,10 +698,7 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
|
|
for( j = 0; j < MAX_SLOTS; ++j )
|
|
for( j = 0; j < MAX_SLOTS; ++j )
|
|
StringBuf_Printf(&buf, ", '%hu'", items[i].card[j]);
|
|
StringBuf_Printf(&buf, ", '%hu'", items[i].card[j]);
|
|
StringBuf_AppendStr(&buf, ")");
|
|
StringBuf_AppendStr(&buf, ")");
|
|
-
|
|
|
|
- updateLastUid(items[i].unique_id); // Unique Non Stackable Item ID
|
|
|
|
}
|
|
}
|
|
- dbUpdateUid(sql_handle); // Unique Non Stackable Item ID
|
|
|
|
|
|
|
|
if( found && SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) )
|
|
if( found && SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) )
|
|
{
|
|
{
|
|
@@ -840,10 +836,7 @@ int char_inventory_to_sql(const struct item items[], int max, int id) {
|
|
for( j = 0; j < MAX_SLOTS; ++j )
|
|
for( j = 0; j < MAX_SLOTS; ++j )
|
|
StringBuf_Printf(&buf, ", '%hu'", items[i].card[j]);
|
|
StringBuf_Printf(&buf, ", '%hu'", items[i].card[j]);
|
|
StringBuf_AppendStr(&buf, ")");
|
|
StringBuf_AppendStr(&buf, ")");
|
|
-
|
|
|
|
- updateLastUid(items[i].unique_id);// Unique Non Stackable Item ID
|
|
|
|
}
|
|
}
|
|
- dbUpdateUid(sql_handle);
|
|
|
|
|
|
|
|
if( found && SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) ) {
|
|
if( found && SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) ) {
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
@@ -989,7 +982,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|
|
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`,"
|
|
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`,"
|
|
"`hair_color`,`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`,"
|
|
"`hair_color`,`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`,"
|
|
"`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`"
|
|
|
|
|
|
+ "`unban_time`,`font`,`uniqueitem_counter`"
|
|
" 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)
|
|
@@ -1048,6 +1041,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 52, SQLDT_UINT32, &p->character_moves, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 52, SQLDT_UINT32, &p->character_moves, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 53, SQLDT_LONG, &p->unban_time, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 53, SQLDT_LONG, &p->unban_time, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 54, SQLDT_UCHAR, &p->font, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 54, SQLDT_UCHAR, &p->font, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 55, SQLDT_UINT, &p->uniqueitem_counter, 0, NULL, NULL)
|
|
)
|
|
)
|
|
{
|
|
{
|
|
SqlStmt_ShowDebug(stmt);
|
|
SqlStmt_ShowDebug(stmt);
|