diff options
Diffstat (limited to 'src/mmo/mmo.hpp')
-rw-r--r-- | src/mmo/mmo.hpp | 145 |
1 files changed, 10 insertions, 135 deletions
diff --git a/src/mmo/mmo.hpp b/src/mmo/mmo.hpp index 89aef6d..d749daa 100644 --- a/src/mmo/mmo.hpp +++ b/src/mmo/mmo.hpp @@ -1,6 +1,6 @@ #ifndef TMWA_MMO_MMO_HPP #define TMWA_MMO_MMO_HPP -// mmo.hpp - Huge mess of structures and constants. +// mmo.hpp - Huge mess of structures. // // Copyright © ????-2004 Athena Dev Teams // Copyright © 2004-2011 The Mana World Development Team @@ -23,119 +23,20 @@ # include "fwd.hpp" -# include <algorithm> - # include "../compat/memory.hpp" -# include "../generic/array.hpp" - -# include "../net/timer.t.hpp" - -# include "enums.hpp" -# include "ids.hpp" -# include "strs.hpp" - -constexpr int FIFOSIZE_SERVERLINK = 256 * 1024; - -constexpr int MAX_MAP_PER_SERVER = 512; -constexpr int MAX_INVENTORY = 100; -constexpr int MAX_AMOUNT = 30000; -constexpr int MAX_ZENY = 1000000000; // 1G zeny -constexpr int TRADE_MAX = 10; - -constexpr int GLOBAL_REG_NUM = 96; -constexpr size_t ACCOUNT_REG_NUM = 16; -constexpr size_t ACCOUNT_REG2_NUM = 16; -constexpr interval_t DEFAULT_WALK_SPEED = std::chrono::milliseconds(150); -constexpr interval_t MIN_WALK_SPEED = interval_t::zero(); -constexpr interval_t MAX_WALK_SPEED = std::chrono::seconds(1); -constexpr int MAX_STORAGE = 300; -constexpr int MAX_PARTY = 12; +# include "../proto2/types.hpp" -# define MIN_HAIR_STYLE battle_config.min_hair_style -# define MAX_HAIR_STYLE battle_config.max_hair_style -# define MIN_HAIR_COLOR battle_config.min_hair_color -# define MAX_HAIR_COLOR battle_config.max_hair_color -# define MIN_CLOTH_COLOR battle_config.min_cloth_color -# define MAX_CLOTH_COLOR battle_config.max_cloth_color - -struct item +inline +bool operator == (const SkillValue& l, const SkillValue& r) { - ItemNameId nameid; - short amount; - EPOS equip; -}; - -struct point + return l.lv == r.lv && l.flags == r.flags; +} +inline +bool operator != (const SkillValue& l, const SkillValue& r) { - MapName map_; - short x, y; -}; - -struct skill_value -{ - unsigned short lv; - SkillFlags flags; - - friend bool operator == (const skill_value& l, const skill_value& r) - { - return l.lv == r.lv && l.flags == r.flags; - } - friend bool operator != (const skill_value& l, const skill_value& r) - { - return !(l == r); - } -}; - -struct global_reg -{ - VarName str; - int value; -}; - -struct CharKey -{ - CharName name; - AccountId account_id; - CharId char_id; - unsigned char char_num; -}; - -struct CharData -{ - CharId partner_id; - - int base_exp, job_exp, zeny; - - Species species; - short status_point, skill_point; - int hp, max_hp, sp, max_sp; - Option option; - short karma, manner; - short hair, hair_color, clothes_color; - PartyId party_id; - - ItemLook weapon; - ItemNameId shield; - ItemNameId head_top, head_mid, head_bottom; - - unsigned char base_level, job_level; - earray<short, ATTR, ATTR::COUNT> attrs; - SEX sex; - - unsigned long mapip; - unsigned int mapport; - - struct point last_point, save_point; - Array<struct item, MAX_INVENTORY> inventory; - earray<skill_value, SkillID, MAX_SKILL> skill; - int global_reg_num; - Array<struct global_reg, GLOBAL_REG_NUM> global_reg; - int account_reg_num; - Array<struct global_reg, ACCOUNT_REG_NUM> account_reg; - int account_reg2_num; - Array<struct global_reg, ACCOUNT_REG2_NUM> account_reg2; -}; + return !(l == r); +} struct CharPair { @@ -147,38 +48,12 @@ struct CharPair {} }; -struct Storage -{ - bool dirty; - AccountId account_id; - short storage_status; - short storage_amount; - Array<struct item, MAX_STORAGE> storage_; -}; - struct GM_Account { AccountId account_id; GmLevel level; }; -struct party_member -{ - AccountId account_id; - CharName name; - MapName map; - int leader, online, lv; - struct map_session_data *sd; -}; - -struct PartyMost -{ - PartyName name; - int exp; - int item; - Array<struct party_member, MAX_PARTY> member; -}; - struct PartyPair { PartyId party_id = {}; |