diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-04-22 11:46:23 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-04-22 13:20:52 -0700 |
commit | ad049a15b43b7ddba3fe7d0a898652fc8022629d (patch) | |
tree | 142624e70ead3e89a8da6d56de41651f171524d0 /src/mmo/extract.cpp | |
parent | ceeda2e337077b2edaf1af09cc4df2c30e8205a1 (diff) | |
download | tmwa-ad049a15b43b7ddba3fe7d0a898652fc8022629d.tar.gz tmwa-ad049a15b43b7ddba3fe7d0a898652fc8022629d.tar.bz2 tmwa-ad049a15b43b7ddba3fe7d0a898652fc8022629d.tar.xz tmwa-ad049a15b43b7ddba3fe7d0a898652fc8022629d.zip |
Use strict ID types
Possibly some missing for the far side of the network.
AccountId and BlockId are still terribly entangled.
Diffstat (limited to 'src/mmo/extract.cpp')
-rw-r--r-- | src/mmo/extract.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mmo/extract.cpp b/src/mmo/extract.cpp index 378986d..f25126f 100644 --- a/src/mmo/extract.cpp +++ b/src/mmo/extract.cpp @@ -22,6 +22,8 @@ #include "../strings/xstring.hpp" #include "../strings/vstring.hpp" +#include "mmo.hpp" + #include "../poison.hpp" bool extract(XString str, XString *rv) @@ -47,7 +49,7 @@ bool extract(XString str, struct item *it) XString ignored; return extract(str, record<',', 11>( - &it->id, + &ignored, &it->nameid, &it->amount, &it->equip, @@ -60,3 +62,24 @@ bool extract(XString str, struct item *it) &ignored, &ignored)); } + +bool extract(XString str, MapName *m) +{ + XString::iterator it = std::find(str.begin(), str.end(), '.'); + str = str.xislice_h(it); + VString<15> tmp; + bool rv = extract(str, &tmp); + *m = tmp; + return rv; +} + +bool extract(XString str, CharName *out) +{ + VString<23> tmp; + if (extract(str, &tmp)) + { + *out = CharName(tmp); + return true; + } + return false; +} |