summaryrefslogtreecommitdiff
path: root/src/mmo
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-05-27 13:33:54 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-05-27 13:33:54 -0700
commitaf4acff261d579428e8eef042cc5359fa392f725 (patch)
treeca73d54da799c3751e87ec88a785d60e7561a2f0 /src/mmo
parentcac49afdef0992b93d8718fd928d73d721d434f4 (diff)
downloadtmwa-af4acff261d579428e8eef042cc5359fa392f725.tar.gz
tmwa-af4acff261d579428e8eef042cc5359fa392f725.tar.bz2
tmwa-af4acff261d579428e8eef042cc5359fa392f725.tar.xz
tmwa-af4acff261d579428e8eef042cc5359fa392f725.zip
Generate the char server protocol
Diffstat (limited to 'src/mmo')
-rw-r--r--src/mmo/fwd.hpp17
-rw-r--r--src/mmo/ids.hpp16
-rw-r--r--src/mmo/mmo.hpp18
3 files changed, 47 insertions, 4 deletions
diff --git a/src/mmo/fwd.hpp b/src/mmo/fwd.hpp
index eb8bc05..3217fc1 100644
--- a/src/mmo/fwd.hpp
+++ b/src/mmo/fwd.hpp
@@ -45,4 +45,21 @@ class VarName;
class MapName;
class CharName;
+# if 0
+class item;
+class point;
+class skill_value;
+class global_reg;
+class CharKey;
+class CharData;
+class CharPair;
+# endif
+class Storage;
+# if 0
+class GM_Account;
+class party_member;
+# endif
+class PartyMost;
+class PartyPair;
+
#endif // TMWA_MMO_FWD_HPP
diff --git a/src/mmo/ids.hpp b/src/mmo/ids.hpp
index ed5ab58..bfd7de9 100644
--- a/src/mmo/ids.hpp
+++ b/src/mmo/ids.hpp
@@ -115,6 +115,22 @@ public:
return true; // LIES. But this code is going away soon anyway
}
+ // TODO kill this code too
+ friend
+ bool native_to_network(Little16 *network, GmLevel native)
+ {
+ uint16_t tmp = native.bits;
+ return native_to_network(network, tmp);
+ }
+ friend
+ bool network_to_native(GmLevel *native, Little16 network)
+ {
+ uint16_t tmp;
+ bool rv = network_to_native(&tmp, network);
+ native->bits = tmp;
+ return rv;
+ }
+
friend
bool native_to_network(Little32 *network, GmLevel native)
{
diff --git a/src/mmo/mmo.hpp b/src/mmo/mmo.hpp
index d96e619..89aef6d 100644
--- a/src/mmo/mmo.hpp
+++ b/src/mmo/mmo.hpp
@@ -44,7 +44,7 @@ constexpr int MAX_ZENY = 1000000000; // 1G zeny
constexpr int TRADE_MAX = 10;
constexpr int GLOBAL_REG_NUM = 96;
-constexpr int ACCOUNT_REG_NUM = 16;
+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();
@@ -147,7 +147,7 @@ struct CharPair
{}
};
-struct storage
+struct Storage
{
bool dirty;
AccountId account_id;
@@ -171,13 +171,23 @@ struct party_member
struct map_session_data *sd;
};
-struct party
+struct PartyMost
{
- PartyId party_id;
PartyName name;
int exp;
int item;
Array<struct party_member, MAX_PARTY> member;
};
+struct PartyPair
+{
+ PartyId party_id = {};
+ PartyMost *party_most = {};
+
+ explicit
+ operator bool() const { return party_most; }
+ bool operator !() const { return !party_most; }
+ PartyMost *operator->() const { return party_most; }
+};
+
#endif // TMWA_MMO_MMO_HPP