diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 24 | ||||
-rw-r--r-- | src/char/int_auction.c | 10 | ||||
-rw-r--r-- | src/char/int_mail.c | 14 | ||||
-rw-r--r-- | src/char/int_storage.c | 8 | ||||
-rw-r--r-- | src/char/inter.h | 4 |
5 files changed, 30 insertions, 30 deletions
diff --git a/src/char/char.c b/src/char/char.c index 1aa6ee734..8bf2dee38 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -811,7 +811,7 @@ int memitemdata_to_sql(const struct item items[], int max, int id, int tableswit SqlStmt_Free(stmt); StringBuf_Clear(&buf); - StringBuf_Printf(&buf, "INSERT INTO `%s`(`%s`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `nsiuid`", tablename, selectoption); + StringBuf_Printf(&buf, "INSERT INTO `%s`(`%s`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `unique_id`", tablename, selectoption); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ", `card%d`", j); StringBuf_AppendStr(&buf, ") VALUES "); @@ -830,12 +830,12 @@ int memitemdata_to_sql(const struct item items[], int max, int id, int tableswit found = true; StringBuf_Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%"PRIu64"'", - id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].nsiuid); + id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].unique_id); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ", '%d'", items[i].card[j]); StringBuf_AppendStr(&buf, ")"); - updateLastUid(items[i].nsiuid); // Unique Non Stackable Item ID + updateLastUid(items[i].unique_id); // Unique Non Stackable Item ID } dbUpdateUid(sql_handle); // Unique Non Stackable Item ID @@ -951,7 +951,7 @@ int inventory_to_sql(const struct item items[], int max, int id) { SqlStmt_Free(stmt); StringBuf_Clear(&buf); - StringBuf_Printf(&buf, "INSERT INTO `%s` (`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `nsiuid`", inventory_db); + StringBuf_Printf(&buf, "INSERT INTO `%s` (`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `unique_id`", inventory_db); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ", `card%d`", j); StringBuf_AppendStr(&buf, ") VALUES "); @@ -969,12 +969,12 @@ int inventory_to_sql(const struct item items[], int max, int id) { found = true; StringBuf_Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%d', '%"PRIu64"'", - id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].favorite, items[i].nsiuid); + id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].favorite, items[i].unique_id); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ", '%d'", items[i].card[j]); StringBuf_AppendStr(&buf, ")"); - updateLastUid(items[i].nsiuid);// Unique Non Stackable Item ID + updateLastUid(items[i].unique_id);// Unique Non Stackable Item ID } dbUpdateUid(sql_handle); @@ -1209,9 +1209,9 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything strcat(t_msg, " memo"); //read inventory - //`inventory` (`id`,`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, `expire_time`, `favorite`, `nsiuid`) + //`inventory` (`id`,`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, `expire_time`, `favorite`, `unique_id`) StringBuf_Init(&buf); - StringBuf_AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `nsiuid`"); + StringBuf_AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `unique_id`"); for( i = 0; i < MAX_SLOTS; ++i ) StringBuf_Printf(&buf, ", `card%d`", i); StringBuf_Printf(&buf, " FROM `%s` WHERE `char_id`=? LIMIT %d", inventory_db, MAX_INVENTORY); @@ -1228,7 +1228,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything || SQL_ERROR == SqlStmt_BindColumn(stmt, 6, SQLDT_CHAR, &tmp_item.attribute, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_UINT, &tmp_item.expire_time, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_CHAR, &tmp_item.favorite, 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 9, SQLDT_ULONGLONG, &tmp_item.nsiuid, 0, NULL, NULL) ) + || SQL_ERROR == SqlStmt_BindColumn(stmt, 9, SQLDT_ULONGLONG, &tmp_item.unique_id, 0, NULL, NULL) ) SqlStmt_ShowDebug(stmt); for( i = 0; i < MAX_SLOTS; ++i ) if( SQL_ERROR == SqlStmt_BindColumn(stmt, 10+i, SQLDT_SHORT, &tmp_item.card[i], 0, NULL, NULL) ) @@ -1240,9 +1240,9 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything strcat(t_msg, " inventory"); //read cart - //`cart_inventory` (`id`,`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, expire_time`, `nsiuid`) + //`cart_inventory` (`id`,`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, expire_time`, `unique_id`) StringBuf_Clear(&buf); - StringBuf_AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `nsiuid`"); + StringBuf_AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `unique_id`"); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ", `card%d`", j); StringBuf_Printf(&buf, " FROM `%s` WHERE `char_id`=? LIMIT %d", cart_db, MAX_CART); @@ -1258,7 +1258,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything || SQL_ERROR == SqlStmt_BindColumn(stmt, 5, SQLDT_CHAR, &tmp_item.refine, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 6, SQLDT_CHAR, &tmp_item.attribute, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_UINT, &tmp_item.expire_time, 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_ULONGLONG, &tmp_item.nsiuid, 0, NULL, NULL) ) + || SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_ULONGLONG, &tmp_item.unique_id, 0, NULL, NULL) ) SqlStmt_ShowDebug(stmt); for( i = 0; i < MAX_SLOTS; ++i ) if( SQL_ERROR == SqlStmt_BindColumn(stmt, 9+i, SQLDT_SHORT, &tmp_item.card[i], 0, NULL, NULL) ) diff --git a/src/char/int_auction.c b/src/char/int_auction.c index e0373c936..34aed5bf7 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -81,17 +81,17 @@ unsigned int auction_create(struct auction_data *auction) auction->timestamp = time(NULL) + (auction->hours * 3600); StringBuf_Init(&buf); - StringBuf_Printf(&buf, "INSERT INTO `%s` (`seller_id`,`seller_name`,`buyer_id`,`buyer_name`,`price`,`buynow`,`hours`,`timestamp`,`nameid`,`item_name`,`type`,`refine`,`attribute`,`nsiuid`", auction_db); + StringBuf_Printf(&buf, "INSERT INTO `%s` (`seller_id`,`seller_name`,`buyer_id`,`buyer_name`,`price`,`buynow`,`hours`,`timestamp`,`nameid`,`item_name`,`type`,`refine`,`attribute`,`unique_id`", auction_db); for( j = 0; j < MAX_SLOTS; j++ ) StringBuf_Printf(&buf, ",`card%d`", j); StringBuf_Printf(&buf, ") VALUES ('%d',?,'%d',?,'%d','%d','%d','%lu','%d',?,'%d','%d','%d','%"PRIu64"'", - auction->seller_id, auction->buyer_id, auction->price, auction->buynow, auction->hours, (unsigned long)auction->timestamp, auction->item.nameid, auction->type, auction->item.refine, auction->item.attribute, auction->item.nsiuid); + auction->seller_id, auction->buyer_id, auction->price, auction->buynow, auction->hours, (unsigned long)auction->timestamp, auction->item.nameid, auction->type, auction->item.refine, auction->item.attribute, auction->item.unique_id); for( j = 0; j < MAX_SLOTS; j++ ) StringBuf_Printf(&buf, ",'%d'", auction->item.card[j]); StringBuf_AppendStr(&buf, ")"); //Unique Non Stackable Item ID - updateLastUid(auction->item.nsiuid); + updateLastUid(auction->item.unique_id); dbUpdateUid(sql_handle); stmt = SqlStmt_Malloc(sql_handle); @@ -186,7 +186,7 @@ void inter_auctions_fromsql(void) StringBuf_Init(&buf); StringBuf_AppendStr(&buf, "SELECT `auction_id`,`seller_id`,`seller_name`,`buyer_id`,`buyer_name`," - "`price`,`buynow`,`hours`,`timestamp`,`nameid`,`item_name`,`type`,`refine`,`attribute`,`nsiuid`"); + "`price`,`buynow`,`hours`,`timestamp`,`nameid`,`item_name`,`type`,`refine`,`attribute`,`unique_id`"); for( i = 0; i < MAX_SLOTS; i++ ) StringBuf_Printf(&buf, ",`card%d`", i); StringBuf_Printf(&buf, " FROM `%s` ORDER BY `auction_id` DESC", auction_db); @@ -216,7 +216,7 @@ void inter_auctions_fromsql(void) Sql_GetData(sql_handle,12, &data, NULL); item->refine = atoi(data); Sql_GetData(sql_handle,13, &data, NULL); item->attribute = atoi(data); - Sql_GetData(sql_handle,14, &data, NULL); item->nsiuid = strtoull(data, NULL, 10); + Sql_GetData(sql_handle,14, &data, NULL); item->unique_id = strtoull(data, NULL, 10); item->identify = 1; item->amount = 1; diff --git a/src/char/int_mail.c b/src/char/int_mail.c index f327bb8a3..8d50c713f 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -29,7 +29,7 @@ static int mail_fromsql(int char_id, struct mail_data* md) StringBuf_Init(&buf); StringBuf_AppendStr(&buf, "SELECT `id`,`send_name`,`send_id`,`dest_name`,`dest_id`,`title`,`message`,`time`,`status`," - "`zeny`,`amount`,`nameid`,`refine`,`attribute`,`identify`,`nsiuid`"); + "`zeny`,`amount`,`nameid`,`refine`,`attribute`,`identify`,`unique_id`"); for (i = 0; i < MAX_SLOTS; i++) StringBuf_Printf(&buf, ",`card%d`", i); @@ -61,7 +61,7 @@ static int mail_fromsql(int char_id, struct mail_data* md) Sql_GetData(sql_handle,12, &data, NULL); item->refine = atoi(data); Sql_GetData(sql_handle,13, &data, NULL); item->attribute = atoi(data); Sql_GetData(sql_handle,14, &data, NULL); item->identify = atoi(data); - Sql_GetData(sql_handle,15, &data, NULL); item->nsiuid = strtoull(data, NULL, 10); + Sql_GetData(sql_handle,15, &data, NULL); item->unique_id = strtoull(data, NULL, 10); item->expire_time = 0; for (j = 0; j < MAX_SLOTS; j++) @@ -107,17 +107,17 @@ int mail_savemessage(struct mail_message* msg) // build message save query StringBuf_Init(&buf); - StringBuf_Printf(&buf, "INSERT INTO `%s` (`send_name`, `send_id`, `dest_name`, `dest_id`, `title`, `message`, `time`, `status`, `zeny`, `amount`, `nameid`, `refine`, `attribute`, `identify`, `nsiuid`", mail_db); + StringBuf_Printf(&buf, "INSERT INTO `%s` (`send_name`, `send_id`, `dest_name`, `dest_id`, `title`, `message`, `time`, `status`, `zeny`, `amount`, `nameid`, `refine`, `attribute`, `identify`, `unique_id`", mail_db); for (j = 0; j < MAX_SLOTS; j++) StringBuf_Printf(&buf, ", `card%d`", j); StringBuf_Printf(&buf, ") VALUES (?, '%d', ?, '%d', ?, ?, '%lu', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%"PRIu64"'", - msg->send_id, msg->dest_id, (unsigned long)msg->timestamp, msg->status, msg->zeny, msg->item.amount, msg->item.nameid, msg->item.refine, msg->item.attribute, msg->item.identify, msg->item.nsiuid); + msg->send_id, msg->dest_id, (unsigned long)msg->timestamp, msg->status, msg->zeny, msg->item.amount, msg->item.nameid, msg->item.refine, msg->item.attribute, msg->item.identify, msg->item.unique_id); for (j = 0; j < MAX_SLOTS; j++) StringBuf_Printf(&buf, ", '%d'", msg->item.card[j]); StringBuf_AppendStr(&buf, ")"); //Unique Non Stackable Item ID - updateLastUid(msg->item.nsiuid); + updateLastUid(msg->item.unique_id); dbUpdateUid(sql_handle); // prepare and execute query @@ -149,7 +149,7 @@ static bool mail_loadmessage(int mail_id, struct mail_message* msg) StringBuf_Init(&buf); StringBuf_AppendStr(&buf, "SELECT `id`,`send_name`,`send_id`,`dest_name`,`dest_id`,`title`,`message`,`time`,`status`," - "`zeny`,`amount`,`nameid`,`refine`,`attribute`,`identify`,`nsiuid`"); + "`zeny`,`amount`,`nameid`,`refine`,`attribute`,`identify`,`unique_id`"); for( j = 0; j < MAX_SLOTS; j++ ) StringBuf_Printf(&buf, ",`card%d`", j); StringBuf_Printf(&buf, " FROM `%s` WHERE `id` = '%d'", mail_db, mail_id); @@ -181,7 +181,7 @@ static bool mail_loadmessage(int mail_id, struct mail_message* msg) Sql_GetData(sql_handle,12, &data, NULL); msg->item.refine = atoi(data); Sql_GetData(sql_handle,13, &data, NULL); msg->item.attribute = atoi(data); Sql_GetData(sql_handle,14, &data, NULL); msg->item.identify = atoi(data); - Sql_GetData(sql_handle,15, &data, NULL); msg->item.nsiuid = strtoull(data, NULL, 10); + Sql_GetData(sql_handle,15, &data, NULL); msg->item.unique_id = strtoull(data, NULL, 10); msg->item.expire_time = 0; for( j = 0; j < MAX_SLOTS; j++ ) diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 23189916f..68b588087 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -38,7 +38,7 @@ int storage_fromsql(int account_id, struct storage_data* p) // storage {`account_id`/`id`/`nameid`/`amount`/`equip`/`identify`/`refine`/`attribute`/`card0`/`card1`/`card2`/`card3`} StringBuf_Init(&buf); - StringBuf_AppendStr(&buf, "SELECT `id`,`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`expire_time`,`nsiuid`"); + StringBuf_AppendStr(&buf, "SELECT `id`,`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`expire_time`,`unique_id`"); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ",`card%d`", j); StringBuf_Printf(&buf, " FROM `%s` WHERE `account_id`='%d' ORDER BY `nameid`", storage_db, account_id); @@ -59,7 +59,7 @@ int storage_fromsql(int account_id, struct storage_data* p) Sql_GetData(sql_handle, 5, &data, NULL); item->refine = atoi(data); Sql_GetData(sql_handle, 6, &data, NULL); item->attribute = atoi(data); Sql_GetData(sql_handle, 7, &data, NULL); item->expire_time = (unsigned int)atoi(data); - Sql_GetData(sql_handle, 8, &data, NULL); item->nsiuid = strtoull(data, NULL, 10); + Sql_GetData(sql_handle, 8, &data, NULL); item->unique_id = strtoull(data, NULL, 10); for( j = 0; j < MAX_SLOTS; ++j ) { Sql_GetData(sql_handle, 9+j, &data, NULL); item->card[j] = atoi(data); @@ -95,7 +95,7 @@ int guild_storage_fromsql(int guild_id, struct guild_storage* p) // storage {`guild_id`/`id`/`nameid`/`amount`/`equip`/`identify`/`refine`/`attribute`/`card0`/`card1`/`card2`/`card3`} StringBuf_Init(&buf); - StringBuf_AppendStr(&buf, "SELECT `id`,`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`nsiuid`"); + StringBuf_AppendStr(&buf, "SELECT `id`,`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`unique_id`"); for( j = 0; j < MAX_SLOTS; ++j ) StringBuf_Printf(&buf, ",`card%d`", j); StringBuf_Printf(&buf, " FROM `%s` WHERE `guild_id`='%d' ORDER BY `nameid`", guild_storage_db, guild_id); @@ -115,7 +115,7 @@ int guild_storage_fromsql(int guild_id, struct guild_storage* p) Sql_GetData(sql_handle, 4, &data, NULL); item->identify = atoi(data); Sql_GetData(sql_handle, 5, &data, NULL); item->refine = atoi(data); Sql_GetData(sql_handle, 6, &data, NULL); item->attribute = atoi(data); - Sql_GetData(sql_handle, 7, &data, NULL); item->nsiuid = strtoull(data, NULL, 10); + Sql_GetData(sql_handle, 7, &data, NULL); item->unique_id = strtoull(data, NULL, 10); item->expire_time = 0; for( j = 0; j < MAX_SLOTS; ++j ) { diff --git a/src/char/inter.h b/src/char/inter.h index e5bfa1572..7ea9cf25c 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -32,8 +32,8 @@ uint64 inter_chk_lastuid(int8 flag, uint64 value); #define updateLastUid(val_) inter_chk_lastuid(1, val_) #define dbUpdateUid(handler_)\ { \ - uint64 nsiuid_ = inter_chk_lastuid(0, 0); \ - if (nsiuid_ && SQL_ERROR == Sql_Query(handler_, "UPDATE `interreg` SET `value`='%"PRIu64"' WHERE `varname`='nsiuid'", nsiuid_)) \ + uint64 unique_id_ = inter_chk_lastuid(0, 0); \ + if (unique_id_ && SQL_ERROR == Sql_Query(handler_, "UPDATE `interreg` SET `value`='%"PRIu64"' WHERE `varname`='unique_id'", unique_id_)) \ Sql_ShowDebug(handler_);\ } #else |