summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.cpp80
-rw-r--r--src/map/battle.cpp8
-rw-r--r--src/map/chrif.cpp25
-rw-r--r--src/map/clif.cpp36
-rw-r--r--src/map/intif.cpp18
-rw-r--r--src/map/magic-expr.cpp2
-rw-r--r--src/map/magic-stmt.cpp4
-rw-r--r--src/map/map.cpp8
-rw-r--r--src/map/map.hpp5
-rw-r--r--src/map/party.cpp36
-rw-r--r--src/map/pc.cpp29
-rw-r--r--src/map/pc.hpp2
-rw-r--r--src/map/script.cpp8
-rw-r--r--src/map/storage.cpp14
-rw-r--r--src/map/tmw.cpp6
-rw-r--r--src/map/trade.cpp8
16 files changed, 147 insertions, 142 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 6cb1425..5e46775 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -178,7 +178,7 @@ void log_atcommand(dumb_ptr<map_session_data> sd, ZString cmd)
FPRINTF(*fp, "[%s] %s(%d,%d) %s(%d) : %s\n",
tmpstr,
map, sd->bl_x, sd->bl_y,
- sd->status.name, sd->status.account_id,
+ sd->status_key.name, sd->status_key.account_id,
cmd);
}
@@ -607,7 +607,7 @@ ATCE atcommand_where(Session *s, dumb_ptr<map_session_data> sd,
{
// you can look only lower or same level
AString output = STRPRINTF("%s: %s (%d,%d)",
- pl_sd->status.name,
+ pl_sd->status_key.name,
pl_sd->mapname_, pl_sd->bl_x, pl_sd->bl_y);
clif_displaymessage(s, output);
}
@@ -730,7 +730,7 @@ ATCE atcommand_who(Session *s, dumb_ptr<map_session_data> sd,
&& (pl_GM_level > GM_level)))
{
// you can look only lower or same level
- VString<23> player_name = pl_sd->status.name.to__lower();
+ VString<23> player_name = pl_sd->status_key.name.to__lower();
if (player_name.contains_seq(match_text))
{
// search with no case sensitive
@@ -738,12 +738,12 @@ ATCE atcommand_who(Session *s, dumb_ptr<map_session_data> sd,
if (pl_GM_level > 0)
output = STRPRINTF(
"Name: %s (GM:%d) | Location: %s %d %d",
- pl_sd->status.name, pl_GM_level,
+ pl_sd->status_key.name, pl_GM_level,
pl_sd->mapname_, pl_sd->bl_x, pl_sd->bl_y);
else
output = STRPRINTF(
"Name: %s | Location: %s %d %d",
- pl_sd->status.name, pl_sd->mapname_,
+ pl_sd->status_key.name, pl_sd->mapname_,
pl_sd->bl_x, pl_sd->bl_y);
clif_displaymessage(s, output);
count++;
@@ -793,7 +793,7 @@ ATCE atcommand_whogroup(Session *s, dumb_ptr<map_session_data> sd,
&& (pl_GM_level > GM_level)))
{
// you can look only lower or same level
- VString<23> player_name = pl_sd->status.name.to__lower();
+ VString<23> player_name = pl_sd->status_key.name.to__lower();
if (player_name.contains_seq(match_text))
{
// search with no case sensitive
@@ -803,7 +803,7 @@ ATCE atcommand_whogroup(Session *s, dumb_ptr<map_session_data> sd,
if (pl_GM_level > 0)
output = STRPRINTF(
"Name: %s (GM:%d) | Party: '%s'",
- pl_sd->status.name, pl_GM_level, temp0);
+ pl_sd->status_key.name, pl_GM_level, temp0);
clif_displaymessage(s, output);
count++;
}
@@ -863,12 +863,12 @@ ATCE atcommand_whomap(Session *s, dumb_ptr<map_session_data> sd,
if (pl_GM_level > 0)
output = STRPRINTF(
"Name: %s (GM:%d) | Location: %s %d %d",
- pl_sd->status.name, pl_GM_level,
+ pl_sd->status_key.name, pl_GM_level,
pl_sd->mapname_, pl_sd->bl_x, pl_sd->bl_y);
else
output = STRPRINTF(
"Name: %s | Location: %s %d %d",
- pl_sd->status.name, pl_sd->mapname_,
+ pl_sd->status_key.name, pl_sd->mapname_,
pl_sd->bl_x, pl_sd->bl_y);
clif_displaymessage(s, output);
count++;
@@ -925,10 +925,10 @@ ATCE atcommand_whomapgroup(Session *s, dumb_ptr<map_session_data> sd,
AString output;
if (pl_GM_level > 0)
output = STRPRINTF("Name: %s (GM:%d) | Party: '%s'",
- pl_sd->status.name, pl_GM_level, temp0);
+ pl_sd->status_key.name, pl_GM_level, temp0);
else
output = STRPRINTF("Name: %s | Party: '%s'",
- pl_sd->status.name, temp0);
+ pl_sd->status_key.name, temp0);
clif_displaymessage(s, output);
count++;
}
@@ -980,14 +980,14 @@ ATCE atcommand_whogm(Session *s, dumb_ptr<map_session_data> sd,
&& (pl_GM_level > GM_level)))
{
// you can look only lower or same level
- VString<23> player_name = pl_sd->status.name.to__lower();
+ VString<23> player_name = pl_sd->status_key.name.to__lower();
if (player_name.contains_seq(match_text))
{
// search with no case sensitive
AString output;
output = STRPRINTF(
"Name: %s (GM:%d) | Location: %s %d %d",
- pl_sd->status.name, pl_GM_level,
+ pl_sd->status_key.name, pl_GM_level,
pl_sd->mapname_, pl_sd->bl_x, pl_sd->bl_y);
clif_displaymessage(s, output);
output = STRPRINTF(
@@ -1109,7 +1109,7 @@ ATCE atcommand_storage(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::EXIST;
}
- if ((stor = account2storage2(sd->status.account_id)) != NULL
+ if ((stor = account2storage2(sd->status_key.account_id)) != NULL
&& stor->storage_status == 1)
{
clif_displaymessage(s, "msg_table[250]");
@@ -1503,7 +1503,7 @@ ATCE atcommand_gm(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::PERM;
}
else
- chrif_changegm(sd->status.account_id, message);
+ chrif_changegm(sd->status_key.account_id, message);
return ATCE::OKAY;
}
@@ -1796,7 +1796,7 @@ void atlist_nearby_sub(dumb_ptr<block_list> bl, Session *s)
nullpo_retv(bl);
AString buf = STRPRINTF(" - \"%s\"",
- bl->is_player()->status.name);
+ bl->is_player()->status_key.name);
clif_displaymessage(s, buf);
}
@@ -2110,7 +2110,7 @@ ATCE atcommand_character_stats(Session *s, dumb_ptr<map_session_data>,
if (pl_sd != NULL)
{
AString output;
- output = STRPRINTF("'%s' stats:", pl_sd->status.name);
+ output = STRPRINTF("'%s' stats:", pl_sd->status_key.name);
clif_displaymessage(s, output);
output = STRPRINTF("Base Level - %d", pl_sd->status.base_level),
clif_displaymessage(s, output);
@@ -2172,7 +2172,7 @@ ATCE atcommand_character_stats_all(Session *s, dumb_ptr<map_session_data>,
AString output;
output = STRPRINTF(
"Name: %s | BLvl: %d | Job: Novice/Human (Lvl: %d) | HP: %d/%d | SP: %d/%d",
- pl_sd->status.name, pl_sd->status.base_level,
+ pl_sd->status_key.name, pl_sd->status.base_level,
pl_sd->status.job_level,
pl_sd->status.hp, pl_sd->status.max_hp,
pl_sd->status.sp, pl_sd->status.max_sp);
@@ -2255,7 +2255,7 @@ ATCE atcommand_char_change_sex(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::USAGE;
{
- chrif_char_ask_name(sd->status.account_id, character, 5, HumanTimeDiff());
+ chrif_char_ask_name(sd->status_key.account_id, character, 5, HumanTimeDiff());
// type: 5 - changesex
clif_displaymessage(s, "Character name sends to char-server to ask it.");
}
@@ -2273,7 +2273,7 @@ ATCE atcommand_char_block(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::USAGE;
{
- chrif_char_ask_name(sd->status.account_id, character, 1, HumanTimeDiff());
+ chrif_char_ask_name(sd->status_key.account_id, character, 1, HumanTimeDiff());
// type: 1 - block
clif_displaymessage(s, "Character name sends to char-server to ask it.");
}
@@ -2293,7 +2293,7 @@ ATCE atcommand_char_ban(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::USAGE;
{
- chrif_char_ask_name(sd->status.account_id, character, 2, modif);
+ chrif_char_ask_name(sd->status_key.account_id, character, 2, modif);
// type: 2 - ban
clif_displaymessage(s, "Character name sends to char-server to ask it.");
}
@@ -2312,7 +2312,7 @@ ATCE atcommand_char_unblock(Session *s, dumb_ptr<map_session_data> sd,
{
// send answer to login server via char-server
- chrif_char_ask_name(sd->status.account_id, character, 3, HumanTimeDiff());
+ chrif_char_ask_name(sd->status_key.account_id, character, 3, HumanTimeDiff());
// type: 3 - unblock
clif_displaymessage(s, "Character name sends to char-server to ask it.");
}
@@ -2331,7 +2331,7 @@ ATCE atcommand_char_unban(Session *s, dumb_ptr<map_session_data> sd,
{
// send answer to login server via char-server
- chrif_char_ask_name(sd->status.account_id, character, 4, HumanTimeDiff());
+ chrif_char_ask_name(sd->status_key.account_id, character, 4, HumanTimeDiff());
// type: 4 - unban
clif_displaymessage(s, "Character name sends to char-server to ask it.");
}
@@ -2697,7 +2697,7 @@ ATCE atcommand_kickall(Session *s, dumb_ptr<map_session_data> sd,
&& pl_sd->state.auth && pc_isGM(sd) >= pc_isGM(pl_sd))
{
// you can kick only lower or same gm level
- if (sd->status.account_id != pl_sd->status.account_id)
+ if (sd->status_key.account_id != pl_sd->status_key.account_id)
clif_GM_kick(sd, pl_sd, 0);
}
}
@@ -2913,7 +2913,7 @@ ATCE atcommand_mapexit(Session *, dumb_ptr<map_session_data> sd,
dumb_ptr<map_session_data> pl_sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s2->session_data.get()));
if (pl_sd && pl_sd->state.auth)
{
- if (sd->status.account_id != pl_sd->status.account_id)
+ if (sd->status_key.account_id != pl_sd->status_key.account_id)
clif_GM_kick(sd, pl_sd, 0);
}
}
@@ -3326,7 +3326,7 @@ ATCE atcommand_recallall(Session *s, dumb_ptr<map_session_data> sd,
dumb_ptr<map_session_data> pl_sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s2->session_data.get()));
if (pl_sd
&& pl_sd->state.auth
- && sd->status.account_id != pl_sd->status.account_id
+ && sd->status_key.account_id != pl_sd->status_key.account_id
&& pc_isGM(sd) >= pc_isGM(pl_sd))
{
// you can recall only lower or same level
@@ -3381,7 +3381,7 @@ ATCE atcommand_partyrecall(Session *s, dumb_ptr<map_session_data> sd,
continue;
dumb_ptr<map_session_data> pl_sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s2->session_data.get()));
if (pl_sd && pl_sd->state.auth
- && sd->status.account_id != pl_sd->status.account_id
+ && sd->status_key.account_id != pl_sd->status_key.account_id
&& pl_sd->status.party_id == p->party_id)
{
if (pl_sd->bl_m && pl_sd->bl_m->flag.get(MapFlag::NOWARP)
@@ -3477,7 +3477,7 @@ ATCE atcommand_mapinfo(Session *s, dumb_ptr<map_session_data> sd,
{
output = STRPRINTF(
"Player '%s' (session #%d) | Location: %d,%d",
- pl_sd->status.name, s2, pl_sd->bl_x, pl_sd->bl_y);
+ pl_sd->status_key.name, s2, pl_sd->bl_x, pl_sd->bl_y);
clif_displaymessage(s, output);
}
}
@@ -3714,7 +3714,7 @@ ATCE atcommand_broadcast(Session *, dumb_ptr<map_session_data> sd,
if (!message)
return ATCE::USAGE;
- AString output = STRPRINTF("%s : %s", sd->status.name, message);
+ AString output = STRPRINTF("%s : %s", sd->status_key.name, message);
intif_GMmessage(output);
return ATCE::OKAY;
@@ -3727,7 +3727,7 @@ ATCE atcommand_localbroadcast(Session *, dumb_ptr<map_session_data> sd,
if (!message)
return ATCE::USAGE;
- AString output = STRPRINTF("%s : %s", sd->status.name, message);
+ AString output = STRPRINTF("%s : %s", sd->status_key.name, message);
clif_GMmessage(sd, output, 1);
@@ -3766,7 +3766,7 @@ ATCE atcommand_email(Session *s, dumb_ptr<map_session_data> sd,
}
else
{
- chrif_changeemail(sd->status.account_id, actual_email, new_email);
+ chrif_changeemail(sd->status_key.account_id, actual_email, new_email);
clif_displaymessage(s, "Information sended to login-server via char-server.");
}
@@ -3837,7 +3837,7 @@ ATCE atcommand_character_item_list(Session *s, dumb_ptr<map_session_data> sd,
{
AString output = STRPRINTF(
"------ Items list of '%s' ------",
- pl_sd->status.name);
+ pl_sd->status_key.name);
clif_displaymessage(s, output);
}
EPOS equip = pl_sd->status.inventory[i].equip;
@@ -3976,7 +3976,7 @@ ATCE atcommand_character_storage_list(Session *s, dumb_ptr<map_session_data> sd,
if (pc_isGM(sd) >= pc_isGM(pl_sd))
{
// you can look items only lower or same level
- if ((stor = account2storage2(pl_sd->status.account_id)) != NULL)
+ if ((stor = account2storage2(pl_sd->status_key.account_id)) != NULL)
{
counter = 0;
count = 0;
@@ -3992,7 +3992,7 @@ ATCE atcommand_character_storage_list(Session *s, dumb_ptr<map_session_data> sd,
{
AString output = STRPRINTF(
"------ Storage items list of '%s' ------",
- pl_sd->status.name);
+ pl_sd->status_key.name);
clif_displaymessage(s, output);
}
AString output;
@@ -4110,7 +4110,7 @@ ATCE atcommand_character_cart_list(Session *s, dumb_ptr<map_session_data> sd,
{
AString output = STRPRINTF(
"------ Cart items list of '%s' ------",
- pl_sd->status.name);
+ pl_sd->status_key.name);
clif_displaymessage(s, output);
}
@@ -4618,7 +4618,7 @@ ATCE atcommand_adjgmlvl(Session *s, dumb_ptr<map_session_data>,
if (pl_sd == NULL)
return ATCE::EXIST;
- pc_set_gm_level(pl_sd->status.account_id, newlev);
+ pc_set_gm_level(pl_sd->status_key.account_id, newlev);
return ATCE::OKAY;
}
@@ -4776,7 +4776,7 @@ ATCE atcommand_tee(Session *, dumb_ptr<map_session_data> sd,
ZString message)
{
MString data;
- data += sd->status.name.to__actual();
+ data += sd->status_key.name.to__actual();
data += " : ";
data += message;
clif_message(sd, AString(data));
@@ -4836,7 +4836,7 @@ ATCE atcommand_jump_iterate(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::PERM;
}
pc_setpos(sd, pl_sd->bl_m->name_, pl_sd->bl_x, pl_sd->bl_y, BeingRemoveWhy::WARPED);
- AString output = STRPRINTF("Jump to %s", pl_sd->status.name);
+ AString output = STRPRINTF("Jump to %s", pl_sd->status_key.name);
clif_displaymessage(s, output);
sd->followtarget = pl_sd->bl_id;
@@ -4863,7 +4863,7 @@ ATCE atcommand_wgm(Session *s, dumb_ptr<map_session_data> sd,
if (tmw_CheckChatSpam(sd, message))
return ATCE::OKAY;
- tmw_GmHackMsg(STRPRINTF("[GM] %s: %s", sd->status.name, message));
+ tmw_GmHackMsg(STRPRINTF("[GM] %s: %s", sd->status_key.name, message));
if (!pc_isGM(sd))
clif_displaymessage(s, "Message sent.");
@@ -5035,7 +5035,7 @@ ATCE atcommand_ipcheck(Session *s, dumb_ptr<map_session_data>,
{
AString output = STRPRINTF(
"Name: %s | Location: %s %d %d",
- pl_sd->status.name, pl_sd->mapname_,
+ pl_sd->status_key.name, pl_sd->mapname_,
pl_sd->bl_x, pl_sd->bl_y);
clif_displaymessage(s, output);
}
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 3830c0f..4d76dbd 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -2050,10 +2050,10 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target,
weapon = sd->inventory_data[weapon_index]->nameid;
MAP_LOG("PC%d %s:%d,%d WPNDMG %s%d %d FOR %d WPN %d",
- sd->status.char_id, src->bl_m->name_, src->bl_x, src->bl_y,
+ sd->status_key.char_id, src->bl_m->name_, src->bl_x, src->bl_y,
(target->bl_type == BL::PC) ? "PC" : "MOB",
(target->bl_type == BL::PC)
- ? target->is_player()-> status.char_id
+ ? target->is_player()-> status_key.char_id
: target->bl_id,
battle_get_class(target),
wd.damage + wd.damage2, weapon);
@@ -2063,10 +2063,10 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target,
{
dumb_ptr<map_session_data> sd2 = target->is_player();
MAP_LOG("PC%d %s:%d,%d WPNINJURY %s%d %d FOR %d",
- sd2->status.char_id, target->bl_m->name_, target->bl_x, target->bl_y,
+ sd2->status_key.char_id, target->bl_m->name_, target->bl_x, target->bl_y,
(src->bl_type == BL::PC) ? "PC" : "MOB",
(src->bl_type == BL::PC)
- ? src->is_player()->status.char_id
+ ? src->is_player()->status_key.char_id
: src->bl_id,
battle_get_class(src),
wd.damage + wd.damage2);
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp
index c49a101..a74e870 100644
--- a/src/map/chrif.cpp
+++ b/src/map/chrif.cpp
@@ -111,15 +111,16 @@ int chrif_save(dumb_ptr<map_session_data> sd)
pc_makesavestatus(sd);
WFIFOW(char_session, 0) = 0x2b01;
- WFIFOW(char_session, 2) = sizeof(sd->status) + 12;
+ WFIFOW(char_session, 2) = sizeof(sd->status_key) + sizeof(sd->status) + 12;
WFIFOL(char_session, 4) = sd->bl_id;
WFIFOL(char_session, 8) = sd->char_id;
- WFIFO_STRUCT(char_session, 12, sd->status);
+ WFIFO_STRUCT(char_session, 12, sd->status_key);
+ WFIFO_STRUCT(char_session, 12 + sizeof(sd->status_key), sd->status);
WFIFOSET(char_session, WFIFOW(char_session, 2));
//For data sync
if (sd->state.storage_open)
- storage_storage_save(sd->status.account_id, 0);
+ storage_storage_save(sd->status_key.account_id, 0);
return 0;
}
@@ -219,7 +220,7 @@ int chrif_changemapserver(dumb_ptr<map_session_data> sd,
WFIFOL(char_session, 2) = sd->bl_id;
WFIFOL(char_session, 6) = sd->login_id1;
WFIFOL(char_session, 10) = sd->login_id2;
- WFIFOL(char_session, 14) = sd->status.char_id;
+ WFIFOL(char_session, 14) = sd->status_key.char_id;
WFIFO_STRING(char_session, 18, name, 16);
WFIFOW(char_session, 34) = x;
WFIFOW(char_session, 36) = y;
@@ -241,14 +242,14 @@ int chrif_changemapserverack(Session *s)
{
dumb_ptr<map_session_data> sd = map_id2sd(RFIFOL(s, 2));
- if (sd == NULL || sd->status.char_id != RFIFOL(s, 14))
+ if (sd == NULL || sd->status_key.char_id != RFIFOL(s, 14))
return -1;
if (RFIFOL(s, 6) == 1)
{
if (battle_config.error_log)
PRINTF("map server change failed.\n");
- pc_authfail(sd->status.account_id);
+ pc_authfail(sd->status_key.account_id);
return 0;
}
MapName mapname = RFIFO_STRING<16>(s, 18);
@@ -939,7 +940,7 @@ void ladmin_itemfrob_c2(dumb_ptr<block_list> bl, int source_id, int dest_id)
case BL::PC:
{
dumb_ptr<map_session_data> pc = bl->is_player();
- struct storage *stor = account2storage2(pc->status.account_id);
+ struct storage *stor = account2storage2(pc->status_key.account_id);
int j;
for (j = 0; j < MAX_INVENTORY; j++)
@@ -1085,11 +1086,13 @@ void chrif_parse(Session *s)
int login_id2 = RFIFOL(s, 8);
TimeT connect_until_time = static_cast<time_t>(RFIFOL(s, 12));
short tmw_version = RFIFOW(s, 16);
- struct mmo_charstatus st {};
- RFIFO_STRUCT(s, 18, st);
+ CharKey st_key;
+ CharData st_data;
+ RFIFO_STRUCT(s, 18, st_key);
+ RFIFO_STRUCT(s, 18 + sizeof(st_key), st_data);
pc_authok(id, login_id2,
connect_until_time, tmw_version,
- &st);
+ &st_key, &st_data);
}
break;
case 0x2afe:
@@ -1168,7 +1171,7 @@ void send_users_tochar(TimerData *, tick_t)
|| sd->state.shroud_active
|| bool(sd->status.option & Option::HIDE)) && pc_isGM(sd)))
{
- WFIFOL(char_session, 6 + 4 * users) = sd->status.char_id;
+ WFIFOL(char_session, 6 + 4 * users) = sd->status_key.char_id;
users++;
}
}
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 5355192..70e9e1d 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -3069,7 +3069,7 @@ void clif_party_invite(dumb_ptr<map_session_data> sd,
return;
WFIFOW(s, 0) = 0xfe;
- WFIFOL(s, 2) = sd->status.account_id;
+ WFIFOL(s, 2) = sd->status_key.account_id;
WFIFO_STRING(s, 6, p->name, 24);
WFIFOSET(s, clif_parse_func_table[0xfe].len);
}
@@ -3212,12 +3212,12 @@ int clif_party_xy(struct party *, dumb_ptr<map_session_data> sd)
nullpo_ret(sd);
WBUFW(buf, 0) = 0x107;
- WBUFL(buf, 2) = sd->status.account_id;
+ WBUFL(buf, 2) = sd->status_key.account_id;
WBUFW(buf, 6) = sd->bl_x;
WBUFW(buf, 8) = sd->bl_y;
clif_send(buf, clif_parse_func_table[0x107].len, sd, SendWho::PARTY_SAMEMAP_WOS);
// if(battle_config.etc_log)
-// PRINTF("clif_party_xy %d\n",sd->status.account_id);
+// PRINTF("clif_party_xy %d\n",sd->status_key.account_id);
return 0;
}
@@ -3232,13 +3232,13 @@ int clif_party_hp(struct party *, dumb_ptr<map_session_data> sd)
nullpo_ret(sd);
WBUFW(buf, 0) = 0x106;
- WBUFL(buf, 2) = sd->status.account_id;
+ WBUFL(buf, 2) = sd->status_key.account_id;
WBUFW(buf, 6) = (sd->status.hp > 0x7fff) ? 0x7fff : sd->status.hp;
WBUFW(buf, 8) =
(sd->status.max_hp > 0x7fff) ? 0x7fff : sd->status.max_hp;
clif_send(buf, clif_parse_func_table[0x106].len, sd, SendWho::PARTY_AREA_WOS);
// if(battle_config.etc_log)
-// PRINTF("clif_party_hp %d\n",sd->status.account_id);
+// PRINTF("clif_party_hp %d\n",sd->status_key.account_id);
return 0;
}
@@ -3358,7 +3358,7 @@ int clif_GM_kick(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> tsd,
nullpo_ret(tsd);
if (type)
- clif_GM_kickack(sd, tsd->status.account_id);
+ clif_GM_kickack(sd, tsd->status_key.account_id);
tsd->opt1 = Opt1::ZERO;
tsd->opt2 = Opt2::ZERO;
clif_parse_QuitGame(tsd->sess, tsd);
@@ -3679,7 +3679,7 @@ void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd)
if (ssd->state.shroud_active)
WFIFO_STRING(s, 6, "", 24);
else
- WFIFO_STRING(s, 6, ssd->status.name.to__actual(), 24);
+ WFIFO_STRING(s, 6, ssd->status_key.name.to__actual(), 24);
WFIFOSET(s, clif_parse_func_table[0x95].len);
struct party *p = NULL;
@@ -4044,7 +4044,7 @@ void clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd)
*/
CharName tname = stringish<CharName>(RFIFO_STRING<24>(s, 4));
if (!(dstsd = map_nick2sd(tname))
- || dstsd->status.name != tname)
+ || dstsd->status_key.name != tname)
intif_wis_message(sd, tname, mbuf);
else
{
@@ -4059,7 +4059,7 @@ void clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd)
{
/* The player is not being ignored. */
{
- clif_wis_message(dstsd->sess, sd->status.name, mbuf);
+ clif_wis_message(dstsd->sess, sd->status_key.name, mbuf);
/* The whisper was sent successfully. */
clif_wis_end(s, 0);
}
@@ -5261,7 +5261,7 @@ int clif_check_packet_flood(Session *s, int cmd)
if (sd->packet_flood_in >= battle_config.packet_spam_flood)
{
- PRINTF("packet flood detected from %s [0x%x]\n", sd->status.name, cmd);
+ PRINTF("packet flood detected from %s [0x%x]\n", sd->status_key.name, cmd);
if (battle_config.packet_spam_kick)
{
s->eof = 1; // Kick
@@ -5281,7 +5281,7 @@ inline
void WARN_MALFORMED_MSG(dumb_ptr<map_session_data> sd, const char *msg)
{
PRINTF("clif_validate_chat(): %s (ID %d) sent a malformed message: %s.\n",
- sd->status.name, sd->status.account_id, msg);
+ sd->status_key.name, sd->status_key.account_id, msg);
}
/**
* Validate message integrity (inspired by upstream source (eAthena)).
@@ -5306,7 +5306,7 @@ AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type)
Session *s = sd->sess;
size_t msg_len = RFIFOW(s, 2) - 4;
- size_t name_len = sd->status.name.to__actual().size();
+ size_t name_len = sd->status_key.name.to__actual().size();
/*
* At least one character is required in all instances.
* Notes for length checks:
@@ -5370,7 +5370,7 @@ AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type)
if (type == ChatType::Global)
{
XString p = pbuf;
- if (!(p.startswith(sd->status.name.to__actual()) && p.xslice_t(name_len).startswith(" : ")))
+ if (!(p.startswith(sd->status_key.name.to__actual()) && p.xslice_t(name_len).startswith(" : ")))
{
/* Disallow malformed/spoofed messages. */
clif_setwaitclose(s);
@@ -5416,7 +5416,7 @@ void clif_parse(Session *s)
pc_logout(sd);
clif_quitsave(s, sd);
- PRINTF("Player [%s] has logged off your server.\n", sd->status.name); // Player logout display [Valaris]
+ PRINTF("Player [%s] has logged off your server.\n", sd->status_key.name); // Player logout display [Valaris]
}
else if (sd)
{ // not authentified! (refused by char-server or disconnect before to be authentified)
@@ -5511,8 +5511,8 @@ void clif_parse(Session *s)
if (sd && sd->state.auth)
{
PRINTF("\nAccount ID %d, character ID %d, player name %s.\n",
- sd->status.account_id, sd->status.char_id,
- sd->status.name);
+ sd->status_key.account_id, sd->status_key.char_id,
+ sd->status_key.name);
}
else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified)
PRINTF("\nAccount ID %d.\n", sd->bl_id);
@@ -5533,8 +5533,8 @@ void clif_parse(Session *s)
FPRINTF(fp,
"%s\nPlayer with account ID %d (character ID %d, player name %s) sent wrong packet:\n",
now,
- sd->status.account_id,
- sd->status.char_id, sd->status.name);
+ sd->status_key.account_id,
+ sd->status_key.char_id, sd->status_key.name);
}
else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified)
FPRINTF(fp,
diff --git a/src/map/intif.cpp b/src/map/intif.cpp
index e994bdb..5c6c46a 100644
--- a/src/map/intif.cpp
+++ b/src/map/intif.cpp
@@ -58,14 +58,14 @@ void intif_wis_message(dumb_ptr<map_session_data> sd, CharName nick, ZString mes
size_t mes_len = mes.size() + 1;
WFIFOW(char_session, 0) = 0x3001;
WFIFOW(char_session, 2) = mes_len + 52;
- WFIFO_STRING(char_session, 4, sd->status.name.to__actual(), 24);
+ WFIFO_STRING(char_session, 4, sd->status_key.name.to__actual(), 24);
WFIFO_STRING(char_session, 28, nick.to__actual(), 24);
WFIFO_STRING(char_session, 52, mes, mes_len);
WFIFOSET(char_session, WFIFOW(char_session, 2));
if (battle_config.etc_log)
PRINTF("intif_wis_message from %s to %s)\n",
- sd->status.name, nick);
+ sd->status_key.name, nick);
}
// The reply of Wisp/page
@@ -150,9 +150,9 @@ void intif_create_party(dumb_ptr<map_session_data> sd, PartyName name)
nullpo_retv(sd);
WFIFOW(char_session, 0) = 0x3020;
- WFIFOL(char_session, 2) = sd->status.account_id;
+ WFIFOL(char_session, 2) = sd->status_key.account_id;
WFIFO_STRING(char_session, 6, name, 24);
- WFIFO_STRING(char_session, 30, sd->status.name.to__actual(), 24);
+ WFIFO_STRING(char_session, 30, sd->status_key.name.to__actual(), 24);
WFIFO_STRING(char_session, 54, sd->bl_m->name_, 16);
WFIFOW(char_session, 70) = sd->status.base_level;
WFIFOSET(char_session, 72);
@@ -176,7 +176,7 @@ void intif_party_addmember(int party_id, int account_id)
WFIFOW(char_session, 0) = 0x3022;
WFIFOL(char_session, 2) = party_id;
WFIFOL(char_session, 6) = account_id;
- WFIFO_STRING(char_session, 10, sd->status.name.to__actual(), 24);
+ WFIFO_STRING(char_session, 10, sd->status_key.name.to__actual(), 24);
WFIFO_STRING(char_session, 34, sd->bl_m->name_, 16);
WFIFOW(char_session, 50) = sd->status.base_level;
WFIFOSET(char_session, 52);
@@ -210,7 +210,7 @@ void intif_party_changemap(dumb_ptr<map_session_data> sd, int online)
{
WFIFOW(char_session, 0) = 0x3025;
WFIFOL(char_session, 2) = sd->status.party_id;
- WFIFOL(char_session, 6) = sd->status.account_id;
+ WFIFOL(char_session, 6) = sd->status_key.account_id;
WFIFO_STRING(char_session, 10, sd->bl_m->name_, 16);
WFIFOB(char_session, 26) = online;
WFIFOW(char_session, 27) = sd->status.base_level;
@@ -264,7 +264,7 @@ int intif_parse_WisMessage(Session *s)
to);
}
sd = map_nick2sd(to); // Searching destination player
- if (sd != NULL && sd->status.name == to)
+ if (sd != NULL && sd->status_key.name == to)
{
// exactly same name (inter-server have checked the name before)
{
@@ -369,14 +369,14 @@ int intif_parse_LoadStorage(Session *s)
{ // Already open.. lets ignore this update
if (battle_config.error_log)
PRINTF("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n",
- sd->status.account_id, sd->status.char_id);
+ sd->status_key.account_id, sd->status_key.char_id);
return 1;
}
if (stor->dirty)
{ // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
if (battle_config.error_log)
PRINTF("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n",
- sd->status.account_id, sd->status.char_id);
+ sd->status_key.account_id, sd->status_key.char_id);
return 1;
}
diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp
index 1628395..65cd35b 100644
--- a/src/map/magic-expr.cpp
+++ b/src/map/magic-expr.cpp
@@ -98,7 +98,7 @@ AString show_entity(dumb_ptr<block_list> entity)
switch (entity->bl_type)
{
case BL::PC:
- return entity->is_player()->status.name.to__actual();
+ return entity->is_player()->status_key.name.to__actual();
case BL::NPC:
return entity->is_npc()->name;
case BL::MOB:
diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp
index 7ca718b..a71f43c 100644
--- a/src/map/magic-stmt.cpp
+++ b/src/map/magic-stmt.cpp
@@ -328,7 +328,7 @@ int op_instaheal(dumb_ptr<env_t> env, const_array<val_t> args)
dumb_ptr<map_session_data> caster_pc = caster->is_player();
dumb_ptr<map_session_data> subject_pc = subject->is_player();
MAP_LOG_PC(caster_pc, "SPELLHEAL-INSTA PC%d FOR %d",
- subject_pc->status.char_id, ARGINT(1));
+ subject_pc->status_key.char_id, ARGINT(1));
}
battle_heal(caster, subject, ARGINT(1), ARGINT(2), 0);
@@ -1438,7 +1438,7 @@ interval_t spell_run(dumb_ptr<invocation> invocation_, int allow_delete)
if (caster)
{
dumb_ptr<env_t> env = invocation_->env;
- ZString caster_name = (caster ? caster->status.name : CharName()).to__actual();
+ ZString caster_name = (caster ? caster->status_key.name : CharName()).to__actual();
argrec_t arg[3] =
{
{"@target", env->VAR(VAR_TARGET).ty == TYPE::ENTITY ? 0 : env->VAR(VAR_TARGET).v.v_int},
diff --git a/src/map/map.cpp b/src/map/map.cpp
index a063d2b..4fa511a 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -795,7 +795,7 @@ void map_addnickdb(dumb_ptr<map_session_data> sd)
{
nullpo_retv(sd);
- nick_db.put(sd->status.name, sd);
+ nick_db.put(sd->status_key.name, sd);
}
/*==========================================
@@ -846,8 +846,8 @@ void map_quit(dumb_ptr<map_session_data> sd)
map_delblock(sd);
id_db.put(sd->bl_id, nullptr);
- nick_db.put(sd->status.name, nullptr);
- charid_db.erase(sd->status.char_id);
+ nick_db.put(sd->status_key.name, nullptr);
+ charid_db.erase(sd->status_key.char_id);
}
/*==========================================
@@ -984,7 +984,7 @@ dumb_ptr<map_session_data> map_nick2sd(CharName nick)
if (pl_sd && pl_sd->state.auth)
{
{
- if (pl_sd->status.name == nick)
+ if (pl_sd->status_key.name == nick)
return dumb_ptr<map_session_data>(pl_sd);
}
}
diff --git a/src/map/map.hpp b/src/map/map.hpp
index 685feed..ad5adcf 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -170,7 +170,8 @@ struct map_session_data : block_list, SessionData
int char_id, login_id1, login_id2;
SEX sex;
unsigned char tmw_version; // tmw client version
- struct mmo_charstatus status;
+ CharKey status_key;
+ CharData status;
struct item_data *inventory_data[MAX_INVENTORY];
earray<short, EQUIP, EQUIP::COUNT> equip_index;
int weight, max_weight;
@@ -605,7 +606,7 @@ void map_log(XString line);
# define MAP_LOG_PC(sd, fmt, ...) \
MAP_LOG("PC%d %s:%d,%d " fmt, \
- sd->status.char_id, (sd->bl_m ? sd->bl_m->name_ : stringish<MapName>("undefined.gat")), sd->bl_x, sd->bl_y, ## __VA_ARGS__)
+ sd->status_key.char_id, (sd->bl_m ? sd->bl_m->name_ : stringish<MapName>("undefined.gat")), sd->bl_x, sd->bl_y, ## __VA_ARGS__)
// 床アイテム関連
void map_clearflooritem_timer(TimerData *, tick_t, int);
diff --git a/src/map/party.cpp b/src/map/party.cpp
index b2ce340..f7b8396 100644
--- a/src/map/party.cpp
+++ b/src/map/party.cpp
@@ -139,9 +139,9 @@ int party_check_member(struct party *p)
int j, f = 1;
for (j = 0; j < MAX_PARTY; j++)
{ // パーティにデータがあるか確認
- if (p->member[j].account_id == sd->status.account_id)
+ if (p->member[j].account_id == sd->status_key.account_id)
{
- if (p->member[j].name == sd->status.name)
+ if (p->member[j].name == sd->status_key.name)
f = 0; // データがある
else
{
@@ -155,7 +155,7 @@ int party_check_member(struct party *p)
sd->status.party_id = 0;
if (battle_config.error_log)
PRINTF("party: check_member %d[%s] is not member\n",
- sd->status.account_id, sd->status.name);
+ sd->status_key.account_id, sd->status_key.name);
}
}
}
@@ -242,7 +242,7 @@ int party_invite(dumb_ptr<map_session_data> sd, int account_id)
if (tsd->trade_partner || tsd->npc_id
|| tsd->npc_shopid || pc_checkskill(tsd, SkillID::NV_PARTY) < 1)
{
- clif_party_inviteack(sd, tsd->status.name, 1);
+ clif_party_inviteack(sd, tsd->status_key.name, 1);
return 0;
}
}
@@ -250,7 +250,7 @@ int party_invite(dumb_ptr<map_session_data> sd, int account_id)
/* The target player is already in a party, or has a pending invitation. */
if (tsd->status.party_id > 0 || tsd->party_invite > 0)
{
- clif_party_inviteack(sd, tsd->status.name, 0);
+ clif_party_inviteack(sd, tsd->status_key.name, 0);
return 0;
}
@@ -264,7 +264,7 @@ int party_invite(dumb_ptr<map_session_data> sd, int account_id)
*/
if (p->member[i].account_id == account_id)
{
- clif_party_inviteack(sd, tsd->status.name, 1);
+ clif_party_inviteack(sd, tsd->status_key.name, 1);
return 0;
}
@@ -275,13 +275,13 @@ int party_invite(dumb_ptr<map_session_data> sd, int account_id)
/* There isn't enough room for a new member. */
if (full)
{
- clif_party_inviteack(sd, tsd->status.name, 3);
+ clif_party_inviteack(sd, tsd->status_key.name, 3);
return 0;
}
/* Otherwise, relay the invitation to the target player. */
tsd->party_invite = sd->status.party_id;
- tsd->party_invite_account = sd->status.account_id;
+ tsd->party_invite_account = sd->status_key.account_id;
clif_party_invite(sd, tsd);
return 0;
@@ -305,7 +305,7 @@ int party_reply_invite(dumb_ptr<map_session_data> sd, int account_id, int flag)
/* The invitation was accepted. */
if (flag == 1)
- intif_party_addmember(sd->party_invite, sd->status.account_id);
+ intif_party_addmember(sd->party_invite, sd->status_key.account_id);
/* The invitation was rejected. */
else
{
@@ -316,7 +316,7 @@ int party_reply_invite(dumb_ptr<map_session_data> sd, int account_id, int flag)
sd->party_invite_account = 0;
if ((tsd = map_id2sd(account_id)))
- clif_party_inviteack(tsd, sd->status.name, 1);
+ clif_party_inviteack(tsd, sd->status_key.name, 1);
}
return 0;
}
@@ -352,7 +352,7 @@ int party_member_added(int party_id, int account_id, int flag)
if (flag == 1)
{ // 失敗
if (sd2 != NULL)
- clif_party_inviteack(sd2, sd->status.name, 0);
+ clif_party_inviteack(sd2, sd->status_key.name, 0);
return 0;
}
@@ -361,7 +361,7 @@ int party_member_added(int party_id, int account_id, int flag)
sd->status.party_id = party_id;
if (sd2 != NULL)
- clif_party_inviteack(sd2, sd->status.name, 2);
+ clif_party_inviteack(sd2, sd->status_key.name, 2);
// いちおう競合確認
party_check_conflict(sd);
@@ -384,7 +384,7 @@ int party_removemember(dumb_ptr<map_session_data> sd, int account_id)
for (i = 0; i < MAX_PARTY; i++)
{ // リーダーかどうかチェック
- if (p->member[i].account_id == sd->status.account_id)
+ if (p->member[i].account_id == sd->status_key.account_id)
if (p->member[i].leader == 0)
return 0;
}
@@ -413,9 +413,9 @@ int party_leave(dumb_ptr<map_session_data> sd)
for (i = 0; i < MAX_PARTY; i++)
{ // 所属しているか
- if (p->member[i].account_id == sd->status.account_id)
+ if (p->member[i].account_id == sd->status_key.account_id)
{
- intif_party_leave(p->party_id, sd->status.account_id);
+ intif_party_leave(p->party_id, sd->status_key.account_id);
return 0;
}
}
@@ -479,7 +479,7 @@ int party_changeoption(dumb_ptr<map_session_data> sd, int exp, int item)
if (sd->status.party_id == 0
|| (p = party_search(sd->status.party_id)) == NULL)
return 0;
- intif_party_changeoption(sd->status.party_id, sd->status.account_id, exp,
+ intif_party_changeoption(sd->status.party_id, sd->status_key.account_id, exp,
item);
return 0;
}
@@ -604,7 +604,7 @@ void party_send_message(dumb_ptr<map_session_data> sd, XString mes)
{
if (sd->status.party_id == 0)
return;
- intif_party_message(sd->status.party_id, sd->status.account_id, mes);
+ intif_party_message(sd->status.party_id, sd->status_key.account_id, mes);
}
// パーティメッセージ受信
@@ -622,7 +622,7 @@ void party_check_conflict(dumb_ptr<map_session_data> sd)
nullpo_retv(sd);
intif_party_checkconflict(sd->status.party_id,
- sd->status.account_id, sd->status.name);
+ sd->status_key.account_id, sd->status_key.name);
}
// 位置やHP通知用
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index f8f9dc8..8ff5a01 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -243,7 +243,7 @@ uint8_t pc_isGM(dumb_ptr<map_session_data> sd)
{
nullpo_ret(sd);
- auto it = gm_accountm.find(sd->status.account_id);
+ auto it = gm_accountm.find(sd->status_key.account_id);
if (it != gm_accountm.end())
return it->second;
return 0;
@@ -606,7 +606,7 @@ int pc_isequip(dumb_ptr<map_session_data> sd, int n)
*------------------------------------------
*/
int pc_authok(int id, int login_id2, TimeT connect_until_time,
- short tmw_version, const struct mmo_charstatus *st)
+ short tmw_version, const CharKey *st_key, const CharData *st_data)
{
dumb_ptr<map_session_data> sd = NULL;
@@ -620,7 +620,8 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time,
sd->login_id2 = login_id2;
sd->tmw_version = tmw_version;
- sd->status = *st;
+ sd->status_key = *st_key;
+ sd->status = *st_data;
if (sd->status.sex != sd->sex)
{
@@ -727,8 +728,8 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time,
clif_authok(sd);
map_addnickdb(sd);
- if (!map_charid2nick(sd->status.char_id).to__actual())
- map_addchariddb(sd->status.char_id, sd->status.name);
+ if (!map_charid2nick(sd->status_key.char_id).to__actual())
+ map_addchariddb(sd->status_key.char_id, sd->status_key.name);
//スパノビ用死にカウンターのスクリプト変数からの読み出しとsdへのセット
sd->die_counter = pc_readglobalreg(sd, stringish<VarName>("PC_DIE_COUNTER"));
@@ -739,12 +740,12 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time,
if (pc_isGM(sd))
{
PRINTF("Connection accepted: character '%s' (account: %d; GM level %d).\n",
- sd->status.name, sd->status.account_id, pc_isGM(sd));
+ sd->status_key.name, sd->status_key.account_id, pc_isGM(sd));
clif_updatestatus(sd, SP::GM);
}
else
PRINTF("Connection accepted: Character '%s' (account: %d).\n",
- sd->status.name, sd->status.account_id);
+ sd->status_key.name, sd->status_key.account_id);
sd->auto_ban_info.in_progress = 0;
@@ -2148,7 +2149,7 @@ int can_pick_item_up_from(dumb_ptr<map_session_data> self, int other_id)
return 1;
/* From our partner? */
- if (self->status.partner_id == other->status.char_id)
+ if (self->status.partner_id == other->status_key.char_id)
return 1;
/* From a party member? */
@@ -3442,7 +3443,7 @@ int pc_damage(dumb_ptr<block_list> src, dumb_ptr<map_session_data> sd,
if (src->bl_type == BL::PC)
{
MAP_LOG_PC(sd, "INJURED-BY PC%d FOR %d",
- src->is_player()->status.char_id,
+ src->is_player()->status_key.char_id,
damage);
}
else
@@ -4837,8 +4838,8 @@ int pc_marriage(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> dstsd)
if (sd == NULL || dstsd == NULL || sd->status.partner_id > 0
|| dstsd->status.partner_id > 0)
return -1;
- sd->status.partner_id = dstsd->status.char_id;
- dstsd->status.partner_id = sd->status.char_id;
+ sd->status.partner_id = dstsd->status_key.char_id;
+ dstsd->status.partner_id = sd->status_key.char_id;
return 0;
}
@@ -4856,8 +4857,8 @@ int pc_divorce(dumb_ptr<map_session_data> sd)
if ((p_sd =
map_nick2sd(map_charid2nick(sd->status.partner_id))) != NULL)
{
- if (p_sd->status.partner_id != sd->status.char_id
- || sd->status.partner_id != p_sd->status.char_id)
+ if (p_sd->status.partner_id != sd->status_key.char_id
+ || sd->status.partner_id != p_sd->status_key.char_id)
{
PRINTF("pc_divorce: Illegal partner_id sd=%d p_sd=%d\n",
sd->status.partner_id, p_sd->status.partner_id);
@@ -4873,7 +4874,7 @@ int pc_divorce(dumb_ptr<map_session_data> sd)
}
}
else
- chrif_send_divorce(sd->status.char_id);
+ chrif_send_divorce(sd->status_key.char_id);
return 0;
}
diff --git a/src/map/pc.hpp b/src/map/pc.hpp
index be66cc4..df612d8 100644
--- a/src/map/pc.hpp
+++ b/src/map/pc.hpp
@@ -53,7 +53,7 @@ int pc_counttargeted(dumb_ptr<map_session_data> sd, dumb_ptr<block_list> src,
int pc_setrestartvalue(dumb_ptr<map_session_data> sd, int type);
void pc_makesavestatus(dumb_ptr<map_session_data>);
int pc_setnewpc(dumb_ptr<map_session_data>, int, int, int, tick_t, SEX);
-int pc_authok(int, int, TimeT, short tmw_version, const struct mmo_charstatus *);
+int pc_authok(int, int, TimeT, short tmw_version, const CharKey *, const CharData *);
int pc_authfail(int accid);
EPOS pc_equippoint(dumb_ptr<map_session_data> sd, int n);
diff --git a/src/map/script.cpp b/src/map/script.cpp
index d13bb05..6fe965c 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -2112,13 +2112,13 @@ void builtin_getcharid(ScriptState *st)
return;
}
if (num == 0)
- push_int(st->stack, ByteCode::INT, sd->status.char_id);
+ push_int(st->stack, ByteCode::INT, sd->status_key.char_id);
if (num == 1)
push_int(st->stack, ByteCode::INT, sd->status.party_id);
if (num == 2)
push_int(st->stack, ByteCode::INT, 0/*guild_id*/);
if (num == 3)
- push_int(st->stack, ByteCode::INT, sd->status.account_id);
+ push_int(st->stack, ByteCode::INT, sd->status_key.account_id);
}
/*==========================================
@@ -2150,7 +2150,7 @@ void builtin_strcharinfo(ScriptState *st)
num = conv_num(st, &AARGO2(2));
if (num == 0)
{
- dumb_string buf = dumb_string::copys(sd->status.name.to__actual());
+ dumb_string buf = dumb_string::copys(sd->status_key.name.to__actual());
push_str(st->stack, ByteCode::STR, buf);
}
if (num == 1)
@@ -3105,7 +3105,7 @@ void builtin_changesex(ScriptState *st)
dumb_ptr<map_session_data> sd = NULL;
sd = script_rid2sd(st);
- chrif_char_ask_name(-1, sd->status.name, 5, HumanTimeDiff()); // type: 5 - changesex
+ chrif_char_ask_name(-1, sd->status_key.name, 5, HumanTimeDiff()); // type: 5 - changesex
chrif_save(sd);
}
diff --git a/src/map/storage.cpp b/src/map/storage.cpp
index d6832c8..b753c0d 100644
--- a/src/map/storage.cpp
+++ b/src/map/storage.cpp
@@ -60,10 +60,10 @@ int storage_storageopen(dumb_ptr<map_session_data> sd)
if (sd->state.storage_open)
return 1; //Already open?
- struct storage *stor = storage_db.search(sd->status.account_id);
+ struct storage *stor = storage_db.search(sd->status_key.account_id);
if (stor == NULL)
{ //Request storage.
- intif_request_storage(sd->status.account_id);
+ intif_request_storage(sd->status_key.account_id);
return 1;
}
@@ -158,7 +158,7 @@ int storage_storageadd(dumb_ptr<map_session_data> sd, int index, int amount)
struct storage *stor;
nullpo_ret(sd);
- stor = account2storage2(sd->status.account_id);
+ stor = account2storage2(sd->status_key.account_id);
nullpo_ret(stor);
if ((stor->storage_amount > MAX_STORAGE) || !stor->storage_status)
@@ -194,7 +194,7 @@ int storage_storageget(dumb_ptr<map_session_data> sd, int index, int amount)
PickupFail flag;
nullpo_ret(sd);
- stor = account2storage2(sd->status.account_id);
+ stor = account2storage2(sd->status_key.account_id);
nullpo_ret(stor);
if (index < 0 || index >= MAX_STORAGE)
@@ -223,7 +223,7 @@ int storage_storageclose(dumb_ptr<map_session_data> sd)
struct storage *stor;
nullpo_ret(sd);
- stor = account2storage2(sd->status.account_id);
+ stor = account2storage2(sd->status_key.account_id);
nullpo_ret(stor);
clif_storageclose(sd);
@@ -232,7 +232,7 @@ int storage_storageclose(dumb_ptr<map_session_data> sd)
if (save_settings & 4)
chrif_save(sd); //Invokes the storage saving as well.
else
- storage_storage_save(sd->status.account_id, 0);
+ storage_storage_save(sd->status_key.account_id, 0);
}
stor->storage_status = 0;
sd->state.storage_open = 0;
@@ -256,7 +256,7 @@ int storage_storage_quit(dumb_ptr<map_session_data> sd)
nullpo_ret(sd);
- stor = account2storage2(sd->status.account_id);
+ stor = account2storage2(sd->status_key.account_id);
if (stor)
{
chrif_save(sd); //Invokes the storage saving as well.
diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp
index 72cfa2b..16276fa 100644
--- a/src/map/tmw.cpp
+++ b/src/map/tmw.cpp
@@ -96,12 +96,12 @@ void tmw_AutoBan(dumb_ptr<map_session_data> sd, ZString reason, int length)
sd->auto_ban_info.in_progress = 1;
AString hack_msg = STRPRINTF("[GM] %s has been autobanned for %s spam",
- sd->status.name,
+ sd->status_key.name,
reason);
tmw_GmHackMsg(hack_msg);
AString fake_command = STRPRINTF("@autoban %s %dh (%s spam)",
- sd->status.name, length, reason);
+ sd->status_key.name, length, reason);
log_atcommand(sd, fake_command);
AString anotherbuf = STRPRINTF("You have been banned for %s spamming. Please do not spam.",
@@ -111,7 +111,7 @@ void tmw_AutoBan(dumb_ptr<map_session_data> sd, ZString reason, int length)
/* type: 2 - ban(year, month, day, hour, minute, second) */
HumanTimeDiff ban_len {};
ban_len.hour = length;
- chrif_char_ask_name(-1, sd->status.name, 2, ban_len);
+ chrif_char_ask_name(-1, sd->status_key.name, 2, ban_len);
clif_setwaitclose(sd->sess);
}
diff --git a/src/map/trade.cpp b/src/map/trade.cpp
index 7fc01ae..9626191 100644
--- a/src/map/trade.cpp
+++ b/src/map/trade.cpp
@@ -56,9 +56,9 @@ void trade_traderequest(dumb_ptr<map_session_data> sd, int target_id)
}
else if (sd != target_sd)
{
- target_sd->trade_partner = sd->status.account_id;
- sd->trade_partner = target_sd->status.account_id;
- clif_traderequest(target_sd, sd->status.name);
+ target_sd->trade_partner = sd->status_key.account_id;
+ sd->trade_partner = target_sd->status_key.account_id;
+ clif_traderequest(target_sd, sd->status_key.name);
}
}
}
@@ -326,7 +326,7 @@ void trade_tradecommit(dumb_ptr<map_session_data> sd)
if ((target_sd = map_id2sd(sd->trade_partner)) != NULL)
{
MAP_LOG_PC(sd, " TRADECOMMIT WITH %d GIVE %d GET %d",
- target_sd->status.char_id, sd->deal_zeny,
+ target_sd->status_key.char_id, sd->deal_zeny,
target_sd->deal_zeny);
if ((sd->deal_locked >= 1) && (target_sd->deal_locked >= 1))
{ // both have pressed 'ok'