From f2757bbfd049777f6fa9089bd33e38f80290c039 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 15 Mar 2014 11:44:28 -0700 Subject: Split out the keys from character data to have better paging performance --- src/common/mmo.hpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/mmo.hpp b/src/common/mmo.hpp index b2f36b6..67123d9 100644 --- a/src/common/mmo.hpp +++ b/src/common/mmo.hpp @@ -294,10 +294,16 @@ SEX sex_from_char(char c) } } -struct mmo_charstatus +struct CharKey { - int char_id; + CharName name; int account_id; + int char_id; + unsigned char char_num; +}; + +struct CharData +{ int partner_id; int base_exp, job_exp, zeny; @@ -314,10 +320,8 @@ struct mmo_charstatus short shield; short head_top, head_mid, head_bottom; - CharName name; unsigned char base_level, job_level; earray attrs; - unsigned char char_num; SEX sex; unsigned long mapip; @@ -334,6 +338,16 @@ struct mmo_charstatus struct global_reg account_reg2[ACCOUNT_REG2_NUM]; }; +struct CharPair +{ + CharKey key; + std::unique_ptr data; + + CharPair() + : key{}, data(make_unique()) + {} +}; + struct storage { int dirty; -- cgit v1.2.3-70-g09d2