Follow up to c0ed836.

- Optimized SQL structure to better fit uint32 value for uniqueitem_counter. (bugreport:9249)
- Added font and uniqueitem_counter to load when loading character menu on char-server.
This commit is contained in:
aleos89 2014-08-26 16:35:58 -04:00
parent 51ecd9b2bc
commit f077a8eb03
3 changed files with 5 additions and 2 deletions

View File

@ -124,7 +124,7 @@ CREATE TABLE IF NOT EXISTS `char` (
`moves` int(11) unsigned NOT NULL DEFAULT '0', `moves` int(11) unsigned NOT NULL DEFAULT '0',
`unban_time` int(11) unsigned NOT NULL default '0', `unban_time` int(11) unsigned NOT NULL default '0',
`font` tinyint(3) unsigned NOT NULL default '0', `font` tinyint(3) unsigned NOT NULL default '0',
`uniqueitem_counter` bigint(20) NOT NULL, `uniqueitem_counter` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`char_id`), PRIMARY KEY (`char_id`),
UNIQUE KEY `name_key` (`name`), UNIQUE KEY `name_key` (`name`),
KEY `account_id` (`account_id`), KEY `account_id` (`account_id`),

View File

@ -0,0 +1 @@
ALTER TABLE `char` MODIFY COLUMN `uniqueitem_counter` int(11) unsigned NOT NULL default '0';

View File

@ -879,7 +879,7 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) {
"`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`," "`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`,"
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`," "`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`,"
"`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`,`delete_date`," "`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`,`delete_date`,"
"`robe`,`moves`, `unban_time`" "`robe`,`moves`,`unban_time`,`font`,`uniqueitem_counter`"
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", schema_config.char_db, sd->account_id, MAX_CHARS) " FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", schema_config.char_db, sd->account_id, MAX_CHARS)
|| SQL_ERROR == SqlStmt_Execute(stmt) || SQL_ERROR == SqlStmt_Execute(stmt)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
@ -920,6 +920,8 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) {
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 35, SQLDT_SHORT, &p.robe, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 35, SQLDT_SHORT, &p.robe, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 36, SQLDT_UINT, &p.character_moves, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 36, SQLDT_UINT, &p.character_moves, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 37, SQLDT_LONG, &p.unban_time, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 37, SQLDT_LONG, &p.unban_time, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 38, SQLDT_UCHAR, &p->font, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 39, SQLDT_UINT, &p->uniqueitem_counter, 0, NULL, NULL)
) )
{ {
SqlStmt_ShowDebug(stmt); SqlStmt_ShowDebug(stmt);