Repository navigation
Releases: ethanmoffat/eolib-cpp
Releases · ethanmoffat/eolib-cpp
Release list
eolib v0.1.0-beta.7
Changed
EoWriterno longer constructsstd::stringfromstd::string_viewin its error messages. With LTO, that constructor links libstdc++'slt4-string-inst.o, which pulls in all ofwstring.
eolib v0.1.0-beta.6
Added
EOLIB_ENUM_STRINGSCMake option (defaultON). When it's off, the enumToString(value)functions andoperator<<overloads aren't compiled, which makes static executables smaller. The generated code guards them withEOLIB_NO_ENUM_STRINGS, which theeolibtarget exports to consumers, and the generatedToString()methods of structs and packets print enum fields as numbers instead.EOLIB_STRUCT_STRINGSCMake option (defaultON). When it's off,Serializable::ToString(), the generatedToString()methods of structs and packets, andoperator<<forSerializablearen't compiled. The generated code guards them withEOLIB_NO_STRUCT_STRINGS, which theeolibtarget exports to consumers.ToString()is virtual, so this is the larger of the two savings: the vtables otherwise keep everyToString()in the executable, even with--gc-sections.
Changed
- On GCC and Clang, the library is compiled with
-ffunction-sections -fdata-sections, so static consumers that link with-Wl,--gc-sectionsonly keep the functions they use. EoReaderno longer usesstd::make_shared, which links extra libstdc++ objects into static builds compiled with-fno-rtti.
eolib v0.1.0-beta.5
Added
- Generated
For<Case>static factories on structs and packets with switches, which set the switch field and its data together, e.g.LoginReplyServerPacket::ForOk(data)andLoginReplyServerPacket::ForWrongUser(). Nested switches are flattened onto the top-level class (InitInitServerPacket::ForBannedTemporary(data)), integer cases with data are named after their case class (ForBanTypeData0(data)), and default cases take the switch value (AccountReplyServerPacket::ForReplyCodeDefault(code, data), which throwsstd::invalid_argumentfor values with their own case). - Generated
As<Case>()accessors for switch data, which return a pointer to the case data ornullptrif the switch holds data for a different case, e.g.packet.AsOk()andpacket.AsBanned()->AsTemporary().
eolib v0.1.0-beta.4
Added
- Named hardcoded fields now generate a
DEFAULT_<FIELD>class constant with the spec value, e.g.InitInitClientPacket::DEFAULT_PROTOCOL_VERSION. - XML comments in the protocol files are now generated as documentation comments. Comments on dummies and other instructions without a member are added as
@noteitems to the documentation of the containing type, prefixed with a description of the instruction (e.g. "The dummy byte (always 255): …"), and comments in empty switch cases are added to the documentation of the switch data member. Comments on unnamed hardcoded fields are omitted, since those values aren't visible to consumers. - Developer documentation for contributors:
docs/architecture.mddescribes how the library is organized and how its parts work together, anddocs/generator.mddescribes howeolib-protocol-gengenerates the protocol code.
Changed
- Named hardcoded fields are now ordinary data members instead of
static constexprconstants. They are deserialized, compared and included inToString(), and serialize their value, so deserialized values round-trip exactly and set values are sent. A zero value is serialized as the default value, unless the object was deserialized. - Protocol comments that are wrapped across several lines in the XML are joined into one line in the generated documentation comments.
- Reorganized the
eolib-protocol-gensource into one header and source file per class. The generated code is unchanged.
Updated
- Pulled in changes for eo-protocol, with impact to generated code:
- Name hardcoded client fields verified by the official server
- Pulled in changes for eo-captured-packets for test parity with protocol changes.
eolib v0.1.0-beta.3
Added
- An API reference site at https://ethanmoffat.github.io/eolib-cpp/, built with Doxygen, with a summary page, the
getting started guide, namespace descriptions and a version picker. It has the newest release of each minor version.
Each release also includes the docs aseolib-<version>-docs.tar.gz. EOLIB_BUILD_DOCSCMake option (off by default), which adds adocstarget that builds the API reference.scripts/serve-docs.sh, which builds the docs site for the working tree and serves it on localhost.scripts/install-deps.sh --docsandscripts/install-deps.ps1 -Docsinstall Doxygen into.tools/bin.PacketFactory::Contains(family, action)for client and server packets, which checks whether a packet exists for a family and action without creating it. It is generated from the protocol files, likeCreate.
Fixed
- Protocol comments containing
#,@or\are escaped in the generated documentation comments, so Doxygen shows
them as written instead of treating them as commands or links (e.g.#nowall).
eolib v0.1.0-beta.2
Added
EoWriter::ToByteArray() &&overload, which moves the data out of the writer instead of copying it.EoReader::View, which creates a reader over data owned by the caller without copying it.operator<<forSerializable(and therefore every generated struct and packet) and for generated enums, which writes theToString()representation to astd::ostream.
Changed
DataEncrypterandStringEncoderfunctions now transform data in place instead of returning a copy. Each function has(std::uint8_t*, std::size_t),std::vector<std::uint8_t>&andstd::string&overloads.StringEncoder::EncodeInPlace/DecodeInPlaceare replaced by theEncodeString/DecodeStringpointer overloads.- Generated structs and packets are now
final. - Functions that cannot throw are now
noexcept, including theSerializable::ByteSize,Packet::Family,Packet::ActionandSequenceStart::Valuevirtual functions. Implementations of these interfaces must also benoexcept. eolib-protocol-gennow rejects protocol files where a non-delimited array without a length is followed by another element in the same chunk, as required byeo-protocol/docs/elements.md.- Documented the numeric type policy: all EO numbers are
int, values aboveINT_MAXwrap to negative numbers, and malformed data can decode to negative values. - Complete documentation for the public API: every hand-written and generated function now documents its parameters, return value and exceptions, and generated switch data members include the XML comment of the
<switch>element.
Fixed
eolib-protocol-genno longer dereferences an empty value (crashing on musl) when a<length>field is referenced by an unnamed hardcoded field; it reports the "Hardcoded fields must not reference a length field" error instead.docs/getting-started.mdincorrectly listed generatedbytefields asstd::uint8_t; they areint.- Using a moved-from
EoReaderno longer dereferences a null pointer; it now behaves like a reader over empty data. DataEncrypterdocumentation: the order of the encryption and decryption steps was incorrect.- Removed documentation links to
encryption.mdandsequence.md, which do not exist ineo-protocol. ServerVerifier::Hashdocumentation: challenges should be no larger than 11,092,110, notEoNumericLimits::ThreeMax, since larger values may produce negative hashes.
eolib v0.1.0-beta.1
Added
- Initial project structure: CMake build,
build-linux.sh/build-windows.ps1convenience scripts,scripts/install-deps.sh/scripts/install-deps.ps1dependency installation scripts,scripts/prepare-release.shandscripts/validate-release.shrelease scripts,eo-protocolandeo-captured-packetssubmodules, code style configuration, and theEOLIB_OFFLINEoption for building without an internet connection. eolib::dataruntime:EoReader(chunked reading, slicing),EoWriter(string sanitization, padding),NumberEncoder,StringEncoderandEoNumericLimits.EolibError,SerializationErrorandDeserializationErrorexception types.eolib::encryptruntime:DataEncrypterandServerVerifier.eolib::packetruntime:PacketSequencerand theZeroSequenceStart,InitSequenceStart,PingSequenceStartandAccountReplySequenceStartsequence starts, withMaxValueconstants for generated values.eolib::protocol::Serializableinterface.eolib-protocol-gencode generator, which generates the protocol code from theeo-protocolXML files at build time.- Generated protocol code: enums, structs, client/server packets and packet factories in
eolib::protocol::net,eolib::protocol::pubandeolib::protocol::map, plus theeolib::protocol::net::Packetinterface. eolib/eolib.hppandeolib/protocol.hppumbrella headers.- CMake package (
find_package(eolib CONFIG),eolib::eolibtarget), FetchContent/add_subdirectorysupport and CPack archives namedeolib-<version>-<platform>. - Tests for the packets in
eo-captured-packets, checking byte-exact round trips and the field values of each packet against the captured properties, and pub/map file tests. - Documentation: getting started guide.